Personal memorandum & Qiita post test
import cv2
#Load and resize images
pic_url = "lena.jpg "
img = cv2.imread(pic_url)
#Image matrix[Y coordinate at the top of the rectangle:Y coordinate at the bottom of the rectangle,X coordinate on the left side of the rectangle:X coordinate on the right side of the rectangle]
cut_img = img[0:200,0:200]
while True:
cv2.imshow("img", cut_img)
#If the q key is pressed, it ends halfway
if cv2.waitKey(25) & 0xFF == ord('q'):
cv2.destroyAllWindows()
break
The point is
Is that the place?
Recommended Posts