6

I am currently following this tutorial (http://www.stanford.edu/class/ee368/Android/Tutorial-2-OpenCV-for-Android-Setup-Windows.pdf) on how to set up OpenCV for Android in Windows and I am having some errors that I do not understand. Basically, at the step 3.c, when I compile the OpenCV libraries in Cygwin using the command “make”, 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 

Thank you for your help in advance,

Ralph.

1
  • Can you clean up the formatting a little please? Commented Jun 29, 2011 at 3:41

4 Answers 4

6

There is an "#undef quad" at the top of both calibfilter.cpp and epilines.cpp. If I comment out these undefs, it succeeds in compiling.

For the life of me I can't figure out why there is an undef there... maybe the order of imports is wrong or something.

Sign up to request clarification or add additional context in comments.

Comments

3

I've run into the same problem. Looking into /home/Ralph/opencv/modules/legacy/include/opencv2/legacy/legacy.hpp, the struct definition is:

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'm completely puzzled as to why it then doesn't appear to work: quad is defined right there.

By commenting all lines in calibfilter.cpp and epilines.cpp that reference the quad attribute, I managed to get OpenCV at least compiling, but this has no doubt broken the stereo camera support.

1 Comment

These problems appear to be symptoms of various problems with compiling OpenCV on Windows. I've tried doing it through Cygwin and MingW, both with various degrees of failure. I eventually gave up and compiled it in Ubuntu instead. I won't be able to create a Windows executable, but that's not a problem for me.
0

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 that you've mentioned doesn't use the official NDK supported by Google. I've had trouble in configuring and working with ndk4 in the past.

If working or not working with ndk4 doesn't matter to you, the official links (with NDK 5) work just fine. Give them a try. They are mostly 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

Comments

0

As @Matthew Hemke wrote, that #undef is the culprit. Which is strange b'coz the code compiles fine , as it is in Ubuntu, but when I faced similar error of 'No member Quad', while compiling OpenCV under Cygwin (on windows-7). There sure is something fundamental missing here.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.