This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Thursday, August 9, 2007 4:57:21 AM(UTC)
Groups: Registered
Posts: 3
Hi,
We are using LeadTools 14.6 DLL API.
We want to detect and remove the blank page. Please provide me support to find the right API and formula.
Regards
Ganesh.
#2
Posted
:
Saturday, August 11, 2007 10:50:38 PM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Hello,
To detect blank pages, you need create a region that consists of a range of white colors. Then check to see how many pixels are NOT(setnot) in this range
If this number is less than .5% of the total number of pixels in the image, we consider the page blank.
You can play with the values for the lower/upper limits and the percentage for different thresholds
The following code shows how to detect blank pages using API programming interface:
+--------------------+
COLORREF lowerColor, upperColor;
L_INT nRet;
L_UINT32 dwArea;
lowerColor = RGB(200, 200, 200);
upperColor = RGB(255, 255, 255);
nRet = L_SetBitmapRgnColorRGBRange(pBitmap, lowerColor, upperColor, L_RGN_SETNOT);
L_GetBitmapRgnArea(pBitmap, &dwArea);
If (dwArea / (ImageWidth * ImageHeight)) < 0.005
// this is a Blank Image
Else
// this is not a Blank Image
+--------------------+
Thanks,
Maen Badwan
LEADTOOLS Technical Support
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.