OpenCV/Android 编译错误
我目前正在关注本教程(http://www.stanford.edu/class/ee368/Android/Tutorial-2-OpenCV-for-Android-Setup-Windows.pdf),了解如何在 Windows 中设置 OpenCV for Android 和我有一些我不明白的错误。基本上,在步骤 3.c 中,当我使用命令“make”在 Cygwin 中编译 OpenCV 库时,我收到这些错误;
/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
提前感谢您的帮助,
拉尔夫。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
calibfilter.cpp 和 epilines.cpp 的顶部都有一个“#undefquad”。如果我注释掉这些undef,它就会成功编译。
对于我的一生,我无法弄清楚为什么那里有一个 undef...也许导入的顺序是错误的或者其他什么。
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.
我遇到了同样的问题。查看
/home/Ralph/opencv/modules/legacy/include/opencv2/legacy/legacy.hpp
,结构定义是:我完全困惑为什么它似乎没有work:quad 就在那里定义的。
通过注释
calibfilter.cpp
和epilines.cpp
中引用quad
属性的所有行,我至少设法让 OpenCV 编译,但是这个毫无疑问打破了立体摄像头的支持。I've run into the same problem. Looking into
/home/Ralph/opencv/modules/legacy/include/opencv2/legacy/legacy.hpp
, the struct definition is: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
andepilines.cpp
that reference thequad
attribute, I managed to get OpenCV at least compiling, but this has no doubt broken the stereo camera support.在 Windows 上安装 OpenCV 很容易。
请按照以下步骤操作。
http://www.developerstation.org /2011/02/using-opencv-21-on-visual-studio-2008.html
您提到的链接不使用支持的官方NDK 谷歌。过去我在配置和使用 ndk4 时遇到了麻烦。
如果使用或不使用 ndk4 对您来说并不重要,官方链接(使用 NDK 5)就可以正常工作。尝试一下。它们的步骤大多相同。
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
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
正如 @Matthew Hemke 所写,#undef 是罪魁祸首。这很奇怪,因为代码编译得很好,就像在 Ubuntu 中一样,但是当我在 Cygwin 下(在 windows-7 上)编译 OpenCV 时遇到类似的“No member Quad”错误时。这里肯定缺少一些基本的东西。
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.