Counting coins in an image...
Show older comments
Hello
I tried below code for counting coins in an image. and it's work...
..........................
function p = CountCoins(i)
subplot(2,2,1);
imshow(i);
subplot(2,2,2);
t=im2bw(i);
imshow(t);
subplot(2,2,3);
imhist(i);
subplot(2,2,4);
x=zeros(size(i));
x(i>110)=1;
imshow(x);
c=bwconncomp(x);
p=c.NumObjects;
end
.................
But i need to do it without using 'bwconncomp()' function. please lead me... Thank You
1 Comment
Amith Kamath
on 17 Jan 2013
Edited: Image Analyst
on 17 Jan 2013
Is this so that you don't use the Image Processing Toolbox, or is it just to avoid that particular function? If it's the latter, I would guess that you can use bwlabel() as well.
Accepted Answer
More Answers (0)
Categories
Find more on Region and Image Properties in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!