Calibration Patterns¶
For calibrating cameras, you need a calibration pattern.
Observation of Pattern Patches¶
The points of calibration patterns contain a unique arrangement of black and white centers. This information is used to locate the observed patch of a pattern within the complete pattern. It is sufficient to observe any patch of 4 × 4 points (including the smaller encoding points). The offset of the observed patch is published in the Offset node of a pattern specification.
Patches of 4 × 4 points are only unique within a single pattern, but not within all possible patterns. The NxLib uses the global pattern data to decide which complete pattern the current observation should belong to. You might get inconsistent results if this is not specified correctly.
It is therefore recommended to first collect an observation with (DecodeData) enabled (which requires the observation of a patch that is unique across all possible patterns). After the global data got updated, you can disable DecodeData
and start collecting smaller patches.
Types of Calibration Patterns¶
There are three different types of calibration patterns, which can encode different information. The type of a collected pattern is indicated by the Type node.
Single and Custom Single Patterns¶
Patterns of type Single
encode their grid spacing and thickness. This information can be decoded uniquely when you observed at least a 6 × 6 patch. The origin of such a pattern always lies at its center point.
You can create a pattern of this type with a custom grid spacing and thickness using the NxCalTab application. 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 15 × 15 pattern in order to decode it.
Flexible Patterns¶
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.
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 SingleCustom
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, you can calibrate the different sides of the assembly to each other, so that they get a common coordinate system. The origin of the common coordinate system will be the center of the first pattern. 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¶
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 following image:
The axes of the coordinate system are indicated by arrows in 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 that is printed on the pattern. This corner is a visual indication for the orientation of the pattern and is not otherwise relevant for collection.
For 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.
On newer revisions of the Ensenso patterns the direction of the x and y axes is also drawn directly onto the pattern. The direction is valid for both the 2D and 3D coordinate system, since they have the same orientation (but not the same origin).
Reference Marks¶
Calibration patterns contain reference marks that can be approached with a robot. The reference marks are not in the center of the pattern’s coordinate system due to the existing point at that position. The exact position of each reference mark is written on the pattern.
Note that the reference marks might not be present on older revisions of the pattern.
Measurement of the Grid Spacing¶
The grid spacing measures the horizontal and vertical distance between two adjacent points on the pattern (excluding the small encoding points).
Printing Calibration Patterns¶
Calibration patterns can be generated for printing using the NxCalTab application or the GenerateCalibrationPattern command.
Custom printed patterns are usually not as accurate as the officially available ones. Please make sure to print the PDF file using its original scaling and check that the resulting pattern is as flat as possible.
Note
The generated calibration pattern data is provided free of charge to print or otherwise manufacture your own calibration targets. The targets must only be used with the Ensenso SDK to calibrate cameras, robots or other movement systems. Under no circumstances does this transfer any rights other than the right of use described here. In particular you are not allowed to distribute your own calibration targets commercially.