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 AnyThe source image used to pick the four reference points and compute the perspective transform.
📤 Outputs
This block provides the following output sockets:
Image AnyThe warped (perspective‑corrected) image produced after four points are defined. Empty until four points are set.Transform MatrixThe perspective transform matrix that can be reused by other blocks that accept a transform or perspective matrix.
🕹️ Controls
Image PreviewClick 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 LinesVisual 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
Provide an image to the
Image Anyinput socket.Click on the preview to place up to four reference points. Use
Uto undo andCto clear.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 Anyoutput and the mapping on theTransform Matrixoutput.The transform matrix can be consumed by other blocks that accept a perspective or transform matrix.
📝 Usage Instructions
Connect a camera or image source to the
Image Anyinput.Run once so the image appears in the preview.
Click four points on the image in the required order (bottom‑left → clockwise).
Inspect the preview; when four points are present the rectified image appears on the output.
Use the
Transform Matrixoutput for measurements, metric corrections or other perspective‑aware tasks.
💡 Tips and Tricks
Combine with
Show Imageto inspect the selected area in a larger viewer before or after placing points.Use
Image ROI SelectorImage ROIto crop a region first if you want to limit the interactive point picking to a smaller area.Feed the
Transform Matrixoutput intoSocial Distance Detector(as thePerspective Matrix) to enable accurate distance measurements in world coordinates.After rectifying, use
Image Resizeto 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 ROIto 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)orClear (C)and retry.If measurements appear incorrect downstream: confirm you passed the block’s
Transform Matrixto blocks that require a perspective matrix and that the matrix corresponds to the same image used for picking points.
Last updated
Was this helpful?