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@v1
to 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:
Keypoint Detection Model
,CogVLM
,Image Convert Grayscale
,Anthropic Claude
,Google Vision OCR
,OpenAI
,Detections Classes Replacement
,Florence-2 Model
,Detection Offset
,Distance Measurement
,Pixelate Visualization
,Dimension Collapse
,Single-Label Classification Model
,SIFT
,VLM as Detector
,OpenAI
,Moondream2
,YOLO-World Model
,Stability AI Image Generation
,SIFT Comparison
,Object Detection Model
,Mask Visualization
,Overlap Filter
,Image Slicer
,Triangle Visualization
,Path Deviation
,VLM as Detector
,CSV Formatter
,Polygon Zone Visualization
,Model Comparison Visualization
,Crop Visualization
,Classification Label Visualization
,LMM
,Segment Anything 2 Model
,Reference Path Visualization
,Multi-Label Classification Model
,Line Counter
,Twilio SMS Notification
,Google Gemini
,Bounding Box Visualization
,Byte Tracker
,Image Contours
,Size Measurement
,Roboflow Custom Metadata
,Circle Visualization
,Perspective Correction
,Slack Notification
,Pixel Color Count
,Polygon Visualization
,Detections Transformation
,Instance Segmentation Model
,VLM as Classifier
,Detections Merge
,Trace Visualization
,Webhook Sink
,Color Visualization
,Identify Changes
,Detections Consensus
,LMM For Classification
,Image Threshold
,Detections Stitch
,SIFT Comparison
,JSON Parser
,Absolute Static Crop
,Clip Comparison
,Line Counter Visualization
,Stitch Images
,Line Counter
,Detections Filter
,Dot Visualization
,Identify Outliers
,Dynamic Zone
,Instance Segmentation Model
,Background Color Visualization
,Florence-2 Model
,Detections Stabilizer
,Model Monitoring Inference Aggregator
,Stitch OCR Detections
,Image Slicer
,Template Matching
,Bounding Rectangle
,Roboflow Dataset Upload
,Roboflow Dataset Upload
,Time in Zone
,Image Blur
,Email Notification
,Camera Focus
,Grid Visualization
,Path Deviation
,Object Detection Model
,Stability AI Inpainting
,Blur Visualization
,Label Visualization
,Depth Estimation
,Image Preprocessing
,Llama 3.2 Vision
,Byte Tracker
,Ellipse Visualization
,ONVIF Control
,VLM as Classifier
,Byte Tracker
,Halo Visualization
,Corner Visualization
,Camera Calibration
,Clip Comparison
,Time in Zone
,Buffer
,Dynamic Crop
,Relative Static Crop
,OpenAI
,Keypoint Visualization
,Velocity
,OCR Model
,Local File Sink
- outputs:
CogVLM
,OpenAI
,Anthropic Claude
,Google Vision OCR
,Detections Classes Replacement
,Florence-2 Model
,Pixelate Visualization
,Single-Label Classification Model
,SIFT
,Moondream2
,YOLO-World Model
,Stability AI Image Generation
,Object Detection Model
,Overlap Filter
,Triangle Visualization
,Model Comparison Visualization
,LMM
,Segment Anything 2 Model
,Keypoint Detection Model
,Line Counter
,Google Gemini
,Roboflow Custom Metadata
,Byte Tracker
,Image Contours
,Circle Visualization
,Detections Merge
,Trace Visualization
,Webhook Sink
,LMM For Classification
,Detections Stitch
,SIFT Comparison
,Clip Comparison
,Line Counter Visualization
,Identify Outliers
,Dynamic Zone
,Background Color Visualization
,Florence-2 Model
,Stitch OCR Detections
,Image Slicer
,Roboflow Dataset Upload
,Email Notification
,Camera Focus
,Path Deviation
,Blur Visualization
,Label Visualization
,Stability AI Inpainting
,Image Preprocessing
,Ellipse Visualization
,ONVIF Control
,VLM as Classifier
,Clip Comparison
,Time in Zone
,Dynamic Crop
,Single-Label Classification Model
,OpenAI
,Keypoint Visualization
,Dominant Color
,OCR Model
,Keypoint Detection Model
,Image Convert Grayscale
,Gaze Detection
,Detection Offset
,Distance Measurement
,SmolVLM2
,Qwen2.5-VL
,VLM as Detector
,OpenAI
,SIFT Comparison
,Mask Visualization
,Image Slicer
,Barcode Detection
,Path Deviation
,VLM as Detector
,Polygon Zone Visualization
,Crop Visualization
,Classification Label Visualization
,Reference Path Visualization
,Multi-Label Classification Model
,Twilio SMS Notification
,Bounding Box Visualization
,Size Measurement
,Perspective Correction
,Slack Notification
,Pixel Color Count
,Polygon Visualization
,Detections Transformation
,VLM as Classifier
,Instance Segmentation Model
,Color Visualization
,Identify Changes
,Detections Consensus
,Image Threshold
,Absolute Static Crop
,Stitch Images
,Multi-Label Classification Model
,Line Counter
,Detections Filter
,Dot Visualization
,QR Code Detection
,Instance Segmentation Model
,Model Monitoring Inference Aggregator
,Detections Stabilizer
,Template Matching
,Bounding Rectangle
,Roboflow Dataset Upload
,Time in Zone
,Image Blur
,Grid Visualization
,CLIP Embedding Model
,Object Detection Model
,Depth Estimation
,Llama 3.2 Vision
,Byte Tracker
,Byte Tracker
,Halo Visualization
,Corner Visualization
,Camera Calibration
,Buffer
,Relative Static Crop
,Velocity
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[instance_segmentation_prediction
,object_detection_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_prediction
or 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
}