How to find critical points - maxima,minima and saddle points in an image?

9 views (last 30 days)
Hi Matlab community, I am new to Matlab and sorry if my question is lame. I would like to find the critical points in an image (maxima,minima,saddle points). I am able to find out the maxima and minima using the 'imregionalmax,imregionalmin'function. But i dunno how to find out the saddle points in an image. I really need help, please help me out.

Answers (1)

Matt J
Matt J on 9 Oct 2014
Edited: Matt J on 9 Oct 2014
How about,
Cx=diff(Image,2,1); Cx(end+2,:)=nan;
Cy=diff(Image,2,2); Cy(:,end+2)=nan;
[i,j]=find( Cx.*Cy<=0);
  3 Comments
Lalith kumar
Lalith kumar on 9 Oct 2014
Edited: Lalith kumar on 9 Oct 2014
Hi Matt,
Thank you so much for your fast reply. When i tried the code which you suggested, i faced a few hiccups.
[i,j]=find( Cx.*Cy<=0); --> Matrix dimensions must agree.
I think this is due to the cx(end+1,:)=nan and cy(:,end+1)=nan part.
I tried to implement the second order derivative test(hessian matrix). But i am not sure on how to implement that on an image, because for a function, the test is fairly simple and straight forward.
I tried calculating the second order derivative by using this snippet of code :
im=double(dicomread'MR_017.dcm'); %calculating the partial derivatives of the image. [imx,imy]=gradient(im); [imxx,imxy]=gradient(imx); [imyx,imyy]=gradient(imy);
I am not sure on how to proceed after this, because i have never done a test of this sort on an image.
Matt J
Matt J on 9 Oct 2014
Edited: Matt J on 9 Oct 2014
I think this is due to the cx(end+1,:)=nan and cy(:,end+1)=nan part.
Whoops. Should be end+2 everywhere...

Sign in to comment.

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!