簡體   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