Perspective Correction¶
Class: PerspectiveCorrectionBlockV1
The PerspectiveCorrectionBlock is a transformer block designed to correct
coordinates of detections based on transformation defined by two polygons.
This block is best suited when produced coordinates should be considered as if camera
was placed directly above the scene and was not introducing distortions.
Type identifier¶
Use the following identifier in step "type" field: roboflow_core/perspective_correction@v1to add the block as
as step in your workflow.
Properties¶
| Name | Type | Description | Refs |
|---|---|---|---|
name |
str |
Enter a unique identifier for this step.. | ❌ |
perspective_polygons |
List[Any] |
Perspective polygons (for each batch at least one must be consisting of 4 vertices). | ✅ |
transformed_rect_width |
int |
Transformed rect width. | ✅ |
transformed_rect_height |
int |
Transformed rect height. | ✅ |
extend_perspective_polygon_by_detections_anchor |
str |
If set, perspective polygons will be extended to contain all bounding boxes. Allowed values: CENTER, CENTER_LEFT, CENTER_RIGHT, TOP_CENTER, TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_CENTER, BOTTOM_RIGHT, CENTER_OF_MASS and ALL to extend to contain whole bounding box. | ✅ |
warp_image |
bool |
If set to True, image will be warped into transformed rect. | ✅ |
The Refs column marks possibility to parametrise the property with dynamic values available
in workflow runtime. See Bindings for more info.
Available Connections¶
Compatible Blocks
Check what blocks you can connect to Perspective Correction in version v1.
- inputs:
VLM as Detector,Byte Tracker,Google Vision OCR,Overlap Filter,SAM 3,Classification Label Visualization,Detections Stabilizer,Circle Visualization,SIFT Comparison,Image Contours,Relative Static Crop,Detections Filter,Image Preprocessing,LMM For Classification,VLM as Classifier,Ellipse Visualization,Stitch Images,Triangle Visualization,Detections Combine,Stability AI Inpainting,QR Code Generator,Image Slicer,VLM as Classifier,Background Color Visualization,Model Monitoring Inference Aggregator,Segment Anything 2 Model,Template Matching,Moondream2,Velocity,OCR Model,Distance Measurement,Dot Visualization,Florence-2 Model,SIFT,Morphological Transformation,Detections Transformation,EasyOCR,Reference Path Visualization,Halo Visualization,SIFT Comparison,Buffer,Polygon Visualization,Image Slicer,Florence-2 Model,Detection Offset,Slack Notification,Clip Comparison,Image Convert Grayscale,Instance Segmentation Model,OpenAI,Byte Tracker,Line Counter,PTZ Tracking (ONVIF).md),Color Visualization,Object Detection Model,Keypoint Detection Model,Google Gemini,JSON Parser,Label Visualization,Email Notification,Llama 3.2 Vision,Byte Tracker,Trace Visualization,Dynamic Zone,Line Counter,YOLO-World Model,Size Measurement,Email Notification,Corner Visualization,Mask Visualization,Time in Zone,CogVLM,Stability AI Outpainting,OpenAI,Roboflow Custom Metadata,Detections Stitch,Stitch OCR Detections,Blur Visualization,Time in Zone,CSV Formatter,Crop Visualization,VLM as Detector,OpenAI,Grid Visualization,Detections Classes Replacement,Perspective Correction,Twilio SMS Notification,Absolute Static Crop,Clip Comparison,Single-Label Classification Model,Seg Preview,Contrast Equalization,Roboflow Dataset Upload,Roboflow Dataset Upload,Polygon Zone Visualization,Stability AI Image Generation,Webhook Sink,Depth Estimation,Dimension Collapse,Bounding Box Visualization,Camera Focus,Instance Segmentation Model,Line Counter Visualization,Multi-Label Classification Model,Icon Visualization,Image Blur,Time in Zone,Pixelate Visualization,Image Threshold,Detections Merge,Path Deviation,Anthropic Claude,LMM,Google Gemini,Identify Outliers,Pixel Color Count,Dynamic Crop,Bounding Rectangle,Path Deviation,Detections Consensus,Model Comparison Visualization,Camera Calibration,Local File Sink,Keypoint Visualization,Identify Changes,Object Detection Model - outputs:
VLM as Detector,Byte Tracker,Overlap Filter,Google Vision OCR,SAM 3,Detections Stabilizer,Image Preprocessing,LMM For Classification,Ellipse Visualization,Triangle Visualization,Stitch Images,Detections Combine,QR Code Generator,Image Slicer,VLM as Classifier,Background Color Visualization,Model Monitoring Inference Aggregator,Segment Anything 2 Model,Template Matching,Distance Measurement,Dot Visualization,EasyOCR,Halo Visualization,Slack Notification,Byte Tracker,Color Visualization,Llama 3.2 Vision,QR Code Detection,Line Counter,Size Measurement,Email Notification,Corner Visualization,Mask Visualization,Time in Zone,Roboflow Custom Metadata,Stability AI Outpainting,Barcode Detection,Dominant Color,Time in Zone,Crop Visualization,VLM as Detector,Grid Visualization,Perspective Correction,Clip Comparison,Single-Label Classification Model,Contrast Equalization,Polygon Zone Visualization,CLIP Embedding Model,Bounding Box Visualization,Camera Focus,Icon Visualization,Image Blur,Time in Zone,Path Deviation,Anthropic Claude,Multi-Label Classification Model,Dynamic Crop,Bounding Rectangle,Path Deviation,Detections Consensus,Model Comparison Visualization,Identify Changes,Classification Label Visualization,Circle Visualization,SIFT Comparison,Image Contours,Relative Static Crop,Detections Filter,VLM as Classifier,Stability AI Inpainting,Moondream2,Velocity,OCR Model,Florence-2 Model,SIFT,Morphological Transformation,Detections Transformation,Gaze Detection,Reference Path Visualization,SIFT Comparison,Buffer,Polygon Visualization,Florence-2 Model,Image Slicer,Detection Offset,Clip Comparison,Perception Encoder Embedding Model,Instance Segmentation Model,OpenAI,Image Convert Grayscale,PTZ Tracking (ONVIF).md),Line Counter,Object Detection Model,Keypoint Detection Model,Google Gemini,Label Visualization,Email Notification,Byte Tracker,Trace Visualization,Dynamic Zone,YOLO-World Model,CogVLM,OpenAI,Detections Stitch,Stitch OCR Detections,Blur Visualization,Single-Label Classification Model,OpenAI,Detections Classes Replacement,Twilio SMS Notification,Absolute Static Crop,Seg Preview,Roboflow Dataset Upload,Roboflow Dataset Upload,Stability AI Image Generation,Webhook Sink,Depth Estimation,Line Counter Visualization,Instance Segmentation Model,Multi-Label Classification Model,Pixelate Visualization,Image Threshold,Detections Merge,Keypoint Detection Model,LMM,Google Gemini,Identify Outliers,Pixel Color Count,SmolVLM2,Qwen2.5-VL,Camera Calibration,Keypoint Visualization,Object Detection Model
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
Perspective Correction in version v1 has.
Bindings
-
input
predictions(Union[object_detection_prediction,instance_segmentation_prediction]): Predictions.images(image): The input image for this step..perspective_polygons(list_of_values): Perspective polygons (for each batch at least one must be consisting of 4 vertices).transformed_rect_width(integer): Transformed rect width.transformed_rect_height(integer): Transformed rect height.extend_perspective_polygon_by_detections_anchor(string): If set, perspective polygons will be extended to contain all bounding boxes. Allowed values: CENTER, CENTER_LEFT, CENTER_RIGHT, TOP_CENTER, TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_CENTER, BOTTOM_RIGHT, CENTER_OF_MASS and ALL to extend to contain whole bounding box.warp_image(boolean): If set to True, image will be warped into transformed rect.
-
output
corrected_coordinates(Union[object_detection_prediction,instance_segmentation_prediction]): Prediction with detected bounding boxes in form of sv.Detections(...) object ifobject_detection_predictionor Prediction with detected bounding boxes and segmentation masks in form of sv.Detections(...) object ifinstance_segmentation_prediction.warped_image(image): Image in workflows.extended_transformed_rect_width(integer): Integer value.extended_transformed_rect_height(integer): Integer value.
Example JSON definition of step Perspective Correction in version v1
{
"name": "<your_step_name_here>",
"type": "roboflow_core/perspective_correction@v1",
"predictions": "$steps.object_detection_model.predictions",
"images": "$inputs.image",
"perspective_polygons": "$steps.perspective_wrap.zones",
"transformed_rect_width": 1000,
"transformed_rect_height": 1000,
"extend_perspective_polygon_by_detections_anchor": "CENTER",
"warp_image": false
}