Thanks for your answer. In fact I have a database of 12 pictures. Each picture is a basket of fruit and vegetable like grapes, tomatoes, orange, apple, carrot (..) The baskets are different on each picture, and even the conditions to take the picture are different (intensity, flu, luminance …) The idea is too develop a program which can tell which kind of fruit or vegetable is in the basket, but I must do a program the simpler as possible, just by using simple function. My idea was to use the function strel('disk',r) like a mask, with different size of disk depends on the fruit diameter I want to mask. It work good but only when I have just some round fruit.
I have upload the pictures of my database in "file exchange"