How to remove horizontal and Vertical lines

I have Binary Image,i need to remove horizontal and vertical lines in that image.Lines are not fixed size.
Is there any method for filtering these Lines..?
Does any one know please suggest me.
Thank You.

 Réponse acceptée

Image Analyst
Image Analyst le 27 Déc 2012

0 votes

Probably a morphological opening (imclose in the Image Processing Toolbox)with a kernel of the proper shape, but you need to post an image for more advice.

5 commentaires

Chandra Shekhar
Chandra Shekhar le 27 Déc 2012
Modifié(e) : Walter Roberson le 27 Déc 2012
Please check these two link for images.
In that images lines, square box and -,< symbols is need to be removed.
Thank You.
Walter Roberson
Walter Roberson le 27 Déc 2012
fileslap is telling me the images cannot be found.
Image Analyst
Image Analyst le 27 Déc 2012
Same here. And it's doubtful that my answer should have been accepted (yet) since it was somewhat vague and awaiting an image to make an improved suggestion.
Chandra Shekhar
Chandra Shekhar le 28 Déc 2012
Modifié(e) : Chandra Shekhar le 28 Déc 2012
Sorry for that..
Please find in dropbox link
I tried with 'imopen' function, but it is removing other object in a image by retaining Lines.
Here i need to remove lines and square box and < symbol, Please check the two images. any help is appreciated.
Thank You.
Walter Roberson
Walter Roberson le 28 Déc 2012
It appears to me that a fair bit of what you want to do could be accomplished by cropping.

Connectez-vous pour commenter.

Plus de réponses (1)

Shaun VanWeelden
Shaun VanWeelden le 28 Déc 2012

1 vote

First step, convert whatever format the image is in to bw logic values, just use im2bw(yourImageValues).
A really, really easy intuitive way to do it would be to check out the bwareaopen: http://www.mathworks.com/help/images/ref/bwareaopen.html
It would take care of the small dots on that first image and whatever else you wanted.
My other approach for large lines is how I use to find scales in images automatically. Simply search the image for a white pixel, then see how far and left you can go with a while loop. If gits a certain theshold (i.e its more than 200 pixels long), add the pixel to a "toEraseVector", you can call it whatever you want, the idea is after you go through your image (should be almost instantaneous), you will call imfill for those selected images, and fill in the white area. You may need to inverse your bw logic values matrix to make sure the color works out and whats supposed to be black is black and vice-versa.
Let me know if you have questions, otherwise good luck!
-Shaun

1 commentaire

Hi Shaun,
Could you please explain me your second method for large lines with example.
Thank You.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Images dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by