How to define the empty page threshold for FineReader Engine 12


How to manage an empty page threshold?


There is MaxBlackPercentage property of EmptyPageDetectionParams Object. It specifies the maximum percentage of black areas on the page, for which it can still be considered empty. It can take values from -1 (which means that the black percentage limit is not used) to 100. The default value of this property is -1, and the black percentage is not used during empty page detection.  

Let`s assume, the percent of black pixels after the binarization is equal to 7 and that is background noise. We can define the threshold higher than this value (e.g. 10%):

FREngine.FRDocument document = engineLoader.Engine.CreateFRDocument();
document.AddImageFile(imagePath, null, null);
FREngine.EmptyPageDetectionParams pageDetectionParams = engineLoader.Engine.CreateEmptyPageDetectionParams();
pageDetectionParams.MaxBlackPercentage = 10;
if (document.Pages[0].IsEmpty(null, null, pageDetectionParams))
//some additional logic for the pages defined as empty;

Have more questions? Submit a request



Please sign in to leave a comment.