Can anyone help me with watermelon detection(image processing)?

I have to work with the texture of watermelon but i don't know the procedures how to use texture of watermelon to detect watermelon from an image and what functions should i use.Help me out with this.

 Accepted Answer

Could be anything. stdfilt() is a commonly used texture detection function. You might also use SURF, Hu's moments, Hausdorf distance, CBIR methods, or any number of other things.
Usually people show us an image when they ask for image processing advice.

2 Comments

Here a sample image containing watermelon is given.If i want to detect watermelon from this image what steps should i take.I have used imcontour function to to get the contours first but its not working properly.First I filtered the image with this...
I = imread('watermelon.jpg');
A = I;
[r c z] = size(A);
for i= 1:r
for j = 1:c
if(2*A(i,j,2)<=(A(i,j,1)+A(i,j,3)))
A(i,j,1)=0; A(i,j,2)=0; A(i,j,3)=0;
elseif(2*A(i,j,2)>=(A(i,j,1)+A(i,j,3)+255))
A(i,j,1)=255; A(i,j,2)=255; A(i,j,3)=255;
else
A(i,j,1)=(2*A(i,j,2))-A(i,j,1)-A(i,j,3); A(i,j,2)=(2*A(i,j,2))-A(i,j,1)-A(i,j,3); A(i,j,3)=(2*A(i,j,2))-A(i,j,1)-A(i,j,3);
end
end
end
B = A(:,:,2);
%//then i get the gray image..
level = graythresh(B);
display(level);
BW =imbinarize(B, level);
imshow(BW);
%//finally the contour..
figure;
imcontour(BW);
output jpg is given at the attachment.How to solve it.I want to get the contours containing the watermelons.
That won't work. I think that because of all the edges and different patterns and different yet similar green colors you're going to need something like convolutional neural networks.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!