Removing caption background for use in ORC (tessearct)

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
gilberto_san
Posts: 11
Joined: 2017-03-07T04:44:13-07:00
Authentication code: 1151

Re: Removing caption background for use in ORC (tessearct)

Post by gilberto_san »

fmw42 wrote: 2017-03-09T11:08:59-07:00 Try this Unix syntax:

Code: Select all

convert 9a6c443dfa76445fa95158948cc4e9bd.png \
\( -clone 0 -colorspace HCL -channel g -separate +channel -threshold 40% \) \
-alpha off -compose copy_opacity -composite result.png
Please always provide your IM version and platform, since syntax may differ.
I´m testing
tks
gilberto_san
Posts: 11
Joined: 2017-03-07T04:44:13-07:00
Authentication code: 1151

Re: Removing caption background for use in ORC (tessearct)

Post by gilberto_san »

I used part of your command

Code: Select all

convert print1.bmp -colorspace HCL -channel g -separate +channel -threshold 10%% -negate print1.bmp
And got 3 figures. (print1-0.bmp print1-1.bmp print1-2.bmp)
Figure print1-1.bmp is perfect for my purpose.

Now 90% of my problem is solved. thank you so much.

Let's go to the remaining 10%.
I have images with the gray background and the font with shades of gray.
Serpá that I can remove the bottom?
Remembering that I can make multiple prints with the same text. And different backgrounds
Do you have any tips or suggestions for such a problem? 8) 8)
Thanks
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Removing caption background for use in ORC (tessearct)

Post by fmw42 »

I do not understand your question. Please post examples and explain further.
gilberto_san
Posts: 11
Joined: 2017-03-07T04:44:13-07:00
Authentication code: 1151

Re: Removing caption background for use in ORC (tessearct)

Post by gilberto_san »

i use the command

Code: Select all

 convert aaaa.bmp -colorspace HCL -channel g -separate +channel -threshold 10% img.bmp  
And got 3 pictures : img-0.bmp | img-1.bmp |img-2.bmp.
Image
Figure img-1.bmp is great for character recognition

If I use in a gray font the result is bad
Image

Any suggestion to be able to extract the character when the font is gray?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Removing caption background for use in ORC (tessearct)

Post by fmw42 »

Gray images have no saturation (since there is no color), so the same technique will not help. All you can do it threshold on intensity.

Code: Select all

convert image -threshold XX% result
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Removing caption background for use in ORC (tessearct)

Post by fmw42 »

If on Unix system, you could try some of my auto-thresholding techniques. See my home page in the table of categories down the page.
Post Reply