5

I want to find ridges for a given image. (Ridges not edges!) An example is like the image below enter image description here

I think Hessian matrix will work intuitively. So I hard coded Hessian matrix kernel by starting from a 2D-Gaussian equation as the links below described. How to build 2D hessian matrix kernel

I use surf to visualize the 3 second order derivative kernels (D_xx,D_yy and D_xy) I created and they look all correct. enter image description here

I then applied these kernels and did 2D convolution with my image.

I am not sure what to do next, should I need to represent eigen values and vectors by using D_xx,D_yy and D_xy? How can we pull out ridge lines from the image by using the eigen analysis of 2-by-2 matrix for each pixel? Any idea, formula or even code will be much helpful.

Attached is the code to generate 2D Hessian matrix

[x y]=meshgrid(round(-N/2):round(N/2), round(-N/2):round(N/2));
common = x.^2+y.^2;
Lxx = ((-1+x.^2/(sigma^2)).*exp(-common/(2*sigma^2))) / (2*pi*sigma^4);
Lxx = Lxx./ sum(Lxx(:));

Lyy = ((-1+y.^2/(sigma^2)).*exp(-common/(2*sigma^2))) / (2*pi*sigma^4);
Lyy = Lyy./ sum(Lyy(:));

Lxy = ((x.*y)/(2*pi*sigma^6)).*exp(-common/(2*sigma^2));
Lxy = Lxy./ sum(Lxy(:));
Cris Luengo
  • 55,762
  • 10
  • 62
  • 120
SimaGuanxing
  • 673
  • 2
  • 10
  • 29
  • Have you considered using threshold and sekleton? – Steffen Feb 20 '15 at 14:31
  • @Steffen How did you use threshold for finding ridges? I do believe skeleton works for binary image processing but I am dealing with greyscale image. – SimaGuanxing Feb 20 '15 at 16:29
  • Threshold to create a binary image where skeleton will work. – Steffen Feb 20 '15 at 16:34
  • @Steffen Threshold method has its limitation. since we want to implement a auto scale selection method for finding ridges, it's too tricky to find a proper threshold for different dimensional feature images. I believe skeleton is the way for dealing with binary image, so I don't want to use it either. – SimaGuanxing Feb 20 '15 at 16:37
  • @Steffen We are not simply dealing with the image shows above. We are dealing with multi-scale feature images by using different scales of DOG. What I show here is a large scale space image with lot of blur on it. Maybe it is ok to use threshold. But if you deal with the small scale space image, there will be a lot of noises and other staffs which may fail the threshold process. – SimaGuanxing Feb 20 '15 at 16:42

0 Answers0