How to copy a image region using opencv in python?

后端 未结 3 1707
悲哀的现实
悲哀的现实 2020-12-02 14:30

I am trying to implement a license plate recognition software using the ideas from http://iamabhik.wordpress.com/category/opencv/.

I implemented the plate location u

3条回答
  •  暖寄归人
    2020-12-02 14:57

    Both cv.GetSubRect and ROI functions are available in Python, but in old import cv mode or import cv2.cv. ie use cv2.cv.GetSubRect() or cv2.cv.SetImageROI if you are familier with them.

    On the other hand, it is simple to set ROI without these functions due to numpy integration in new cv2.

    If (x1,y1) and (x2,y2) are the two opposite vertices of plate you obtained, then simply use function:

    roi = gray[y1:y2, x1:x2]
    

    that is your image ROI.

    So choose whatever suit you.

提交回复
热议问题