OpenCV: using Canny and Shi-Tomasi to detect round corners of a playing card
问题 I want to do some planar rectification, to convert from left to right: I have the code to do the correction, but I need the 4 corner coords. I'm using the following code to find them: import cv2 image = cv2.imread('input.png') gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) canny = cv2.Canny(gray, 120, 255, 1) corners = cv2.goodFeaturesToTrack(canny,4,0.5,50) for corner in corners: x,y = corner.ravel() cv2.circle(image,(x,y),5,(36,255,12),-1) cv2.imshow("result", image) cv2.waitKey() It reads