title: How to rotate a group of objects inside an image?
body: <p>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 <em>upright</em> rectangle and keep all relative distances among all objects of the original image.</p>
  <p>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).</p>
  <p>Any suggestions would be very much appreciated.</p>
  <p>Thanks in advance<img src="https://i.stack.imgur.com/t0Xpx.jpg" alt="My image." /></p>