To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016
From the given input image, how to separate the frontground image and the background image?
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?