Qt と opencv を使用してビデオ処理プロジェクトに取り組んでいます。処理ステップとして、人間が通り過ぎるビデオ (リアルタイム ストリーミング) から背景を抽出する必要があります。ビデオから静的オブジェクトを抽出するための関数が Opencv に組み込まれているかどうかを知る必要がありますか?
1908 次
2 に答える
3
この 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 . コードは非常に高速で、影の検出も実行します。ガウス成分の数は、ピクセルごとに適応されます。
于 2013-01-30T20:02:54.187 に答える