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

crashing at cv::Rect FDet::Detect(cv::Mat im) function - error telling me the image dims are 0,0 #135

Open
tyhenry opened this issue Nov 25, 2016 · 0 comments

Comments

@tyhenry
Copy link

tyhenry commented Nov 25, 2016

I'm using VS2015 - everything works well up to this point, using webcam.

Now I'm trying to using the color stream from a Kinect v2 (using Elliot Woods' ofxKinectForWindows2)

No issues displaying the Kinect's color video (1080p30), but when I try to send the ofPixels to ofxFaceTracker, it crashes.

Here's my relevant code:

        // update face tracker
	ofPixels& colPix = kinect.getColorPixels();
	if (colPix.size() < 1) return;

	cout << "colPix - w: " << colPix.getWidth() << ", h: " << colPix.getHeight() << endl;

	if (kinect.isFrameNew())
		faceTracker.update(toCv(colPix));

In console, I get an

OpenCV Error: Assertion failed (ssize.area() > 0) in cv::resize, file ......\modules\imgproc\src\imgwarp.cpp, line 1834

Here's the VS2015 exception I get:

Unhandled exception at 0x00007FF9356B8A5C in kinectFaceTracker_debug.exe: Microsoft C++ exception: cv::Exception at memory location 0x0000000000139FE0.

It's traced to FDet.cc, somewhere at lines 88/89, within the cv::Rect FDet::Detect(cv::Mat im) function:

cv::resize(gray,small_img_,cv::Size(w,h),0,0,CV_INTER_LINEAR); cv::equalizeHist(small_img_,small_img_);

In the VS variable readout, it tells me the im.cols and im.rows are both 0 - any ideas?

	CV_BGR2GRAY	CV_BGR2GRAY (6)	<unnamed-enum-CV_BGR2BGRA>
	CV_INTER_LINEAR	CV_INTER_LINEAR (1)	<unnamed-enum-CV_INTER_NN>
  •   gray	{flags=1124007936 dims=0 rows=0 ...}	cv::Mat
      h	0	int
    
  •   im	{flags=1124007936 dims=0 rows=0 ...}	cv::Mat
      im.cols	0	int
      im.rows	0	int
    
  •   small_img_	{flags=1124007936 dims=0 rows=0 ...}	cv::Mat
    
  •   this	0x0000000002f9f970 {_haar_count=0 _haar_rect={x=0 y=0 width=0 ...} _min_neighbours=2 ...}	FACETRACKER::FDet *
      _haar_count	0	int
    
  •   _haar_rect	{x=0 y=0 width=0 ...}	cv::Rect_<int>
      _min_neighbours	2	int
      _min_size	30	int
      _img_scale	1.3000000000000000	double
      _scale_factor	1.1000000000000001	double
    
  •   _cascade	0x0000000002faea40 {flags=1112539136 count=20 orig_window_size={width=20 height=20 } ...}	CvHaarClassifierCascade *
    
  •   small_img_	{flags=1124007936 dims=0 rows=0 ...}	cv::Mat
    
  •   storage_	0x0000000000330670 {signature=1116274688 bottom=0x0000000000000000 <NULL> top=0x0000000000000000 <NULL> ...}	CvMemStorage *
      w	0	int
    
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