How can I do fisheyes correction in Python without knowing the contours? I use OpenCV, is it any function I can use? I found sample code for correction.
pts1 = np.float32([[56,65],[368,52],[28,387],[389,390]])
pts2 = np.float32([[0,0],[300,0],[0,300],[300,300]])
M = cv2.getPerspectiveTransform(pts1,pts2)
But in actual, I don't know the contours and size. The picture is capturing a receipt. Receipt in the middle part can be left or right.
Do I need to detect the contours of the receipt before doing fisheyes correction? And How? I use OpenCV to detect, but cannot give me a image back.
img = cv2.drawContours(img, contours, -1, (0,255,0), 3)
Thanks, Robin