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