LoginSignup
2
2

More than 5 years have passed since last update.

FaceDetect をWindows 64bit 環境でコンパイル

Last updated at Posted at 2013-02-27

Matlabで顔検出する際,しばしばFaceDetect(http://www.mathworks.com/matlabcentral/fileexchange/19912) を利用する機会があるかと思われますが,そのままだとWindows 64bit環境でmexコンパイルできずつらい感じになります(先のリンクのコメント欄が阿鼻叫喚になってることからもわかるかと思います)

この原因は至極単純で,同梱されているcv.lib, cvhaartraining.lib, cxcore.libが32bit版だから,ということになります.

以下のように修正することで,Windows 64bit環境でもコンパイルができるようになります.

  1. 64bit版ライブラリをビルド
    http://wtpage.info/program/opencv.html
    ここが非常に詳しいです.

  2. できあがったcv_64.lib, cxcore_64.lib, cvhaartraining_64.libをFaceDetect/lib/内に,cv100_64.dll, cxcore100_64.dllをFaceDetect/bin/に置く.

  3. FaceDetect.cpp内部を以下のように修正.

#include "cv.h" 

#pragma comment(lib, "../lib/cv_64")
#pragma comment(lib, "../lib/cxcore_64")
#pragma comment(lib, "../lib/cvhaartraining_64")

...
  1. srcディレクトリに移動し,コンパイル
>> mex FaceDetect.cpp -I../Include/ -outdir ../bin/

以上です.

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2