79566443

Date: 2025-04-10 11:08:16
Score: 1
Natty:
Report link

drawContours will work in-place on the image. Just make a copy of your image prior to drawing the contours onto it:

contour_image = copy.deepcopy(image)
contours, _   = cv2.findContours(canny, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
cv2.drawContours(contour_image, contours, -1, (0, 255, 0), 3)
cv2.imwrite('contours_on_image.png', contour_image)

Your image will remain untouched, thus you are cropping the original pixels.

License plat image without green glare

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: André