基於高斯混合模型的背景/前景分割演算法。更多...
#include <opencv2/video/background_segm.hpp>
基於高斯混合模型的背景/前景分割演算法。
該類實現了 [327] 和 [326] 中描述的高斯混合模型背景減除演算法。
◆ apply()
| virtual void cv::BackgroundSubtractorMOG2::apply |
( |
InputArray | image, |
|
|
OutputArray | fgmask, |
|
|
double | learningRate = -1 ) |
|
純虛擬函式 |
| Python |
|---|
| cv.BackgroundSubtractorMOG2.apply( | image[, fgmask[, learningRate]] | ) -> | fgmask |
計算前景掩碼。
- 引數
-
| image | 下一影片幀。浮點幀將不進行縮放使用,其範圍應在 \([0,255]\) 內。 |
| fgmask | 作為 8 位二進位制影像的輸出前景掩碼。 |
| learningRate | 介於 0 和 1 之間的值,表示背景模型的學習速度。負引數值表示演算法將使用自動選擇的學習率。0 表示背景模型完全不更新,1 表示背景模型從最後一幀完全重新初始化。 |
實現 cv::BackgroundSubtractor。
◆ getBackgroundRatio()
| virtual double cv::BackgroundSubtractorMOG2::getBackgroundRatio |
( |
| ) |
const |
|
純虛擬函式 |
| Python |
|---|
| cv.BackgroundSubtractorMOG2.getBackgroundRatio( | | ) -> | retval |
返回演算法的“背景比率”引數。
如果一個前景畫素在約 backgroundRatio*history 幀內保持半恆定值,則被視為背景,並作為新分量的中心新增到模型中。這對應於論文中的 TB 引數。
◆ getComplexityReductionThreshold()
| virtual double cv::BackgroundSubtractorMOG2::getComplexityReductionThreshold |
( |
| ) |
const |
|
純虛擬函式 |
| Python |
|---|
| cv.BackgroundSubtractorMOG2.getComplexityReductionThreshold( | | ) -> | retval |
返回複雜度降低閾值。
此引數定義了接受以證明元件存在的樣本數量。CT=0.05 是所有樣本的預設值。透過設定 CT=0,您將獲得與標準 Stauffer&Grimson 演算法非常相似的演算法。
◆ getDetectShadows()
| virtual bool cv::BackgroundSubtractorMOG2::getDetectShadows |
( |
| ) |
const |
|
純虛擬函式 |
| Python |
|---|
| cv.BackgroundSubtractorMOG2.getDetectShadows( | | ) -> | retval |
返回陰影檢測標誌。
如果為 true,演算法將檢測並標記陰影。詳情請參見 createBackgroundSubtractorMOG2。
◆ getHistory()
| virtual int cv::BackgroundSubtractorMOG2::getHistory |
( |
| ) |
const |
|
純虛擬函式 |
| Python |
|---|
| cv.BackgroundSubtractorMOG2.getHistory( | | ) -> | retval |
◆ getNMixtures()
| virtual int cv::BackgroundSubtractorMOG2::getNMixtures |
( |
| ) |
const |
|
純虛擬函式 |
| Python |
|---|
| cv.BackgroundSubtractorMOG2.getNMixtures( | | ) -> | retval |
◆ getShadowThreshold()
| virtual double cv::BackgroundSubtractorMOG2::getShadowThreshold |
( |
| ) |
const |
|
純虛擬函式 |
| Python |
|---|
| cv.BackgroundSubtractorMOG2.getShadowThreshold( | | ) -> | retval |
返回陰影閾值。
如果畫素是背景的較暗版本,則檢測到陰影。陰影閾值(論文中的 Tau)定義了陰影可以有多暗。Tau=0.5 意味著如果畫素暗度超過兩倍,則它不是陰影。參見 Prati, Mikic, Trivedi and Cucchiara, Detecting Moving Shadows...*, IEEE PAMI,2003。
◆ getShadowValue()
| virtual int cv::BackgroundSubtractorMOG2::getShadowValue |
( |
| ) |
const |
|
純虛擬函式 |
| Python |
|---|
| cv.BackgroundSubtractorMOG2.getShadowValue( | | ) -> | retval |
返回陰影值。
陰影值是用於在前景掩碼中標記陰影的值。預設值為 127。掩碼中的值 0 始終表示背景,255 表示前景。
◆ getVarInit()
| virtual double cv::BackgroundSubtractorMOG2::getVarInit |
( |
| ) |
const |
|
純虛擬函式 |
| Python |
|---|
| cv.BackgroundSubtractorMOG2.getVarInit( | | ) -> | retval |
◆ getVarMax()
| virtual double cv::BackgroundSubtractorMOG2::getVarMax |
( |
| ) |
const |
|
純虛擬函式 |
| Python |
|---|
| cv.BackgroundSubtractorMOG2.getVarMax( | | ) -> | retval |
◆ getVarMin()
| virtual double cv::BackgroundSubtractorMOG2::getVarMin |
( |
| ) |
const |
|
純虛擬函式 |
| Python |
|---|
| cv.BackgroundSubtractorMOG2.getVarMin( | | ) -> | retval |
◆ getVarThreshold()
| virtual double cv::BackgroundSubtractorMOG2::getVarThreshold |
( |
| ) |
const |
|
純虛擬函式 |
| Python |
|---|
| cv.BackgroundSubtractorMOG2.getVarThreshold( | | ) -> | retval |
返回畫素-模型匹配的方差閾值。
馬氏距離平方上的主要閾值,用於判斷樣本是否被背景模型很好地描述。與論文中的 Cthr 相關。
◆ getVarThresholdGen()
| virtual double cv::BackgroundSubtractorMOG2::getVarThresholdGen |
( |
| ) |
const |
|
純虛擬函式 |
| Python |
|---|
| cv.BackgroundSubtractorMOG2.getVarThresholdGen( | | ) -> | retval |
返回用於生成新混合分量的畫素模型匹配的方差閾值。
馬氏距離平方的閾值,用於幫助判斷樣本何時接近現有分量(對應於論文中的 Tg)。如果畫素不接近任何分量,則被視為前景或作為新分量新增。3 sigma => Tg=3*3=9 是預設值。較小的 Tg 值會生成更多分量。較大的 Tg 值可能會導致分量數量較少,但它們可能變得太大。
◆ setBackgroundRatio()
| virtual void cv::BackgroundSubtractorMOG2::setBackgroundRatio |
( |
double | ratio | ) |
|
|
純虛擬函式 |
| Python |
|---|
| cv.BackgroundSubtractorMOG2.setBackgroundRatio( | ratio | ) -> | 無 |
◆ setComplexityReductionThreshold()
| virtual void cv::BackgroundSubtractorMOG2::setComplexityReductionThreshold |
( |
double | ct | ) |
|
|
純虛擬函式 |
| Python |
|---|
| cv.BackgroundSubtractorMOG2.setComplexityReductionThreshold( | ct | ) -> | 無 |
◆ setDetectShadows()
| virtual void cv::BackgroundSubtractorMOG2::setDetectShadows |
( |
bool | detectShadows | ) |
|
|
純虛擬函式 |
| Python |
|---|
| cv.BackgroundSubtractorMOG2.setDetectShadows( | detectShadows | ) -> | 無 |
◆ setHistory()
| virtual void cv::BackgroundSubtractorMOG2::setHistory |
( |
int | history | ) |
|
|
純虛擬函式 |
| Python |
|---|
| cv.BackgroundSubtractorMOG2.setHistory( | history | ) -> | 無 |
◆ setNMixtures()
| virtual void cv::BackgroundSubtractorMOG2::setNMixtures |
( |
int | nmixtures | ) |
|
|
純虛擬函式 |
| Python |
|---|
| cv.BackgroundSubtractorMOG2.setNMixtures( | nmixtures | ) -> | 無 |
設定背景模型中的高斯分量數量。
需要重新初始化模型以保留記憶體。
◆ setShadowThreshold()
| virtual void cv::BackgroundSubtractorMOG2::setShadowThreshold |
( |
double | RANSAC引數。它是點到畫素中對極線的最大距離,超過此距離的點將被視為異常值,不用於計算最終的基本矩陣。它可以設定為1-3左右,具體取決於點定位的精度、影像解析度和影像噪聲。 | ) |
|
|
純虛擬函式 |
| Python |
|---|
| cv.BackgroundSubtractorMOG2.setShadowThreshold( | RANSAC引數。它是點到畫素中對極線的最大距離,超過此距離的點將被視為異常值,不用於計算最終的基本矩陣。它可以設定為1-3左右,具體取決於點定位的精度、影像解析度和影像噪聲。 | ) -> | 無 |
◆ setShadowValue()
| virtual void cv::BackgroundSubtractorMOG2::setShadowValue |
( |
int | 值 | ) |
|
|
純虛擬函式 |
| Python |
|---|
| cv.BackgroundSubtractorMOG2.setShadowValue( | 值 | ) -> | 無 |
◆ setVarInit()
| virtual void cv::BackgroundSubtractorMOG2::setVarInit |
( |
double | varInit | ) |
|
|
純虛擬函式 |
| Python |
|---|
| cv.BackgroundSubtractorMOG2.setVarInit( | varInit | ) -> | 無 |
◆ setVarMax()
| virtual void cv::BackgroundSubtractorMOG2::setVarMax |
( |
double | varMax | ) |
|
|
純虛擬函式 |
| Python |
|---|
| cv.BackgroundSubtractorMOG2.setVarMax( | varMax | ) -> | 無 |
◆ setVarMin()
| virtual void cv::BackgroundSubtractorMOG2::setVarMin |
( |
double | varMin | ) |
|
|
純虛擬函式 |
| Python |
|---|
| cv.BackgroundSubtractorMOG2.setVarMin( | varMin | ) -> | 無 |
◆ setVarThreshold()
| virtual void cv::BackgroundSubtractorMOG2::setVarThreshold |
( |
double | varThreshold | ) |
|
|
純虛擬函式 |
| Python |
|---|
| cv.BackgroundSubtractorMOG2.setVarThreshold( | varThreshold | ) -> | 無 |
◆ setVarThresholdGen()
| virtual void cv::BackgroundSubtractorMOG2::setVarThresholdGen |
( |
double | varThresholdGen | ) |
|
|
純虛擬函式 |
| Python |
|---|
| cv.BackgroundSubtractorMOG2.setVarThresholdGen( | varThresholdGen | ) -> | 無 |
此類的文件生成自以下檔案