Cog3DPatMaxPattern Granularity Property Cognex VisionPro 9.8 SR1
Gets or sets the size of the subsampling cube to use during training and runtime. This value is the length of one side of the cube. If GranularityAutoSelect is "true" this size value is recomputed automatically when the pattern is trained, overwriting the previous value.

Namespace: Cognex.VisionPro3D
Assembly: Cognex.VisionPro3D (in Cognex.VisionPro3D.dll) Version: 75.0.0.0
Syntax

public double Granularity { get; set; }

Property Value

Type: Double
The length of one side of the subsampling cube. Default value is one.
Events

Event TypeReason
ICogChangedEvent Changed Fires when this property changes. The following state flags may be affected:
Exceptions

ExceptionCondition
ArgumentOutOfRangeException The supplied value is less than or equal to zero.
Remarks

3DPatMax uses a multi-resolution search strategy. The tool subsamples your input vision data at a coarse resolution to quickly identify candidate areas that might match the pattern. Each candidate match is then re-examined at a fine resolution to determine the higher-accuracy score and alignment pose. The coarse stage has a dominant influence on the correctness and robustness of the candidates, and the fine stage has more impact on the accuracy of the final result pose.

The amount of coarse subsampling is controlled by the Granularity. This property specifies the length of one side of a cube in 3D space. The space occupied by your input data is divided into tightly-packed cubes of this size, and your data is subsampled by replacing all of the points within each cube by a single new point that best represents the original points.

The amount of fine subsampling is controlled by the product of GranularityFineFraction and Granularity. In other words, the fine subsampling cube size is a specified fraction of the coarse subsampling cube size.

These cube sizes allow you to control the tradeoff between alignment speed and accuracy. As you make the size of each cube larger the number of trained points gets smaller. This makes the trained pattern smaller and faster, but less accurate.

If your time budget allows, you should set the coarse subsampling cube size to be about half the size of the smallest salient feature in your input data. If you need more speed, try increasing the size. Be sure to verify that you are still getting the accuracy and robustness you need.

The 3D input data that you provide at runtime is also subsampled. The cubes used at runtime are the same size as the ones used to train the pattern. These cubes are aligned to the 3D selected space of the input data.

If GranularityAutoSelect is "true" the coarse subsampling cube size is recomputed, and overwritten, whenever the pattern is trained.

The default value of GranularityFineFraction works well on a wide variety of patterns and run-time data. Typically you would leave it alone. However, in certain circumstances you might want to adjust it to fit particular needs. For example, when RunMode is RefineStartPose, or when you are working with high-quality input data and need to get higher accuracy in the result pose.

You have direct control over GranularityFineFraction. The tool does not attempt to adjust this value even if GranularityAutoSelect is "true". Also note that although specifying a very small fraction can result in a nominal fine subsampling cube size smaller than the vision data's voxel size, the tool will internally clamp the effective fine subsampling cube size to the vision data's voxel size.

If you change this value on a trained pattern object, the pattern will become untrained.

See Also