现在的位置: 首页 > 综合 > 正文

在windows下运行Felzenszwalb的Discriminatively Trained Deformable Part Models matlab代码

2013年04月29日 ⁄ 综合 ⁄ 共 942字 ⁄ 字号 评论关闭

转至http://blog.csdn.net/pozen/article/details/7023742

 

Felzenszwalb的Discriminatively Trained Deformable Part Models  URL:http://www.cs.brown.edu/~pff/latent/

据说是目前最好的object detection method。我自己试了一下,效果真的不错。不过代码只可以在unix/linux/mac上运行。

(Pascal voc 近两届obj detection冠军的方法都是基于此框架的,但是别人的研究是不公开的,顺便表示一下不满)

但是呢,只要稍作修改就可以在windows上跑啦:

1,dt.cc 添加一句:#define int32_t  int

2,features.cc &  resize.cc中添加:

     #define bzero(a, b) memset(a, 0, b) 
     int round(float a) { float tmp = a - (int)a; if( tmp >= 0.5 ) return (int)a + 1; else return (int)a; }

3,resize.cc中:  alphainfo ofs[len]; 这句改成:alphainfo *ofs = new alphainfo[len];  当然在同一作用域后面加上:delete []ofs

4,compile.m中:结尾加上mex -O fconv.cc

% use one of the following depending on your setup
% 1 is fastest, 3 is slowest

% 1) multithreaded convolution using blas
% mex -O fconvblas.cc -lmwblas -O fconv
% 2) mulththreaded convolution without blas
% mex -O fconvMT.cc -o fconv
% 3) basic convolution, very compatible
% mex -O fconv.cc -o fconv
mex -O fconv.cc

其他几个fconv用了其他平台的multiThread在windows上跑不起!

 

改了上边的几个地方后,就可以运行了。跑demo.m看效果吧,,,

抱歉!评论已关闭.