|
From: | Antonio Diaz Diaz |
Subject: | Re: [Bug-ocrad] Question about OCRad |
Date: | Fri, 09 May 2014 16:29:23 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.7.11) Gecko/20050905 |
SOUA, Mahmoud wrote:
Thanks for your quick answer. I saw this function, of otsu_th. But i can't find where you modifie the data pixels to the binary form based on the otsu threshold.
Modifying the data pixels destroys information. Ocrad is more clever than that.
The real binarization happens at 'get_bit' functions (page_image.h lines 68-71):
bool get_bit( const int row, const int col ) const { return data[row-top()][col-left()] <= threshold_; } bool get_bit( const int row, const int col, const uint8_t th ) const { return data[row-top()][col-left()] <= th; }This allows the recalculation of the threshold or even the application of different thresholds to different parts of the image.
Best regards, Antonio.
[Prev in Thread] | Current Thread | [Next in Thread] |