Clear Filters
Clear Filters

Remove only horizontal lines from an image

5 views (last 30 days)
Pankaj Patil
Pankaj Patil on 19 Apr 2016
Answered: Swarooph on 19 Apr 2016
I need to remove only horizontal lines from an image. Sample images are here
https://drive.google.com/folderview?id=0BzJGVam7JuLbYkFHdS13MVF6N0k
Kindly help me out.

Answers (1)

Swarooph
Swarooph on 19 Apr 2016
Hello,
In my best guess, I think you are looking for some sort of 'line detection'. Hough transform is a popular way to do this. The Image Processing Toolbox has this functionality. Look here: Hough Transform in MATLAB
You can also apply image filters to do what is called 'edge detection': Edge detection in MATLAB
Once you identify the lines/edges, you should be able to compare with the original image using functions such as imabsdiff to locate and remove lines. This is easier to do using the first approach of line detection since it more or less directly gives you line locations..
If you don't have the image processing toolbox, I suggest you use google to see the best resource to implement one of the above 2 functionalities using basic MATLAB code. Particularly 'edge detection' should be fairly straightforward to do using just MATLAB.
Best, Swarooph

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!