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

采纳的回答

Image Analyst
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 个评论
Shruti Jha
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 CenterFile 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!

Translated by