http://www.imagemagick.org/discourse-server/viewtopic.php?t=23723
remove all horizontal or vertical black lines that are at least 30 pixels long
convert example_box_ocr.png ^
-define morphology:compose=lighten ^
-morphology Thicken ^
1x30+0+0^<:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ^
e.png
convert example_box_ocr.png ^
-negate ^
-define morphology:compose=darken ^
-morphology Thinning Rectangle:1x30+0+0^< ^
-negate ^
e2.png
http://www.imagemagick.org/discourse-server/viewtopic.php?t=22338
convert billy.png -morphology close:2 "1x4: 0,1,1,0" result.png
It is a morphological close (erode and dilate) attempt to remove two pixel tall horizontal black lines that have white above and below them.
-statistic median 7x7
-monochrome
-median
-morphology Smooth Octagon:1
沒有留言:
張貼留言