![screenshot.jpg](https://www.mathworks.com/matlabcentral/mlc-downloads/downloads/submissions/28512/versions/3/screenshot.jpg)
How do I detect colored objects in a picture?
11 次查看(过去 30 天)
显示 更早的评论
Hello,
I'd like your help with sample code to be able to find these the yellow Lego pieces in the doll house,
The idea is that I take a picture and the code finds all the blocks. The picture shows only 2 blocks, but there could be more, and different colors, but I'm only interested in the yellow ones. I'd like to be able to find the blocks and outline green all the yellow blocks and red the rest of the blocks, and find their position in the frame.
Thanks in advance for your help!
Attached is a sample picture![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/270756/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/270756/image.jpeg)
0 个评论
采纳的回答
Image Analyst
2020-2-10
Use the Color Threshold on the Apps tab of the tool ribbon. Use hsv color space and adjust the hue angle with the sliders, then Export the function that you can then use in your program.
Also, check out my File Exchange for color segmentation demos. I have one (this one) where I find yellow.
![screenshot.jpg](https://www.mathworks.com/matlabcentral/mlc-downloads/downloads/submissions/28512/versions/3/screenshot.jpg)
0 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Multicore Processor Targets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!