请写出python opencv 为二值化图片轮廓点每一百个取一个样点,并获取样点坐标的具体代码...

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:

猜你喜欢

转载自blog.csdn.net/weixin_42594427/article/details/129594546