おくればせながらインストールしてみました。
ちょこっとハマったので、メモ。Macのバージョンは10.4.9。
1、OpenCVをインスト。DarwinPortsだと現時点で0.9.9。オフィシャルから1.0をインストールしました。こちらを参考にさせていただきました。
2、cpanでinstall Image::ObjectDetect。以下のようなエラーがでて、失敗。
/usr/bin/gcc-4.0 -c -I/usr/local/include/opencv -Isrc -I/usr/local/include/opencv -O3 -DVERSION=\"0.11\" -DXS_VERSION=\"0.11\" "-I/opt/local/lib/perl5/5.8.8/darwin-2level/CORE" ObjectDetect.c In file included from ObjectDetect.xs:7: /opt/local/lib/perl5/5.8.8/darwin-2level/CORE/cv.h:14: error: redefinition of ‘struct xpvcv’ ObjectDetect.xs: In function ‘XS_Image__ObjectDetect_new’: ObjectDetect.xs:19: error: ‘CvHaarClassifierCascade’ undeclared (first use in this function) ObjectDetect.xs:19: error: (Each undeclared identifier is reported only once ObjectDetect.xs:19: error: for each function it appears in.) ObjectDetect.xs:19: error: ‘cascade’ undeclared (first use in this function) ObjectDetect.xs: In function ‘XS_Image__ObjectDetect_xs_detect’: ObjectDetect.xs:40: error: ‘CvHaarClassifierCascade’ undeclared (first use in this function) ObjectDetect.xs:40: error: ‘cascade’ undeclared (first use in this function) ObjectDetect.xs:51: error: ‘CV_BGR2GRAY’ undeclared (first use in this function) ObjectDetect.xs:55: error: parse error before ‘)’ token ObjectDetect.xs:57: error: ‘CV_HAAR_DO_CANNY_PRUNING’ undeclared (first use in this function) ObjectDetect.xs:57: warning: assignment makes pointer from integer without a cast ObjectDetect.xs: In function ‘XS_Image__ObjectDetect_DESTROY’: ObjectDetect.xs:82: error: ‘CvHaarClassifierCascade’ undeclared (first use in this function) ObjectDetect.xs:82: error: ‘cascade’ undeclared (first use in this function) ObjectDetect.xs:84: error: parse error before ‘)’ token make: *** [ObjectDetect.o] Error 1どうやら、"cv.h" が /opt/local/lib/perl5/5.8.8/darwin-2level/CORE/cv.h と /usr/local/include/opencv/cv.h、両方にあって混乱してるよう。
cpan> look Image::ObjectDetect # cp lib/Image/ObjectDetect.xs lib/Image/ObjectDetect.xs.orig # ed lib/Image/ObjectDetect.xs 2391 7 #include "cv.h" s|cv.h|../opencv/cv.h| 7 #include "../opencv/cv.h" w 2401 q # diff lib/Image/ObjectDetect.xs.orig lib/Image/ObjectDetect.xs 7c7 < #include "cv.h" --- > #include "../opencv/cv.h" # make install
3、おしまい。お知りあいではありませんが、spiritlooseさんCool!!!!!
コメントする