opencv 3.0.0 compiling errors

asked 2015-06-28 11:54:38 -0600

franken gravatar image

updated 2015-06-29 06:32:06 -0600

Hi all , i'm trying to compile some examples found in the link below for face detection

https://codeload.github.com/bsdnoobz/...

but i got the following errors :

compiling display-histogram.cpp
compiling eye-tracking.cpp
eye-tracking.cpp: In function ‘int detectEye(cv::Mat&, cv::Mat&, cv::Rect&)’:
eye-tracking.cpp:30:53: error: ‘CASCADE_SCALE_IMAGE’ was not declared in this scope
  face_cascade.detectMultiScale(im, faces, 1.1, 2, 0|CASCADE_SCALE_IMAGE, cv::Size(30,30)); // HAAR_SCALE_IMAGE
                                                     ^
eye-tracking.cpp:30:53: note: suggested alternative:
In file included from /usr/local/include/opencv2/objdetect/objdetect.hpp:48:0,
                 from eye-tracking.cpp:14:
/usr/local/include/opencv2/objdetect.hpp:87:8: note:   ‘CASCADE_SCALE_IMAGE’
        CASCADE_SCALE_IMAGE         = 2,
        ^
eye-tracking.cpp: In function ‘void trackEye(cv::Mat&, cv::Mat&, cv::Rect&)’:
eye-tracking.cpp:62:42: error: ‘CV_TM_SQDIFF_NORMED’ was not declared in this scope
  cv::matchTemplate(im(window), tpl, dst, CV_TM_SQDIFF_NORMED); // CV_TM_SQDIFF_NORMED 
                                          ^
eye-tracking.cpp: In function ‘int main(int, char**)’:
eye-tracking.cpp:93:10: error: ‘CAP_PROP_FRAME_WIDTH’ was not declared in this scope
  cap.set(CAP_PROP_FRAME_WIDTH, 320);  // CV_CAP_PROP_FRAME_WIDTH
          ^
eye-tracking.cpp:93:10: note: suggested alternative:
In file included from /usr/local/include/opencv2/highgui.hpp:48:0,
                 from /usr/local/include/opencv2/highgui/highgui.hpp:48,
                 from eye-tracking.cpp:13:
/usr/local/include/opencv2/videoio.hpp:86:8: note:   ‘CAP_PROP_FRAME_WIDTH’
        CAP_PROP_FRAME_WIDTH    =3,
        ^
eye-tracking.cpp:94:10: error: ‘CAP_PROP_FRAME_HEIGHT’ was not declared in this scope
  cap.set(CAP_PROP_FRAME_HEIGHT, 240);
          ^
eye-tracking.cpp:94:10: note: suggested alternative:
In file included from /usr/local/include/opencv2/highgui.hpp:48:0,
                 from /usr/local/include/opencv2/highgui/highgui.hpp:48,
                 from eye-tracking.cpp:13:
/usr/local/include/opencv2/videoio.hpp:87:8: note:   ‘CAP_PROP_FRAME_HEIGHT’
        CAP_PROP_FRAME_HEIGHT   =4,
        ^
eye-tracking.cpp:111:29: error: ‘COLOR_BGR2GRAY’ was not declared in this scope
   cv::cvtColor(frame, gray, COLOR_BGR2GRAY);
                             ^
eye-tracking.cpp:111:29: note: suggested alternative:
In file included from /usr/local/include/opencv2/imgproc/imgproc.hpp:48:0,
                 from eye-tracking.cpp:12:
/usr/local/include/opencv2/imgproc.hpp:222:8: note:   ‘COLOR_BGR2GRAY’
        COLOR_BGR2GRAY     = 6,
        ^
eye-tracking.cpp:125:33: error: ‘scaled’ is not a member of ‘cv’
    cv::rectangle(frame, eye_bb, cv::scaled(0,255,0));
                                 ^
compiling pupil-detect.cpp
pupil-detect.cpp: In function ‘int main(int, char**)’:
pupil-detect.cpp:19:27: error: ‘CV_BGR2GRAY’ was not declared in this scope
  cv::cvtColor(~src, gray, CV_BGR2GRAY);
                           ^
pupil-detect.cpp:26:43: error: ‘CV_RETR_EXTERNAL’ was not declared in this scope
  cv::findContours(gray.clone(), contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_NONE);
                                           ^
pupil-detect.cpp:26:61: error: ‘CV_CHAIN_APPROX_NONE’ was not declared in this scope
  cv::findContours(gray.clone(), contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_NONE);
                                                             ^
pupil-detect.cpp:29:57: error: ‘CV_RGB’ was not declared in this scope
  cv::drawContours(gray, contours, -1, CV_RGB(255,255,255), -1);
                                                         ^
compiling quad-segmentation.cpp
quad-segmentation.cpp: In function ‘int main()’:
quad-segmentation.cpp:63:24: error: ‘COLOR_BGR2GRAY’ was not declared in this scope
  cv::cvtColor(src, bw, COLOR_BGR2GRAY);
                        ^
quad-segmentation.cpp:63:24: note: suggested alternative:
In file included from /usr/local/include/opencv2/imgproc/imgproc.hpp:48:0,
                 from quad-segmentation.cpp:5:
/usr/local/include/opencv2/imgproc.hpp:222:8: note:   ‘COLOR_BGR2GRAY’
        COLOR_BGR2GRAY     = 6,
        ^
quad-segmentation.cpp:116:63: error: ‘scalar’ is ...
(more)
edit retag flag offensive close merge delete

Comments

1

the sample you're trying is using opencv's 2.4 api, please try with this instead

also: http://docs.opencv.org/ref/master/db/...

berak gravatar imageberak ( 2015-06-29 02:01:21 -0600 )edit