Python OpenCV Box2D

前端 未结 2 1400
有刺的猬
有刺的猬 2021-02-14 15:56

I am trying to call OpenCV function MinAreaRect2 from within python. I use OpenCV 2.4.2 with python 2.7 and numpy 1.6. I went this far :

import cv

def nda2ipl(a         


        
2条回答
  •  醉梦人生
    2021-02-14 16:18

    OpenCV Python wrapper documentation is kept along with the normal documentation in same site, www.docs.opencv.org

    Earlier Python module used was cv interface, which used native data types from original C++ interface like cvMat, cvSeq etc.

    Later it was shifted to more better, advanced and simpler module cv2 interface. In it, everything is returned as either Numpy arrays or native python data types.

    Here, tuple returned has the same arguments as that of cvBox2D. You can find more details the differences between different python wrappers here : What is different between all these OpenCV Python interfaces?

    Here, your assumption is correct. Those values specified exactly what you mentioned.

    If you want to draw rotated rect, you need 4 vertices of the rectangle. For that, you need a function which is never seen in documentation, ie cv2.cv.BoxPoints() (but don't worry, it will be there in documentation when OpenCV 2.4.3 is released. )

    enter image description here

提交回复
热议问题