Ask Your Question

mohmed7258's profile - activity

2016-12-15 08:23:57 -0500 commented question open CV detect multiscal issue

@sturkmen , yes you are right, im using opencv-3.0.0-alpha,, i thought it was 3.1 but apparently it was mistake. So opencv-3.0.0-alpha might produce such kind of issue??

2016-12-15 08:21:56 -0500 commented answer open CV detect multiscal issue

Thanks pi-null-mezon, this is what Im already did to continue my work,, thanks..

2016-12-13 18:55:31 -0500 received badge  Student (source)
2016-12-13 03:59:12 -0500 asked a question open CV detect multiscal issue

Dears, im working with the object detection functions, exactly with the detect multiscal , and my problem that in some times "detectMultiScale" function detect objects(in my case faces) and when i try to get the ROI of that face, open CV throw an exception as follow:

terminate called after throwing an instance of 'cv::Exception' what(): /home/mohammad/yabrodi/opencv/opencv-3.0.0-alpha/modules/core/src/matrix.cpp:492: error: (-215) 0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows in function Mat

After investigation i found that "detectMultiScale" return an object of size greater than the original image used in the detection process. an exact case occurs as follow :

face_cascade.detectMultiScale(frame , faces_in_frame, 1.3, 2, 0| CASCADE_SCALE_IMAGE, Size(25, 25) ); frame.size().width = 720
frame.size().height = 565

faces_in_frame[0].x = 30
faces_in_frame[0].y = 137
faces_in_frame[0].width = 430
faces_in_frame[0].height = 430

and when i tried to get the ROI i got the exception above which is true since the height of the object is (137+ 430 = 567) which is grater than the frame height (565).

SO, what is the issue that let "detectMultiScale" return object with invalid size ???

my OpenCV version 3.1

thanks