L_INT LBitmap::CorrelationList(hCorList, pPoints, puListIndex, uMaxPoints, puNumOfPoints, uXStep, uYStep, uThreshold, uFlags = 0)
Compares the images in hCorList with all the areas of the same dimensions in pBitmap and finds those portions that match according to the measure of correlation.
Bitmap list handle that contains the images for which to search. All the images in the list should have the same dimensions.
Pointer to an array of points. This array will be filled with the starting points for the correlated areas.
Pointer to an array of unsigned integers. This array will be filled with the indices of the images that match correlated areas.
Size of the point array. This is also equal to the maximum number of regions in pBitmap that can be found to be correlated.
Pointer to a variable to be updated with the number of areas in pBitmap that correlate to an image in pCorBitmap. Its maximum value is uMaxPoints.
Step size in the X direction (along image width), in pixels. For best results, use 1.
Step size in the Y direction (along image height), in pixels. For best results, use 1.
Value that indicates the correlation threshold, which is a measure of the association necessary for two areas to be considered to be correlated. If the correlation value between an image in hCorList and an area in pBitmap is less than the correlation threshold they are uncorrelated. Valid values range from 0 (zero resemblance) to 100 (perfect resemblance).
Reserved for future use. Must be 0.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
This function compares the images in hCorList with all the areas of the same dimensions in the bitmap image and finds those areas that match according to the measure of correlation. All the images in hCorList must have the same dimensions. Correlation is a measure of the association (resemblance) between two images. It varies from 0 (zero resemblance) to 100 (perfect resemblance). This function updates the pPoints parameter with the point of origin for those areas of the bitmap image where the resemblance with an image in hCorList is greater than the value of uThreshold and also updates puListIndex with the index of that image. The dimensions of the hCorList images must be less than or equal to the bitmap image dimensions.
For example:
Select bitmaps of the objects for which you want to look. Put them in hCorList. For example:
Select a bitmap that contains the objects for which you are searching and put it as your bitmap image. For example:
Call the LBitmap::CorrelationList function.
The function will update the pPoints array parameter with the point of origin (top-left) for each area of the bitmap image where the correlation with the image in hCorList is greater than the correlation threshold. The height and width of the rectangles are the same as for hCorList image.
The result is:
To look for one object in a bitmap, use the LBitmap::Correlation function.
To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallback.
This function 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.
If the bitmap has a region, this function works only on the region. If the bitmap does not have a region, this function works on the entire bitmap.
This function 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 function.
This function does not support 32-bit grayscale images. It returns the error code ERROR_GRAY32_UNSUPPORTED if a 32-bit grayscale image is passed to this function.
Win32, x64.
L_INT LBitmap__CorrelationListExample()
{
L_INT nRet = 0;
POINT pPoints[100] = {0};
L_UINT puListIndex [100] = {0};
L_UINT uNumOfPoints = 0 ;
LBitmap LeadBitmap, Bitmap1, Bitmap2;
LBitmapList BitmapList;
nRet =BitmapList.Create() ;
if(nRet !=SUCCESS)
return nRet;
nRet =LeadBitmap.Load(MAKE_IMAGE_PATH(TEXT("clean.tif")), 0,ORDER_BGR);
if(nRet !=SUCCESS)
return nRet;
nRet =Bitmap1.Load(MAKE_IMAGE_PATH(TEXT("LetterA.cmp")),0,ORDER_BGR);
if(nRet !=SUCCESS)
return nRet;
nRet =Bitmap2.Load(MAKE_IMAGE_PATH(TEXT("LetterR.cmp")),0,ORDER_BGR);
if(nRet !=SUCCESS)
return nRet;
nRet =BitmapList.InsertItem(&Bitmap1);
if(nRet !=SUCCESS)
return nRet;
nRet =BitmapList.InsertItem(&Bitmap2);
if(nRet !=SUCCESS)
return nRet;
nRet =LeadBitmap.CorrelationList(BitmapList.GetHandle(), pPoints, puListIndex, 90 , &uNumOfPoints, 1, 2, 10);
if(nRet !=SUCCESS)
return nRet;
BitmapList.Destroy() ;
return SUCCESS;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document