Removing Black spots and clean the image

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?".
Post Reply
rocamargo
Posts: 4
Joined: 2014-05-09T07:40:48-07:00
Authentication code: 6789

Removing Black spots and clean the image

Post by rocamargo »

Hi guys, I have this original image:
Image

after running several filter, I have got this:
Image

but I still need to remove the black remaining spots. Could you please help? Thanks!
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Removing Black spots and clean the image

Post by snibgo »

This seems to be for robots to defeat captcha.

As a person who suffers from robots defeating captcha, and who also suffers from trying to login to sites that have increasingly difficult captcha, I won't help.
snibgo's IM pages: im.snibgo.com
rocamargo
Posts: 4
Joined: 2014-05-09T07:40:48-07:00
Authentication code: 6789

Re: Removing Black spots and clean the image

Post by rocamargo »

Fair enough, but I still need to work and earn money from capitalist companies :-)
rocamargo
Posts: 4
Joined: 2014-05-09T07:40:48-07:00
Authentication code: 6789

Re: Removing Black spots and clean the image

Post by rocamargo »

Even without your help I can handle that, and now more bots for you. Regards! :lol:

Image
magicfan
Posts: 2
Joined: 2014-06-01T04:57:09-07:00
Authentication code: 6789

Re: Removing Black spots and clean the image

Post by magicfan »

@rocamargo would you mind sharing how did you managed to achieve this please? what filters did you used?
thanks
rocamargo
Posts: 4
Joined: 2014-05-09T07:40:48-07:00
Authentication code: 6789

Re: Removing Black spots and clean the image

Post by rocamargo »

Sure. I used this sequence:

Code: Select all

convert entry.jpg -threshold 10% -morphology close:2 "1x4: 0,1,1,0" -normalize out.jpg

convert out.jpg -write MPR:source -morphology close rectangle:7x3 -clip-mask MPR:source -morphology erode:8 square +clip-mask r.jpg

convert r.jpg -filter Box -resize 320x240+0+0 -noise 5 -median 5 -unsharp 0x1+0.25+0 -quality 86% -sampling-factor 1x1 -despeckle -sharpen 2 -normalize -negate -verbose -morphology Thinning 3:0,0,0,0,1,0,0,0,0 -negate pre_final.jpg

convert pre_final.jpg -negate -morphology Thinning "4x4:0,0,0,0, 0,1,1,0, 0,1,1,0, 0,0,0,0" -morphology Thinning:5 LineEnds -morphology Thinning "3:0,0,0, 0,1,0, 0,0,0" -negate final.jpg
But if you can make the letter less rounded please let me know. It seems that these filters I'm using can't make a good difference between B and 8, for instance. I still need to check a better solution.
magicfan
Posts: 2
Joined: 2014-06-01T04:57:09-07:00
Authentication code: 6789

Re: Removing Black spots and clean the image

Post by magicfan »

@rocamargo thanks, i ll let you know if i ll make any progress.
btw check pm
Post Reply