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)
Show older comments
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) ;
0 Comments
Answers (1)
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 can read this: http://www.mathworks.com/matlabcentral/answers/13205-tutorial-how-to-format-your-question-with-markup
Also, you forgot to attach your image.
1 Comment
John D'Errico
on 12 Dec 2014
Since no image was attached, obviously there are no boats. Easy to count. :)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!