Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: please help me
Replies: 2   Last Post: Jun 16, 2012 1:12 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
dwiyoga masbukhin

Posts: 1
Registered: 6/15/12
please help me
Posted: Jun 15, 2012 10:22 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

filename='font4.png';
I=imread(filename);

[bar,kol,z]=size(I);
if z==3
bw=im2bw(I,.5);
else
bw=I;
end
bw=~bw;

bw=bwconncomp(bw, 4);
bw=labelmatrix(bw);

stats=regionprops(bw,{'centroid','boundingbox'});

imshow(I);
title('How to count characters in an image','fontsize',14);
hold on;

for k=1:length(stats);
cent=stats(k).Centroid;
boks=stats(k).BoundingBox;
plot(cent(1),cent(2),'bo','MarkerSize',5,'MarkerFaceColor','g');
bx=[boks(1),boks(1),boks(1)+boks(3),boks(1)+boks(3),boks(1)];
by=[boks(2)+boks(4),boks(2),boks(2),boks(2)+boks(4),boks(2)+boks(4)];
line(bx,by,'color','r');
pause(.01);
end

xlabel(sprintf('There is %d characters counted',length(stats)));
hold off;


------------------------------------------------------------------------------------------------------------------------
??? Undefined function or method 'bwconncomp' for input arguments of type 'double'.

Error in ==> TA_PCD at 12
bw=bwconncomp(bw, 4);
------------------------------------------------------------------------------------------------------------------------

why the error occurred?
can you solve the problem?
thank you so much



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2013. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.