Ask Your Question

Revision history [back]

error in compliling

hi all i use opencv 2.3.1 windows 32bit and visual 2010. i have done all related setting. but i get error when compile my codes.below is my codes:

include "opencv2/objdetect/objdetect.hpp"

include "opencv2/highgui/highgui.hpp"

include "opencv2/imgproc/imgproc.hpp"

include <iostream>

include <stdio.h>

using namespace std; using namespace cv;

/** Function Headers */ void detectAndDisplay( Mat frame );

/** Global variables */ String face_cascade_name = "haarcascade_frontalface_alt.xml"; String eyes_cascade_name = "haarcascade_eye_tree_eyeglasses.xml"; CascadeClassifier face_cascade; CascadeClassifier eyes_cascade; string window_name = "Capture - Face detection"; RNG rng(12345);

/* @function main */ int main( int argc, const char* argv ) { CvCapture* capture; Mat frame;

//-- 1. Load the cascades if( !face_cascade.load( face_cascade_name ) ){ printf("--(!)Error loading\n"); return -1; }; if( !eyes_cascade.load( eyes_cascade_name ) ){ printf("--(!)Error loading\n"); return -1; };

//-- 2. Read the video stream capture = cvCaptureFromCAM( -1 ); if( capture ) { while( true ) { frame = cvQueryFrame( capture );

//-- 3. Apply the classifier to the frame if( !frame.empty() ) { detectAndDisplay( frame ); } else { printf(" --(!) No captured frame -- Break!"); break; }

   int c = waitKey(10);
   if( (char)c == 'c' ) { break; }
  }

} return 0; }

/** @function detectAndDisplay */ void detectAndDisplay( Mat frame ) { std::vector<rect> faces; Mat frame_gray;

cvtColor( frame, frame_gray, CV_BGR2GRAY ); equalizeHist( frame_gray, frame_gray );

//-- Detect faces face_cascade.detectMultiScale( frame_gray, faces, 1.1, 2, 0|CV_HAAR_SCALE_IMAGE, Size(30, 30) );

for( int i = 0; i < faces.size(); i++ ) { Point center( faces[i].x + faces[i].width0.5, faces[i].y + faces[i].height0.5 ); ellipse( frame, center, Size( faces[i].width0.5, faces[i].height0.5), 0, 0, 360, Scalar( 255, 0, 255 ), 4, 8, 0 );

Mat faceROI = frame_gray( faces[i] );
std::vector<Rect> eyes;

//-- In each face, detect eyes
eyes_cascade.detectMultiScale( faceROI, eyes, 1.1, 2, 0 |CV_HAAR_SCALE_IMAGE, Size(30, 30) );

for( int j = 0; j < eyes.size(); j++ )
 {
   Point center( faces[i].x + eyes[j].x + eyes[j].width*0.5, faces[i].y + eyes[j].y + eyes[j].height*0.5 );
   int radius = cvRound( (eyes[j].width + eyes[j].height)*0.25 );
   circle( frame, center, radius, Scalar( 255, 0, 0 ), 4, 8, 0 );
 }

} //-- Show what you got imshow( window_name, frame ); }


and error is : 'faceRecognition.exe': Loaded 'D:\Visual Studio 2010\Projects\faceRecognition\Debug\faceRecognition.exe', Symbols loaded. 'faceRecognition.exe': Loaded 'C:\Windows\System32\ntdll.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\kernel32.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\KernelBase.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Opencv2.3\opencv\build\x86\vc9\bin\opencv_core231.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4974_none_50940634bcb759cb\msvcp90.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4974_none_50940634bcb759cb\msvcr90.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Opencv2.3\opencv\build\x86\vc9\bin\opencv_highgui231.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\user32.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\gdi32.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\lpk.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\usp10.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\msvcrt.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\ole32.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\rpcrt4.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\oleaut32.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\advapi32.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\sechost.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7600.16385_none_ebf82fc36c758ad5\comctl32.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\avifil32.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\winmm.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\msacm32.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\msvfw32.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\shell32.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\shlwapi.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\avicap32.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\version.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Opencv2.3\opencv\build\x86\vc9\bin\opencv_imgproc231.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Opencv2.3\opencv\build\common\tbb\ia32\vc10\tbb.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\msvcp100.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\msvcr100.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Opencv2.3\opencv\build\x86\vc9\bin\opencv_objdetect231.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Opencv2.3\opencv\build\x86\vc9\bin\opencv_features2d231.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Opencv2.3\opencv\build\x86\vc9\bin\opencv_flann231.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Opencv2.3\opencv\build\x86\vc9\bin\opencv_calib3d231.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\msvcp100d.dll', Symbols loaded. 'faceRecognition.exe': Loaded 'C:\Windows\System32\msvcr100d.dll', Symbols loaded. 'faceRecognition.exe': Loaded 'C:\Windows\System32\imm32.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\msctf.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\cryptbase.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\uxtheme.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Program Files\SweetIM\Messenger\mgAdaptersProxy.dll', Binary was not built with debug information. 'faceRecognition.exe': Loaded 'C:\Program Files\SweetIM\Messenger\msvcr71.dll', Cannot find or open the PDB file First-chance exception at 0x755f9617 in faceRecognition.exe: Microsoft C++ exception: cv::Exception at memory location 0x001ff448.. Unhandled exception at 0x755f9617 in faceRecognition.exe: Microsoft C++ exception: cv::Exception at memory location 0x001ff448..

how may i resolve and run it? thanks

click to hide/show revision 2
code formatting

updated 2013-04-06 02:42:21 -0500

berak gravatar image

error in compliling

hi all i use opencv 2.3.1 windows 32bit and visual 2010. i have done all related setting. but i get error when compile my codes.below is my codes:

include "opencv2/objdetect/objdetect.hpp"

include "opencv2/highgui/highgui.hpp"

include "opencv2/imgproc/imgproc.hpp"

include <iostream>

include <stdio.h>

#include "opencv2/objdetect/objdetect.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"

#include <iostream>
#include <stdio.h>

 using namespace std;
 using namespace cv;

cv; /** Function Headers */ void detectAndDisplay( Mat frame );

); /** Global variables */ String face_cascade_name = "haarcascade_frontalface_alt.xml"; String eyes_cascade_name = "haarcascade_eye_tree_eyeglasses.xml"; CascadeClassifier face_cascade; CascadeClassifier eyes_cascade; string window_name = "Capture - Face detection"; RNG rng(12345);

