LBitmap::Smooth

#include "ltwrappr.h"

virtual L_INT LBitmap::Smooth(pSmooth, uFlags = 0)

pSMOOTH pSmooth;

pointer to a structure

L_UINT32 uFlags;

flags

Smooths the bumps and fills in the nicks of a 1-bit black and white image.  

Parameter

Description

pSmooth

Pointer to the SMOOTH structure that LEADTOOLS uses to perform the smoothing operation

uFlags

Reserved for future use. Must be 0.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

This function smooths the text in scanned text documents.

The behavior of this function can be modified by overriding LBitmap::SmoothCallback.

This function works only on 1-bit black and white images.

If a region is selected, only the selected region will be changed by this function. If no region is selected, the whole image will be processed.

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.

Required DLLs and Libraries

LTIMGCOR

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

Platforms

Win32, x64.

See Also

Functions:

LBitmap::SmoothCallback, LBitmap::LineRemove, LBitmap::BorderRemove, LBitmap::InvertedText, LBitmap::DotRemove, LBitmap::HolePunchRemove, LBitmap::AutoBinarize, LBitmap::DynamicBinary, LBitmap::AutoBinary, Class Members

Topics:

Cleaning Up 1-Bit Images

Example

//This example smooths all nicks and bumps up to 2 pixels in length //Long bumps/nicks are treated before short bumps/nicks //A LEAD region is updated to show all the changes. 
#define MAKE_IMAGE_PATH(pFileName) TEXT("C:\\Users\\Public\\Documents\\LEADTOOLS Images\\")pFileName 
L_INT LBitmap__SmoothExample(LBitmapWindow *) 
{ 
   SMOOTH smooth; 
   LBitmap m_Bitmap; 
   BITMAPHANDLE BitmapHandle; 
   L_INT32      nRet; 
   nRet = m_Bitmap.Load(MAKE_IMAGE_PATH(TEXT("clean.tif")), 0,ORDER_BGR); 
   if(nRet == SUCCESS) 
   { 
      ZeroMemory(&smooth, sizeof(SMOOTH)); 
      smooth.uStructSize = sizeof (SMOOTH); 
      smooth.iLength = 2; 
      smooth.pBitmapRegion = &BitmapHandle; 
      smooth.uBitmapStructSize = sizeof(BITMAPHANDLE); 
      smooth.uFlags = SMOOTH_SINGLE_REGION | SMOOTH_LEAD_REGION | SMOOTH_FAVOR_LONG; 
      nRet = m_Bitmap.Smooth(&smooth); 
      if (nRet == SUCCESS) 
      { 
         //smooth.pBitmapRegion will have the region 
         //free region bitmap 
         L_FreeBitmap(smooth.pBitmapRegion); 
      } 
   } 
   return nRet; 
} 

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