'Opencv Cumulative = true difference to false”改写成中文描述如下: 将Opencv的累积参数Cumulative设置为false,而不是true。
示例代码如下: 在python中,将累积参数设置为false的代码如下所示:
cv2.createBackgroundSubtractorMOG2(history=100, varThreshold=50, detectShadows=True) p.setBool('OpenCvBGSDetector', 'Cumulative', False)
在C++中,将累积参数设置为false的代码如下所示:
cv::Ptrcv::BackgroundSubtractorMOG2 pBackSub; pBackSub = cv::createBackgroundSubtractorMOG2(history, varThreshold, detectShadows); pBackSub->set("detectShadows", true); pBackSub->set("nmixtures", 3); pBackSub->set("backgroundRatio", 0.9); pBackSub->set("varThreshold", 16.0); pBackSub->set("VarThresholdGen", 9.0); pBackSub->set("GammaCorrection", true); pBackSub->set("Cumulative", false);