
function img = RemoveBackground(im)

    im= double(im);

    [masked_image] = separate(im,1);

    img= uint8(masked_image.*im);
    imshow(img);

    %For shadow
    hsv = rgb2hsv(img);

    [Hwidth, Hheight,z1] = size(hsv);
    img_hue= hsv(:,:,1);
    img_sat= hsv(:,:,2);
    for x = 1: Hwidth
        for y = 1: Hheight

            if(img_hue(x,y) < 0.15 )
                img(x,y,:) = 0;
            end
            if(img_sat(x,y) <0.30)
                img(x,y,:) =0.3;
            end

        end
    end
    imshow(img)
end
