matlab - How to count the number of detected objects in the image? -


i want develop application can count number of objects in image. it's not important know shape of objects. need information of how many objects in image.

and want able implement many images. possible? how that?

here code:

    a=citra1;       a_citra_keabuan = rgb2gray(a);     threshold = graythresh(a_citra_keabuan);     a_bww = im2bw(a_citra_keabuan,threshold);     a_bw = bwareaopen(a_bww,30);     se = strel('disk',2);     a_bw = imclose(a_bw,se);     a_bw=~a_bww;     [labeled,numobjects]=bwlabel(a_bw); 

the numobjects shows number of detected objects in images.

here sample of images

images1

images2

to start off can flood images in different colors , thereafter detect how many colors left. take point, fill neighbors same color if condition satisfied. should leave picture big fields (the before objects if conditions right). these can counted then.

here's hint on how that: http://blogs.mathworks.com/steve/2008/02/25/neighbor-indexing-2/


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -