I need to crop the license plate out of a car's image with python given the coordinates for bounding boxes of the plate. (4 coordinates) . Any tips on how I could do this ?
I have the following code , but does not work as expected.
> x1, y1: 1112 711
> x2, y2: 1328 698
> x3, y3: 1330 749
> x4, y4: 1115 761
image = cv2.imread(IMAGE_PATH)
fixed_image = cv2.cvtColor(image,cv2.COLOR_BGR2RGB)
new_img = cv2.rectangle(fixed_image, (x3,y3), (x1,y1), (0, 255, 0), 5)
plt.figure(figsize=(12,13))
plt.imshow(new_img)
Thank you.