Hi,
I understand that you want to determine the threshold between the two Gaussian curves from the histogram distribution.
Since the “graythresh” function provides a normalized value and using “normalize” function isn’t possible, here is an alternative approach that can be used:
- Use the “fitgmdist” function to fit a Gaussian Mixture Model (GMM) to identify the parameters of the two Gaussian distributions.
- Extract the means, standard deviations and weights of the Gaussian components from the fitted GMM.
- Use the “normpdf” function to calculate the probability density function for each Gaussian distribution based on the extracted parameters.
- Determine the intersection point where the two Gaussian PDFs are equal using the “fzero” function, starting with an initial guess such as the average of the means of the distribution.
To know more in detail on how to use these functions, refer to the MATLAB documentation listed below:
- fitgmdist: https://www.mathworks.com/help/releases/r2024b/stats/fitgmdist.html
- normpdf: https://www.mathworks.com/help/releases/r2024b/stats/normpdf.html
- fzero: https://www.mathworks.com/help/releases/r2024b/matlab/ref/fzero.html
Since, the above functions are available in older releases of MATLAB as well, I hope this approach helps achieve the desired goal.