How can local maxima be pinpointed on a surf plot?

4 ビュー (過去 30 日間)
Paschalis Garouniatis
Paschalis Garouniatis 2017 年 1 月 22 日
コメント済み: Walter Roberson 2017 年 2 月 3 日
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
Paschalis Garouniatis 2017 年 1 月 22 日
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 件のコメント
Paschalis Garouniatis
Paschalis Garouniatis 2017 年 1 月 30 日
I was refering to Imregionalmax().
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 件のコメント
Walter Roberson
Walter Roberson 2017 年 1 月 22 日
The code I showed will do that '+' .
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 Center および File ExchangeEntering Commands についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by