Skip to content

Image Alignment vTool#

The Image Alignment vTool allows you to align images with the reference image used during a previous teaching process.

Some vTools, e.g., the Measurements Basic vTool, rely on the object to be measured to appear at the same position as the object in the model.

Using the Image Alignment vTool between a Matching tool, e.g., Geometric Pattern Matching vTool, and a Measurements vTool gives you more flexibility regarding the position of objects. It can align an object in the input image with the reference object used during matching. This way, you can measure objects at different positions.

The Image Alignment vTool accepts an image via the Image input pin and alignment transformation data from the Matching tools via the AlignmentTf input pin. It outputs an aligned image via the Image output pin and the data for reversing the transformation via the InverseTf output pin.

Image Alignment vTool

How It Works#

The position of the target object in the teaching image used by Matching vTools is the reference position. During operation, the Matching vTools compare the position of the matched object in the input image to the reference position. The result is a relative transformation from the reference position to the actual position. This data is output via the Matching vTool's AlignmentTf output pin.

The Image Alignment vTool accepts the alignment transformation data from the Matching tool via its AlignmentTf input pin. Using this data, it can output an image in which the target object always appears at the same position. The aligned image is output via the Image output pin and can be used by subsequent vTools that require identical positioning of the target object.

The Image Alignment vTool also computes and outputs inverse transformation data via its InverseTf output pin. The inverse transformation data allows the subsequent vTool to output correct position data for the input image instead of the aligned image.

The Matching vTool and the Alignment vTool use the same input image. Alignment works best if the image only contains one target object. While it is possible to fine-tune matching via the Matches and Score options, problems may occur if the score values of target objects are too similar. This could lead to the wrong match being chosen and alignment not working as expected.

Image Alignment Example#

Assume you are a manufacturer of punching dies and want to make sure that the dies you are producing are identical by measuring the gaps between the different square-shaped holes in the die. Because the position of the dies may vary during the inspection process, you use the Geometric Pattern Matching Basic vTool and the Image Alignment vTool in preparation for the actual measuring task using the Measurements Basic vTool.

The recipe for this workflow looks like this. Note that the Image output pin of the Camera vTool must be connected to the Image input pins of the Geometric Pattern Matching Basic vTool and the Image Alignment vTool.

Image Alignment Recipe for Die Inspection

The following image is the template image, i.e., the ideal image that you want to compare against.

Template Image

During inspection, you may encounter the following dies that deviate from the template image in certain aspects.

Die with correct gaps but rotated by 30 degrees:

Inspection Image Rotated by Thirty Degrees

Die in identical position but with incorrect gaps between the holes:

Inspection Image With Incorrect Gaps Between Two Holes

Die with incorrect gaps and rotated by 30 degrees:

Inspection Image Rotated by Thirty Degrees And With Incorrect Gaps Between Two Holes

To configure the Geometric Pattern Matching Basic vTool, load the template image, mark the die and teach the model.

Teaching the Matching vTool

To configure the Measurements Basic vTool, load the template image and configure the settings as shown in the following screenshot.

Configuring the Measurements vTool

If you run the recipe, the results will look like this.

Die with correct gaps:

Measurement Result With Correct Gaps

Die with incorrect gaps:

Measurement Result With Incorrect Gaps

Configuring the vTool#

The vTool has no configurable settings.

Inputs#

Image#

Accepts images directly from a Camera vTool or from a vTool that outputs images, e.g., the Image Format Converter vTool.

AlignmentTf#

Accepts alignment transformation data from any Matching vTool.

  • Data type: Transformation Data

Outputs#

Image#

Returns the aligned image. The output image can be used by any vTool accepting images as input. The output image has the same size as the input image.

InverseTf#

Returns the inverse transformation data of the alignment transformation. With this, 2D point coordinates from the coordinate system of the aligned image can be transformed into the coordinate system of the input image.

  • Data type: Transformation Data

Supported Pixel Formats#

Depending on the pixel format of the input image, the Image Alignment vTool outputs the following pixel formats:

Input Pixel Format Output Pixel Format
Bayer GR 8 BGR 8 Packed
Bayer GR 16 RGB 16 Packed
Bayer RG 8 BGR 8 Packed
BGRA 8 Packed BGRA 8 Packed
BGR 8 Packed BGR 8 Packed
Mono 8 Mono 8
Mono 16 Mono 16
RGB 8 Packed RGB 8 Packed
RGB 16 Packed RGB 16 Packed
RGB 8 Planar RGB 8 Packed
RGB 16 Planar RGB 16 Packed

Typical Predecessors#

Typical Successors#