Code: Select all
magick convert -units PixelsPerInch a.tif -density 800 a.tif
magick convert a.tif -fuzz -50% -colorspace gray -lat 25x25+10% 0.tif
magick convert 0.tif -fuzz 90% -monochrome 1.tif
magick convert 1.tif -morphology open square 2.tif
magick 2.tif -rotate -2 3.tif
magick 3.tif -gaussian-blur 1x1 3.tif
magick 3.tif -morphology erode square:1 4.tif
magick 4.tif -sharpen 0x10 4.tif
magick 4.tif -normalize -level 90% 4.tif
I aim to reach at least a 95% accuracy and as I am not very experienced I would love if you could help me out.
Many thanks in advance !