Page 1 of 1
Removing Horizontal Lines
Posted: 2011-04-29T06:08:47-07:00
by jeromerocks
Hi!
I've been stumped on this problem for a while. Could anyone please tell me how to remove horizontal lines from an image? The horizontal lines could be slightly angled.
Is there any way to complete this in ImageMagick?
I tried the solution in: /viewtopic.php?f=1&t=15692 but the commands didn't seem to be recognised.
Thanks in advance!
Re: Removing Horizontal Lines
Posted: 2011-04-29T07:06:55-07:00
by Bonzo
A sample image would be useful along with your Imagemagick version and how you will be runing Imagemagick.
Re: Removing Horizontal Lines
Posted: 2011-04-29T17:21:55-07:00
by fmw42
I tried the solution in: /viewtopic.php?f=1&t=15692 but the commands didn't seem to be recognised.
As Bonzo had suggested above, it would be best if you could provide a link to your example image and your exact command line and your operating system. Please read
viewtopic.php?f=1&t=9620 before posting questions and try to follow those instructions as it makes it much easier for others to help if they know more about your problem and environment.
Perhaps your lines are thicker than 1 pixel wide. If so then the command above in my earlier post you reference will not work and you need another convolve filter. However, I have verified that it still works on the image that I tested with the convolve filter specified. Please note that my command was for unix. If you are on Windows, then you need to use other syntax for variables or just hard code the actual values into the convolve kernel. See
http://www.imagemagick.org/Usage/windows/
But now, you may be able to do what you need for broader lines with the relatively newer 1D morphology gaussian convolution (vertical direction). See
http://www.imagemagick.org/Usage/convolve/#blur
PS If lines are at an angle, then the above horizontal or vertical filters will not work very well, especially the more rotated the lines.
Re: Removing Horizontal Lines
Posted: 2011-04-30T09:30:48-07:00
by jeromerocks
Thanks for your replies!
I really want to post an example picture but they are not mine to post and I don't have permission. I've found the problem, to call Morphology on Windows, one needs to use:
Anyway I tried the 1D vertical blurring and it worked! Thanks for your suggestion! Wouldn't have worked without applying the blurring because some of the lines intersect, causing them to be more than 1px wide.
Thanks everyone!