Perspective Transform

This function block lets you interactively define a four-point perspective mapping on an image and produce a rectified (top‑down) view plus the transform matrix. Use it when you need to remove perspective distortion or generate a bird’s-eye view from a photographed plane.

📥 Inputs

This block accepts the following input socket:

  • Image Any The source image used to pick the four reference points and compute the perspective transform.

📤 Outputs

This block provides the following output sockets:

  • Image Any The warped (perspective‑corrected) image produced after four points are defined. Empty until four points are set.

  • Transform Matrix The perspective transform matrix that can be reused by other blocks that accept a transform or perspective matrix.

🕹️ Controls

  • Image Preview Click on the preview area to place points on the image.

  • Place Points (mouse left click) Place up to four points in the displayed image.

  • Undo (U) Remove the most recently placed point.

  • Clear (C) Remove all placed points and start over.

  • Point Markers and Lines Visual markers and connecting lines are drawn on the preview so you can see the selected polygon before generating the output.

Tip: Select four points starting from the bottom‑left and proceed clockwise for predictable results.

🎨 Features

  • Interactive point selection directly on the image preview for intuitive setup.

  • Visual feedback with circles and connecting lines so you can verify point order and placement.

  • Outputs both a rectified image and the transform matrix for downstream processing or reuse.

  • Point selection is persisted so you can save and reload your configuration.

⚙️ Running mechanism

  1. Provide an image to the Image Any input socket.

  2. Click on the preview to place up to four reference points. Use U to undo and C to clear.

  3. Once four points are placed (recommended order: bottom‑left, then clockwise), the block computes the perspective mapping and outputs the rectified image on the Image Any output and the mapping on the Transform Matrix output.

  4. The transform matrix can be consumed by other blocks that accept a perspective or transform matrix.

📝 Usage Instructions

  1. Connect a camera or image source to the Image Any input.

  2. Run once so the image appears in the preview.

  3. Click four points on the image in the required order (bottom‑left → clockwise).

  4. Inspect the preview; when four points are present the rectified image appears on the output.

  5. Use the Transform Matrix output for measurements, metric corrections or other perspective‑aware tasks.

💡 Tips and Tricks

  • Combine with Show Image to inspect the selected area in a larger viewer before or after placing points.

  • Use Image ROI Select or Image ROI to crop a region first if you want to limit the interactive point picking to a smaller area.

  • Feed the Transform Matrix output into Social Distance Detector (as the Perspective Matrix) to enable accurate distance measurements in world coordinates.

  • After rectifying, use Image Resize to scale the result for downstream processing or to match other blocks’ expected sizes.

  • If you need to extract the rectified region back into other processing steps, pair with Get ROI to pass the corrected image into analysis blocks.

🛠️ Troubleshooting

  • If the output is blank or not appearing: ensure an image is connected and visible in the preview, then place four points.

  • If the rectified output looks skewed: verify the point order (start bottom‑left and go clockwise) and reposition points using Undo (U) or Clear (C) and retry.

  • If measurements appear incorrect downstream: confirm you passed the block’s Transform Matrix to blocks that require a perspective matrix and that the matrix corresponds to the same image used for picking points.

Last updated

Was this helpful?