Reputation: 199
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.
Upvotes: 12
Views: 4320
Reputation: 114796
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.
Upvotes: 3
Reputation: 74940
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('https://i.sstatic.net/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);
Upvotes: 1
Reputation: 8538
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
Upvotes: 13