title: How to straighten a rotated rectangle area of an image using OpenCV in Python?
body: <p>The following picture will tell you what I want.</p>
  
  <p>I have the information of the rectangles in the image (width, height, center point and rotation degree). Now, I want to write a script to cut them out and save them as an image, but straighten them as well. As in, I want to  go from the rectangle shown inside the image to the rectangle that is shown outside.</p>
  
  <p>I am using OpenCV Python. <strong>Please</strong> tell me a way to accomplish this.</p>
  
  <p><strong>Kindly</strong> show some code as examples of OpenCV Python are hard to find.</p>
  
  <p><img src="https://i.stack.imgur.com/6Xinc.jpg" alt="Example Image"></p>