i want to remove the background from the image so i can get the grapes only ... but i don't know how to... pls help :) .. i attached the image..... thanks in advance :)
There are many image segmentation techniques availble in image processing toolbox. Search "image segmentation" in documentation. Below is one technique:
RGB = imread("image.jpeg");
imshow(RGB);
L = superpixels(RGB, 500);
% foreground
f = drawrectangle(gca, 'Position', [2000 1000 1500 600], 'Color', 'g');
foreground = createMask(f, RGB);
% background
b = drawrectangle(gca, 'Position', [10 10 4500 600], 'Color', 'r');