先说下star-cascade是什么?
models of Object Detection with Discriminatively Trained Part Based Models中的检测升级
运用了pca降维产生的分级检测。
首先还是转到window下运行:
makefile比较麻烦,主要是编译cascade.cc和model.cc。
两个文件是有关联的,单独编译任何一个都不可以。
所以把文件后缀改为cpp后,进入有文件的目录
在matlab命令行中敲入:
mex -v cascade.cpp model.cpp
会有一些c语法的错误,可以参看前面的几个篇博文
修改后再次编译,应该就可以了。
之后可以根据原始程序中的readme所写:
3. Start matlab.
Start matlab inside your voc-release4 directory. To use the cascade
code you will need to add it to your path with the following matlab
command.
>> addpath star-cascade;
Now run to see a demonstration of cascade detection.
>> cascade_demo
Fin.
或者是:
An example.
% load the PASCAL 2007 bicycle model into the variable 'model'
load('VOC2007/bicycle_final');
% produce a cascade model trained on the 2007 dataset
% using 5 dimensional PCA filters and a global detection
% threshold of -1.
csc_model = cascade_model(model, '2007', 5, -1);
% compute the feature pyramid for image im
pyra = featpyramid(im, csc_model);
% get cascade detections
[dets, boxes] = cascade_detect(pyra, csc_model, csc_model.thresh);
当然还要参看readme中修改global.m中的目录。
2. Edit globals.m.
Add the following two lines to the end of globals.m in your
voc-release4 installation.
% directory for cascade algorithm data
cscdir = [pwd() '/star-cascade/data/'];