Calibration Patterns

For calibrating cameras, you need a calibration pattern. The NxLib supports two different types of calibration patterns.

Some of the pattern types can encode some information. This information can be decoded with the DecodeData parameter of the CollectPattern command. When this is not possible due to the light conditions, they can also be specified in the global pattern data .

Halcon Patterns

../_images/pattern_halcon.png

A Halcon pattern always has a grid size 7x7 and always needs to be observed completely. The dots in the pattern can encode its grid spacing and thickness.

Ensenso Patterns

All Ensenso patterns have a different point arrangement and are automatically distinguished from Halcon patterns when observing them. The main difference to Halcon patterns is that the camera doesn’t need to observe the whole pattern. As soon as it sees any 4x4 patch, the location of this patch in the complete pattern can be uniquely determined and the pattern section can be used just like any other pattern observation. The offset of the observed patch is published in the Offset node of a pattern specification.

Note

Very small patches can only be localized uniquely in their complete pattern, but not in all possible Ensenso patterns. The NxLib uses the global pattern data to decide which complete pattern the patch belongs to. When this data is not correct while you collect the pattern, you will get inconsistent results. It is therefore recommended to first collect an observation with DecodeData enabled (which requires the observation of a patch that is big enough to decode all information). When the global data got updated, you can then disable the decoding flag and start collecting smaller patches.

There are three different types of Ensenso patterns, which can encode different information. The type of a collected pattern is indicated with the Type node.

Single and Custom Single Patterns

../_images/pattern_single.png

Patterns of type “Single” always have size 15x15 and can encode their grid spacing and thickness. This information can be decoded uniquely when you observed at least a 6x6 patch. The origin of such a pattern always lies at its center point.

You can create a pattern of this type with custom grid spacing and thickness in NxCalTab. In contrast to the official single patterns, this pattern will have type “SingleCustom” and its decoding works slightly different. The information in such a custom pattern cannot be decoded from a patch of the pattern. You either need to specify it manually before using the pattern or make sure that you can observe the complete pattern in order to decode it.

Flexible Patterns

../_images/pattern_flexible.png

Patterns of type “Flexible” can have an arbitrary size in both dimensions and their center can have an offset to the origin of the world coordinate system.

Note

Flexible patterns can have an arbitrary grid spacing, but it is not encoded in the pattern. You always have to specify the grid spacing manually when using them. For calibrating a single monocular or stereo camera the flexibility of the size and the offset doesn’t have any advantages, so we recommend using an official or “Single” pattern with its grid spacing encoded for these cases.

Assembly Patterns

For patterns of type “Assembly”, you can combine multiple flat calibration patterns to an arbitrary structure. Individually, each of these patterns behaves the same as a pattern of type “Single” and has its grid spacing encoded.

Additionally, though, you can calibrate the different sides of the assembly to each other, so that they get a common coordinate system. You can start such a calibration from NxCalTab. The result is a JSON file that you can load into the global AssemblyCalibration node. The NxView calibration wizard will automatically ask for a calibration when it detects an assembly pattern.

Note

The assembly calibration must already be loaded when you collect an assembly pattern. Otherwise some of the patterns in the pattern buffer will not have a calibration and each of their sides will have its own coordinate system.

Coordinate Systems on Calibration Patterns

When you use a calibration pattern to calibrate your workspace it is important to know how the reference coordinate system is placed on the pattern. This is shown in the images below. The axes of the coordinate system are indicated by arrows with the color red for the x axis, green for the y axis and blue for the z axis (this is the same order as in the common RGB color format). Note that regardless of the pattern type, the coordinate system always has the same orientation with respect to the black corner on the pattern.

For Ensenso patterns of type “Flexible”, the origin of the coordinate system must not lie in the center of the pattern, but can have an offset. The orientation will still be the same, though.

In addition to the 3D coordinate system, each pattern also has a 2D coordinate system on the pattern plane. The CollectPattern command draws this coordinate system into the overlay images to indicate the detected rotation of the pattern. The origin will always be at the black corner.

../_images/coordinates_halcon_pattern.png
../_images/coordinates_ensenso_pattern.png

Measurement of the Grid Spacing

The grid spacing measures the horizontal and vertical distance between two adjacent points on the pattern. For Ensenso patterns, the small encoding points do not count.

../_images/grid_spacing_halcon.png
../_images/grid_spacing_ensenso.png