Info

This question is closed. Reopen it to edit or answer.

Could you please help me to count the number of boats on this picture ?

1 view (last 30 days)
img = imread('C:\Users\TOSHIBA1\Desktop\Ry.jpg') ;
thresh_range = 15 ;
thresh_noBlack = 70 ;
thresh_noWhite = 200 ;
rgb_mean = mean(img, 3) ;
rgb_range = range(img, 3) ;
id = rgb_range < thresh_range & ...
rgb_mean > thresh_noBlack & ...
rgb_mean < thresh_noWhite ;
r = img(:,:,1) ; g = img(:,:,2) ; b = img(:,:,3) ;
r(id) = 0 ; g(id) = 0 ; b(id) = 255 ;
img_windshields = cat(3, r, g, b) ;
subplot(2, 1, 1) ;
imshow(img) ;
subplot(2, 1, 2) ;
imshow(img_windshields) ;

Answers (1)

Image Analyst
Image Analyst on 11 Dec 2014
Edited: Image Analyst on 11 Dec 2014
My Image Segmentation Tutorial will show you how to measure objects in an image and count them and find other measurements. http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
Also, you forgot to attach your image.

Community Treasure Hunt

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

Start Hunting!