Need help understanding imextendedmax

10 views (last 30 days)
Knut Skaug
Knut Skaug on 18 Oct 2022
Answered: Sumukh on 19 Sep 2024
Hello,
Im using this function to identify the peaks/maximum centroids in a 2d matrix normalized between 0 and 1.
I need help understanding how to properly select the second input, called h-max in the documentation.
Say there are three peaks, or areas of interest in my matrix, each with its own maximum. Sometimes, the difference in values between peaks are large, for example, 0.4 between the largest and the smallest. I thought I would capture the areas of interest if I then allow h-max to be a little less than 0.6. However, it only captures the three areas if it is much lower, say 0.2.
Can anyone explain how this works? And if you have some suggestions as to how to choose h-max?
Any help is appreciated.
Kind regards
Knut

Answers (1)

Sumukh
Sumukh on 19 Sep 2024
Hi Knut,
The “imextended(I, H)” command performs two operations on the image matrix “I”:
  • Compute the H-maxima transform matrix, say “J” from the image matrix I based on the input argument “H”.
  • Compute the binary image matrix “BW” that identifies the regional maxima from the H-maxima-transform matrix “J”.
The input argument “H” is a parameter used for the H-maxima transform. This transform suppresses any local/regional maxima within the regions of the image matrix “I” that are less than a certain height “H” above their immediate surroundings. The unit of scalar “H” depends on the values in the image matrix “I” and must be chosen based on what height values will be regarded as significant for the H-maxima transformation.
To get an idea as to how to choose the “H” value, the regions of interest or “peaks” in the image matrix can be first obtained using the “imregionalmax(I)” command. You can refer to the following documentation to know more about the command:
The command returns a binary matrix “BW”, which can then be applied as a mask to the image matrix “I” to identify the regions of maxima using logical indexing. The value of “H” can be chosen based on the value of the regional maxima.
You can refer to the following MATLAB Blog that explains more about “H” in H-maxima transform and how it is chosen based on the value of the regional maxima:
Additionally, you can refer to the following MATLAB blog to understand more about identifying peaks and centroids in images using h-maxima transform:
I hope this answers your query.

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!