Page 1 of 1

Removing Black spots and clean the image

Posted: 2014-05-09T07:52:22-07:00
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!

Re: Removing Black spots and clean the image

Posted: 2014-05-09T08:00:38-07:00
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.

Re: Removing Black spots and clean the image

Posted: 2014-05-09T10:00:00-07:00
by rocamargo
Fair enough, but I still need to work and earn money from capitalist companies :-)

Re: Removing Black spots and clean the image

Posted: 2014-05-09T12:28:00-07:00
by rocamargo
Even without your help I can handle that, and now more bots for you. Regards! :lol:

Image

Re: Removing Black spots and clean the image

Posted: 2014-06-01T04:58:53-07:00
by magicfan
@rocamargo would you mind sharing how did you managed to achieve this please? what filters did you used?
thanks

Re: Removing Black spots and clean the image

Posted: 2014-06-02T12:20:38-07:00
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.

Re: Removing Black spots and clean the image

Posted: 2014-06-02T15:08:20-07:00
by magicfan
@rocamargo thanks, i ll let you know if i ll make any progress.
btw check pm