FuzzyColor

所属分类:模式识别(视觉/语音等)
开发工具:matlab
文件大小:595KB
下载次数:192
上传日期:2007-09-28 20:10:43
上 传 者wodetianshi
说明:  一种基于模糊理论的颜色识别程序员代码. 用matlab语言编写,能够快速地识别出颜色来,而不用指定精确的RGB数值
(Based on fuzzy theory to identify the color code programmers. Matlab language used, to rapidly identify the color, rather than precise RGB values assigned)

文件列表:
FuzzyColor\.DS_Store (6148, 2006-09-20)
FuzzyColor\FuzzyColorData.mat (15622, 2006-09-20)
FuzzyColor\buildfuzzyluts.m (4198, 2006-09-20)
FuzzyColor\displaycolorpatches.m (1553, 2006-09-19)
FuzzyColor\fuzzycolor.m (4161, 2006-09-20)
FuzzyColor\monet_adresse.jpg (148268, 2006-03-24)
FuzzyColor\Demo\.DS_Store (6148, 2006-09-20)
FuzzyColor\Demo\fuzzycolor_demo.m (1619, 2006-09-20)
FuzzyColor\Demo\html\fuzzycolor_demo.html (7773, 2006-09-20)
FuzzyColor\Demo\html\fuzzycolor_demo.png (6060, 2006-09-20)
FuzzyColor\Demo\html\fuzzycolor_demo_01.png (42397, 2006-09-20)
FuzzyColor\Demo\html\fuzzycolor_demo_02.png (4940, 2006-09-20)
FuzzyColor\Demo\html\fuzzycolor_demo_03.png (6421, 2006-09-20)
FuzzyColor\Demo\html\fuzzycolor_demo_04.png (8901, 2006-09-20)
FuzzyColor\Demo\html\fuzzycolor_demo_05.png (3729, 2006-09-20)
FuzzyColor\Demo\html\fuzzycolor_demo_06.png (303070, 2006-09-20)
FuzzyColor\Demo\html\fuzzycolor_demo_07.png (70469, 2006-09-20)

{\rtf1\mac\ansicpg10000\cocoartf102 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \margl1440\margr1440\vieww10160\viewh15760\viewkind0 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\qc \f0\fs24 \cf0 FuzzyColor\ John D'Errico\ woodchips@rochester.rr.com\ 9/19/06\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx***80\tx7200\tx7920\tx8***0\ql\qnatural \cf0 \ Fuzzycolor is a tool for identifying the "color name" of any RGB intensity triad, i.e., sets of 3 color values scaled to [0,1] as matlab likes, that denote (red, green, blue) monitor drive values. (Fuzzycolor also accepts uint8 arrays.) I called it "fuzzycolor" because color names are really a fuzzy concept. A color that I see as a red may be construed as pink, or orange, or magenta to you. We all have slightly different color responses through our own visual systems. How you view a color is crucially important, since my monitor is certainly calibrated differently from your monitor. If you print an image, how the printer is set up, calibrated, and characterized are all important. The illuminant you view the print under is crucial. Finally, color has a learned aspect to it too, in that we are taught to recognize colors from an early age. Color is not trivial to characterize.\ \ For example, what color does [1, 0, 0] represent? Its clearly a red. But can you be sure about [1, 0.1, 0.1]? Is this also a red? How about [1, 0.7, 0.7]? Its easy to test\ which of these is flagged as a red.\ \ >> fuzzycolor([1 0 0],'red')\ ans =\ 1\ \ >> fuzzycolor([1 .1 .1],'red')\ ans =\ 1\ \ >> fuzzycolor([1 .3 .3],'red')\ ans =\ 0.49\ \ >> fuzzycolor([1 .7 .7],'red')\ ans =\ 0\ \ Eventually, as we move along this path, 'red' turns into another color name, call it 'pink'. Exactly where this happens is a matter of opinion. In fact there will be some region where fuzzycolor will return an intermediate value. This is where the name fuzzycolor comes from. This is the problem with color names. They do indeed represent somewhat fuzzy sets in color space.\ \ See what happens with a large set of pixels of random color. The function displaycolorpatches will display them for you.\ \ >> Cp = sortrows(rand(100000,3));\ >> displaycolorpatches(Cp)\ \ Which of those random colors are red?\ \ >> figure\ >> isc = fuzzycolor(Cp,'red');\ >> displaycolorpatches(Cp(isc>0.999,:))\ \ And, which ones are fleshtones?\ \ >> isc = fuzzycolor(Cp,'flesh');\ >> figure\ >> displaycolorpatches(Cp(isc>0.999,:))\ \ Note that some colors may belong to more than one color name set. If you call fuzzycolor with only one argument, it tests each color against all the color names in its database. Any color is believed to have a given color name gets a 1 in the appropriate column. If its close, then fuzzycolor returns a number between 0 and 1.\ \ >> isc = fuzzycolor(Cp);\ >> k = find(sum(isc>0,2)>1);\ >> length(k)\ ans =\ 1041\ \ Here there were 1041 colors which had two or more color names potentially attached to them. Some were flesh tones, which are also dark, muddy reds. Some were both green and yellow, etc.\ \ The current set of color names I've put into my database is 'red, 'green', 'blue', 'neutral', 'pastel', 'yellow', 'flesh', 'cyan', 'magenta' 'black', 'white', 'purple', 'brown'. I'll hope to expand that set with time, and refine my lookup tables to define those sets more accurately. The current table in my database are decent, but clearly have some flaws near the edges. Other users may find that the set of colors they feel should lie in a given color name region is different form what I chose. I can't make everybody happy.\ \ Anyway, have fun. You may choose to refine the lookup tables in FuzzyColorData yourself. I left the function buildfuzzyluts in this directory just in case anybody wants to try it.\ \ }

近期下载者

相关文件


收藏者