Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

how to get the background of an image?

Asked by Sivakumaran Chandrasekaran on 22 Aug 2012

From the given input image, how to separate the frontground image and the background image?

0 Comments

Sivakumaran Chandrasekaran

1 Answer

Answer by Matt Kindig on 22 Aug 2012
Accepted answer

This question is almost impossible to answer without a) the image in question, and b) your definition of what the "background" is. Please upload your image (see the "Image" icon in the editor where you post your question) and provide some details as to your criteria for distinguishing foreground from background. Also, do you have the Image Processing Toolbox?

3 Comments

Hi, Please check the input image in the link...http://tinypic.com/r/r7onpi/6

Matt Kindig on 22 Aug 2012

Looking at the image, how do you want to define the "foreground"? There are three polar bears in the image you supplied. Do you want to identify only the one closest to the camera? If so, this is potentially quite difficult, as standard thresholding techniques based on color matching would likely not work. I guess you would need some way to identify the "sharpness" or "in focus" portion of the image (edge detection?). Perhaps someone on this forum with more experience in this area can assist.

Hi Matt, I should get only 3 polar bears as the output.. Nothing others should be visible.

Matt Kindig

Contact us