File Exchange

image thumbnail

Background Removal using Gaussian Model

version 1.0.0.0 (114 KB) by Alexander Farley
Input image. Get out binary foreground mask.

14 Downloads

Updated 04 Dec 2011

View License

Models image as sample from one of 2 Gaussians in RGB space. Classifies each pixel as having originated from one Gaussian.

In the future this could be expanded to remove the ith, kth, etc Gaussians from an N-Gaussian image model.

RemoveBackground.m contains a demonstration of how to use the main function, separate.m

Comments and Ratings (8)

Victor Sun

I tried this code for my image which is black-white picture. The code can't process my picture.

liu liu

though it has a good result for the picture author gives, this method has a bad effect for my picture.
thank you !

It is not a fast code but output is awesome.

Maxaon

Maxaon (view profile)

Thanks

Hi Supriya, I just tested in R2013a and it seems to work correctly.

supriya M

sir i tried to run this code in matlab2013-computer vision toolbox as well as 2010 but it shows error for2013-undefined function kmeans,also statsremovenan....how to run it....

Reja Rabbi

MATLAB Release Compatibility
Created with R2010b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired by: EM_GM

MATLAB Online Live Editor Challenge

View the winning live scripts from faculty and students who participated in the recent challenge.

Learn more

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video