Dewarp the image, make it square, crop out the edges that are not part of the main image
Are you sure?