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