#include "ltwrappr.h"

L_INT LBitmap::RakeRemove (bAuto, pRake, pDstRect, nRectCount, uFlags = 0)

L_BOOL bAuto;

automation flag


pointer to RAKEREOVE structure

RECT * pDstRect;

pointer to rake areas rectangles

L_INT nRectCount;

number of rectangles

L_UINT32 uFlags;


Removes the isolated data rakes from 1-bit black and white images.

Parameter Description
pAuto 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.
pRake Pointer to the RAKEREMOVE structure that LEADTOOLS uses to perform the rake removal operation.
pDstRect 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.
nRectCount 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.
uFlags Reserved for future use. Must be 0.



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 pRake 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.

Required DLLs and Libraries


For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.


Win32, x64.

See Also


LBitmap::RakeRemoveCallBack, LBitmap::LineRemove, LBitmap::Smooth, LBitmap::BorderRemove, LBitmap::InvertedText, LBitmap::DotRemove, LBitmap::HolePunchRemove, LBitmap::BlankPageDetector, LBitmap::AutoBinarize, LBitmap::DynamicBinary, LBitmap::AutoBinary


Raster Image Functions: Cleaning - up 1-Bit Images


Cleaning Up 1-Bit Images


//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 
   virtual L_INT RakeRemoveCallBack(L_INT32        iLength 
L_INT LRakeRemoveBitmap::RakeRemoveCallBack(L_INT32 iLength) 
   CString 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 Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Raster Imaging C++ Class Library Help