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