#include "l_bitmap.h"
L_LTIMGCOR_API L_INT EXT_FUNCTION L_BlankPageDetectorBitmapExt(pBitmap, bIsBlank, pAccuracy, PMargins, uSensitivity, uFlags)
Determines whether the scanned image is a blank page.
Pointer to the bitmap handle that references the image to be tested.
Pointer to a flag to be updated with a value indicating whether the image is a blank page. Possible values are:
Value | Meaning |
---|---|
true | Blank page |
false | Non-blank page |
Pointer to a variable to be updated with the accuracy of the result, in hundredths of a percent. Possible values range from 0 to 10000. This value is divided internally by 100.
Pointer to the PAGEMARGINS structure that contains information about excluded margins. Pass NULL if there are no margins to exclude.
Determines the sensitivity of the blank page detection, based on the amount of black pixels in the image. Possible values range from 0 to 100.
Flags that indicate how to define blank pages and determine the function's behavior. Values can be combined when appropriate by using a bitwise OR (|). Use a flag only if it describes the needed behavior. In many cases the default behavior is fine, and no flag is needed.
Note: Some uFlags values are being deprecated in Version 20. They will be removed from the toolkits, effective with LEADTOOLS version 21.
Default Behavior | Override Value |
---|---|
A blank page cannot have noise. It must be totally blank. | Include the BLANK_DETECT_NOISY flag [0x00000001] if a blank page can have some noise. |
Default Behavior | Override Value |
---|---|
A blank page cannot have bleed-through from the other side of the page. | Include the BLANK_BLEED_THROUGH flag [0x00000010] if a blank page can have bleed-through. |
Default Behavior | Override Value |
---|---|
A blank page cannot have any lines. | Include the BLANK_DETECT_LINES flag [0x00000100] if a blank page can have lines. |
Default Behavior | Override Value |
---|---|
A blank page includes the blank spaces around the page's edges. | Include the BLANK_USE_ACTIVE_AREA flag [0x00001000] to ignore any blank spaces around the page's edges. |
Default Behavior | Override Value |
---|---|
Use the default margins, which are computed automatically by the engine by excluding 6.5% from the image width and 11% from the image height. | Include the BLANK_USER_MARGIN flag [0x00010000] to use the user-specified margins, which are specified in PMargins. |
Default Behavior | Override Value |
---|---|
Use the pixel as the unit of measure to specify user margins. | Include the BLANK_USE_INCHES flag [0x00400000] to specify that the inch be used as the unit of measure to specify user margins. Include the BLANK_USE_CENTIMETERS flag [0x00800000] to specify that the centimeter be used as the unit of measure to specify user margins. |
Default Behavior | Override Value |
---|---|
BLANK_ADVANCED | [0x00100000] Analyze both text and non-text content. |
BLANK_DETECT_TEXT_ONLY | [0x00100000] Analyze text and ignore non-text content in the image. The BLANK_ADVANCED flag must be set in order for this flag to be used. |
BLANK_USE_PIXELS | [0x00000000] Use the Pixel as the unit of measure to specify user-margins. |
BLANK_USE_INCHES | [0x00400000] Use the Inch as the unit of measure to specify user-margins. |
BLANK_USE_CENTIMETERS | [0x00800000] Use the Centimeter as the unit of measure to specify user-margins. |
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
For various reasons, documents being scanned can contain a significant number of blank pages. Disk storage space for the scanned items can be reduced if such pages can be removed before the documents are stored.
This function determines whether the scanned image is a blank page. It can detect noisy, bleed-through, and lined blank pages with high precision and speed, and provides an accuracy percentage for the result.
Support for this function is available in the Document and Medical Imaging toolkits.
This function does not support signed data images. It returns the ERROR_SIGNED_DATA_NOT_SUPPORTED error code if a signed data image is passed to this function.
This function does not support 32-bit grayscale images. It returns the ERROR_GRAY32_UNSUPPORTED error code if a 32-bit grayscale image is passed to this function.
This function does not support 12-, 16-, 48-, or 64-bit images. It returns the ERROR_INV_PARAMETER error code if such an image is passed to this function.
The following flags are being deprecated in Version 20. They will be removed from the toolkits, effective with LEADTOOLS version 21.
Required DLLs and Libraries
Win32, x64, Linux.
L_INT BlankPageDetectorBitmapExtExample(L_VOID)
{
L_INT nRet;
BITMAPHANDLE LeadBitmap; /* Bitmap handle hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
nRet = L_LoadBitmap(MAKE_IMAGE_PATH(TEXT("IMAGE1.CMP")), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
if (nRet != SUCCESS)
return nRet;
/* Check if the image is a blank page the bitmap */
L_BOOL IsBlank = 1;
L_UINT Accuracy = 0;
L_UINT Sensitivity = 80;
nRet = L_BlankPageDetectorBitmapExt(&LeadBitmap,
&IsBlank,
&Accuracy,
NULL,
Sensitivity,
BLANK_DETECT_NOISY | BLANK_BLEED_THROUGH);
if (IsBlank)
OutputDebugString(L_TEXT("Image is blank.\n"));
else
OutputDebugString(L_TEXT("Image is not blank.\n"));
//free bitmap
L_FreeBitmap(&LeadBitmap);
return nRet;
}
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