NVIDIA Jetson TK1学习与开发(九):基于GPU加速的OpenCV人体检测(Full Body Detection)

基于GPU加速的OpenCV人体检测(Full Body Detection)

1、CUDA和OpenCV的安装

首先,确定一下自己的平台是否安装好了CUDA和OpenCV。

CUDA的安装可以参考:http://blog.csdn.net/frd2009041510/article/details/42042807http://blog.csdn.net/frd2009041510/article/details/42925205

OpenCV的安装可以参考:http://blog.csdn.net/frd2009041510/article/details/42930113

2、Simply build the OpenCV HOG (Hough Of Gradients) sample person detector program

[cpp]  view plain  copy
 print ?
  1. cd opencv-2.4.9/samples/gpu  
  2. g++ hog.cpp -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_calib3d -lopencv_contrib -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_legacy -lopencv_ml -lopencv_nonfree -lopencv_objdetect -lopencv_photo -lopencv_stitching -lopencv_superres -lopencv_video -lopencv_videostab -o hog  

进入目录:


编译:


3、run the HOG demo

[cpp]  view plain  copy
 print ?
  1. ./hog --video 768x576.avi  

注意:You can run the HOG demo such as on a pre-recorded video of people walking around. The HOG demo displays a graphical output, hence you should plug a HDMI monitor in or use a remote viewer such as X Tunneling or VNC or TeamViewer on your desktop in order to see the output.

结果截图如下:



如果有摄像头,可以执行下面的命令来完成演示:

[html]  view plain  copy
 print ?
  1. ./hog --camera 0  


注意:Note: This looks for whole bodies and assumes they are small, so you need to stand atleast 5m away from the camera if you want it to detect you!

结果截图如下:


4、HOG demo中的一些控制命令

You can toggle between CPU vs GPU by pressing 'm', where you will see that the GPU is typically 5x faster at HOG than the CPU!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值