OpenCV / Android Compilation Errors

I am currently following this guide (http://www.stanford.edu/class/ee368/Android/Tutorial-2-OpenCV-for-Android-Setup-Windows.pdf) on how to configure OpenCV for Android on Windows , and I have some errors that I donโ€™t understand. Basically, in step 3.c, when I compile the OpenCV libraries in Cygwin using the make command, I get these errors;

/home/Ralph/opencv/modules/legacy/src/calibfilter.cpp: In member function `virtual bool CvCalibFilter::SaveCameraParams(const char*)': /home/Ralph/opencv/modules/legacy/src/calibfilter.cpp:693: error: `struct CvStereoCamera' has no member named `quad' /home/Ralph/opencv/modules/legacy/src/calibfilter.cpp:694: error: `struct CvStereoCamera' has no member named `quad' /home/Ralph/opencv/modules/legacy/src/calibfilter.cpp: In member function `virtual bool CvCalibFilter::LoadCameraParams(const char*)': /home/Ralph/opencv/modules/legacy/src/calibfilter.cpp:749: error: `struct CvStereoCamera' has no member named `quad' /home/Ralph/opencv/modules/legacy/src/calibfilter.cpp:750: error: `struct CvStereoCamera' has no member named `quad' make[2]: *** [modules/legacy/CMakeFiles/opencv_legacy.dir/src/calibfilter.o] Error 1 make[1]: *** [modules/legacy/CMakeFiles/opencv_legacy.dir/all] Error 2 make: *** [all] Error 2 

Thanks for your help in advance,

Ralph.

+6
source share
4 answers

At the top of both calibfilter.cpp and epilines.cpp is "#undef quad". If I comment on these undefs, it compiles successfully.

In my life, I cannot understand why there is undef ... maybe the import order is wrong or something like that.

+6
source

I ran into the same problem. Considering /home/Ralph/opencv/modules/legacy/include/opencv2/legacy/legacy.hpp , the structure definition:

 typedef struct CvStereoCamera { CvCamera* camera[2]; /* two individual camera parameters */ float fundMatr[9]; /* fundamental matrix */ /* New part for stereo */ CvPoint3D32f epipole[2]; CvPoint2D32f quad[2][4]; /* coordinates of destination quadrangle after epipolar geometry rectification */ double coeffs[2][3][3];/* coefficients for transformation */ CvPoint2D32f border[2][4]; CvSize warpSize; CvStereoLineCoeff* lineCoeffs; int needSwapCameras;/* flag set to 1 if need to swap cameras for good reconstruction */ float rotMatrix[9]; float transVector[3]; } CvStereoCamera; 

I am completely puzzled by why it doesn't seem to work: quad is defined right there.

calibfilter.cpp commented on all the lines in calibfilter.cpp and epilines.cpp that refer to the quad attribute, I managed to get at least an OpenCV compilation, but this, without a doubt, broke the stereo sound support.

+3
source

Installing OpenCV on Windows is easy.

Follow these steps.

http://www.developerstation.org/2011/02/using-opencv-21-on-visual-studio-2008.html

The link you mentioned does not use the official NDK supported by Google. I had problems setting up and working with ndk4 in the past.

If you work or work with ndk4, it doesnโ€™t matter to you that official links (with NDK 5) work fine. Give it a try. These are basically the same steps.

http://opencv.itseez.com/doc/tutorials/introduction/android_binary_package/android_binary_package.html

http://opencv.itseez.com/doc/tutorials/introduction/android_binary_package/android_binary_package_using_with_NDK.html

0
source

As @Matthew Hemke wrote, #undef is the culprit. What strange bccoz code compiles fine, like in Ubuntu, but when I encountered a similar "No member Quad" error compiling OpenCV under Cygwin (on windows-7). There is nothing significant here.

0
source

Source: https://habr.com/ru/post/891607/


All Articles