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