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