YOLOv8WithOpenCVForUnityExample icon indicating copy to clipboard operation
YOLOv8WithOpenCVForUnityExample copied to clipboard

Unity keeps crashing with the Run the scene

Open shahanhyperspace opened this issue 1 year ago • 8 comments

I imported both OpenCV and the Yolo package in Unity, didnt get any errors which was amazing.

I tried to run the scenes in the folder "YOLOv8WithOpenCVForUnityExample" but all of them keep crashing as soon as I run them.

Any suggestions why?

For Open CV, I have the latest package from the asset store. Same for Yolo the latest one. Running this on Windows. My unity version is: 2022.3.45f1

shahanhyperspace avatar Sep 27 '24 11:09 shahanhyperspace

What is the Yolo package you imported?

EnoxSoftware avatar Sep 28 '24 07:09 EnoxSoftware

I am using the latest version YOLOv8WithOpenCVForUnityExample_v1.0.5

I have tried with different versions of unity as well still crashing

shahanhyperspace avatar Sep 30 '24 05:09 shahanhyperspace

I think i know what could be the cause of the crash, Unity is trying to get access to the camera and its not getting access to it. I have also tried to make a windows build and test, still the same crash. I have also noticed that I dont get any pop-up notification to access the camera in the build? I have tried the webgl build and on the browser it does ask for permission for the camera.

Do anyone know how to fix this? running this on windows and making a build on windows as well

shahanhyperspace avatar Sep 30 '24 05:09 shahanhyperspace

We have tested it in our environment and have never encountered any crashing errors. Windows editor and the latest OpenCVForUnity2.6.3 with YOLOv8WithOpenCVForUnityExample_v1.0.5. And does one of the example scenes included in the assets, “Basic/WebCamTextureToMatHelperExample” work correctly? If it is a camera access issue, I would expect a similar error.

EnoxSoftware avatar Sep 30 '24 12:09 EnoxSoftware

Yes its the same for this scene as well Every other scene works perfectly, where there is no access to a camera.

https://github.com/user-attachments/assets/dfe020e8-b59f-4312-a379-435110a4d403

shahanhyperspace avatar Sep 30 '24 13:09 shahanhyperspace

This is a test environment that has been verified to have no problems. OS: Windows10 UniryEditor: Unity2022.3.45.f1 OpenCVForUnity: 2.6.3

Since accessing the camera seems to induce a crash, could you try a simple WebCamTexture test like the code below? https://docs.unity3d.com/ja/2021.1/ScriptReference/WebCamTexture.Play.html Since it is possible that the problem is not related to our plugin.

EnoxSoftware avatar Sep 30 '24 16:09 EnoxSoftware

You are correct, there is some issue with webcamtexture. I have tried it on a different PC, its the same issue.

shahanhyperspace avatar Oct 01 '24 06:10 shahanhyperspace

How to use Video source from outside Unity

I have a video playing in another software, I am getting the video feed in unity using NDI/Spout. https://github.com/keijiro/KlakNDI

I am currently using the scene where I am just using a pre recorded video. The video I am receiving in unity is playing on a quad

shahanhyperspace avatar Oct 01 '24 11:10 shahanhyperspace