Step 7: The Code





B = bwboundaries(img2);
text(10,10,strcat('\color{green}Objects Found:',num2str(length(B))))
hold on

for k = 1:length(B)
boundary = B{k};
plot(boundary(:,2), boundary(:,1), 'g', 'LineWidth', 0.2)

<p>thank you </p>
Hello!<br>How can i take one frame or image from live streaming video to process it?
<p>hy guys</p><p>i need some help</p><p>i have an image of a scanned txt and i want to do kmean clustering....into 3 clusters of background, upground and dity areas...</p>
<p>thnx buddy</p>
<p>thnx buddy</p>
<p>Thanks you :)</p>
thank you.. a great help for me.. :) .. i only found this easy toturial to do that task after searching .. God bless u dear
good job.. <br>my question: how about vehicle...? how to counting vehicle? <br>here the picture: http://postimg.org/image/m1u3jyqlp/
NIce work done. Like this can u tell how to detect objects in an image and find their locations. It will be very useful.
It is possible that the objects appear overlapped in image. Is it still possible to count their numbers?
My girlfriend had to do something like this for a class using Matlab. Too bad she didn't read this first!
thx bro
nice work
Aditya bhai this is slick......... I am loving it great work
Great work, I think everyone should learn the basics like this! You could also use the watershed filter to pick our objects not so clearly defined. It could be useful to show something like that as an next step for people who want to try it with any blob structures that may touch.
maybe im planning 2 fill those up in my next instructable. Thanx anyway!!
When I first looked at that first image, I thought it looked familiar but I couldn't place it. When I closed out of the browser twenty minutes later, i realized that my desktop has that as the background. That's basically my life for you.
Ya, i could'nt think of anything when i have that on my desktop.
Matlab rules. Nice one.
More people need to know this stuff!

About This Instructable


53 favorites


Bio: Oh, hi there! My name is Aditya Reddy. I am an Electronics Engineer, Software developer and a tech-blogger. You can see more of my works ... More »
More by adityareddy: Image Processing and Counting using MATLAB
Add instructable to: