import cv2
o=cv2.imread('C:/Users/xpp/Desktop/Finger.png')#原始图像
cv2.imshow("original",o)
gray=cv2.cvtColor...threshold(gray,235,255,cv2.THRESH_BINARY)#将灰度图片转换为二值图片
contours,hierarchy=cv2.findContours(thresh,2,1)#计算图像轮廓...300,200),font,1,(0,255,0),3)
print("distB=",distB)
distC=cv2.pointPolygonTest(hull,(300,250),True)#点C到轮廓的距离...font=cv2.FONT_HERSHEY_SIMPLEX
cv2.putText(gray,'C',(300,300),font,1,(0,255,0),3)
print("distC=",distC...如果点在轮廓的外部,返回值为-1;如果点在轮廓上,返回值为0;如果点在轮廓内部,返回值为1