I have two questions concerning fitting a gauss curve to histogram peaks. My first question is a very basic one:
- How can I fit a gauss curve to a entire histogram? Does this only mean that I have to find out and calculate the mean value(µ) and the deviation(ϭ) of the histogram and put them into the formula for the Gauss curve?
Would the following example be right?: Assume (just as an example) I have a histogram of an image with 5 colour values. On the X-Axes there are these 5 color values and on the Y-Axes there are the frequencies of each of these values. i.e.:
value 1: 1 time
value 2: 4 times
value 3: 7 times
value 4: 3 times
value 5: 2 times
Now the mean value(µ) would be 3(µ = 3).
And the deviation(ϭ) would be 0.9 (ϭ = 0.9). formular:
Now I use these values in the formular of the density function to calculate my gauss curve?
Is that correct? Unfortunately I am a little unsecure about the math background.
- My second question is a little more tricky: This time, I have a histogram with several peaks, but I only want to fit the gauss curve to the highest peak. So, I go through all the bins of the histogram with a simple for loop and find one intensity value on the x-axis(which contains the intensities of the image) with the most frequencies(shown on the y-axes). This would be the highest peak. But how do I find out the deviation? Especially, since I dont know which of the intensity values I should include in my calculations. As far as I know the turning point of the gauss curve lies at µ+ϭ and µ-ϭ. Could that help to solve the problem.
I am sorry that this question is a little mathematical, but I did not find a better place to ask it. I also read some similar topics, but unfortunatley they did not finally answer my question.
Thanks for your help!
Regards Marc