LBitmap::BlankPageDetector

#include "ltwrappr.h"

L_INT LBitmap::BlankPageDetector(pOptions, uFlags)

Determines whether the scanned image is a blank page or not.

Parameters

pBLANKPAGEDETECTOROPTIONS pOptions

Pointer to a BLANKPAGEDETECTOROPTIONS structure containing options for detecting whether an image is a blank page.

L_UINT uFlags

Flags that indicate how to consider blank pages and the function behavior. You can combine values when appropriate by using a bitwise OR ( | ). Possible values are:

Consider noisy page as a blank page:

Value Meaning
BLANK_DETECT_EMPTY [0x00000000] A page must be totally blank.
BLANK_DETECT_NOISY [0x00000001] A page may have some noise. This is the default value.

Consider page which bleeds through its other side as a blank page:

Value Meaning
BLANK_NOT_BLEED_THROUGH [0x00000000] Do not ignore bleed through from the page.
BLANK_BLEED_THROUGH [0x00000010] Ignore bleed through from the page. This is the default value.

Consider lined page as a blank page:

Value Meaning
BLANK_DONT_DETECT_LINES [0x00000000] Do not consider lined page as a blank page. This is the default value.
BLANK_DETECT_LINES [0x00000100] Consider lined page as a blank page.

Indicate whether to ignore blank spaces around the page edges:

Value Meaning
BLANK_DONT_USE_ACTIVE_AREA [0x00000000] Do not ignore blank spaces around the page edges. This is the default value.
BLANK_USE_ACTIVE_AREA [0x00001000] Ignore blank spaces around the page edges.

Indicate whether to use default margins or user-specified margins:

Value Meaning
BLANK_DEFAULT_MARGIN [0x00000000] Use default margins, which are computed automatically by the function based on the page dimensions. This is the default value.
BLANK_USER_MARGIN [0x00010000] Use the user-specified margins, which are specified in PMargins.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

Scanned image could contain few blank (empty) pages used as separators, or just empty pages. This function determines whether the scanned image is a blank page or not, and gives an accuracy percentage of the result. It detects noisy, bleed through, and lined blank pages with high precision and speed. This function helps in reducing disk storage of scanned images.

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

Platforms

Win32, x64.

See Also

Functions

Topics

Example

L_INT LBitmap__BlankPageExample() 
{ 
 
   LBase::LoadLibraries(LT_FIL | LT_IMG, LT_IMGCOR); 
 
   L_INT nRet; 
   LBitmap LeadBitmap; 
   nRet = LeadBitmap.Load(MAKE_IMAGE_PATH("Image1.cmp"), 0, ORDER_BGR); 
   if (nRet != SUCCESS) 
      return nRet; 
   BLANKPAGEDETECTOROPTIONS Options = { 0 }; 
   Options.uStructSize = sizeof BLANKPAGEDETECTOROPTIONS; 
   nRet = LeadBitmap.BlankPageDetector(&Options, BLANK_DETECT_NOISY | BLANK_BLEED_THROUGH | BLANK_DEFAULT_MARGIN); 
   if (nRet != SUCCESS) 
      return nRet; 
 
   OutputDebugString(L_TEXT("Loaded image is ")); 
   OutputDebugString(Options.bIsBlank ? L_TEXT("Blank\n") : L_TEXT("Not Blank\n")); 
 
   return SUCCESS; 
} 
Help Version 22.0.2021.9.12
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help