<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Hello, in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/RGB-to-HSV-Issue/m-p/925379#M16141</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;It seems that I am an idiot :)&lt;/P&gt;
&lt;P&gt;I have looked into this and the results are correct.&amp;nbsp; I re-read the documentation and noticed "The computed H,S,V values are scaled to the full range of the destination data type".&lt;/P&gt;
&lt;P&gt;So When I was using color dropper in GIMP, the HSV values for the first pixels are 240,100,100 (GIMP rounds to nearest ingeter).&amp;nbsp; The Hue is 240 degrees in color wheel so the ratio is 240/360=0.666666667, the S=100 and V=100&amp;nbsp; are 100%.&amp;nbsp; The values that IPP returns (170,255,254) are values related to the "MAX of the data type my Image is using", which is 255, so the Hue is 170 (170/255)=0.6666666667, 255/255 = 1 (100%) and 254/255 = 0.996.&amp;nbsp; So everything works as advertised it seems...I just didn't know how to interpret the return values :)&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;Alessandro Ferrucci&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Apr 2013 17:58:02 GMT</pubDate>
    <dc:creator>alessandroferrucci</dc:creator>
    <dc:date>2013-04-09T17:58:02Z</dc:date>
    <item>
      <title>RGB to HSV Issue</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/RGB-to-HSV-Issue/m-p/925376#M16138</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I'm using IPP 6.1.2.041.&lt;BR /&gt;&lt;BR /&gt;I need to convert RGB image to HSV color model.&amp;nbsp; I have a simple 2 pixel image to test, first pixel is RGB 0,0,254 (near pure blue), second pixel is&lt;BR /&gt;&lt;BR /&gt;0,255,1 (near pure green).&lt;BR /&gt;&lt;BR /&gt;First Pixel in HSV should be 240,100,100, but IPP sets first pixel components to 170,255,254.&lt;BR /&gt;&lt;BR /&gt;Here is code for the simple test program I wrote (ReadImageJPEGHighLevel basically just calls ReadImageJPEG in jpeg.cpp that is included with IPP decoder package).&lt;BR /&gt;&lt;BR /&gt;1) First is the JPEG reading method:&lt;BR /&gt;&lt;BR /&gt;[cpp]JERRCODE ReadImageJPEGHighLevel ( CIppImage&amp;amp; image, std::string fileName ){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; JERRCODE jerr;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; image.Color(JC_UNKNOWN);&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CStdFileInput in;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; UIC::BaseStream::TStatus status;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; status = in.Open(fileName.c_str());&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PARAMS_JPEG m_param_jpeg;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_param_jpeg.nthreads&amp;nbsp; = 2;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_param_jpeg.dct_scale = JD_1_1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_param_jpeg.use_qdct&amp;nbsp; = 1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; jerr = ReadImageJPEG(in, m_param_jpeg, image);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; in.Close();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return jerr;&lt;BR /&gt;}[/cpp]&lt;BR /&gt;&lt;BR /&gt;2: Here is the sample test program that performs conversion:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;[cpp]string fileName= "C:\\bluegreen.jpg";&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;JERRCODE jerr;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;CIppImage imageRGB;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;CIppImage imageHSV;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;cout &amp;lt;&amp;lt; "filename: " &amp;lt;&amp;lt; fileName &amp;lt;&amp;lt; endl;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;jerr=ReadImageJPEGHighLevel ( imageRGB, fileName );&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if(jerr!=JPEG_OK){&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;cerr &amp;lt;&amp;lt; "read image failed"&amp;lt;&amp;lt;endl;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}else{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;cout &amp;lt;&amp;lt; "read image success"&amp;lt;&amp;lt;endl;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CIppImage imageHSV( imageRGB.Width(), imageRGB.Height(), imageRGB.NChannels(), imageRGB.Precision() );&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;IppStatus hsvConversionStatus = ippiRGBToHSV_8u_C3R( imageRGB.DataPtr(), imageRGB.Step(), imageHSV.DataPtr(), imageHSV.Step(), imageHSV.Size() );&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if( hsvConversionStatus == ippStsNoErr ){&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Ipp8u* colorDataRGB = imageRGB.DataPtr();&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Ipp8u* colorDataHSV = imageHSV.DataPtr();&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;cout &amp;lt;&amp;lt; "RGB(0,0) = " &amp;lt;&amp;lt; (int)colorDataRGB[0] &amp;lt;&amp;lt; "," &amp;lt;&amp;lt; (int)colorDataRGB[1] &amp;lt;&amp;lt; "," &amp;lt;&amp;lt; (int)colorDataRGB[2] &amp;lt;&amp;lt; endl;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;cout &amp;lt;&amp;lt; "HSV(0,0) = " &amp;lt;&amp;lt; (int)colorDataHSV[0] &amp;lt;&amp;lt;","&amp;lt;&amp;lt;(int)colorDataHSV[1]&amp;lt;&amp;lt;","&amp;lt;&amp;lt;(int)colorDataHSV[2]&amp;lt;&amp;lt;endl;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}else{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; cout &amp;lt;&amp;lt; "RGB-&amp;gt;HSV Conversion error"&amp;lt;&amp;lt;endl;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;imageRGB.Free();&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;imageHSV.Free();[/cpp]&lt;/P&gt;
