Phreak87 / LeptonicaSharp

Full featured wrapper for leptonica 1.77.0
Other
8 stars 5 forks source link

Para is not quite right #43

Closed fdncred closed 5 years ago

fdncred commented 5 years ago

I noticed today that the isn't quite right. Instead of having it on every line, it should be where every bullet is. Currently:

(1) The Otsu method finds a single global threshold for an image.<para/> 
 This function allows a locally adapted threshold to be<para/> 
 found for each tile into which the image is broken up.<para/> 
 (2) The array of threshold values, one for each tile, constitutes<para/> 
 a highly downscaled image.  This array is optionally<para/> 
 smoothed using a convolution.  The full width and height of the<para/> 
 convolution kernel are (2  %smoothx + 1) and (2  %smoothy + 1).<para/> 
 (3) The minimum tile dimension allowed is 16.  If such small<para/> 
 tiles are used, it is recommended to use smoothing, because<para/> 
 without smoothing, each small tile determines the splitting<para/> 
 threshold independently.  A tile that is entirely in the<para/> 
 image bg will then hallucinate fg, resulting in a very noisy<para/> 
 binarization.  The smoothing should be large enough that no<para/> 
 tile is only influenced by one type (fg or bg) of pixels,<para/> 
 because it will force a split of its pixels.<para/> 

Should be:

(1) The Otsu method finds a single global threshold for an image. 
 This function allows a locally adapted threshold to be
 found for each tile into which the image is broken up.<para/> 
 (2) The array of threshold values, one for each tile, constitutes
 a highly downscaled image.  This array is optionally
 smoothed using a convolution.  The full width and height of the
 convolution kernel are (2  %smoothx + 1) and (2  %smoothy + 1).<para/> 
 (3) The minimum tile dimension allowed is 16.  If such small
 tiles are used, it is recommended to use smoothing, because
 without smoothing, each small tile determines the splitting
 threshold independently.  A tile that is entirely in the
 image bg will then hallucinate fg, resulting in a very noisy
 binarization.  The smoothing should be large enough that no
 tile is only influenced by one type (fg or bg) of pixels,
 because it will force a split of its pixels.<para/> 

I don't think this looks good. 2018-11-06_08-51-04

Phreak87 commented 5 years ago

OK, i see.

i hope that makes no other problems. The updated rule is now Regex.Replace(Eintrag, "(\r\n([0-9]*))", "" & vbNewLine & "${1}") which gives this output:

Notes:

(1) The Otsu method finds a single global threshold for an image. This function allows a locally adapted threshold to be found for each tile into which the image is broken up.</para.>

(2) The array of threshold values, one for each tile, constitutes a highly downscaled image. This array is optionally smoothed using a convolution. The full width and height of the convolution kernel are (2 %smoothx + 1) and (2 %smoothy + 1).</para.>

(3) The minimum tile dimension allowed is 16. If such small tiles are used, it is recommended to use smoothing, because without smoothing, each small tile determines the splitting threshold independently. A tile that is entirely in the image bg will then hallucinate fg, resulting in a very noisy binarization. The smoothing should be large enough that no tile is only influenced by one type (fg or bg) of pixels, because it will force a split of its pixels.</para.> ...