I have this black and white image, which I would like to transform into a new image where the 4 corner balls will form a perfectly upright rectangle and keep all relative distances among all objects of the original image.
I believe that a sort of rotation would accomplish what I am wanting, but, being a novice with OpenCV, I do not know how to do that. As far as I have learned, one can rotate an image, but what I am wanting is not to rotate the entire image but only the above described rectangle of balls (and all objects inside that rectangle).
Any suggestions would be very much appreciated.
Thanks in advance