Help us understand the problem. What is going on with this article?

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

More than 1 year has passed since last update.

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/

以上です.

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away