find local maxima and local minima

2 次查看(过去 30 天)
Pat
Pat 2012-9-10
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

回答(2 个)

Mohamed Nedal
Mohamed Nedal 2017-11-22
For Max, you can use findpeaks() function. And for Min, it's the same function but with negative data (i.e. -x).
  2 个评论
Image Analyst
Image Analyst 2017-11-22
findpeaks() works only with vectors (see the help), not with 2-D arrays.
Mohamed Nedal
Mohamed Nedal 2017-11-22
oh, sorry I didn't know that. Thanks for correcting me.

请先登录,再进行评论。


Image Analyst
Image Analyst 2017-11-22
You can use the functions imregionalmax() and imregionalmin() in the Image Processing Toolbox.
  1 个评论
Image Analyst
Image Analyst 2017-11-22
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);

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Computer Vision with Simulink 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by