Skip to content

Error - The type or namespace name 'Mat' could not be found #1

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

Open
pederj1 opened this issue Apr 6, 2021 · 5 comments
Open

Error - The type or namespace name 'Mat' could not be found #1

pederj1 opened this issue Apr 6, 2021 · 5 comments

Comments

@pederj1
Copy link

pederj1 commented Apr 6, 2021

I bought the $95 openCV for unity asset and downloaded this example specifically to connect my Kinect to unity and use open cv processing on it. I started by importing the kinect asset pack and then the openCV for unity pack. Then I copied the example into assets and the warning pops up that it will not compile because the namespace name 'Mat' could not be found (are you missing a using directive or an assembly reference?). That message is displayed 5 times, and one shows for 'Size' could not be found.

I have tried googling but could not find a solution.

For reference i'm using the
kinect.2.0.1410.19000 (same as requested in readme)
openCV for Unity 2.4.3 (0.4.3 newer than requested in readme, do not know how to get an older version)

I was wondering if there was any suggestions you would have to get the code to work? I have been lost and nothing I have tried has worked.

@EnoxSoftware
Copy link
Owner

EnoxSoftware commented Apr 8, 2021

Thank you very much for reporting.

Unfortunately, the KinetixWithOpenCVForUnityExample does not support the latest OpenCVForUnity 2.4.3.
You will probably need to add "using" to example code to fix the error.
using OpenCVForUnity.CoreModule;
using OpenCVForUnity.UnityUtils;

Could you try the attached file?
KinectWithOpenCVForUnityExample1.0.1.zip

Regards,
EnoxSoftware

@pederj1
Copy link
Author

pederj1 commented Apr 12, 2021

I did try the attached code and it does allow it to compile and run now, but it shows an error with the MultiSourceFrame that "IndexOutOfRangeException: Index was outside the bounds of the array.
MultiSourceFrameExample.Update () (at Assets/KinectOpenCVForUnityExample/MultiSourceFrameExample.cs:173)"

I looked at line 173 and that is where the color frame is mapped to the depth space.

I have been trying tweaking it to try and get it to work but that has not worked so far.

@EnoxSoftware
Copy link
Owner

Hmm, I don't have a Kinect v2 device at hand right now. I'm working on getting a device now.
I need some days time to try this example for the first time in years.

@EnoxSoftware
Copy link
Owner

There seems to be a small error with newer Unity versions.
I'm attaching the new example file that fixes the error.

KinectWithOpenCVForUnityExample1.0.2.zip

@EnoxSoftware
Copy link
Owner

I've committed a new example with some fixes. Please try it. 2f341e5

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

2 participants