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