Please write python opencv to take one sample point for every one hundred contour points of the binarized image, and obtain the specific code of the sample point coordinates...

import cv2

Read the image

img = cv2.imread("image.jpg")

Convert to grayscale

gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

Find the contours

contours, _ = cv2.findContours(gray, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)

Iterate through each contour

for cnt in contours:

Guess you like

Origin blog.csdn.net/weixin_42594427/article/details/129594546