I need to compute a background model using the information below can someone please help me in understanding and implementing the idea below

5 views (last 30 days)
To compute this background model all of the pixels in the image are histogrammed-namely, for each pixel its color intensity is placed in the proper bin of a preferred possible 256 intensity levels. This is preferably done for each of the red, green and blue (RGB) channels thus generating three separate histograms. Alternately, one histogram could be generated using some joint space rep- resentation of the channels. Once the histogram has been computed, a Gaussian distribution for each histogram is calculated to provide the mean pixel intensity of the background and the vari- ance.

Answers (1)

Image Analyst
Image Analyst on 2 Aug 2012
Edited: Image Analyst on 2 Aug 2012
Depends on what your background image is. I use polyfitn ( http://www.mathworks.com/matlabcentral/fileexchange/34765-polyfitn) to get a smooth illumination profile that I can use to correct for non-uniform lighting. But if you had, say a street scene with a bunch of people on it, then you wouldn't use that method, you'd take the mode or use GMM models or something.
I don't see how your proposed method would work at all. I don't even know what it does, except maybe get the mean color of the image, but you don't need to fit histograms to Gaussians to do that, or even to take histograms at all. Basically your method is just the same as:
meanRedValue = mean(rgbImage(:,:,1));
meanGreenValue = mean(rgbImage(:,:,2));
meanBlueValue = mean(rgbImage(:,:,3));
That's all your algorithm does, which is not even as locally adaptive as a blurring with conv2(). That's not really background correction at all.
  7 Comments
Maria
Maria on 4 Aug 2012
Can you give me a complete code for this since I am completely blank now.I need to do this for couple of images not for a single image. I have lets say 10 images and I have to compute background model this way using all 10 images.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!