Understanding of opencv picture coordinate system

Zero coordinates system is the upper left corner of the image, X-axis is a rectangular piece of the image above the horizon; the Y-axis of a rectangular piece of the image on the left vertical line. X, Y are positive, the coordinate system in the body, such as Mat structure, Rect, Point in are suitable.

img = np.zeros((500, 500, 3), dtype=np.uint8)
img[:, :, :] = 255
cv2.rectangle(img, (100, 100), (400, 400), [0, 0, 255])
cv2.rectangle(img, (200, 200), (300, 300), [0, 0, 255])
cv2.imshow("img", img)
cv2.waitKey(-1)

Draw pictures

Guess you like

Origin www.cnblogs.com/answerThe/p/11428284.html