How to make it so that the whole fruit is white and the background is black
===

I have a to make an application that recognizes fruits. So far i have made that you can crop the image and get the color of the fruit you want. Now i am trying to get roundness of the fruit but i need the fruit to be black and the background to be white so i can find area and roundness value. This is my code so far for that part : 

        crop_temp = rgb2gray(crop);
        threshold = graythresh(crop_temp);
        bw = im2bw(crop_temp,threshold);
        imshow(bw)

Crop i get passed when i crop the image. The problem gets when the fruit has a camera flash and that part stays white.

I can't post images but this is the link to the image [**lemon**][1], i am not promoting the page it is just the link to the picture. 

The problem is the white area in the lemon stays white after the code but i want it so that the whole lemon is black. But not just the lemon, but for other fruits to.

The problem is the white area in the lemon stays white after the code but i want it so that the whole lemon is black. But not just the lemon, but for other fruits to.

Yeah and how can you make so that the fruit is white and the background is black.
I am new to image processing so don't jump on me. I just can't find specific stuff for this.


  [1]: http://fruitfortheoffice.blogspot.com/2012/04/top-5-uses-for-lemon-in-office.html