Ask Your Question

Shelly30's profile - activity

2016-01-19 08:34:10 -0600 received badge  Student (source)
2014-10-09 03:43:40 -0600 commented question Get Image On Same Dialog box in opencv 3.0

I am doing work on mfc vc++ with dialog based application.I want to show image on dialog box not on window

2014-10-01 00:27:40 -0600 asked a question Get Image On Same Dialog box in opencv 3.0

How to get image on dialog box in dialog based Application, As i use imshow image is displayed on another window

2014-09-24 02:38:17 -0600 commented question FaceDetection Using OpenCv-3.0.0-alpha

Ok Thanks alot

2014-09-24 02:36:03 -0600 commented question FaceDetection Using OpenCv-3.0.0-alpha

Please Specify me the right code, so that i can implement that in my application.

Thanks

2014-09-24 02:29:02 -0600 commented question FaceDetection Using OpenCv-3.0.0-alpha

I have Changed the code As you suggested before.

2014-09-24 02:20:29 -0600 commented question FaceDetection Using OpenCv-3.0.0-alpha

I am Using MFC Dialog Based Application, not Win32 Console Application. Please Help me out as these functions are not working in VC++.

2014-09-23 23:43:58 -0600 received badge  Editor (source)
2014-09-23 23:43:26 -0600 asked a question FaceDetection Using OpenCv-3.0.0-alpha

I am using Visual Studio 2012 with Open Cv-3.0.0 alpha. I want to detect faces from Image in MFC dialog based application. Code I am Using Is:- void CFaceDetectionDlg::OnBnClickedOk() {

  CvHaarClassifierCascade* cascade;
  CvMemStorage* storage;
  IplImage *image;
  CvSeq* faces;
  const char* file_name;
  int i;

CFileDialog dlg(TRUE, _T(".bmp"), NULL, OFN_FILEMUSTEXIST|OFN_PATHMUSTEXIST|OFN_HIDEREADONLY,_T("image files (.bmp; .jpg) |.bmp;.jpg|All Files (.)|.*||"),NULL); dlg.m_ofn.lpstrTitle= _T("Open Image"); if (dlg.DoModal() == IDOK) {

CString path= dlg.GetPathName();
CStringA filename(path);
storage=cvCreateMemStorage(0);

cvFirstType();
file_name="E:/OpenCv/opencv/sources/data/haarcascades/haarcascade_frontalface_alt.xml"; cascade = (CvHaarClassifierCascade*)cvLoad(file_name,NULL, NULL, NULL);

image = cvLoadImage(filename, 1 );

faces=cvHaarDetectObjects( image, cascade, storage, 1.1, 1,CV_HAAR_DO_CANNY_PRUNING,cvSize(10, 10));

//draw rectangles

for(i=0;i<(faces ? faces->total:0); i++ ) { CvRect* r; r = (CvRect*)cvGetSeqElem( faces, i ); CvPoint pt1= cvPoint (r->x, r->y) ; CvPoint pt2 = cvPoint (r->x + r->width, r->y + r->height) ;

cvRectangle( image, pt1, pt2, CV_RGB(255,0,0), 3, 8, 0 ); } // create window and show the image with outlined faces cvNamedWindow("faces", 1 ); cvShowImage( "faces", image ); cvSaveImage("Result.bmp", image);

 cvWaitKey();
 cvReleaseImage( &image );      // after a key pressed, release data
 cvReleaseHaarClassifierCascade( &cascade );
 cvReleaseMemStorage( &storage );
 }

}

But i am getting Exception in this line as given below:

cascade = (CvHaarClassifierCascade*)cvLoad(file_name,NULL, NULL, NULL);

Please do reply with a valid Solution.

Thanks and Regards Shelly Rani