how to recognize three different colors and when one is recognised to do an action

2 次查看(过去 30 天)
hello everyone this is my first question and i am new to this "forum" so don't be mad if this question was asked earlier.
Is it possible to recognize 3 different colors (red,green,yellow) I am doing an project "traffic lights" and i need to write a program in matlab which recognizes 3 different colors red green and yellow and when the recognized color is green i would do action number 1 ,if it is yellow i would do action number 2 ....
It should be like this: a robot is moving and when seeing an object he turns web-cam on and now i have to determinate which color i see if it is r/g/y.
So my question is if i identify a color lets say it is green How can i say do action number 1.How to fuse the results of an image with code.
like switch: case1:green case2:yellow case3:red..
any ideas how this can be done
thank you very much for every help

采纳的回答

Image Analyst
Image Analyst 2011-11-21
See my color segmentation demos for several ways to do color detection and location: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Segmentation and Analysis 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by