snibgo wrote: ↑2018-09-25T12:35:07-07:00
@isfando: You have reverted to small characters, as you had in your first posts. Why? Your later post had larger characters, which will give better quality, thus better OCR.
@snibgo What shows that i have reverted to small characters. I am not able to grasp it.
I am trying to stream line the approaches you taught me step by step.
I used your script in the 'EARLIER APPROACH' and got good results which are sharp in quality. But I am using convert twice.
In 'CURRENT APPROACH' i am using convert once and i am not able to apply same parameters as step1 of 'EARLIER 'APPROACH' and my results are not good.My question is how can i can join step1 and step2 of 'EARLIER APPROACH' into step1 of 'CURRENT APPROACH'.
********************EARLIER APPROACH******************************
1)
Code: Select all
convert -density 300 ./sam.pdf -depth 8 -strip -background white -alpha off -threshold 70% sam.png
the output image sam.png from this step is pretty crisp so the result in step 3 is also crisp
https://drive.google.com/open?id=1fBFFo ... HG-8w-6zGI
2)
Code: Select all
convert ^
sam.png ^
-strip ^
( +clone ^
-threshold 50%% ^
-write mpr:ORG ^
+delete ^
) ^
( mpr:ORG ^
-negate ^
-morphology Erode rectangle:200x1 ^
-mask mpr:ORG -morphology Dilate rectangle:200x1 ^
+mask ^
-morphology Dilate Disk:3 ^
) ^
-compose Lighten -composite ^
( +clone ^
-morphology HMT "1x4:1,0,0,1" ^
) ^
-compose Lighten -composite ^
( +clone ^
-morphology HMT "1x3:1,0,1" ^
) ^
-compose Lighten -composite ^
( +clone ^
-morphology HMT "3x1:1,0,1" ^
) ^
-compose Lighten -composite ^
-blur 0x0.5 out.png
3) Result image
https://drive.google.com/open?id=1obtnH ... hHFV0VsOCL
################################################################################################################33
*********************CURRENT APPROACH*********************************
1) doonepage.bat
Code: Select all
convert ^
-density 300 ^
%1 ^
-depth 8 ^
-strip ^
( +clone ^
-threshold 50%% ^
-write mpr:ORG ^
+delete ^
) ^
( mpr:ORG ^
-negate ^
-morphology Erode rectangle:200x1 ^
-mask mpr:ORG -morphology Dilate rectangle:200x1 ^
+mask ^
-morphology Dilate Disk:3 ^
) ^
-compose Lighten -composite ^
( +clone ^
-morphology HMT "1x4:1,0,0,1" ^
) ^
-compose Lighten -composite ^
( +clone ^
-morphology HMT "1x3:1,0,1" ^
) ^
-compose Lighten -composite ^
( +clone ^
-morphology HMT "3x1:1,0,1" ^
) ^
-compose Lighten -composite ^
-blur 0x0.5 %2
2) domanypages.bat
Code: Select all
set INPDF=sam.pdf
for /F "usebackq" %%L in (`exiftool -args -PageCount %INPDF%`) do set %%L
set /A LASTPAGE=%-PageCount%-1
for /L %%I in (0,1,%LASTPAGE%) do call DoOnePage %INPDF%[%%I] out_%%I.png
3)Result
https://drive.google.com/open?id=1toqjB ... 5pItrdMeRi