Correlation method (Main Control)

C++ Builder example

Delphi example

 

Builder Syntax

int Correlation(TBitmapHandle CorrelationBitmap, PPoint pPoints, unsigned uMaxPoints, unsigned &uNumOfPoints, unsigned uXStep, unsigned uYStep, unsigned uThreshold);

Delphi Syntax

Function Correlation (CorrelationBitmap: TBitmapHandle; pPoints: pPOINT; uMaxPoints: L_UINT; var uNumOfPoints: L_UINT; uXStep: L_UINT; uYStep: L_UINT; uThreshold: L_UINT): L_INT;

Overview

Refer to Bitmaps and Bitmap Lists

Remarks

(Medical only) This method compares the bitmap referenced by the CorrelationBitmap parameter (or part of CorrelationBitmap) with all the areas of the same dimensions in the bitmap currently loaded in the Main Control, (This bitmap can be accessed through the Bitmap property (Main Control).) and finds those portions that match according to the measure of correlation.

Correlation is a measure of association (resemblance) between two images. It varies from 0 (zero resemblance) to 100 (perfect resemblance). This method updates the pPoints parameter with the point of origin for those areas of the active bitmap where the resemblance with CorrelationBitmap (or part of CorrelationBitmap) is greater than the value of uThreshold. The CorrelationBitmap dimensions must be less than or equal to the active bitmap dimensions.

For example:

1.

Load a bitmap of the object for which you want to look in the control "LEADImage2"

 

For example:

 

image\Correlation1.gif

2.

Load a bitmap that contains the object for which you are searching in the control LEADImage1

 

For example:

 

image\Correlation2.gif

3.

Call LEADImage1.Correlation.

4.

The method will update the pPoints array parameter with the point of origin (top-left) for each area of the LEADImage1.Bitmap where the correlation with LEADImage2.Bitmap is greater than the correlation threshold. The height and width of the rectangles are the same as for LEADImage2.Bitmap.

5.

The result is:

 

image\Correlation3.gif

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements:

IntensityDetect method, SpatialFilter method, BinaryFilter method, MaxFilter method, MinFilter method.

Topics:

Raster Images: Comparing Images