Gaussian Distribution for image pixels

Hi all
Can any one help me how to model the variation of each pixel in grayscale image using its mean and std
as there is one function in matlab normpdf.
y=normpdf(img,mean(img(:),std(img(:))));
Any help is appreciated..
Thanks.

5 Comments

I have no idea what you want to do. Maybe you have a sequence of images and you want the mean and standard deviation of each pixel, so you'd have two images - the mean image (over all the input images), and the standard deviation image. But I really have no idea what you want.
I am modeling and subtracting the background from video sequence using 2-dimensional principle component anaylsis. I have extract the foreground pixels as
Fg(i)= |b1(i)-b2(i)|
Where b1 is original image and b2 is reconstructed background image using PCA. Now this Fg(i) should be Fg>th(i).
Now threshold can be computed from the
th(i) = max (thMin,min (thMax, m(i) +κσ(i))),
where thMax=60 thMin=30 and k=5.
and m is mean and sigma is variance which are obtained from distance between original and reconstructed image using Gaussian distribution.
This threshold is also updating by updating the mean and variance(standard deviation).like that
mnew(i) = (1 −α)m(i) +α||bi−bˆi||
and
σ2new(i)= (1 −α)σ2 (i)+α(1−α)(|bi−bˆi| − m(i))2.
So my problem is computing the initial mean and variance which are obtained from Fg image.
Thanks
What is the difficulty in adding up the 5 previous frames? You have to convert to single or double of course, but that's really straightforward.
how can I update the threshold equations.
because if I compute the mean it is just row vector i want to compute the mean of each pixel in bgframe.
As I have declared the first frame for background modelling and rest of other are the current input frames for object detection.

Sign in to comment.

Answers (0)

Asked:

on 29 Apr 2013

Community Treasure Hunt

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

Start Hunting!