Remove all horizontal and vertical lines from an image

后端 未结 2 1973
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-01 07:55

I want to remove all horizontal and vertical lines but some small vertical lines are not getting removed. Adding the input and output images and the code below.



        
2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-01 08:39

    You can do this with ImageMagick library easily, just use some predefined filter

    I am not sure this works with tiff format , you may need convert your tiff file to bmp/png/jpb first

    This removes horizontal lines

     convert rtaImage.png -morphology close:1 "1x5: 0,1,1,1,0"
    

    this removes both

     convert rtaImage.png -convolve "0,$v,0,0,$v,0,0,$v,0" -threshold 99% rtaImage2.png
    

提交回复
热议问题