【问题标题】:Within OpenCV,some methods exist in c++ only,how to do same thing in python?在 OpenCV 中,一些方法只存在于 c++ 中,如何在 python 中做同样的事情?
【发布时间】:2017-04-24 09:57:10
【问题描述】:

例如:

  BackgroundSubtractorMOG2::setShadowThreshold(double threshold)

在python中

cv2.createBackgroundSubtractorMOG2(detectShadows=True)

会返回一个对象,但是这个对象没有任何方法,那么如何在python中设置shadow threshod呢?

【问题讨论】:

    标签: python c++ opencv


    【解决方案1】:

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

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

    希望对您有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-05-18
      • 2022-10-15
      • 2011-03-07
      • 1970-01-01
      • 1970-01-01
      • 2022-07-27
      • 1970-01-01
      相关资源
      最近更新 更多