Reputation: 385
I have two questions concerning fitting a gauss curve to histogram peaks. My first question is a very basic one:
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.
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
Upvotes: 4
Views: 6217
Reputation: 15867
Your approach to estimating the parameters of a single gaussian is correct, I think.
For multiple gaussians, you might want to look up mixture models or more specifically mixtures of gaussians. Just a few notes on that:
Upvotes: 3
Reputation: 38033
Your simple approach for a single peak should be OK. [BTW I think this is properly a programming question if it relates to images.]
Multiple peaks are more difficult. The process of resolving peaks is called deconvolution (http://en.wikipedia.org/wiki/Deconvolution) and there is not normally a unique answer. You may have to decide how many peaks there are, or what the minimum variance of a peak is (otherwise you could create a peak for each bin :-)).
Upvotes: 4