baidut
8/3/2017 - 1:33 PM

行人检测 DPM 方法 (Oct 30 2015)

行人检测 DPM 方法 (Oct 30 2015)

在windows下运行DPM 较早版本的DPM已经有人配置好了windows下的编译环境 项目代码见: https://github.com/j0x7c4/dpm (测试可用) https://github.com/luckykelfor/DPM4.01_windows

注意先mex -setup 选可用的编译器

>> compile
Building with 'Microsoft Visual C++ 2010'.
MEX completed successfully.
Building with 'Microsoft Visual C++ 2010'.
MEX completed successfully.
Building with 'Microsoft Visual C++ 2010'.
MEX completed successfully.
Building with 'Microsoft Visual C++ 2010'.
MEX completed successfully.
Building with 'Microsoft Visual C++ 2010'.
MEX completed successfully.
>> demo
input image
press any key to continue
continuing...
car model visualization
press any key to continue
continuing...
detections
press any key to continue
continuing...
bounding boxes
press any key to continue
input image
press any key to continue
continuing...
inriaperson model visualization
press any key to continue
continuing...
detections
press any key to continue
continuing...
bounding boxes
press any key to continue
input image
press any key to continue
continuing...
bicycle model visualization
press any key to continue
continuing...
detections
press any key to continue
continuing...
bounding boxes
press any key to continue
  1. 从官网下载最新版本的DPM Discriminatively trained deformable part models
  2. 解压,查看README文件 Basic Usage
Basic Usage

===========

 

1. Unpack the code.

2. Start matlab.

3. Run the 'compile' function to compile the helper functions.

   (you may need to edit compile.m to use a different convolution 

    routine depending on your system)

4. Load a model and an image.

5. Use 'process' to detect objects.
  1. 也就是说配置好matlab的mex工具后,运行compile即可。之后就可以运行demo了

注意在ubuntu 14.04中,默认的gcc版本为4.8,而MATLAB2014a/2014b仅支持4.7.x 所以出错

Error using mex

No supported compiler or SDK was found. For options, visit 

http://www.mathworks.com/support/compilers/R2014a/glnxa64.

卸载gcc,安装gcc-4.7后,matlab不识别gcc-4.7,需要修改mex配置:

Ubuntu 14.04 by default has the compiler GCC 4.8, but Matlab R2014b .mex files require GCC 4.7.x

Error: You are using gcc version '4.8.2'. The version of gcc is not supported.

Solution:

Install GCC 4.7 and G++ 4.7
sudo apt-get install gcc-4.7 g++-4.7

Copy the mex-options file and provide read permissions
cp /usr/local/MATLAB/R2014b/bin/mexopts.sh ~/.matlab/R2014b/mexopts.sh

Make edits
sudo vim ~/.matlab/R2014b/mexopts.sh

Change
CC=’gcc’ to CC=’gcc-4.7′
CCX=’g++’ to CCX=’g++-4.7′

参考资料: http://blog.sina.com.cn/s/blog_54dd80920102v260.html https://help.ubuntu.com/community/MATLAB#MATLAB_R2014a_on_Ubuntu_14.04 http://bafnatech.blogspot.com/2015/02/building-mex-files-in-matlab-2014b-on.html http://www.mathworks.com/matlabcentral/answers/137228-setup-mex-compiler-for-r2014a-for-linux