ubuntu 10.04 上的 OpenCV 在 Roboard上無法執行
http://robosavvy.com/forum/viewtopic.php?p=32617按照此篇的教學下載opencv2.0版,已經修改過 cxtypes.h 中的 程式碼,後才開始編譯
#if ((defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64) && \
(_MSC_VER >= 1400 || defined CV_ICC)) \
|| (defined __SSE2__ && defined __GNUC__ && __GNUC__ >= 4)
#include <emmintrin.h>
#define CV_SSE2 1
#else
#define CV_SSE2 0
#endif
修改成
#if ((defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64) && \
(_MSC_VER >= 1400 || defined CV_ICC)) \
|| (defined __SSE2__ && defined __GNUC__ && __GNUC__ >= 4)
//#include <emmintrin.h>
#define CV_SSE2 0
#else
#define CV_SSE2 0
#endif
#undef __MMX__
#undef __SSE__
並使用下列的設定值來組態opencv ./configure --prefix=/usr/local --enable-apps --enable-shared --with-ffmpeg --with-gnu-ld --with-x --without-quicktime CXXFLAGS=-fno-strict-aliasing
編譯完成後,在Roboard上執行下列命令
./facedetect --cascade="/usr/local/share/opencv/haarcascades/haarcascade_frontalface_alt.xml" --scale=1.5 lena.jpg
得到下列的結果illegal instruction
請問有高手可以幫忙嗎? 謝謝 自行解決了,使用下列config,然後再重build就可執行了。
cmake -DCMAKE_BUILD_TYPE=Release \
-DENABLE_SSE=OFF \
-DENABLE_SSE2=OFF \
-DENABLE_SSE3=OFF \
-DENABLE_SSSE3=OFF .
頁:
[1]