how to scale a contour's height by a factor?
问题 I am trying to scan a passport page using the phone's camera using OpenCV. In the above image the contour marked in red is my ROI (will need a top view of that). Performing segmentation I can detect the MRZ area. And the pages should have a fixed aspect ratio. Is there a way to scale the green contour using the aspect ratio to approximate the red one? I have tried finding the corners of the green rect using approxPolyDP , and then scaling that rect and finally doing a perspective warp to get