&lt;P&gt;I have included sample JPG in post.&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;BR /&gt;Alessandro Ferrucci&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2013 15:46:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/RGB-to-HSV-Issue/m-p/925376#M16138</guid>
      <dc:creator>alessandroferrucci</dc:creator>
      <dc:date>2013-04-09T15:46:43Z</dc:date>
    </item>
    <item>
      <title>Alessandro, I don't see the</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/RGB-to-HSV-Issue/m-p/925377#M16139</link>
      <description>&lt;P&gt;Alessandro, I don't see the JPG in this thread.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2013 16:56:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/RGB-to-HSV-Issue/m-p/925377#M16139</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2013-04-09T16:56:18Z</dc:date>
    </item>
    <item>
      <title>I have included the JPG now,</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/RGB-to-HSV-Issue/m-p/925378#M16140</link>
      <description>&lt;P&gt;I have included the JPG now, sorry about that.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2013 17:09:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/RGB-to-HSV-Issue/m-p/925378#M16140</guid>
      <dc:creator>alessandroferrucci</dc:creator>
      <dc:date>2013-04-09T17:09:48Z</dc:date>
    </item>
    <item>
      <title>Hello,</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/RGB-to-HSV-Issue/m-p/925379#M16141</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;It seems that I am an idiot :)&lt;/P&gt;
&lt;P&gt;I have looked into this and the results are correct.&amp;nbsp; I re-read the documentation and noticed "The computed H,S,V values are scaled to the full range of the destination data type".&lt;/P&gt;
&lt;P&gt;So When I was using color dropper in GIMP, the HSV values for the first pixels are 240,100,100 (GIMP rounds to nearest ingeter).&amp;nbsp; The Hue is 240 degrees in color wheel so the ratio is 240/360=0.666666667, the S=100 and V=100&amp;nbsp; are 100%.&amp;nbsp; The values that IPP returns (170,255,254) are values related to the "MAX of the data type my Image is using", which is 255, so the Hue is 170 (170/255)=0.6666666667, 255/255 = 1 (100%) and 254/255 = 0.996.&amp;nbsp; So everything works as advertised it seems...I just didn't know how to interpret the return values :)&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;Alessandro Ferrucci&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2013 17:58:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/RGB-to-HSV-Issue/m-p/925379#M16141</guid>
      <dc:creator>alessandroferrucci</dc:creator>
      <dc:date>2013-04-09T17:58:02Z</dc:date>
    </item>
  </channel>
</rss>

