title: Image Processing: how to find factor x and y of resizing image knowing that the object has an angle up to 90°
body: <p>I built such classification model that takes as input an image of such rectangular object that has fixed dimensions (w0 x h0). the output of the model is the class of this object.., where w0 = 742 pixels and h0 = 572 pixels</p>
  <p>now I have the same problem but with bigger rectangular object that has new fixed dimensions (w x h), where w = 1077 pixels and h = 681 pixels.</p>
  <p>I would like to resize the new image so that the object will have exactly the same size of the old object to fit the current model I already built. How can I find the x and y factors of the image resizing knowing that the object is not straight and can has an angle alpha from 0° to 90°? alpha is known for me.</p>
  <p>currently I have a bad solution:</p>
  <ol>
  <li>rotate the image -alpha</li>
  <li>resize the image using factor x = x0/x and y = y0/y</li>
  <li>rotate the image back (+alpha)</li>
  </ol>
  <p>Is it possible to calculate the resizing factors with respect of the angle alpha so I only resize the image without rotating the image back and forth? or maybe you know such function in opencv that does this calcuation?</p>