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