Installation Error OpenCV 3.0 on Mac [closed]

asked 2018-01-02 10:01:30 -0600

anpki gravatar image

Hi all,

so I tried to install OpenCV(3.0) for Python(3.6) with this tutorial (https://www.pyimagesearch.com/2016/12... ) and ended up with an issue I can't solve.

The configuration step with the cmake command ended after several attempts quite well and I got the desired output, but I get an error during the compilation process. Somehow, my laptop can't handle a variable ( INTER_LINEAR_EXACT) that is used in multiple files. When I rename it to INTER_LINEAR, it works for the specific file, but since it is used multiple times and I don't really want to change the original files from OpenCV, I may need some help or advice.

The error message is shown below.

Thanks for your time and help!

Output:

 [ 34%] Building CXX object modules/img_hash/CMakeFiles/opencv_img_hash.dir/src/average_hash.cpp.o
[ 34%] Built target opencv_shape
[ 34%] Building CXX object modules/xobjdetect/CMakeFiles/opencv_xobjdetect.dir/src/waldboost.cpp.o
/Users/Anna/opencv_contrib/modules/img_hash/src/average_hash.cpp:29:59: error: use of undeclared identifier 'INTER_LINEAR_EXACT'
        cv::resize(input, resizeImg, cv::Size(8,8), 0, 0, INTER_LINEAR_EXACT);
                                                          ^
1 error generated.
make[2]: * [modules/img_hash/CMakeFiles/opencv_img_hash.dir/src/average_hash.cpp.o] Error 1
make[1]:  [modules/img_hash/CMakeFiles/opencv_img_hash.dir/all] Error 2
make[1]:  Waiting for unfinished jobs....
[ 34%] Building CXX object modules/xobjdetect/CMakeFiles/opencv_xobjdetect.dir/src/wbdetector.cpp.o
/Users/Anna/opencv_contrib/modules/xobjdetect/src/waldboost.cpp:133:56: error: use of undeclared identifier 'INTER_LINEAR_EXACT'
        resize(img, resized_img, Size(), scale, scale, INTER_LINEAR_EXACT);
                                                       ^
/Users/Anna/opencv_contrib/modules/xobjdetect/src/waldboost.cpp:165:56: error: use of undeclared identifier 'INTER_LINEAR_EXACT'
        resize(img, resized_img, Size(), scale, scale, INTER_LINEAR_EXACT);
                                                       ^
2 errors generated.
make[2]:  [modules/xobjdetect/CMakeFiles/opencv_xobjdetect.dir/src/waldboost.cpp.o] Error 1
make[2]:  Waiting for unfinished jobs....
/Users/Anna/opencv_contrib/modules/xobjdetect/src/wbdetector.cpp:182:84: error: use of undeclared identifier 'INTER_LINEAR_EXACT'
                    resize(img(bboxes[indices(k, 0)]), window, Size(24, 24), 0, 0, INTER_LINEAR_EXACT);
                                                                                   ^
1 error generated.
make[2]:  [modules/xobjdetect/CMakeFiles/opencv_xobjdetect.dir/src/wbdetector.cpp.o] Error 1
make[1]:  [modules/xobjdetect/CMakeFiles/opencv_xobjdetect.dir/all] Error 2
make: * [all] Error 2
 

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by berak
close date 2018-01-04 13:01:12.503491

Comments

please update you opencv main repo to current master (3.4)

if you want to use the contrib modules, both opencv repos have to be in close sync.

berak gravatar imageberak ( 2018-01-02 11:51:24 -0600 )edit

Thanks for your fast response! Do I have to uninstall my current opencv repository or can I just write the git command in the terminal and it "knows what to do"?

anpki gravatar imageanpki ( 2018-01-04 03:30:57 -0600 )edit

git pull upstream master (for both opencv main and opencv_contrib) will do the trick.

you don't have to uninstall, but you should clean your build folder (cmake artefacts)

berak gravatar imageberak ( 2018-01-04 03:34:16 -0600 )edit

You're awesome! Thanks

anpki gravatar imageanpki ( 2018-01-04 12:48:39 -0600 )edit