find local maxima and local minima

12 views (last 30 days)
Pat
Pat on 10 Sep 2012
Commented: Image Analyst on 22 Nov 2017
Input=my image
how to find all the points od 2D local maxima and all points of 2D local minima of input(i,j)
please help

Answers (2)

Mohamed Nedal
Mohamed Nedal on 22 Nov 2017
For Max, you can use findpeaks() function. And for Min, it's the same function but with negative data (i.e. -x).
  2 Comments
Mohamed Nedal
Mohamed Nedal on 22 Nov 2017
oh, sorry I didn't know that. Thanks for correcting me.

Sign in to comment.


Image Analyst
Image Analyst on 22 Nov 2017
You can use the functions imregionalmax() and imregionalmin() in the Image Processing Toolbox.
  1 Comment
Image Analyst
Image Analyst on 22 Nov 2017
Input is the name of a built-in function so don't use that for your variable name. Try this:
localMaxImage = imregionalmax(grayImage);
localMinImage = imregionalmin(grayImage);

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by