Home > Back-end >  On opencv face recognition detectMultiScale use times 0 xc0000374: wrong pile has been damaged.
On opencv face recognition detectMultiScale use times 0 xc0000374: wrong pile has been damaged.

Time:10-04

Contact use opencv to do face recognition recently, just want to do a small practice always program error, when using the others run code correctly, but it has been an error, the hope can get everybody experienced great god's help, thank you!
Is originally want to use camera to collect images, after an error for a simple example, but still an error... In order to ensure the integrity of their code so retained commented out part of the
error message is as follows:
"FaceDemo1. Exe (Win32) :" loaded "C: \ Program Files \ (x86) Intel \ \ 1.5 \ bin \ x86 OpenCL SDK \ intelocl DLL", cannot find or open the PDB file,
"FaceDemo1. Exe (Win32) :" unloaded "C: \ Program Files \ (x86) Intel \ \ 1.5 \ bin \ x86 OpenCL SDK \ intelocl DLL"
Critical error detected c0000374
FaceDemo1. Exe has triggered a breakpoint,

0 x00007ffe3037e6fc (NTDLL. DLL) (located in FaceDemo1. Exe) caused by abnormal: 0 xc0000374: pile has been damaged, (parameters: 0 x00007ffe303d22b0),
0 x00007ffe3037e6fc (NTDLL. DLL) (FaceDemo1. Exe) in untreated exception: 0 xc0000374: pile has been damaged, (parameters: 0 x00007ffe303d22b0),

Two program error location is in "detectMultiScale" place, see some people say that this error is address cross-border online, but I also don't know what to modify where, hope to be able to get you a great god help,

 # include & lt; Opencv2/opencv. Hpp> 
# include & lt; Iostream>

Using the namespace CV;
using namespace std;

String haar_face_datapath="G:/opencv3.4.0/opencv/build/etc/haarcascades/haarcascade_frontalface_alt_tree XML";
Int main (int arg c, char * * argv) {
/* VideoCapture capture (0);//open the camera
if (! The capture. IsOpened ()) {
Printf (" could not open the camera... \n");
return -1;
}
The Size S=Size ((int) capture. Get (CV_CAP_PROP_FRAME_WIDTH), (int) capture. Get (CV_CAP_PROP_FRAME_HEIGHT));
Int FPS=the capture. Get (CV_CAP_PROP_FPS);
*/

CascadeClassifier faceDetector;
FaceDetector. Load (haar_face_datapath);//load detector

/* Mat frame;
NamedWindow (" camera - demo ", CV_WINDOW_AUTOSIZE);
Vector Faces;
int count=0;
While (the capture. Read (frame)) {
Flip (frame, frame, 1);//image about flip
FaceDetector. DetectMultiScale (frame, faces, 1.1, 1, 0, the Size (100, 120), the Size (380, 400));
for (int i=0; I & lt; Faces. The size (); I++) {
If (count % 10==0) {
Mat DST.
The resize (frame (faces [I]), DST, the Size (100, 100));
Imwrite (format (" D:/MyFaces surprised/face_ % jeter pg ", count), DST);
}
A rectangle (frame, faces [I], Scalar (0, 0, 255), 2, 8, 0).
}
Imshow (" camera - demo, "frame).
Char c=waitKey (10);
If (27) c=={
break;
}
count++;
}

The capture. Release ();
*/

Mat srcImage, grayImage, dstImage;
//[2] read picture
SrcImage=imread (" D:/123 JPG ");
DstImage=srcImage. Clone ();
Imshow (" [artwork], "srcImage);
GrayImage. Create (srcImage. The size (), srcImage. The type ());
CvtColor (srcImage, grayImage, CV_BGR2GRAY);//generated grayscale, and improve the detection efficiency
Scalar colors []=
{
//red, orange, yellow, green, blue, purple
CV_RGB (255, 0, 0),
CV_RGB (255, 97, 0),
CV_RGB (255, 255, 0),
CV_RGB (0, 255, 0),
CV_RGB (0, 255, 255),
CV_RGB (0, 0, 255),
CV_RGB (160, 32, 240)
};
//[3] test
Vector The rect.
FaceDetector. DetectMultiScale (grayImage, the rect, 1.1, 3, 0).//object classifier called
Printf (" the number of detected face: % d \ n ", the rect. The size ());

//[4] tag, the circle is drawn on the face
for (int i=0; I & lt; The rect. The size (); I++)
{
Point center;
Int the radius;
Center. X=cvRound ((the rect [I] x + the rect [I] width * 0.5));
Center. Y=cvRound ((the rect [I] y + the rect [I] height * 0.5));

The radius=cvRound ((the rect [I] width + the rect [I] height) * 0.25);
Circle (dstImage, center, the radius, colors, [7] I % 2);
}

//[5] according to
Imshow (" [face recognition detectMultiScale], "dstImage);


WaitKey (0);
return 0;
}

CodePudding user response:

FaceDetector. Load (haar_face_datapath);//load success here?
Bool ok=faceDetector. Load (haar_face_datapath);
Printf (" % d ", "ok");
Assert (! "Ok");//check whether loaded successfully

CodePudding user response:

reference 1st floor qybao response:
faceDetector. Load (haar_face_datapath);//load success here?
Bool ok=faceDetector. Load (haar_face_datapath);
Printf (" % d ", "ok");
Assert (! "Ok");//check whether load success

Thank you for your reply! , I put this code added to the output OK value is 1, but the assert is not available, the run times wrong, so I send this assert annotation, leaving output OK statements, OK values is 1

CodePudding user response:

Code can't see what problem, you try to download a 64 - bit opencv SDK, it is possible that a 64 - bit machine called 32-bit DLL is out of question

CodePudding user response:

reference qybao reply: 3/f
code can't see what problem, you try to download a 64 - bit opencv SDK, it is possible that a 64 - bit machine called 32-bit DLL out

Uh-huh, I try, thank you ~

CodePudding user response:

have to solve this problem, the solution is as follows:
1. I use "debug" + "x64" version for development, so in this version of the properties of "linker -" input - "additional dependencies", the persons to be filled with "d" in each item, such as: "opencv_world340. Lib" and "opencv_world340d. Lib", don't fill in "opencv_world340. Lib and choose" with a "d",
2. Before using imshow to use namedWindow function to create the window first, or it will be submitted to the above error,
  • Related