How do I resolved ‘samples’ has not been declared
Hi, I tried to compile the facedetect.cpp file having entered the path to /opencv/samples/cpp as shown below, I received error: ‘samples’ has not been declared
~/opencv/samples/cpp$ g++ -ggdb facedetect.cpp -o facedetect `pkg-config --cflags --libs opencv`
facedetect.cpp: In function ‘int main(int, const char**)’:
facedetect.cpp:65:29: error: ‘samples’ has not been declared
if (!nestedCascade.load(samples::findFileOrKeep(nestedCascadeName)))
^
facedetect.cpp:67:23: error: ‘samples’ has not been declared
if (!cascade.load(samples::findFile(cascadeName)))
^
facedetect.cpp:84:24: error: ‘samples’ has not been declared
image = imread(samples::findFileOrKeep(inputName), IMREAD_COLOR);
^
facedetect.cpp:87:31: error: ‘samples’ has not been declared
if (!capture.open(samples::findFileOrKeep(inputName)))
^
facedetect.cpp:96:24: error: ‘samples’ has not been declared
image = imread(samples::findFile("lena.jpg"), IMREAD_COLOR);
^
facedetect.cpp: In function ‘void detectAndDraw(cv::Mat&, cv::CascadeClassifier&, cv::CascadeClassifier&, double, bool)’:
facedetect.cpp:187:45: error: ‘INTER_LINEAR_EXACT’ was not declared in this scope
resize( gray, smallImg, Size(), fx, fx, INTER_LINEAR_EXACT );
which opencv version are you using ?
it looks, like you try to run opencv4.1.0 code with some older opencv version..
I have the same problem and I would appreciate if anyone could help.