Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object detection and Color detection #165

Open
Haseeb-Ali-Khan opened this issue May 25, 2023 · 0 comments
Open

Object detection and Color detection #165

Haseeb-Ali-Khan opened this issue May 25, 2023 · 0 comments

Comments

@Haseeb-Ali-Khan
Copy link

Haseeb-Ali-Khan commented May 25, 2023

Hi,

I want to use object detection and color detection in the same scene. when I attach both scripts to the quad gameobject and make the necessary settings it doesn't work together, I was following a youtube video where he combined object detection and color detection. It was working fine in the video but when I do the same it does not work.
moreover, can I train the model and add more classes for detection?

following is the error that I get when I try to combine both. I have tried color detection with all of the models but I get the same error.

NullReferenceException: Object reference not set to an instance of an object
OpenCVForUnityExample.DnnObjectDetectionWebCamTextureExample.OnWebCamTextureToMatHelperInitialized () (at Assets/OpenCVForUnity/Examples/MainModules/dnn/DnnObjectDetectionWebCamTextureExample.cs:228)
UnityEngine.Events.InvokableCall.Invoke () (at :0)
UnityEngine.Events.UnityEvent.Invoke () (at :0)
OpenCVForUnity.UnityUtils.Helper.WebCamTextureToMatHelper+<_Initialize>d__68.MoveNext () (at Assets/OpenCVForUnity/org/opencv/unity/helper/WebCamTextureToMatHelper.cs:742)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at :0)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
OpenCVForUnity.UnityUtils.Helper.WebCamTextureToMatHelper:Initialize() (at Assets/OpenCVForUnity/org/opencv/unity/helper/WebCamTextureToMatHelper.cs:447)
OpenCVForUnityExample.MultiObjectTrackingBasedOnColorExample:Start() (at Assets/OpenCVForUnity/Examples/Advanced/MultiObjectTrackingBasedOnColorExample/MultiObjectTrackingBasedOnColorExample.cs:82)

Thank You.

unity version: 2021.3.3
opencvforunity version: 2.5.4

@Haseeb-Ali-Khan Haseeb-Ali-Khan changed the title Object detectiona and Color detection Object detection and Color detection May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant