繁体   English   中英

从视频中提取背景场景

[英]Extract background scene from video

我正在使用Qt和opencv进行视频处理项目。 作为处理步骤,我需要从人类经过的视频(实时流)中提取背景。 我需要知道Opencv是否具有用于从视频提取静态对象的内置功能?

看一下这个OpenCV类

cv::Mat original;     // your frame
cv::Mat foreground;   // your foreground
cv::Mat background;   // your background

cv::BackgroundSubtractorMOG2 mog;

mog.history = 150;            // How many frames should be used for calculation
mog.nShadowDetection = false; // There are a lot of parameters to adjust

mog(original,foreground,0.01);  // Binary foreground saved in "foreground"

mog.getBackgroundImage(background); // Output the current background of the model

该类实现了以下描述的高斯混合模型背景减法:

Z.Zivkovic,用于背景扣除的改进的自适应高斯混合模型,国际会议模式识别,英国,2004年8月, http: //www.zoranz.net/Publications/zivkovic2004ICPR.pdf。 该代码非常快,并且还执行阴影检测。 每个像素适应高斯分量的数量。

最快,最简单的方法是使用先前帧的中值

您可以使用第一个背景图片的更新过程来考虑新的静态对象,例如Pinciple Component Analysis,高斯混合,自组织背景减法和CNN等更复杂的方法,除非您使用特殊的硬件FPGA或GPU

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM