<?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 OpenCV to IPP in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/OpenCV-to-IPP/m-p/830368#M5500</link>
    <description>Hello bibi88, &lt;BR /&gt;&lt;BR /&gt;No sure if i understand correct, &lt;BR /&gt;&lt;BR /&gt;but if youare using thestructIplImage* pcv_Img in OpenCV( i.e OpenCV 2.1.0), then &lt;STRONG&gt;the two struct of IPL image and IPP image&lt;/STRONG&gt; is almost aligned witheach other, you don't need to any change. &lt;BR /&gt;&lt;BR /&gt;For example &lt;BR /&gt;// 3 channel image&lt;BR /&gt;IplImage* pSrcImg = cvLoadImage( "testimg.bmp", 1 );&lt;BR /&gt;int SRC_WIDTH= pSrcImg-&amp;gt;width;&lt;BR /&gt;int SRC_HEIGHT=pSrcImg-&amp;gt;height; &lt;BR /&gt;CvSize cvsrcSize={ SRC_WIDTH,SRC_HEIGHT};&lt;BR /&gt;IppiSize t_size={SRC_WIDTH, SRC_HEIGHT};&lt;BR /&gt;&lt;BR /&gt;when call ipp function (ipp image)&lt;BR /&gt;the width is same, height is same, step is same. Just please notes theimageData pointer.&lt;BR /&gt;&lt;BR /&gt;// copy the OpenCV IPL image to IPP image &lt;BR /&gt;Ipp8u *ipp_template = ippiMalloc_8u_C3( SRC_WIDTH, SRC_HEIGHT, &amp;amp;stepByte );&lt;BR /&gt;ippiCopy_8u_C3R((Ipp8u*)pSrcImg-&amp;gt;imageData, (Ipp8u) pSrcImg-&amp;gt;widthStep, ipp_template, stepByte, t_size);&lt;BR /&gt;more dicussion are in &lt;A href="http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-open-source-computer-vision-library-opencv-faq/"&gt;Intel Ipp - Open Source Computer Vision Library (OpenCV) FAQ &lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;So reviewyour code, &lt;STRONG&gt;3 commponent picture&lt;/STRONG&gt; or4 layers (RGB for example+gamma). &lt;BR /&gt;the keyproblem is the storage format. &lt;BR /&gt;is it &lt;BR /&gt;RGBRGBRGBRGB...&lt;BR /&gt;or &lt;BR /&gt;RRRRRRR&lt;BR /&gt;GGGGGGG&lt;BR /&gt;BBBBBBB ? &lt;BR /&gt;&lt;BR /&gt;If it is former, then the stucture is alignment naturally as above sample. The convertion is not needed. &lt;BR /&gt;&lt;BR /&gt;If it is latter, &lt;BR /&gt;first the memory allocation is not needed&lt;BR /&gt;pipp_Img-&amp;gt;data[0] = ippiMalloc_8u_C1(pcv_Img-&amp;gt;width, pcv_Img-&amp;gt;height, &amp;amp;(pipp_Img-&amp;gt;stepWidth[0]));&lt;BR /&gt;pipp_Img-&amp;gt;data[1] = ippiMalloc_8u_C1(pcv_Img-&amp;gt;width, pcv_Img-&amp;gt;height, &amp;amp;(pipp_Img-&amp;gt;stepWidth[1]));&lt;BR /&gt;pipp_Img-&amp;gt;data[2] = ippiMalloc_8u_C1(pcv_Img-&amp;gt;width, pcv_Img-&amp;gt;height, &amp;amp;(pipp_Img-&amp;gt;stepWidth[2]));&lt;BR /&gt;&lt;BR /&gt;It is ok to use the memory from pcv_Image. &lt;BR /&gt;But second question, &lt;STRONG&gt;are you sure the R frame and G frame and B frame are stored in IPL like the below?&lt;/STRONG&gt; (could you show how*version_version_datadefined based onpcv_Img?) &lt;BR /&gt;pipp_Img-&amp;gt;data[0] = (Ipp8u *) &amp;amp;pcv_Img-&amp;gt;imageData[0];&lt;BR /&gt;pipp_Img-&amp;gt;data[1] = (Ipp8u *) &amp;amp;pcv_Img-&amp;gt;imageData[pcv_Img-&amp;gt;width*pcv_Img-&amp;gt;height];&lt;BR /&gt;pipp_Img-&amp;gt;data[2] = (Ipp8u *) &amp;amp;pcv_Img-&amp;gt;imageData[2*pcv_Img-&amp;gt;width*pcv_Img-&amp;gt;height];&lt;BR /&gt;&lt;BR /&gt;According to your code&lt;BR /&gt;int i,j,k;&lt;BR /&gt; for (k=0;k&amp;lt;3;k++)&lt;BR /&gt; {&lt;BR /&gt; for (i=0;i&lt;PIPP_IMG-&gt;height&lt;K&gt;;i++)&lt;BR /&gt; {&lt;BR /&gt; for (j=0;j&lt;PIPP_IMG-&gt;width&lt;K&gt;;j++)&lt;BR /&gt; {&lt;BR /&gt; printf("%d ",pipp_Img-&amp;gt;data&lt;K&gt;[i*pipp_Img-&amp;gt;widthStep&lt;K&gt;+j]);&lt;BR /&gt; }&lt;BR /&gt; printf("\n");&lt;BR /&gt; }&lt;BR /&gt; printf("\n \n \n");&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt;It seems &lt;BR /&gt;at least should be &lt;BR /&gt;&lt;BR /&gt;pipp_Img-&amp;gt;data[0] = (Ipp8u *) &amp;amp;pcv_Img-&amp;gt;imageData[0];&lt;BR /&gt;pipp_Img-&amp;gt;data[1] = (Ipp8u *) &amp;amp;pcv_Img-&amp;gt;imageData[pcv_Img-&amp;gt;widthStep&lt;K&gt;*pcv_Img-&amp;gt;height];&lt;BR /&gt;pipp_Img-&amp;gt;data[2] = (Ipp8u *) &amp;amp;pcv_Img-&amp;gt;imageData[2*pcv_Img-&amp;gt;widthStep&lt;K&gt;*pcv_Img-&amp;gt;height];&lt;BR /&gt;&lt;BR /&gt;Please notes the width is not widthStep &lt;BR /&gt;(awhole rowin bytes, may be 4 bytes align of 32 bytes align). &lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Ying&lt;BR /&gt;&lt;/K&gt;&lt;/K&gt;&lt;/K&gt;&lt;/K&gt;&lt;/K&gt;&lt;/PIPP_IMG-&gt;&lt;/K&gt;&lt;/PIPP_IMG-&gt;</description>
    <pubDate>Wed, 05 Jan 2011 08:56:59 GMT</pubDate>
    <dc:creator>Ying_H_Intel</dc:creator>
    <dc:date>2011-01-05T08:56:59Z</dc:date>
    <item>
      <title>OpenCV to IPP</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/OpenCV-to-IPP/m-p/830365#M5497</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I've some problem, trying to convert the linear structure of an IPL (OpenCV) image into an IPP image structure.&lt;BR /&gt;When I display the IPP matrix of the picture, it appears that it's not the expected one.&lt;BR /&gt;Here is my code:&lt;BR /&gt;&lt;BR /&gt;typedef struct IppImage_8u IppImage_8u;&lt;BR /&gt;struct IppImage_8u{&lt;BR /&gt; Ipp8u* data[4]; // 4 layers (RGB for example+gamma)&lt;BR /&gt; int width[4];&lt;BR /&gt; int height[4];&lt;BR /&gt; int stepWidth[4];&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;IplImage* pcv_Img contains an image.&lt;BR /&gt;IppImage_8u* pipp_Img is allocated (sizeof(IppImage_8u))&lt;BR /&gt;pipp_Img-&amp;gt;data[0] = NULL;&lt;BR /&gt;