/* rng(12345); /** @function main */ int main( int argc, const char* char** argv ) { CvCapture* capture; Mat frame;

frame; //-- 1. Load the cascades if( !face_cascade.load( face_cascade_name ) ){ printf("--(!)Error loading\n"); return -1; }; if( !eyes_cascade.load( eyes_cascade_name ) ){ printf("--(!)Error loading\n"); return -1; };

}; //-- 2. Read the video stream capture = cvCaptureFromCAM( -1 ); if( capture ) { while( true ) { frame = cvQueryFrame( capture );

); //-- 3. Apply the classifier to the frame if( !frame.empty() ) { detectAndDisplay( frame ); } else { printf(" --(!) No captured frame -- Break!"); break; }

}

       int c = waitKey(10);
    if( (char)c == 'c' ) { break; }
   }

} return 0; }

} /** @function detectAndDisplay */ void detectAndDisplay( Mat frame ) { std::vector<rect> std::vector<Rect> faces; Mat frame_gray;

frame_gray; cvtColor( frame, frame_gray, CV_BGR2GRAY ); equalizeHist( frame_gray, frame_gray );

); //-- Detect faces face_cascade.detectMultiScale( frame_gray, faces, 1.1, 2, 0|CV_HAAR_SCALE_IMAGE, Size(30, 30) );

); for( int i = 0; i < faces.size(); i++ ) { Point center( faces[i].x + faces[i].width0.5, faces[i].width*0.5, faces[i].y + faces[i].height0.5 faces[i].height*0.5 ); ellipse( frame, center, Size( faces[i].width0.5, faces[i].height0.5), faces[i].width*0.5, faces[i].height*0.5), 0, 0, 360, Scalar( 255, 0, 255 ), 4, 8, 0 );

);

    Mat faceROI = frame_gray( faces[i] );
 std::vector<Rect> eyes;

 //-- In each face, detect eyes
 eyes_cascade.detectMultiScale( faceROI, eyes, 1.1, 2, 0 |CV_HAAR_SCALE_IMAGE, Size(30, 30) );

 for( int j = 0; j < eyes.size(); j++ )
  {
    Point center( faces[i].x + eyes[j].x + eyes[j].width*0.5, faces[i].y + eyes[j].y + eyes[j].height*0.5 );
    int radius = cvRound( (eyes[j].width + eyes[j].height)*0.25 );
    circle( frame, center, radius, Scalar( 255, 0, 0 ), 4, 8, 0 );
  }

} //-- Show what you got imshow( window_name, frame ); }

}

and error is : 'faceRecognition.exe': Loaded 'D:\Visual Studio 2010\Projects\faceRecognition\Debug\faceRecognition.exe', Symbols loaded. 'faceRecognition.exe': Loaded 'C:\Windows\System32\ntdll.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\kernel32.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\KernelBase.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Opencv2.3\opencv\build\x86\vc9\bin\opencv_core231.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4974_none_50940634bcb759cb\msvcp90.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4974_none_50940634bcb759cb\msvcr90.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Opencv2.3\opencv\build\x86\vc9\bin\opencv_highgui231.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\user32.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\gdi32.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\lpk.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\usp10.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\msvcrt.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\ole32.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\rpcrt4.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\oleaut32.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\advapi32.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\sechost.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7600.16385_none_ebf82fc36c758ad5\comctl32.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\avifil32.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\winmm.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\msacm32.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\msvfw32.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\shell32.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\shlwapi.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\avicap32.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\version.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Opencv2.3\opencv\build\x86\vc9\bin\opencv_imgproc231.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Opencv2.3\opencv\build\common\tbb\ia32\vc10\tbb.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\msvcp100.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\msvcr100.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Opencv2.3\opencv\build\x86\vc9\bin\opencv_objdetect231.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Opencv2.3\opencv\build\x86\vc9\bin\opencv_features2d231.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Opencv2.3\opencv\build\x86\vc9\bin\opencv_flann231.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Opencv2.3\opencv\build\x86\vc9\bin\opencv_calib3d231.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\msvcp100d.dll', Symbols loaded. 'faceRecognition.exe': Loaded 'C:\Windows\System32\msvcr100d.dll', Symbols loaded. 'faceRecognition.exe': Loaded 'C:\Windows\System32\imm32.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\msctf.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\cryptbase.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\uxtheme.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Program Files\SweetIM\Messenger\mgAdaptersProxy.dll', Binary was not built with debug information. 'faceRecognition.exe': Loaded 'C:\Program Files\SweetIM\Messenger\msvcr71.dll', Cannot find or open the PDB file First-chance exception at 0x755f9617 in faceRecognition.exe: Microsoft C++ exception: cv::Exception at memory location 0x001ff448.. Unhandled exception at 0x755f9617 in faceRecognition.exe: Microsoft C++ exception: cv::Exception at memory location 0x001ff448..

how may i resolve and run it? thanks