-1

NEW TO OPENCV AND KINECT :)

I am sorry if there are other similar questions here - I did search and am still lost.

I am trying to use the Microsoft Kinect SDK with opencv. I looked at the KinectBridgeWithOpenCVBasis example in the SDK but find it too complex.

Here is the question: I am using the DepthSensor class from this site I am trying to get the depth data into opencv matrix. The code is as follows:

DepthSensor *ds = new DepthSensor();
ds->init();
Mat frame;
ds->getDepthMat().copyTo(frame);
imshow("display", ds->getColorMat());

I did add ds->processDepth(); at various points to check if it works. The exact error message is :

OpenCV Error: Assertion failed (size.width>0 && size.height>0) in cv::imshow, fi le C:\builds\2_4_PackSlave-win64-vc12-shared\opencv\modules\highgui\src\window.c pp, line 261

and

Unhandled exception at 0x000007FEFC7B940D in opencvtest.exe: Microsoft C++ exception: cv::Exception at memory location 0x00000000001AF500.

Any ideas on how I fix this? Thanks.

MT

user3259040
  • 155
  • 1
  • 11

1 Answers1

0

I'm still fairly new to OpenCV and the Kinect as well, but I came across this post. It seems to describe a similar problem. If you look at the last comment on any of the posts, the OP has described the solution they found:

Thanks for answering. I figured out the issue. It was a conflict between the 32 and 64 bits dlls vs the compiler. When I installed VS 2010 with superpack 2.3 the compiler I think tries to use a mix match of x86 and x64 dlls based on the way its setup in the environment vars and Vs2010. I figured it out by installing VS2010 on a different computer with only x86 support compiler and I had no trouble at all. Everything Worked Fine! Exact same setup, only one is X86 and the other is X86 and X64. It didn't make sense because the compiler should choose one right? and not a mix of x86 and 64 dlls?

Another (perhaps related?) possibility is that something is wrong in your install of OpenCV. The first couple times I tried building the libraries I made mistakes and got strange errors when trying to run code. I eventually settled on using the pre-built libraries. If you get errors with all OpenCV code, try reinstalling.

Finally, it looks as though you've only posted a fragment of your code. I've seen many people request that questions include the complete code so that it can be more easily debugged and in case you missed an error somewhere else.

Good luck!

Community
  • 1
  • 1
Justin
  • 23
  • 5