Hi all , i'm trying to compile some examples found in the link below for face detection
https://codeload.github.com/bsdnoobz/opencv-code/zip/master
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 not a member of ‘cv’ cv::line(dst, cv::Point(v[0], v[1]), cv::Point(v[2], v[3]), cv::scalar(0,255,0)); ^ quad-segmentation.cpp:120:33: error: ‘scalar’ is not a member of ‘cv’ cv::circle(dst, corners[0], 3, cv::scalar(255,0,0), 2); ^ quad-segmentation.cpp:121:33: error: ‘scalar’ is not a member of ‘cv’ cv::circle(dst, corners[1], 3, cv::scalar(0,255,0), 2); ^ quad-segmentation.cpp:122:33: error: ‘scalar’ is not a member of ‘cv’ cv::circle(dst, corners[2], 3, cv::scalar(0,0,255), 2); ^ quad-segmentation.cpp:123:33: error: ‘scalar’ is not a member of ‘cv’ cv::circle(dst, corners[3], 3, cv::scalar(255,255,255), 2); ^ quad-segmentation.cpp:126:29: error: ‘scalar’ is not a member of ‘cv’ cv::circle(dst, center, 3, cv::scalar(255,255,0), 2); ^ compiling shape-detect.cpp shape-detect.cpp: In function ‘void setLabel(cv::Mat&, std::string, std::vector<cv::point_<int> >&)’: shape-detect.cpp:38:109: error: ‘CV_RGB’ was not declared in this scope cv::rectangle(im, pt + cv::Point(0, baseline), pt + cv::Point(text.width, -text.height), CV_RGB(255,255,255), CV_FILLED); ^ shape-detect.cpp:38:112: error: ‘CV_FILLED’ was not declared in this scope cv::rectangle(im, pt + cv::Point(0, baseline), pt + cv::Point(text.width, -text.height), CV_RGB(255,255,255), CV_FILLED); ^ shape-detect.cpp: In function ‘int main()’: shape-detect.cpp:51:26: error: ‘CV_BGR2GRAY’ was not declared in this scope cv::cvtColor(src, gray, CV_BGR2GRAY); ^ shape-detect.cpp:59:41: error: ‘CV_RETR_EXTERNAL’ was not declared in this scope cv::findContours(bw.clone(), contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE); ^ shape-detect.cpp:59:59: error: ‘CV_CHAIN_APPROX_SIMPLE’ was not declared in this scope cv::findContours(bw.clone(), contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE); ^ compiling straighten-img.cpp straighten-img.cpp: In function ‘void on_mouse(int, int, int, int, void*)’: straighten-img.cpp:41:15: error: ‘CV_EVENT_LBUTTONDOWN’ was not declared in this scope if (event == CV_EVENT_LBUTTONDOWN) ^ straighten-img.cpp:58:20: error: ‘CV_EVENT_MOUSEMOVE’ was not declared in this scope else if (event == CV_EVENT_MOUSEMOVE && pt.size() == 1) ^ straighten-img.cpp:61:54: error: ‘CV_RGB’ was not declared in this scope cv::line(im1, pt[0], cv::Point(x,y), CV_RGB(255,0,0), 2); ^ straighten-img.cpp: In function ‘int main()’: straighten-img.cpp:77:25: error: ‘CV_WINDOW_AUTOSIZE’ was not declared in this scope cv::namedWindow("src", CV_WINDOW_AUTOSIZE); ^ compiling watershed.cpp watershed.cpp: In function ‘int main()’: watershed.cpp:22:24: error: ‘COLOR_BGR2GRAY’ was not declared in this scope cv::cvtColor(src, bw, COLOR_BGR2GRAY); ^ watershed.cpp:22:24: note: suggested alternative: In file included from /usr/local/include/opencv2/imgproc/imgproc.hpp:48:0, from watershed.cpp:7: /usr/local/include/opencv2/imgproc.hpp:222:8: note: ‘COLOR_BGR2GRAY’ COLOR_BGR2GRAY = 6, ^ watershed.cpp:23:33: error: ‘THRESH_BINARY’ was not declared in this scope cv::threshold(bw, bw, 40, 255, THRESH_BINARY); ^ watershed.cpp:23:33: note: suggested alternative: In file included from /usr/local/include/opencv2/imgproc/imgproc.hpp:48:0, from watershed.cpp:7: /usr/local/include/opencv2/imgproc.hpp:106:8: note: ‘THRESH_BINARY’ enum { THRESH_BINARY = 0, // value = value > threshold ? max_value : 0 ^ watershed.cpp:28:34: error: ‘DIST_L2’ was not declared in this scope cv::distanceTransform(bw, dist, DIST_L2, 3); ^ watershed.cpp:28:34: note: suggested alternative: In file included from /usr/local/include/opencv2/imgproc/imgproc.hpp:48:0, from watershed.cpp:7: /usr/local/include/opencv2/imgproc.hpp:91:8: note: ‘DIST_L2’ DIST_L2 = 2, // the simple euclidean distance ^
it's maybe due to the old version used for these files ... plz tell me what can i do know thanks :)