在OPENCV中,仅在C 中存在某些方法,如何在Python中做同一件事

Within OpenCV,some methods exist in c++ only,how to do same thing in python?

本文关键字:一件 Python 仅在 OPENCV 存在 方法      更新时间:2023-10-16

例如:

  BackgroundSubtractorMOG2::setShadowThreshold(double threshold)

在Python中

cv2.createBackgroundSubtractorMOG2(detectShadows=True)

将返回一个对象,但是此对象没有任何方法,因此如何在Python中设置阴影阈值?

执行help(cv2.createBackgroundSubtractorMOG2())时,它显示了Python绑定上可用的方法。setShadowThreshold()在那里。创建一个MOG2对象并调用该方法。

 |  setShadowThreshold(...)
 |      setShadowThreshold(threshold) -> None

希望这个帮助。