I'm looking for some ideas to detect lines in the attached image. Lines are assumed to be vertical, but their are very poor quality and there are only 2-3 pixels between each blurry line.
I tried these methods already: Erosion& Dilation in vertical ->good result for enhancement CLAHE -> Good for enhancement Hough -> Failed since converting the images to Black & while will have too many broken lines or bridges. Also I tried vertical line Mask too. Basically methods based on Black&White image conversion won't be applicable for this.
If you have any background in signal processing, the first method to consider would be computing the Fast Fourier Transform of the image and then examining the distribution of low and high frequencies — if there are a low amount of high frequencies, then the image can be considered blurry.
Edge detection is the process of finding outlines in an image, whatever they look like. Line detection finds line segments (sometimes by extension, other geometric figures such as circular arcs).
Edge detection: Edge detection is an image processing technique for finding the boundaries of objects within images. It works by detecting discontinuities in brightness. Edge detection is used for image segmentation and data extraction in areas such as image processing, computer vision, and machine vision.
I would collapse the image along the lines to get 1d profile. And do the detection there (e.g. by looking at the peaks above the median.
Here is the collapsed image
The object detection there is obvious
Very promising works regarding faint edges detection in noisy images: Basic version for straight lines: http://www.wisdom.weizmann.ac.il/~meirav/EdgesGalunBasriBrandt.pdf More advanced version: http://www.wisdom.weizmann.ac.il/~meirav/Curves_Alpert_Galun_Nadler_Basri.pdf
I'm not sure if the authors made their code publicly available. It might be worth-while contacting the authors directly.
These works proposes a well studied and principled method for faint-edge detection.
Here's an alternative approach, that will find you the lines, assuming that the peak is apparent within ~5 pixels. It will be tolerant to small rotations of the image.
img = imread('http://i.stack.imgur.com/w7qMT.jpg');
img = rgb2gray(img);
%# smoothen the image a little with an anisotroic Gaussian
fimg = imfilter(double(img),fspecial('gaussian',[3 1]));
%# find the lines as local maxima
msk = ones(5);
msk(:,2:4) = 0;
lines = fimg > imdilate(fimg,msk);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With