How i could make better this image for tesseract recognition?
How i could make better this image for tesseract recognition?
convert dIsuln.png -unsharp 0x10 A_blur_unsharp0.jpg
convert A_blur_unsharp0.jpg -negate -lat 10x10+10% -negate jx8MPc9_kuw2_lat10-0.png
convert jx8MPc9_kuw2_lat10-0.png -fill white -opaque "#00ff00" balloon_white0.gif
tesseract -psm 10 balloon_white0.gif scanned2.txt
I have a simple image but I dont know How i could make better
this command output an E instead 2
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How i could make better this image for tesseract recognition?
The image is too small and too even colored to do OCR. There are limits to what you can do by way of character size in the image and how thick it is. Is it a 2 or a Z? How will OCR know, I a person cannot tell the difference. I doubt you can do anything to improve this to get the OCR to read it accurately. But I do not know that much about OCR. Perhaps someone else can advise
Re: How i could make better this image for tesseract recognition?
But there is a way to remove that little point
Re: How i could make better this image for tesseract recognition?
The small point on the upper left margin
Re: How i could make better this image for tesseract recognition?
My command works when there are no such small points that interferes in the image
Re: How i could make better this image for tesseract recognition?
I see one of your command for filter blob but I dont know how use this
convert balloon_white0.gif -define connected-components:area-threshold=40 -connected-components 4 -threshold 0 jx8MPc9_kuw2_lat10_cc30.png
how I could use this Please help
convert balloon_white0.gif -define connected-components:area-threshold=40 -connected-components 4 -threshold 0 jx8MPc9_kuw2_lat10_cc30.png
how I could use this Please help
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How i could make better this image for tesseract recognition?
try
Code: Select all
convert 1FY60.png -channel red -separate +channel -threshold 70% result.png
Re: How i could make better this image for tesseract recognition?
thanks ; but not works how expected however this command works better ;
convert balloon_white0.gif -colorspace gray -colors 2 +dither -type bilevel imageout.tif
convert imageout.tif -define connected-components:area-threshold=77 -connected-components -4 -auto-level hh
convert balloon_white0.gif -colorspace gray -colors 2 +dither -type bilevel imageout.tif
convert imageout.tif -define connected-components:area-threshold=77 -connected-components -4 -auto-level hh
Last edited by diegomage on 2017-03-16T19:12:43-07:00, edited 1 time in total.
Re: How i could make better this image for tesseract recognition?
but output a image with another colors
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How i could make better this image for tesseract recognition?
Each image will likely be different and require different approaches. I do not know one universal solution.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: How i could make better this image for tesseract recognition?
Input: 1FY60.png
This image has an object with a background that extends to the edges of the image. So we can remove the background by making transparent all pixels that are within a certain fuzz percentage of any edge pixel. For this image, 6% works fine.
Windows BAT syntax.
1fy_x1.png:
1fy_x2.png:
This gives the expected result, "2".
This image has an object with a background that extends to the edges of the image. So we can remove the background by making transparent all pixels that are within a certain fuzz percentage of any edge pixel. For this image, 6% works fine.
Windows BAT syntax.
Code: Select all
call %PICTBAT%edgeColsTrans 1FY60.png 1fy_x1.png . 6
Code: Select all
%IM%convert ^
1fy_x1.png ^
-background White -layers Flatten ^
-fill Black +opaque White ^
-resize 300%% ^
1fy_x2.png
Code: Select all
tesseract 1fy_x2.png 1fy_x2 -psm 10
snibgo's IM pages: im.snibgo.com
Re: How i could make better this image for tesseract recognition?
very thank you this help me so much