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