From: Tom Clune Subject: Re: image processing with RGB Date: 30 Apr 1999 00:00:00 GMT Message-ID: <7gc93d$khu$1@nnrp1.dejanews.com> References: <37288EF9.F8BEBEBF@polonium.de> <7gad22$1qb$1@nnrp1.dejanews.com> <3728D656.2262343C@polonium.de> X-Http-Proxy: 1.0 SBS1, 1.0 x2.dejanews.com:80 (Squid/1.1.22) for client 209.6.173.190 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Fri Apr 30 12:53:02 1999 GMT Newsgroups: comp.graphics.algorithms X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT) In article <3728D656.2262343C@polonium.de>, Rafal wrote: > Tom Clune wrote: > > > In article <37288EF9.F8BEBEBF@polonium.de>, > > Rafal wrote: > > > Hallo, > > > > > > I wont to use my filters on colored digital images. But all algorithms > > > which I have, are for grayed images. How can I use this algoriths for > > > colored images? > > > > > > > I don't know how other people do it, but I always convert to YUV color space, > > and only filter the Y (grayscale) data. After filtering, you can switch back > > to RGB if you like. Trying to filter color images directly can give you some > > funny artifacts in the color. > > Thanks. In my book I found only YIQ color space. Can you send me the > matrix for converting from RGB -> YUV. Or ist YUV equal to YIQ? > I'm not familiar with YIQ. But if the Y is just luminance, it should do. Here's my comment from the code I use to do the conversion. R is the red color value, G is the green color value, and B is the blue color value. All colors are 8- bit. If your color depth varies, change the 128 value accordingly. (BTW, YCbCr == YUV). /* calculate the YCbCr pixel data and copy it to m_YData, m_CbData, and m_CrData. The factors that I use to convert to luminance and chrominance are from CCIR Rec. 709: Y = 0.2125R + 0.7154G + 0.0721B; Cr = (R - Y) + 128 Cb = (B - Y) + 128 */ FWIW. --Tom Clune, MediSpectra, Inc. -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own