topic This is a short follow up in Intel® Integrated Performance Primitives
https://community.intel.com/t5/Intel-Integrated-Performance/RGBToGray/m-p/957523#M19253
This is a short follow up with some technical details.
>>A very famous equation
>>
>>Y = 0.299 * R + 0.587 * G + 0.114 * B
>>
>>is used to do this conversion RGB to Grey. However, you need to verify that it doesn't do something like:
>>
>>Y = 0.299 * B + 0.587 * G + 0.114 * R
Let's say R=64, G=128, B=192, then
<STRONG>Case 1</STRONG>
Y = 0.299 * R + 0.587 * G + 0.114 * B
Y = 0.299 * 64 + 0.587 * 128 + 0.114 * 192 = <STRONG>116.16</STRONG>
<STRONG>Case 2</STRONG>
Y = 0.299 * B + 0.587 * G + 0.114 * R
Y = 0.299 * 192 + 0.587 * 128 + 0.114 * 64 = <STRONG>139.84</STRONG>
Intensity of a grey image is Not the same, as you can see. In some applications, like X-Ray imaging or MRI, incorect conversions are Not allowed.Wed, 22 May 2013 14:30:00 GMTSKost2013-05-22T14:30:00ZRGBToGray
https://community.intel.com/t5/Intel-Integrated-Performance/RGBToGray/m-p/957517#M19247
<P>I'm a little confused. The function RGBToGray will work for BGR format too? Or I have to do the conversion before? Thank you very much.</P>Fri, 10 May 2013 14:53:39 GMThttps://community.intel.com/t5/Intel-Integrated-Performance/RGBToGray/m-p/957517#M19247Paulo_César_B_2013-05-10T14:53:39ZIf there's a version with
https://community.intel.com/t5/Intel-Integrated-Performance/RGBToGray/m-p/957518#M19248
<P>If there's a version with planar input, then yes you could and just swap the R and B planes</P>Fri, 10 May 2013 15:23:07 GMThttps://community.intel.com/t5/Intel-Integrated-Performance/RGBToGray/m-p/957518#M19248andy4us2013-05-10T15:23:07ZI don't understand ... A tell
https://community.intel.com/t5/Intel-Integrated-Performance/RGBToGray/m-p/957519#M19249
I don't understand ... A tell about calc... I can't use BGR24 directly? First I need swap or IPP will work with BGR24 too?
T don't know how IPP convert to gray.
Thanks.Fri, 10 May 2013 15:49:54 GMThttps://community.intel.com/t5/Intel-Integrated-Performance/RGBToGray/m-p/957519#M19249Paulo_César_B_2013-05-10T15:49:54ZThank you very much! So, here
https://community.intel.com/t5/Intel-Integrated-Performance/RGBToGray/m-p/957520#M19250
Thank you very much! So, here worked fine with BGR format too =]Fri, 10 May 2013 18:52:05 GMThttps://community.intel.com/t5/Intel-Integrated-Performance/RGBToGray/m-p/957520#M19250Paulo_César_B_2013-05-10T18:52:05ZPlease use full names for IPP
https://community.intel.com/t5/Intel-Integrated-Performance/RGBToGray/m-p/957521#M19251
Please use <STRONG>full names</STRONG> for IPP functions when you're describing a problem or asking a question. Thanks in advance.
<STRONG>Note:</STRONG> Actually this is a discussion about a set of IPP functions <STRONG>ippiRGBToGray_xx_xxxxx</STRONG>.
>>... So, here worked fine with BGR format too...
A very famous equation
<STRONG>Y</STRONG> = 0.299 * <STRONG>R</STRONG> + 0.587 * <STRONG>G</STRONG> + 0.114 * <STRONG>B</STRONG>
is used to do this conversion RGB to Gray. However, you need to verify that it doesn't do something like:
<STRONG>Y</STRONG> = 0.299 * <STRONG>B</STRONG> + 0.587 * <STRONG>G</STRONG> + 0.114 * <STRONG>R</STRONG>
I'm Not sure that it does not.Sun, 12 May 2013 04:42:24 GMThttps://community.intel.com/t5/Intel-Integrated-Performance/RGBToGray/m-p/957521#M19251SKost2013-05-12T04:42:24ZIf Sergey are right and you
https://community.intel.com/t5/Intel-Integrated-Performance/RGBToGray/m-p/957522#M19252
<P>If Sergey are right and you see wrong coefficients for B & R - use another function, please:</P>
<P>/* /////////////////////////////////////////////////////////////////////////////<BR />// Name: ippiColorToGray<BR />// Purpose: Converts an RGB image to gray scale (custom coefficients)<BR />// Parameters:<BR />// pSrc Pointer to the source image , points to point(0,0)<BR />// pDst Pointer to the destination image , points to point(0,0)<BR />// roiSize Size of the ROI in pixels. Since the function performs point<BR />// operations (without a border), the ROI may be the whole image.<BR />// srcStep Step in bytes through the source image to jump on the next line<BR />// dstStep Step in bytes through the destination image to jump on the next line<BR />// coeffs[3] User-defined vector of coefficients.<BR />// The sum of the coefficients should be less than or equal to 1<BR />// Returns:<BR />// ippStsNullPtrErr pSrc == NULL, or pDst == NULL<BR />// ippStsSizeErr roiSize has a field with zero or negative value<BR />// ippStsNoErr No errors<BR />//<BR />// The following equation is used to convert an RGB image to gray scale:<BR />//<BR />// Y = coeffs[0] * R + coeffs[1] * G + coeffs[2] * B;<BR />//<BR />//<BR />*/</P>
<P>just swap coefficients from the formula above.</P>
<P>Regards, Igor</P>Tue, 14 May 2013 12:13:24 GMThttps://community.intel.com/t5/Intel-Integrated-Performance/RGBToGray/m-p/957522#M19252Igor_A_Intel2013-05-14T12:13:24ZThis is a short follow up
https://community.intel.com/t5/Intel-Integrated-Performance/RGBToGray/m-p/957523#M19253
This is a short follow up with some technical details.
>>A very famous equation
>>
>>Y = 0.299 * R + 0.587 * G + 0.114 * B
>>
>>is used to do this conversion RGB to Grey. However, you need to verify that it doesn't do something like:
>>
>>Y = 0.299 * B + 0.587 * G + 0.114 * R
Let's say R=64, G=128, B=192, then
<STRONG>Case 1</STRONG>
Y = 0.299 * R + 0.587 * G + 0.114 * B
Y = 0.299 * 64 + 0.587 * 128 + 0.114 * 192 = <STRONG>116.16</STRONG>
<STRONG>Case 2</STRONG>
Y = 0.299 * B + 0.587 * G + 0.114 * R
Y = 0.299 * 192 + 0.587 * 128 + 0.114 * 64 = <STRONG>139.84</STRONG>
Intensity of a grey image is Not the same, as you can see. In some applications, like X-Ray imaging or MRI, incorect conversions are Not allowed.Wed, 22 May 2013 14:30:00 GMThttps://community.intel.com/t5/Intel-Integrated-Performance/RGBToGray/m-p/957523#M19253SKost2013-05-22T14:30:00Z