Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detecting thin lines in blurry image

enter image description hereenter image description hereI'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.

Detecting very thin lines in blurry image

like image 661
Hamed Avatar asked Dec 07 '12 17:12

Hamed


People also ask

Is there a way to detect if an image is blurry?

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.

What are the differences between line and edge detection?

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).

What is edge or line detection in image processing?

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.


3 Answers

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 collapsed image

The object detection there is obvious

like image 126
sega_sai Avatar answered Oct 19 '22 12:10

sega_sai


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.

like image 23
Shai Avatar answered Oct 19 '22 12:10

Shai


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);

enter image description here

like image 1
Jonas Avatar answered Oct 19 '22 11:10

Jonas