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