OIV.ImageViz.Engines.GeometryAndMatching.PatternRecognition Namespace |
This group provides a package of pattern recognition functions based on standard correlation.
Structure | Description | |
---|---|---|
SoBinaryCorrelationProcessing2dSbCorrelationDetail | Results details of image correlation. | |
SoGrayscaleCorrelationProcessing2dSbCorrelationDetail | Results details of image correlation. |
Enumeration | Description | |
---|---|---|
SoBinaryCorrelationProcessing2dOffsetModes | See Correlation. | |
SoGrayscaleCorrelationProcessing2dCorrelationCriterions | See Correlation. | |
SoGrayscaleCorrelationProcessing2dCorrelationModes | See Correlation and for each OIV.ImageViz.Engines.GeometryAndMatching.PatternRecognition.SoGrayscaleCorrelationProcessing2d.CorrelationCriterions. | |
SoGrayscaleCorrelationProcessing2dOffsetModes | This field is ignored in the multiply correlation mode. |
Some tools to ease the exploitation of results are also included.
The correlation filters allow you to specify a correlation step.
The correlation filters allow the matching of rectangular or irregular patterns. Non-rectangular patterns are implemented with mask AOIs.
Use OIV.ImageViz.Engines.GeometryAndMatching.PatternRecognition.SoGrayscaleCorrelationProcessing2d for grayscale image correlation and OIV.ImageViz.Engines.GeometryAndMatching.PatternRecognition.SoBinaryCorrelationProcessing2d for binary image correlation.
OIV.ImageViz.Engines.GeometryAndMatching.PatternRecognition.SoGrayscaleCorrelationProcessing2d allows for local luminosity and / or contrast normalization. There are 4 different correlation types (see OIV.ImageViz.Engines.GeometryAndMatching.PatternRecognition.SoGrayscaleCorrelationProcessing2d.CorrelationModes) :
DIRECT: Direct correlation (no normalization).
MEAN: Mean normalized correlation (luminosity).
VARIANCE: Variance normalized correlation (contrast).
MEAN_VARIANCE: Mean and variance normalized correlation (luminosity and contrast).
We perform the correlation between a input image, , and a kernel, . The output image is an floating point image, . The correlation coefficient at location is given by a local calculation between the model and a pattern extraction from the input image, . The pattern location is and its dimension is . The actual calculation depends on image type:
logical for OIV.ImageViz.Engines.GeometryAndMatching.PatternRecognition.SoBinaryCorrelationProcessing2d,
multiplication for OIV.ImageViz.Engines.GeometryAndMatching.PatternRecognition.SoGrayscaleCorrelationProcessing2d with OIV.ImageViz.Engines.GeometryAndMatching.PatternRecognition.SoGrayscaleCorrelationProcessing2d.CorrelationCriterions.MULTIPLY ,
difference OIV.ImageViz.Engines.GeometryAndMatching.PatternRecognition.SoGrayscaleCorrelationProcessing2d with OIV.ImageViz.Engines.GeometryAndMatching.PatternRecognition.SoGrayscaleCorrelationProcessing2d.CorrelationCriterions.SUBSTRACT or
sign change criteria OIV.ImageViz.Engines.GeometryAndMatching.PatternRecognition.SoGrayscaleCorrelationProcessing2d with OIV.ImageViz.Engines.GeometryAndMatching.PatternRecognition.SoGrayscaleCorrelationProcessing2d.CorrelationCriterions.SIGNCHANGE .
It also depends on the correlation normalization TYPE as shown below. When a part of the pattern lies beyond the edge of the image the correlation is not performed on the image border. SCorrelation filters provide a step parameter (see OIV.ImageViz.Engines.GeometryAndMatching.PatternRecognition.SoGrayscaleCorrelationProcessing2d.OffsetModes and OIV.ImageViz.Engines.GeometryAndMatching.PatternRecognition.SoBinaryCorrelationProcessing2d.OffsetModes) which speeds up the operation by calculating 1 value out of each step, as shown in Figure 1.
The luminosity and contrast normalization is controlled by one of the 4 correlation types:
DIRECT: Direct correlation (no normalization).
MEAN: Mean normalized correlation (luminosity).
VARIANCE: Variance normalized correlation (contrast).
MEAN_VARIANCE: Mean and variance normalized correlation (luminosity and contrast).
During the correlation the minimum and the maximum values are calculated . At the end of the filter processus, the correlation image is normalized between -1 and 1. The normalization depends on the following algorithm:
If the dimensions are odd, the position of the correlation coefficient is centerd in the pattern and corresponds to a pixel position.
If the dimensions are even, the position of the correlation coefficient is the closest pixel position to the top and the left.If a binary image is attached as a mask to the kernel image , the correlation is made locally between and . The mean and variance calculation are made on and on .
The correlation filters return a floating point correlation image. At the end of the processus, this correlation image is converted between -1 and 1 (worst and best matching detected). The non-calculated points are set to -3e38. Then, the OIV.ImageViz.Engines.GeometryAndMatching.PatternRecognition.SoGrayscaleCorrelationProcessing2d.SbCorrelationDetail contains:
the position of the best matching ((), ()),
the minimum and the maximum values of the correlation image before the conversion ((), ()),
the theoretical minimum and maximum correlation values before the conversion ((), ()).