How to implement a funtion to 'Count an amount of one type of lego piece in the Image'?
20 次查看(过去 30 天)
显示 更早的评论
Sorry if it's a lot to ask but is there an easy way to implement a function that takes in the image of cluster of lego pieces and returns the count of a particular type of Lego piece? i.e. given the lego piece type shown in the first image--------->
how to implement a function that return the amount of the same type of lego pieces existed in the image below.
Thank you very much in advance!!
Baz
0 个评论
采纳的回答
Image Analyst
2015-1-19
First you have to do color segmentation to get separate, individual blocks. See my File Exchange for demos: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
Then try using imfindcircles() to count the circles in each colored brick. Here is a demo: http://www.mathworks.com/matlabcentral/fileexchange/34365-circle-finder
7 个评论
Image Analyst
2019-1-13
Well of course you can ask regionprops() for the BoundingBox, but I think you may want the Feret Diameters.
See this link: Image Processing Blog on Feret Diameters
Shruti Jha
2020-12-8
Adding on to this thread, I have a similar problem. I am able to isolate blue coloured legos, however when I perform edge detection and filling, I get something like this (the last image).
Now, I'm not sure how to fill all the others and separate out the rectangular ones. Can somebody please help?
Much appreciated!
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 MATLAB Support Package for LEGO MINDSTORMS EV3 Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!