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