StupidBeauty
Read times:463Posted at:Tue Jun 26 22:59:39 2012
- no title specified

转载:读视频文件和运动物体检测

看起来,用opencv来做运行物体检测是狠方便的。

http://www.opencv.org.cn/index.php/%E8%AF%BB%E8%A7%86%E9%A2%91%E6%96%87%E4%BB%B6%E5%92%8C%E8%BF%90%E5%8A%A8%E7%89%A9%E4%BD%93%E6%A3%80%E6%B5%8B

亮点:

cvCvtColor(pFrame, pFrImg, CV_BGR2GRAY) ;

cvConvert ( pFrImg , pFrameMat ) ;

// 高斯滤波先,以平滑图像

//cvSmooth(pFrameMat, pFrameMat, CV_GAUSSIAN, 3, 0, 0);

// 当前帧跟背景图相减

cvAbsDiff ( pFrameMat , pBkMat , pFrMat ) ;

// 二值化前景图

cvThreshold ( pFrMat , pFrImg , 60 , 255.0 , CV_THRESH_BINARY ) ;

// 进行形态学滤波,去掉噪音

//cvErode(pFrImg, pFrImg, 0, 1);

//cvDilate(pFrImg, pFrImg, 0, 1);

// 更新背景

cvRunningAvg ( pFrameMat , pBkMat , 0.003 , 0 ) ;

// 将背景转化为图像格式,用以显示

cvConvert ( pBkMat , pBkImg ) ;

Your opinions
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands

 
Recent comments
2017年4月~2019年4月垃圾短信排行榜Posted at:Thu Sep 26 04:51:48 2024
Qt5.7文档翻译:QWebEngineCookieStore类,QWebEngineCookieStore ClassPosted at:Fri Aug 11 06:50:35 2023盲盒kill -9 18289 Grebe.20230517.211749.552.mp4