Robofun 機器人論壇

 找回密碼
 申請會員
搜索
熱搜: 活動 交友 discuz
查看: 3247|回復: 1

ubuntu 10.04 上的 OpenCV 在 Roboard上無法執行

[複製鏈接]
發表於 2012-1-8 10:47:57 | 顯示全部樓層 |閱讀模式

http://robosavvy.com/forum/viewtopic.php?p=32617


按照此篇的教學下載opencv2.0版,已經修改過 cxtypes.h 中的 程式碼,後才開始編譯
  1.   #if ((defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64) && \
  2. (_MSC_VER >= 1400 || defined CV_ICC)) \
  3. || (defined __SSE2__ && defined __GNUC__ && __GNUC__ >= 4)
  4. #include <emmintrin.h>
  5. #define CV_SSE2 1
  6. #else
  7. #define CV_SSE2 0
  8. #endif
複製代碼

修改成
  1.   #if ((defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64) && \
  2. (_MSC_VER >= 1400 || defined CV_ICC)) \
  3. || (defined __SSE2__ && defined __GNUC__ && __GNUC__ >= 4)
  4. //#include <emmintrin.h>
  5. #define CV_SSE2 0
  6. #else
  7. #define CV_SSE2 0
  8. #endif

  9. #undef __MMX__
  10. #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

請問有高手可以幫忙嗎? 謝謝

 樓主| 發表於 2012-1-8 15:05:34 | 顯示全部樓層
自行解決了,使用下列config,然後再重build就可執行了。

  1. cmake -DCMAKE_BUILD_TYPE=Release \
  2. -DENABLE_SSE=OFF \
  3. -DENABLE_SSE2=OFF \
  4. -DENABLE_SSE3=OFF \
  5. -DENABLE_SSSE3=OFF .
複製代碼
您需要登錄後才可以回帖 登錄 | 申請會員

本版積分規則

小黑屋|手機版|Archiver|機器人論壇 from 2005.07

GMT+8, 2024-3-28 23:16 , Processed in 0.169158 second(s), 7 queries , Apc On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表