OpenCV 2.1: the collision faces the consequences of .cpp when it finds an ugly face

I am trying to compile facedetect.cpp in the OpenCV \ Samples \ C folder in Visual Studio 2010. The project compiles and starts just fine, shows a preview of my camera, and then seems to crash to cascade.detectMultiScale () as soon as it detects a face. I came to the conclusion that OpenCV thinks I'm too ugly.

Unhandled exception at 0x100342bf in HeadTrackerExample.exe: 0xC0000005: Access violation writing location 0x00000000.

Unfortunately, debugging information does not allow me to investigate more deeply. I am contacting cv210.lib; cxcore210.lib; highgui210.lib; debug versions will not work:

LDR: LdrpWalkImportDescriptor() failed to probe D:\OpenCV2.1\bin\cv210d.dll for its manifest, ntstatus 0xc0150002

I am going to try to trick the Ann Hathaway listing classifier, but I am open to other suggestions.

https://code.ros.org/trac/opencv/browser/trunk/opencv/samples/c/facedetect.cpp

+6
source share
2 answers

I spent this day trying to fix it. Who knows why it collapses? I could not reference the debug DLL, so we will never know. I downloaded the OpenCV-2.1.0-win32-vs2008.exe distribution. And I am using Visual Studio 2010. Therefore exe crashes using

LDR: LdrpWalkImportDescriptor() failed to probe D:\OpenCV2.1\bin\cv210d.dll for its manifest, ntstatus 0xc0150002 Debugger:: An unhandled non-continuable exception was thrown during process load The program '[5172] HeadTrackerExample.exe: Native' has exited with code -1072365566 (0xc0150002).

This is the error "0xc0150002". According to Dependency Walker, the OpenCV debugging DLL is trying to find the msvcr90d.dll and msvct90d.dll files, the Visual Studio 2008 debugging DLLs. Well, I got them and it still doesn't work, so it gets into the esoteric Windows sidebyside and manifest.

I switched to the OpenCV-2.3.1-win-superpack.exe distribution and now it works.

0
source

I think I look better than you, because it works here (under OS X). Are you really uploaded xml files? Do you use the default xml files (haarcascade_frontalface_alt.xml and haarcascade_eye_tree_eyeglasses.xml)?

I am sure that you have a null pointer. Try setting a breakpoint when calling cascade.detectMultiScale() and check the values ​​of cascade , smallImg , smallImg.data and faces .

Edit: filling faces vector

Here's the detectMultiScale code:

 void HaarClassifierCascade::detectMultiScale( const Mat& image, Vector<Rect>& objects, double scaleFactor, int minNeighbors, int flags, Size minSize ) { MemStorage storage(cvCreateMemStorage(0)); CvMat _image = image; CvSeq* _objects = cvHaarDetectObjects( &_image, cascade, storage, scaleFactor, minNeighbors, flags, minSize ); Seq<Rect>(_objects).copyTo(objects); } 

This does not apply to the faces vector to the last line after detection is complete. If you are adventurous, you can drop a few printf statements here to find out if cvHaarDetectObjects and whether it returns a null pointer.

+1
source

Source: https://habr.com/ru/post/898311/


All Articles