virtual L_INT LBitmap::RakeRemove (bAuto, pRakeRemove, pDstRect, nRectCount, uFlags = 0)
Removes the isolated data rakes from 1-bit black and white images.
Flag that indicates whether to automate the rakes removal. Possible values are:
Value | Meaning |
---|---|
TRUE | Automate the rakes removal. |
FALSE | Do not automate the rakes removal. |
Pointer to the RAKEREMOVE structure that LEADTOOLS uses to perform the rake removal operation.
Pointer to an array of Windows RECT structure specifying the areas where the rakes are in the image. If the parameter is passed as NULL, the function will look for rakes in the entire image.
Number of rectangles specified which equals to the number of rakes in an image or more if one rectangle contains more than one rake. If the parameter pDstRect is passed as NULL this parameter should be passed as 0.
Reserved for future use. Must be 0.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
A rake is a horizontal line with vertical partitioning lines pointing upwards attached to it. Rakes are used to contain data (digits or characters) filled individually and separated by the spaces created by the partitioning vertical lines.
A typical rake looks like the following:
(Document) This function removes data rakes from scanned text documents. If the rakes pass through text, the pRakeRemove parameter can be configured to remove or preserve the text. The behavior of this function can be further modified by using its callback.
If a region is selected, only the selected region will be changed. If no region is selected, the whole image will be processed.
For rake structures that are inside or part of tables, the user can select the rake structure and the rake structure only- via region (preferably a rectangular region) and call the function on that region.
This function works only on 1-bit black and white images.
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.
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.
Win32, x64.
This example removes rakes that are at least 50 pixels in length
and no more than 3 pixels in width
The rakes can have gaps up to one pixel in length.
The callback member function is used to show the length of each removed rake
The callback member function does NOT receive a Windows region.
class LRakeRemoveBitmap : public LBitmap
{
public:
LRakeRemoveBitmap();
~LRakeRemoveBitmap();
virtual L_INT RakeRemoveCallBack(L_INT32 iLength
);
};
LRakeRemoveBitmap::LRakeRemoveBitmap()
{
}
LRakeRemoveBitmap::~LRakeRemoveBitmap()
{
}
L_INT LRakeRemoveBitmap::RakeRemoveCallBack(L_INT32 iLength)
{
CString strMsg;
strMsg.Format(
TEXT("Length[%d]\n"),
iLength
);
OutputDebugString(strMsg);
return SUCCESS_REMOVE;
}
L_INT LBitmap__RakeRemoveExample(LBitmapWindow *pBitmapWindow)
{
RAKEREMOVE rr;
L_BOOL bAuto = FALSE;
rr.nMinLength = 50;
rr.nMaxWidth = 3;
rr.nMinWallHeight = 10;
rr.nMaxWallPercent = 25;
rr.nMaxMidteethLength = 20;
rr.nMaxSideteethLength = 25;
rr.nGaps = 1;
rr.nVariance = 2;
rr.nTeethSpacing = 5;
pBitmapWindow->RakeRemove( bAuto, &rr, NULL, 0, 0);
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