How can local maxima be pinpointed on a surf plot?

4 次查看(过去 30 天)
Hello everyone. I posted a question a few days ago and I repost it now since I got no answers (maybe because Ι wasn't clear about what I needed). So I have a surf plot (I include an image of it) and I need to pinpoint the local maxima on it. The range of the local maxima that will be pinpointed I want to be controlled by me. I also include my data if that helps. Thanks in advance!
  1 个评论
Paschalis Garouniatis
In reference to the range of the local maxima. What I mean is that I need to pinpoint local maxima points from a certain value and higher. Hope that clarifies the meaning of range.

请先登录,再进行评论。

回答(3 个)

KSSV
KSSV 2017-1-22
You can get your maximum value using max along with indices. To get your range values use find.

Walter Roberson
Walter Roberson 2017-1-22
Calculate a mask image, Data>threshold. regionprops asking for PixelIdxList. For each region returned use the indices to index the data and take max of that subset of the data with the two output max to find the index of the max relative to to that subset; use that to index the the PixelIdxList to find the linear index of the local max. You can then convert linear to 2d coordinate. Caution: the local max might be duplicated which your problem description did not account for.
  18 个评论
Walter Roberson
Walter Roberson 2017-2-3
Sorry, I missed seeing the update here. Could you include a bit of data with this kind of structure that imregionalmax is not working for? Looking at the diagram it looks to me as if imregionalmax would work.

请先登录,再进行评论。


Image Analyst
Image Analyst 2017-1-22
编辑:Image Analyst 2017-1-22
I don't know what "pinpoint" means. Perhaps you want a 3-D arrow with the tip of it pointing to the max. If so, there are 3-D arrow functions in the File Exchange. Please attach a screenshot that's an image file, like PNG, NOT a .fig file which requires me to right click, save it to disk, switch to MATLAB, browse to the file I saved, and open it. I did not do any of that. With a PNG file you can jsut insert it here and save me a lot of work.
By the way, local max can be found with the function imregionalmax().
  3 个评论
Image Analyst
Image Analyst 2017-1-22
I'd probably use plot3() to put a marker at the top peak location. Let's say you somehow found the x,y,z location(s) of the peaks, then say
plot3(x, y, z, 'r.', 'MarkerSize', 30);
Of course the arrow in 3D is also a good alternative way.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Entering Commands 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by