transform | Camera Component

transform

Use the transform model to apply transformations to input source images. The transformations are applied in the order they are written in the pipeline.

Configuration


Attributes

Name Type Required? Description
source string Required name of the camera to transform.
pipeline array Required Specify an array of transformation objects.
intrinsic_parameters object Optional The intrinsic parameters of the camera used to do 2D <-> 3D projections:
- width_px: The expected width of the aligned image in pixels. Value must be >= 0.
- height_px: The expected height of the aligned image in pixels. Value must be >= 0.
- fx: The image center x point.
- fy: The image center y point.
- ppx: The image focal x.
- ppy: The image focal y.
distortion_parameters object Optional Modified Brown-Conrady parameters used to correct for distortions caused by the shape of the camera lens:
- rk1: The radial distortion x.
- rk2: The radial distortion y.
- rk3: The radial distortion z.
- tp1: The tangential distortion x.
- tp2: The tangential distortion y.

Pipeline transformations

The following transformation objects are available for the pipeline:

Classifications

Classifications overlay text from the GetClassifications method of the vision service onto the image.


Attributes:

Crop

The Crop transform trims an image to a rectangular area specified by two points: the top left ((x_min, y_min)) and the bottom right ((x_max, y_max)).
You can provide these points as integer pixel values or as decimal proportions of the image’s width and height.
The origin ((0, 0)) occupies the top left pixel of the image; X values increase as you move right, Y values increase as you move down.


To crop a 100 x 200 image to the rectangular region between pixel coordinates (30, 40) and (60, 80), pass those coordinates in the following configuration:


To crop any image to a rectangular region that occupies the central 50% of the image, use proportional coordinates (0.25, 0.25) and (0.75, 0.75):


Tip

To convert pixel coordinates to proportional, divide X by image width and Y by image height.
For example, for pixel coordinates (25, 50) and (75, 150) in a 100 × 200 image:

Use the formula (X / <image width>, Y / <image height>).

Attributes:

Detections

The Detections transform takes the input image and overlays the detections from a given detector configured within the vision service.


Attributes:

Resize

The Resize transform resizes the image to the specified height and width.


Attributes:

Rotate

The Rotate transformation rotates the image by the angle specified in angle_deg. Default: 180 degrees.
This feature is useful for when the camera is installed upside down or sideways on your machine.


Attributes: