Collecting Calibration Patterns

<< Click to Display Table of Contents >>

Navigation:  HowTo's > Calibration >

Collecting Calibration Patterns

The Global Pattern Buffer

Most commands that work with calibration patterns (e.g. EstimatePatternPose, Calibrate, CalibrateHandEye) use the pattern observations that were previously put into the global pattern buffer. You can fill this buffer in two ways.

Collect a new observation from camera images with the CollectPattern command. By default, the command will add all collected observations to the buffer, but you can control this with the Buffer and Filter parameters.

Import previously collected patterns with the SetPatternBuffer command. You can export this data with the GetPatternBuffer command.

 

The commands that use patterns from the pattern buffer can be instructed to use only a part of the collected patterns with a Filter parameter. To avoid repeating the filter for every command, you can also set up a view with the AddPatternBufferView command and reference this view by its name.

The FilterPatternBuffer command can discard all patterns in the buffer that don't match a given filter.

Collecting Patterns

Note: Before you start to collect patterns, you should always clear the pattern buffer with DiscardPatterns. Otherwise the pattern buffer might still contain old observations that are inconsistent with the new ones. This can cause invalid calibration results.

 

To collect a pattern, capture an image and call the CollectPattern command. By default, this command will add any patterns it finds to the pattern buffer as well as return them in its result node.

Note that some types of calibration patterns need additional data to the point locations in the images. In most cases, it is encoded directly in the pattern and can be decoded by enabling the DecodeData parameter. You can also specify the information manually in the global pattern data node. See the how-to on calibration patterns for more information on the different types of calibration patterns and the information that is encoded in them. For most situations and pattern types, it is recommended to decode the pattern data once and using the global pattern data afterwards.

Make sure that the projector is turned off on any images that you want to use to collect patterns. Collecting patterns with the projector is possible with the Projector parameter, but should only be used in special situations, as it requires prior knowledge on the size of the pattern in the image.

Code Example

hmtoggle_plus1C++