Consider the scanned document on the left shown below It is

Consider the scanned document on the left shown below. It is a section from a standard notebook page with 7 lines every 2 inches. The document was sampled at 75 pixels/inch in both the horizontal and vertical directions, resulting in a 554x554 pixel image.

Design a filter to remove the horizontal lines from the document without affecting the writing. Hint: Consider each column of the image separately; treat it as a one-dimensional signal.

n Your nyour opnion Garner\'s fun.? oners flo orner feu about Batles hr Galaia tsr balada

Solution

Windows BAT syntax.

convert ^
Test2image.png ^
-strip ^
-write mpr:ORG ^
( +clone ^
-negate ^
-morphology Erode rectangle:50x1 ^
-mask mpr:ORG -morphology Dilate rectangle:50x1 ^
+mask ^
) ^
-compose Lighten -composite ^
( +clone ^
-morphology HMT \"1x4:1,0,0,1\" ^
) ^
-compose Lighten -composite ^
( +clone ^
-morphology HMT \"1x3:1,0,1\" ^
) ^
-compose Lighten -composite ^
( +clone ^
-morphology HMT \"3x1:1,0,1\" ^
) ^
-compose Lighten -composite ^
out.png

Consider the scanned document on the left shown below. It is a section from a standard notebook page with 7 lines every 2 inches. The document was sampled at 75

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site