pipp_Img-&amp;gt;data[1] = NULL;&lt;BR /&gt;
pipp_Img-&amp;gt;data[2] = NULL;&lt;BR /&gt;pipp_Img-&amp;gt;data[0] = ippiMalloc_8u_C1(pcv_Img-&amp;gt;width, pcv_Img-&amp;gt;height, &amp;amp;(pipp_Img-&amp;gt;stepWidth[0]));&lt;BR /&gt;pipp_Img-&amp;gt;data[1] = ippiMalloc_8u_C1(pcv_Img-&amp;gt;width, pcv_Img-&amp;gt;height, &amp;amp;(pipp_Img-&amp;gt;stepWidth[1]));&lt;BR /&gt;pipp_Img-&amp;gt;data[2] = ippiMalloc_8u_C1(pcv_Img-&amp;gt;width, pcv_Img-&amp;gt;height, &amp;amp;(pipp_Img-&amp;gt;stepWidth[2]));&lt;BR /&gt;pipp_Img-&amp;gt;data[0] = (Ipp8u *) &amp;amp;pcv_Img-&amp;gt;imageData[0];&lt;BR /&gt;pipp_Img-&amp;gt;data[1] = (Ipp8u *) &amp;amp;pcv_Img-&amp;gt;imageData[pcv_Img-&amp;gt;width*pcv_Img-&amp;gt;height];&lt;BR /&gt;pipp_Img-&amp;gt;data[2] = (Ipp8u *) &amp;amp;pcv_Img-&amp;gt;imageData[2*pcv_Img-&amp;gt;width*pcv_Img-&amp;gt;height];&lt;BR /&gt;pipp_Img-&amp;gt;width[0] = pcv_Img-&amp;gt;width;&lt;BR /&gt;pipp_Img-&amp;gt;width[1] = pcv_Img-&amp;gt;width;&lt;BR /&gt;pipp_Img-&amp;gt;width[2] = pcv_Img-&amp;gt;width;&lt;BR /&gt;pipp_Img-&amp;gt;height[0] = pcv_Img-&amp;gt;height;&lt;BR /&gt;pipp_Img-&amp;gt;height[1] = pcv_Img-&amp;gt;height;&lt;BR /&gt;pipp_Img-&amp;gt;height[2] = pcv_Img-&amp;gt;height;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Here is the displaying method that I use:&lt;BR /&gt;&lt;BR /&gt;int i,j,k;&lt;BR /&gt; for (k=0;k&amp;lt;3;k++)&lt;BR /&gt; {&lt;BR /&gt; for (i=0;i&lt;PIPP_IMG-&gt;height&lt;K&gt;;i++)&lt;BR /&gt; {&lt;BR /&gt; for (j=0;j&lt;PIPP_IMG-&gt;width&lt;K&gt;;j++)&lt;BR /&gt; {&lt;BR /&gt; printf("%d ",pipp_Img-&amp;gt;data&lt;K&gt;[i*pipp_Img-&amp;gt;widthStep&lt;K&gt;+j]);&lt;BR /&gt; }&lt;BR /&gt; printf("\\n");&lt;BR /&gt; }&lt;BR /&gt; printf("\\n \\n \\n");&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt;The displayed number doesn't correspond to what, for example, Matlab says. Could you please explain me why?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance for your help!&lt;/K&gt;&lt;/K&gt;&lt;/K&gt;&lt;/PIPP_IMG-&gt;&lt;/K&gt;&lt;/PIPP_IMG-&gt;</description>
      <pubDate>Tue, 04 Jan 2011 16:43:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/OpenCV-to-IPP/m-p/830365#M5497</guid>
      <dc:creator>bibi88</dc:creator>
      <dc:date>2011-01-04T16:43:24Z</dc:date>
    </item>
    <item>
      <title>OpenCV to IPP</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/OpenCV-to-IPP/m-p/830366#M5498</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;unfortunately I did not get the idea you show with code snippet. Why do you overwrite pipp_Img-&amp;gt;data pointers?&lt;BR /&gt;&lt;BR /&gt;pipp_Img-&amp;gt;data[0] = ippiMalloc_8u_C1(pcv_Img-&amp;gt;width, pcv_Img-&amp;gt;height, &amp;amp;(pipp_Img-&amp;gt;stepWidth[0]));&lt;BR /&gt;pipp_Img-&amp;gt;data[1] = ippiMalloc_8u_C1(pcv_Img-&amp;gt;width, pcv_Img-&amp;gt;height, &amp;amp;(pipp_Img-&amp;gt;stepWidth[1]));&lt;BR /&gt;pipp_Img-&amp;gt;data[2] = ippiMalloc_8u_C1(pcv_Img-&amp;gt;width, pcv_Img-&amp;gt;height, &amp;amp;(pipp_Img-&amp;gt;stepWidth[2]));&lt;BR /&gt;&lt;BR /&gt;// the assigments below will overwrite pipp_Img-&amp;gt;data pointers, resulting in loose of just allocated memory &lt;BR /&gt;pipp_Img-&amp;gt;data[0] = (Ipp8u *) &amp;amp;pcv_Img-&amp;gt;imageData[0];&lt;BR /&gt;pipp_Img-&amp;gt;data[1] = (Ipp8u *) &amp;amp;pcv_Img-&amp;gt;imageData[pcv_Img-&amp;gt;width*pcv_Img-&amp;gt;height];&lt;BR /&gt;pipp_Img-&amp;gt;data[2] = (Ipp8u *) &amp;amp;pcv_Img-&amp;gt;imageData[2*pcv_Img-&amp;gt;width*pcv_Img-&amp;gt;height];&lt;BR /&gt;&lt;BR /&gt;If you try to represent IplImage datawith your IppImage_8u data structure you also need to ensure you use IplImage step (aka pitch) to navigate correctlythrough IplImage pixels.&lt;BR /&gt;&lt;BR /&gt;Vladimir</description>
      <pubDate>Tue, 04 Jan 2011 21:58:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/OpenCV-to-IPP/m-p/830366#M5498</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2011-01-04T21:58:26Z</dc:date>
    </item>
    <item>
      <title>OpenCV to IPP</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/OpenCV-to-IPP/m-p/830367#M5499</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;Sorry for the misunderstanding! My problem is quite easy in fact. I've a 3 component picture in a format char* old_version_data, with height "old_version_height", width "old_version_width" and a pitch "old_version_pitch".&lt;BR /&gt;I would like to get this picture in an ippi format, so I've defined a Ipp8u* ipp_data[3], IppSize ipp_size and int ipp_pitch.&lt;BR /&gt;How can I do the translation from "old_version" to ipp?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!</description>
      <pubDate>Tue, 04 Jan 2011 23:31:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/OpenCV-to-IPP/m-p/830367#M5499</guid>
      <dc:creator>bibi88</dc:creator>
      <dc:date>2011-01-04T23:31:35Z</dc:date>
    </item>
    <item>
      <title>OpenCV to IPP</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/OpenCV-to-IPP/m-p/830368#M5500</link>
      <description>Hello bibi88, &lt;BR /&gt;&lt;BR /&gt;No sure if i understand correct, &lt;BR /&gt;&lt;BR /&gt;but if youare using thestructIplImage* pcv_Img in OpenCV( i.e OpenCV 2.1.0), then &lt;STRONG&gt;the two struct of IPL image and IPP image&lt;/STRONG&gt; is almost aligned witheach other, you don't need to any change. &lt;BR /&gt;&lt;BR /&gt;For example &lt;BR /&gt;// 3 channel image&lt;BR /&gt;IplImage* pSrcImg = cvLoadImage( "testimg.bmp", 1 );&lt;BR /&gt;int SRC_WIDTH= pSrcImg-&amp;gt;width;&lt;BR /&gt;int SRC_HEIGHT=pSrcImg-&amp;gt;height; &lt;BR /&gt;CvSize cvsrcSize={ SRC_WIDTH,SRC_HEIGHT};&lt;BR /&gt;IppiSize t_size={SRC_WIDTH, SRC_HEIGHT};&lt;BR /&gt;&lt;BR /&gt;when call ipp function (ipp image)&lt;BR /&gt;the width is same, height is same, step is same. Just please notes theimageData pointer.&lt;BR /&gt;&lt;BR /&gt;// copy the OpenCV IPL image to IPP image &lt;BR /&gt;Ipp8u *ipp_template = ippiMalloc_8u_C3( SRC_WIDTH, SRC_HEIGHT, &amp;amp;stepByte );&lt;BR /&gt;ippiCopy_8u_C3R((Ipp8u*)pSrcImg-&amp;gt;imageData, (Ipp8u) pSrcImg-&amp;gt;widthStep, ipp_template, stepByte, t_size);&lt;BR /&gt;more dicussion are in &lt;A href="http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-open-source-computer-vision-library-opencv-faq/"&gt;Intel Ipp - Open Source Computer Vision Library (OpenCV) FAQ &lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;So reviewyour code, &lt;STRONG&gt;3 commponent picture&lt;/STRONG&gt; or4 layers (RGB for example+gamma). &lt;BR /&gt;the keyproblem is the storage format. &lt;BR /&gt;is it &lt;BR /&gt;RGBRGBRGBRGB...&lt;BR /&gt;or &lt;BR /&gt;RRRRRRR&lt;BR /&gt;GGGGGGG&lt;BR /&gt;BBBBBBB ? &lt;BR /&gt;&lt;BR /&gt;If it is former, then the stucture is alignment naturally as above sample. The convertion is not needed. &lt;BR /&gt;&lt;BR /&gt;If it is latter, &lt;BR /&gt;first the memory allocation is not needed&lt;BR /&gt;pipp_Img-&amp;gt;data[0] = ippiMalloc_8u_C1(pcv_Img-&amp;gt;width, pcv_Img-&amp;gt;height, &amp;amp;(pipp_Img-&amp;gt;stepWidth[0]));&lt;BR /&gt;pipp_Img-&amp;gt;data[1] = ippiMalloc_8u_C1(pcv_Img-&amp;gt;width, pcv_Img-&amp;gt;height, &amp;amp;(pipp_Img-&amp;gt;stepWidth[1]));&lt;BR /&gt;pipp_Img-&amp;gt;data[2] = ippiMalloc_8u_C1(pcv_Img-&amp;gt;width, pcv_Img-&amp;gt;height, &amp;amp;(pipp_Img-&amp;gt;stepWidth[2]));&lt;BR /&gt;&lt;BR /&gt;It is ok to use the memory from pcv_Image. &lt;BR /&gt;But second question, &lt;STRONG&gt;are you sure the R frame and G frame and B frame are stored in IPL like the below?&lt;/STRONG&gt; (could you show how*version_version_datadefined based onpcv_Img?) &lt;BR /&gt;pipp_Img-&amp;gt;data[0] = (Ipp8u *) &amp;amp;pcv_Img-&amp;gt;imageData[0];&lt;BR /&gt;pipp_Img-&amp;gt;data[1] = (Ipp8u *) &amp;amp;pcv_Img-&amp;gt;imageData[pcv_Img-&amp;gt;width*pcv_Img-&amp;gt;height];&lt;BR /&gt;pipp_Img-&amp;gt;data[2] = (Ipp8u *) &amp;amp;pcv_Img-&amp;gt;imageData[2*pcv_Img-&amp;gt;width*pcv_Img-&amp;gt;height];&lt;BR /&gt;&lt;BR /&gt;According to your code&lt;BR /&gt;int i,j,k;&lt;BR /&gt; for (k=0;k&amp;lt;3;k++)&lt;BR /&gt; {&lt;BR /&gt; for (i=0;i&lt;PIPP_IMG-&gt;height&lt;K&gt;;i++)&lt;BR /&gt; {&lt;BR /&gt; for (j=0;j&lt;PIPP_IMG-&gt;width&lt;K&gt;;j++)&lt;BR /&gt; {&lt;BR /&gt; printf("%d ",pipp_Img-&amp;gt;data&lt;K&gt;[i*pipp_Img-&amp;gt;widthStep&lt;K&gt;+j]);&lt;BR /&gt; }&lt;BR /&gt; printf("\n");&lt;BR /&gt; }&lt;BR /&gt; printf("\n \n \n");&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt;It seems &lt;BR /&gt;at least should be &lt;BR /&gt;&lt;BR /&gt;pipp_Img-&amp;gt;data[0] = (Ipp8u *) &amp;amp;pcv_Img-&amp;gt;imageData[0];&lt;BR /&gt;pipp_Img-&amp;gt;data[1] = (Ipp8u *) &amp;amp;pcv_Img-&amp;gt;imageData[pcv_Img-&amp;gt;widthStep&lt;K&gt;*pcv_Img-&amp;gt;height];&lt;BR /&gt;pipp_Img-&amp;gt;data[2] = (Ipp8u *) &amp;amp;pcv_Img-&amp;gt;imageData[2*pcv_Img-&amp;gt;widthStep&lt;K&gt;*pcv_Img-&amp;gt;height];&lt;BR /&gt;&lt;BR /&gt;Please notes the width is not widthStep &lt;BR /&gt;(awhole rowin bytes, may be 4 bytes align of 32 bytes align). &lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Ying&lt;BR /&gt;&lt;/K&gt;&lt;/K&gt;&lt;/K&gt;&lt;/K&gt;&lt;/K&gt;&lt;/PIPP_IMG-&gt;&lt;/K&gt;&lt;/PIPP_IMG-&gt;</description>
      <pubDate>Wed, 05 Jan 2011 08:56:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/OpenCV-to-IPP/m-p/830368#M5500</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2011-01-05T08:56:59Z</dc:date>
    </item>
    <item>
      <title>OpenCV to IPP</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/OpenCV-to-IPP/m-p/830369#M5501</link>
      <description>Thank you very much, IplImage was following the interleaved format (RGB RGB RGB and not a planar RRR GGG BBB), that's why I had so many problems! Sorry for my dummy question!</description>
      <pubDate>Wed, 05 Jan 2011 12:02:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/OpenCV-to-IPP/m-p/830369#M5501</guid>
      <dc:creator>bibi88</dc:creator>
      <dc:date>2011-01-05T12:02:25Z</dc:date>
    </item>
  </channel>
</rss>

