
after running several filter, I have got this:

but I still need to remove the black remaining spots. Could you please help? Thanks!
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