--- title: points-4-perspective emoji: 📐 colorFrom: blue colorTo: yellow sdk: gradio sdk_version: 3.45.2 app_file: app.py pinned: false python_version: 3.9.18 --- # points-4-perspective A cute little tool that applies a 4-point perspective transform based on coordinates the user defines on the image. To compute the transformation matrix, we define target coordinates from a top-down perpendicular view relative to the source coordinates. We then use this transformation matrix on the image to warp its perspective to get the top-down view of whatever ROI the user selects in the image - neat! ![Input Image](pics/input_image.png "Input Image") ![Output Image](pics/output_image.png "Output Image") This approach defines the aspect ratio of the target coordinates based on the source coordinates, which does not produce an accurate aspect ratio. To get around this, width/height sliders are provided to the user to adjust the output image dimensions. ![App Screenshot](pics/app_screenshot.png "App Screenshot")