

It's really best to get a calibration pattern and wave it (well. And the picked points on the side view may be off by a pixel or so, but that translates into several feet at such a shallow angle and distance across the field. Besides distortion coefficients, the optical center might not really be where it's supposed to. You can then build something interactive using createTrackbar to mess with the distortion coefficients until the output looks straight-ish.ĭon't expect that to become perfect. # add some in the X and Y dimensionĪnd then you apply the homography to the undistorted input image: topdown = cv.warpPerspective(im_undistorted, H, dsize=(90*15, 60*15)) You can chain some more transformations to that homography (H), like translation/scaling in either image space, to move the picture where you want it. H = cv.getPerspectiveTransform(impts_undist, modelpts) In each pair, one point is defined in the one perspective (side of the field), and the other point is defined in the other perspective (top-down/"model"). Perspective transform requires at least four pairs of points. Now you have image and points without lens distortion.

Matrix = cv.getPerspectiveTransform(pt1, pt2) # 4 Corresponding Points of Desired Bird Eye View Image Img = cv.imread("/Users/laulpee/Desktop/python/Screen Shot at 2.44.15 AM.png")
#Birdfont distortion code
This is the code I have so far in Python: import cv2 as cv Any next steps or resources I can learn from are also appreciated.
#Birdfont distortion how to
I'm looking for any advice on how to go about undistort-ing the image to have a perfect bird eye view of the field without knowing the camera properties. The issue here is that I do not have any information on the properties of the camera used to record the soccer field footage (and this is the only angle which makes it difficult to do camera calibration). I've researched ways to undistort images but from what I've read so far is that I need to do camera calibration. Which shows that there is distortion in the original image. To a bird eye view and have attempted initially with warpPerspective only (OpenCV in python) but results with I'm trying to transform this soccer field image
