DPM,windows环境搭建测试

来源:互联网 发布:被x是什么体验 知乎 编辑:程序博客网 时间:2024/06/05 03:13

DMP的源码下载地址:

  http://cs.brown.edu/~pff/latent-release4/


下载进行解压, 修改部分:

由于该程序是在linux或者Apple系统的,所以需要改一些地方使demo.m能够在windows下运行
需要改动的地方:

1、把用到的文件dt.cc resize.cc fconv.cc features.cc、getdetection.cc的后缀都修改为cpp

2、dt.cpp中加:#define int32_t int

3、features.cpp、resize.cpp、fconv.cpp中加入
[html] view plaincopy
#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;
 }  

4、resize.cpp中的alphainfo ofs[len] 换成:
resize.cpp中 将alphainfo ofs[len]; 改成 struct alphainfo *ofs = (struct alphainfo *)malloc(sizeof(struct alphainfo)*len);        
在该函数的结尾要free(ofs);

compile.m编译,通过。
我再编译时,提示错误如下:
 error C4716: “process”: 必须返回一个值 




然后我在 void *process(void *thread_arg)函数的末尾添加了:
return  NULL;
不加的话看语法好像也没啥错误。但是编译不通过, 加了后就通过了, 运行 demo.m可以了。

参考:
http://blog.sina.com.cn/s/blog_4af4d81f0101dk38.html
http://blog.csdn.net/tiandijun/article/details/50499656






原创粉丝点击