<?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 Re: Universal pyramid help in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/Universal-pyramid-help/m-p/899703#M12608</link>
    <description>&lt;FONT face="Verdana" size="3"&gt;Hi, &lt;BR /&gt;&lt;BR /&gt;I'm new to IPP and I want to implement Gaussian-Laplacian Pyramid decomposition/reconstruction. So I use the code here and make some revision to build a Gaussian pyramid and a Laplacian pyramid. I expect to get an identical image of the original after reconstruction, but the image I get is &lt;BR /&gt;quite diffrent. &lt;BR /&gt;&lt;BR /&gt;I try to use ippiPyrDown_Gauss5x5_32f_C1R/ippiPyrUp_Gauss5x5_32f_C1R and ippiPyrDown_Gauss5x5_8u_C1R/ippiPyrUp_Gauss5x5_8u_C1R instead to build the pyramids from 32-bit float image and 8-bit unsigned image respectively, but the results are almost the same.&lt;BR /&gt;&lt;BR /&gt;I'm wondering if there something wrong with the approach I get the Laplacian image, or this problem is due to the precision loss in the computation. &lt;BR /&gt;&lt;BR /&gt;Please look through the following code to find the reason for me. &lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;******************************************************************************************************&lt;BR /&gt;&lt;BR /&gt;#include "cv.h"&lt;BR /&gt;#include "highgui.h"&lt;BR /&gt;#include "ipp.h"&lt;BR /&gt;&lt;BR /&gt;#pragma comment( lib, "cv.lib")&lt;BR /&gt;#pragma comment( lib, "cxcore.lib")&lt;BR /&gt;#pragma comment( lib, "highgui.lib")&lt;BR /&gt;&lt;BR /&gt;#pragma comment( lib, "ippcore.lib")&lt;BR /&gt;#pragma comment( lib, "ippcv.lib")&lt;BR /&gt;#pragma comment( lib, "ippi.lib")&lt;BR /&gt;#pragma comment( lib, "ipps.lib")&lt;BR /&gt;&lt;BR /&gt;void ShowImage(IppiSize size, Ipp32f *image, int width_step)&lt;BR /&gt;{ &lt;BR /&gt; static count = 0;&lt;BR /&gt; char title[256]; &lt;BR /&gt; CvMat tmp; &lt;BR /&gt; cvInitMatHeader( &amp;amp;tmp, size.height, size.width, CV_32F, image, width_step ); &lt;BR /&gt; sprintf(title, "image #%d", count++); &lt;BR /&gt; cvNamedWindow( title, 1 ); &lt;BR /&gt; cvShowImage( title, &amp;amp;tmp ); &lt;BR /&gt; cvWaitKey(0); &lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;int main(int argc, char *argv[])&lt;BR /&gt;{&lt;BR /&gt; IplImage* src = cvLoadImage( "lena.jpg", 0 );&lt;BR /&gt; IplImage* srcf = cvCreateImage( cvGetSize(src), IPL_DEPTH_32F, 1 );&lt;BR /&gt; cvConvertScale( src, srcf, 1./255 );&lt;BR /&gt;&lt;BR /&gt; IppStatus resultStats;&lt;BR /&gt; Ipp32f* pSrc = (Ipp32f*)srcf-&amp;gt;imageData;&lt;BR /&gt; int srcStep = srcf-&amp;gt;widthStep;&lt;BR /&gt; IppiSize srcRoi = { srcf-&amp;gt;width, srcf-&amp;gt;height };&lt;BR /&gt; const int kerSize = 7;&lt;BR /&gt; Ipp32f pKernel[kerSize];&lt;BR /&gt; CvMat _kernel = cvMat( 1, kerSize, CV_32F, pKernel );&lt;BR /&gt; CvSepFilter::init_gaussian_kernel( &amp;amp;_kernel, 1.5 );&lt;BR /&gt; &lt;BR /&gt; IppiPyramid *gPyr; // pointer to Gaussian down pyramid structure &lt;BR /&gt; IppiPyramid *lPyr; // pointer to Laplacian pyramid structure&lt;BR /&gt;&lt;BR /&gt; // allocate pyramid structures&lt;BR /&gt; Ipp32f rate = 2;&lt;BR /&gt; int layers = 3;&lt;BR /&gt; ippiPyramidInitAlloc (&amp;amp;gPyr, layers, srcRoi, rate);&lt;BR /&gt; ippiPyramidInitAlloc (&amp;amp;lPyr, layers, srcRoi, rate);&lt;BR /&gt;&lt;BR /&gt; IppiPyramidDownState_32f_C1R **gState = (IppiPyramidDownState_32f_C1R**)&amp;amp;(gPyr-&amp;gt;pState);&lt;BR /&gt; IppiPyramidUpState_32f_C1R **lState = (IppiPyramidUpState_32f_C1R**)&amp;amp;(lPyr-&amp;gt;pState);&lt;BR /&gt;&lt;BR /&gt; Ipp32f **gImage = (Ipp32f**)(gPyr-&amp;gt;pImage);&lt;BR /&gt; IppiSize *pRoi = gPyr-&amp;gt;pRoi;&lt;BR /&gt; in
t *gStep = gPyr-&amp;gt;pStep;&lt;BR /&gt; int level = gPyr-&amp;gt;level;&lt;BR /&gt;&lt;BR /&gt; Ipp32f **lImage = (Ipp32f**)(lPyr-&amp;gt;pImage);&lt;BR /&gt; int *lStep = lPyr-&amp;gt;pStep;&lt;BR /&gt; &lt;BR /&gt; // allocate structures to calculate pyramid layers&lt;BR /&gt; int mode = IPPI_INTER_LINEAR;&lt;BR /&gt;&lt;BR /&gt; ippiPyramidLayerDownInitAlloc_32f_C1R(gState, srcRoi, rate, pKernel, kerSize, mode);&lt;BR /&gt; ippiPyramidLayerUpInitAlloc_32f_C1R(lState, srcRoi, rate, pKernel, kerSize, mode);&lt;BR /&gt;&lt;BR /&gt; // build Gaussian pyramid with level+1 layers&lt;BR /&gt; gImage[0] = pSrc;&lt;BR /&gt; gStep[0] = srcStep;&lt;BR /&gt; &lt;BR /&gt; int i = 0, nStep;&lt;BR /&gt; Ipp32f *ptr = ippiMalloc_32f_C1(srcRoi.width, srcRoi.height, &amp;amp;nStep);&lt;BR /&gt;&lt;BR /&gt; ShowImage(pRoi&lt;I&gt;, gImage&lt;I&gt;, gStep&lt;I&gt;);&lt;BR /&gt; for (i=1; i&amp;lt;=level; i++) &lt;BR /&gt; {&lt;BR /&gt; gImage&lt;I&gt; = ippiMalloc_32f_C1(pRoi&lt;I&gt;.width, pRoi&lt;I&gt;.height, gStep+i); &lt;BR /&gt;  resultStats = ippiPyramidLayerDown_32f_C1R(gImage[i-1], gStep[i-1], pRoi[i-1],&lt;BR /&gt; gImage&lt;I&gt;, gStep&lt;I&gt;, pRoi&lt;I&gt;, *gState);&lt;BR /&gt;  ShowImage(pRoi&lt;I&gt;, gImage&lt;I&gt;, gStep&lt;I&gt;);&lt;BR /&gt;&lt;BR /&gt;  lImage[i-1] = ippiMalloc_32f_C1(pRoi[i-1].width, pRoi[i-1].height, lStep+i-1);&lt;BR /&gt;  resultStats = ippiPyramidLayerUp_32f_C1R(gImage&lt;I&gt;, gStep&lt;I&gt;, pRoi&lt;I&gt;, &lt;BR /&gt;   ptr, nStep, pRoi[i-1], *lState);&lt;BR /&gt;  // build Laplacian pyramid &lt;BR /&gt;  ippiSub_32f_C1R(gImage[i-1], gStep[i-1], &lt;BR /&gt;   ptr, nStep, lImage[i-1], lStep[i-1], pRoi[i-1]);&lt;BR /&gt; ShowImage(pRoi[i-1], lImage[i-1], lStep[i-1]);&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; // reconstruction&lt;BR /&gt; for (i=level; i&amp;gt;0; i--)&lt;BR /&gt; {&lt;BR /&gt; resultStats = ippiPyramidLayerUp_32f_C1R(gImage&lt;I&gt;, gStep&lt;I&gt;, pRoi&lt;I&gt;, &lt;BR /&gt;   ptr, nStep, pRoi[i-1], *lState);&lt;BR /&gt;  ShowImage(pRoi[i-1], ptr, nStep);&lt;BR /&gt;  ippiAdd_32f_C1R(ptr, nStep, lImage[i-1], lStep[i-1], gImage[i-1], gStep[i-1], pRoi[i-1]);&lt;BR /&gt;  ShowImage(pRoi[i-1], gImage[i-1], gStep[i-1]); &lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; ippiFree(ptr);&lt;BR /&gt;&lt;BR /&gt; ippiPyramidLayerDownFree_32f_C1R(*gState); &lt;BR /&gt; ippiPyramidLayerUpFree_32f_C1R(*lState);&lt;BR /&gt;&lt;BR /&gt; for (i=1; i&amp;lt;=level; i++)&lt;BR /&gt; {&lt;BR /&gt; ippiFree(gImage&lt;I&gt;);&lt;BR /&gt;   ippiFree(lImage[i-1]);&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; ippiPyramidFree (gPyr);&lt;BR /&gt; ippiPyramidFree (lPyr);&lt;BR /&gt;&lt;BR /&gt; return 0;&lt;BR /&gt;}&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/FONT&gt;</description>
    <pubDate>Fri, 21 Mar 2008 12:33:12 GMT</pubDate>
    <dc:creator>mingzhong_yu</dc:creator>
    <dc:date>2008-03-21T12:33:12Z</dc:date>
    <item>
      <title>Universal pyramid help</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Universal-pyramid-help/m-p/899701#M12606</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I am trying to use the Universal pyramid functions to decompose and reconstruct a Gaussian as well as Laplacian pyramids (for image contrast/sharpness enhancement purposes). Before I actually implement the Laplacian pyramid, I wanted to decompose and reconstruct a Gaussian pyramid and test if the image reconstructs correctly.&lt;BR /&gt;&lt;BR /&gt;The pyramid decomposition gives me the correct images for all levels i use, however, the reconstruction loop only reconstructs part of the image - IF the ROI provided is not square but a rectangle. For a square ROI the reconstruction works fine. Is this a limitation of the PyramidLayerUp function or is there a problem in my code that I cannot catch? &lt;BR /&gt;&lt;BR /&gt;I followed the example given at the end of the Universal Pyramid section in the manual. I am using the following code for my testing:&lt;BR /&gt;&lt;BR /&gt;IppiPyramid *gPyr; // pointer to Gaussian down pyramid structure  &lt;BR /&gt;IppiPyramid *gUpPyr; // pointer to Gaussian Up pyramid structure&lt;BR /&gt;&lt;BR /&gt;// allocate pyramid structures&lt;BR /&gt;Ipp32f rate = 2;&lt;BR /&gt;ippiPyramidInitAlloc (&amp;amp;gPyr, 3, srcRoi, rate);&lt;BR /&gt;ippiPyramidInitAlloc (&amp;amp;gUpPyr, 3, srcRoi, rate);&lt;BR /&gt;&lt;BR /&gt;IppiPyramidDownState_32f_C1R **gState = (IppiPyramidDownState_32f_C1R**)&amp;amp;(gPyr-&amp;gt;pState);&lt;BR /&gt;  &lt;BR /&gt;IppiPyramidUpState_32f_C1R **gUpState = (IppiPyramidUpState_32f_C1R**)&amp;amp;(gUpPyr-&amp;gt;pState);&lt;BR /&gt;  &lt;BR /&gt;Ipp32f **gImage = (Ipp32f**)(gPyr-&amp;gt;pImage);&lt;BR /&gt;IppiSize *pRoi = gPyr-&amp;gt;pRoi;&lt;BR /&gt;int *gStep = gPyr-&amp;gt;pStep;&lt;BR /&gt;int level = gPyr-&amp;gt;level;&lt;BR /&gt;Ipp32f **gUpImage = (Ipp32f**)(gUpPyr-&amp;gt;pImage);&lt;BR /&gt;int *gUpStep = gUpPyr-&amp;gt;pStep;&lt;BR /&gt;&lt;BR /&gt;// allocate structures to calculate pyramid layers&lt;BR /&gt;int mode = IPPI_INTER_LINEAR;&lt;BR /&gt;&lt;BR /&gt;ippiPyramidLayerDownInitAlloc_32f_C1R(gState, srcRoi, rate, pKernel, kerSize, mode);&lt;BR /&gt;&lt;BR /&gt;ippiPyramidLayerUpInitAlloc_32f_C1R (gUpState, srcRoi, rate, pKernel, kerSize, mode);&lt;BR /&gt;&lt;BR /&gt;// build Gaussian pyramid with level+1 layers&lt;BR /&gt;gImage[0] = pSrc;&lt;BR /&gt;gStep[0] = srcStep;&lt;BR /&gt;for (int i=1; i&amp;lt;=level; i++) &lt;BR /&gt;{&lt;BR /&gt;  gImage&lt;I&gt; = ippiMalloc_32f_C1(pRoi&lt;I&gt;.width,pRoi&lt;I&gt;.height,gStep+i);&lt;BR /&gt;   &lt;BR /&gt;  ippiPyramidLayerDown_32f_C1R(gImage[i-1], gStep[i-1], pRoi[i-1],&lt;BR /&gt;   gImage&lt;I&gt;, gStep&lt;I&gt;, pRoi&lt;I&gt;, *gState);&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;  &lt;BR /&gt;// build Gaussian UP pyramid with level layers&lt;BR /&gt;for (int i=level-1; i&amp;gt;=0; i--) &lt;BR /&gt;{&lt;BR /&gt; gUpImage&lt;I&gt; = ippiMalloc_32f_C1(pRoi&lt;I&gt;.width,pRoi&lt;I&gt;.height,gUpStep+i);&lt;BR /&gt;   &lt;BR /&gt;  resultStats = ippiPyramidLayerUp_32f_C1R(gImage[i+1], gStep[i+1],  pRoi[i+1], gUpImage&lt;I&gt;, gUpStep&lt;I&gt;, pRoi&lt;I&gt;, *gUpState);&lt;BR /&gt; &lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;ippiPyramidLayerDownFree_32f_C1R(*gState);&lt;BR /&gt;ippiPyramidLayerUpFree_32f_C1R (*gUpState);&lt;BR /&gt;  &lt;BR /&gt;// free allocated images&lt;BR /&gt;for (int i=1; i&amp;lt;=level; i++)&lt;BR /&gt;{&lt;BR /&gt; ippiFree(gImage&lt;I&gt;);&lt;BR /&gt; ippiFree(gUpImage[i-1]);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;// free pyramid structures&lt;BR /&gt;ippiPyramidFree (gPyr);&lt;BR /&gt;ippiPyramidFree (gUpPyr);&lt;BR /&gt;&lt;BR /&gt;Please review and let me know if I am doing something wrong or if this is a l
imitation of the function. &lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;Mittal&lt;BR /&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;</description>
      <pubDate>Mon, 22 Oct 2007 20:20:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Universal-pyramid-help/m-p/899701#M12606</guid>
      <dc:creator>bhatt1</dc:creator>
      <dc:date>2007-10-22T20:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: Universal pyramid help</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Universal-pyramid-help/m-p/899702#M12607</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I reviewed your code and it looks good. However, I could not reproduce the problem with IPP 5.3. Thus, it is either a problem in an ealier version of IPP, or a bug somewhere outside this code (for example, check if srcRoi is set correctly).&lt;BR /&gt;Below is the complete sample, based on your code, that I ran with a few different images.&lt;BR /&gt;It is for MS Visual Studio, but it should not be difficult to adapt it for a different compiler or port it to Linux.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Vadim&lt;BR /&gt;&lt;BR /&gt;#include "cv.h"&lt;BR /&gt;#include "highgui.h"&lt;BR /&gt;#include "ipp.h"&lt;BR /&gt;&lt;BR /&gt;#ifdef _DEBUG&lt;BR /&gt;#pragma comment( lib, "cvd.lib")&lt;BR /&gt;#pragma comment( lib, "cxcored.lib")&lt;BR /&gt;#pragma comment( lib, "highguid.lib")&lt;BR /&gt;#else&lt;BR /&gt;#pragma comment( lib, "cv.lib")&lt;BR /&gt;#pragma comment( lib, "cxcore.lib")&lt;BR /&gt;#pragma comment( lib, "highgui.lib")&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;#pragma comment( lib, "ippcore.lib")&lt;BR /&gt;#pragma comment( lib, "ippcv.lib")&lt;BR /&gt;#pragma comment( lib, "ippi.lib")&lt;BR /&gt;#pragma comment( lib, "ipps.lib")&lt;BR /&gt;&lt;BR /&gt;void main(void)&lt;BR /&gt;{&lt;BR /&gt; IplImage* src = cvLoadImage( "C:/User/VP/Pictures/Art/Pics/DiagonalSand.jpg", 0 );&lt;BR /&gt; IplImage* srcf = cvCreateImage( cvGetSize(src), IPL_DEPTH_32F, 1 );&lt;BR /&gt; cvConvertScale( src, srcf, 1./255 );&lt;BR /&gt;&lt;BR /&gt; IppStatus resultStats;&lt;BR /&gt; Ipp32f* pSrc = (Ipp32f*)srcf-&amp;gt;imageData;&lt;BR /&gt; int srcStep = srcf-&amp;gt;widthStep;&lt;BR /&gt; IppiSize srcRoi = { srcf-&amp;gt;width, srcf-&amp;gt;height };&lt;BR /&gt; const int kerSize = 7;&lt;BR /&gt; Ipp32f pKernel[kerSize];&lt;BR /&gt; CvMat _kernel = cvMat( 1, kerSize, CV_32F, pKernel );&lt;BR /&gt; CvSepFilter::init_gaussian_kernel( &amp;amp;_kernel, 1.5 );&lt;BR /&gt; cvNamedWindow( "layer", 1 );&lt;BR /&gt; &lt;BR /&gt; IppiPyramid *gPyr; // pointer to Gaussian down pyramid structure &lt;BR /&gt; IppiPyramid *gUpPyr; // pointer to Gaussian Up pyramid structure&lt;BR /&gt;&lt;BR /&gt; // allocate pyramid structures&lt;BR /&gt; Ipp32f rate = 2;&lt;BR /&gt; ippiPyramidInitAlloc (&amp;amp;gPyr, 3, srcRoi, rate);&lt;BR /&gt; ippiPyramidInitAlloc (&amp;amp;gUpPyr, 3, srcRoi, rate);&lt;BR /&gt;&lt;BR /&gt; IppiPyramidDownState_32f_C1R **gState = (IppiPyramidDownState_32f_C1R**)&amp;amp;(gPyr-&amp;gt;pState);&lt;BR /&gt; IppiPyramidUpState_32f_C1R **gUpState = (IppiPyramidUpState_32f_C1R**)&amp;amp;(gUpPyr-&amp;gt;pState);&lt;BR /&gt; &lt;BR /&gt; Ipp32f **gImage = (Ipp32f**)(gPyr-&amp;gt;pImage);&lt;BR /&gt; IppiSize *pRoi = gPyr-&amp;gt;pRoi;&lt;BR /&gt; int *gStep = gPyr-&amp;gt;pStep;&lt;BR /&gt; int level = gPyr-&amp;gt;level;&lt;BR /&gt; Ipp32f **gUpImage = (Ipp32f**)(gUpPyr-&amp;gt;pImage);&lt;BR /&gt; int *gUpStep = gUpPyr-&amp;gt;pStep;&lt;BR /&gt;&lt;BR /&gt; // allocate structures to calculate pyramid layers&lt;BR /&gt; int mode = IPPI_INTER_LINEAR;&lt;BR /&gt;&lt;BR /&gt; ippiPyramidLayerDownInitAlloc_32f_C1R(gState, srcRoi, rate, pKernel, kerSize, mode);&lt;BR /&gt; ippiPyramidLayerUpInitAlloc_32f_C1R (gUpState, srcRoi, rate, pKernel, kerSize, mode);&lt;BR /&gt;&lt;BR /&gt; // build Gaussian pyramid with level+1 layers&lt;BR /&gt; gImage[0] = pSrc;&lt;BR /&gt; gStep[0] = srcStep;&lt;BR /&gt;&amp;amp;nbs
p; for (int i=1; i&amp;lt;=level; i++) &lt;BR /&gt; {&lt;BR /&gt; gImage&lt;I&gt; = ippiMalloc_32f_C1(pRoi&lt;I&gt;.width,pRoi&lt;I&gt;.height,gStep+i);&lt;BR /&gt; resultStats = ippiPyramidLayerDown_32f_C1R(gImage[i-1], gStep[i-1], pRoi[i-1],&lt;BR /&gt; gImage&lt;I&gt;, gStep&lt;I&gt;, pRoi&lt;I&gt;, *gState);&lt;BR /&gt; assert( resultStats &amp;gt;= 0 );&lt;BR /&gt; {&lt;BR /&gt; CvMat tmp;&lt;BR /&gt; cvInitMatHeader( &amp;amp;tmp, pRoi&lt;I&gt;.height, pRoi&lt;I&gt;.width, CV_32F, gImage&lt;I&gt;, gStep&lt;I&gt; );&lt;BR /&gt; cvShowImage( "layer", &amp;amp;tmp );&lt;BR /&gt; cvWaitKey(0);&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; // build Gaussian UP pyramid with level layers&lt;BR /&gt; for (int i=level-1; i&amp;gt;=0; i--) &lt;BR /&gt; {&lt;BR /&gt; gUpImage&lt;I&gt; = ippiMalloc_32f_C1(pRoi&lt;I&gt;.width,pRoi&lt;I&gt;.height,gUpStep+i);&lt;BR /&gt; resultStats = ippiPyramidLayerUp_32f_C1R(gImage[i+1], gStep[i+1], pRoi[i+1], gUpImage&lt;I&gt;, gUpStep&lt;I&gt;, pRoi&lt;I&gt;, *gUpState);&lt;BR /&gt; assert( resultStats &amp;gt;= 0 );&lt;BR /&gt; {&lt;BR /&gt; CvMat tmp;&lt;BR /&gt; cvInitMatHeader( &amp;amp;tmp, pRoi&lt;I&gt;.height, pRoi&lt;I&gt;.width, CV_32F, gImage&lt;I&gt;, gStep&lt;I&gt; );&lt;BR /&gt; cvShowImage( "layer", &amp;amp;tmp );&lt;BR /&gt; cvWaitKey(0);&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; ippiPyramidLayerDownFree_32f_C1R(*gState);&lt;BR /&gt; ippiPyramidLayerUpFree_32f_C1R (*gUpState);&lt;BR /&gt; &lt;BR /&gt; // free allocated images&lt;BR /&gt; for (int i=1; i&amp;lt;=level; i++)&lt;BR /&gt; {&lt;BR /&gt; ippiFree(gImage&lt;I&gt;);&lt;BR /&gt; ippiFree(gUpImage[i-1]);&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; // free pyramid structures&lt;BR /&gt; ippiPyramidFree (gPyr);&lt;BR /&gt; ippiPyramidFree (gUpPyr);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;</description>
      <pubDate>Mon, 14 Jan 2008 12:21:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Universal-pyramid-help/m-p/899702#M12607</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2008-01-14T12:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: Universal pyramid help</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Universal-pyramid-help/m-p/899703#M12608</link>
      <description>&lt;FONT face="Verdana" size="3"&gt;Hi, &lt;BR /&gt;&lt;BR /&gt;I'm new to IPP and I want to implement Gaussian-Laplacian Pyramid decomposition/reconstruction. So I use the code here and make some revision to build a Gaussian pyramid and a Laplacian pyramid. I expect to get an identical image of the original after reconstruction, but the image I get is &lt;BR /&gt;quite diffrent. &lt;BR /&gt;&lt;BR /&gt;I try to use ippiPyrDown_Gauss5x5_32f_C1R/ippiPyrUp_Gauss5x5_32f_C1R and ippiPyrDown_Gauss5x5_8u_C1R/ippiPyrUp_Gauss5x5_8u_C1R instead to build the pyramids from 32-bit float image and 8-bit unsigned image respectively, but the results are almost the same.&lt;BR /&gt;&lt;BR /&gt;I'm wondering if there something wrong with the approach I get the Laplacian image, or this problem is due to the precision loss in the computation. &lt;BR /&gt;&lt;BR /&gt;Please look through the following code to find the reason for me. &lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;******************************************************************************************************&lt;BR /&gt;&lt;BR /&gt;#include "cv.h"&lt;BR /&gt;#include "highgui.h"&lt;BR /&gt;#include "ipp.h"&lt;BR /&gt;&lt;BR /&gt;#pragma comment( lib, "cv.lib")&lt;BR /&gt;#pragma comment( lib, "cxcore.lib")&lt;BR /&gt;#pragma comment( lib, "highgui.lib")&lt;BR /&gt;&lt;BR /&gt;#pragma comment( lib, "ippcore.lib")&lt;BR /&gt;#pragma comment( lib, "ippcv.lib")&lt;BR /&gt;#pragma comment( lib, "ippi.lib")&lt;BR /&gt;#pragma comment( lib, "ipps.lib")&lt;BR /&gt;&lt;BR /&gt;void ShowImage(IppiSize size, Ipp32f *image, int width_step)&lt;BR /&gt;{ &lt;BR /&gt; static count = 0;&lt;BR /&gt; char title[256]; &lt;BR /&gt; CvMat tmp; &lt;BR /&gt; cvInitMatHeader( &amp;amp;tmp, size.height, size.width, CV_32F, image, width_step ); &lt;BR /&gt; sprintf(title, "image #%d", count++); &lt;BR /&gt; cvNamedWindow( title, 1 ); &lt;BR /&gt; cvShowImage( title, &amp;amp;tmp ); &lt;BR /&gt; cvWaitKey(0); &lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;int main(int argc, char *argv[])&lt;BR /&gt;{&lt;BR /&gt; IplImage* src = cvLoadImage( "lena.jpg", 0 );&lt;BR /&gt; IplImage* srcf = cvCreateImage( cvGetSize(src), IPL_DEPTH_32F, 1 );&lt;BR /&gt; cvConvertScale( src, srcf, 1./255 );&lt;BR /&gt;&lt;BR /&gt; IppStatus resultStats;&lt;BR /&gt; Ipp32f* pSrc = (Ipp32f*)srcf-&amp;gt;imageData;&lt;BR /&gt; int srcStep = srcf-&amp;gt;widthStep;&lt;BR /&gt; IppiSize srcRoi = { srcf-&amp;gt;width, srcf-&amp;gt;height };&lt;BR /&gt; const int kerSize = 7;&lt;BR /&gt; Ipp32f pKernel[kerSize];&lt;BR /&gt; CvMat _kernel = cvMat( 1, kerSize, CV_32F, pKernel );&lt;BR /&gt; CvSepFilter::init_gaussian_kernel( &amp;amp;_kernel, 1.5 );&lt;BR /&gt; &lt;BR /&gt; IppiPyramid *gPyr; // pointer to Gaussian down pyramid structure &lt;BR /&gt; IppiPyramid *lPyr; // pointer to Laplacian pyramid structure&lt;BR /&gt;&lt;BR /&gt; // allocate pyramid structures&lt;BR /&gt; Ipp32f rate = 2;&lt;BR /&gt; int layers = 3;&lt;BR /&gt; ippiPyramidInitAlloc (&amp;amp;gPyr, layers, srcRoi, rate);&lt;BR /&gt; ippiPyramidInitAlloc (&amp;amp;lPyr, layers, srcRoi, rate);&lt;BR /&gt;&lt;BR /&gt; IppiPyramidDownState_32f_C1R **gState = (IppiPyramidDownState_32f_C1R**)&amp;amp;(gPyr-&amp;gt;pState);&lt;BR /&gt; IppiPyramidUpState_32f_C1R **lState = (IppiPyramidUpState_32f_C1R**)&amp;amp;(lPyr-&amp;gt;pState);&lt;BR /&gt;&lt;BR /&gt; Ipp32f **gImage = (Ipp32f**)(gPyr-&amp;gt;pImage);&lt;BR /&gt; IppiSize *pRoi = gPyr-&amp;gt;pRoi;&lt;BR /&gt; in
t *gStep = gPyr-&amp;gt;pStep;&lt;BR /&gt; int level = gPyr-&amp;gt;level;&lt;BR /&gt;&lt;BR /&gt; Ipp32f **lImage = (Ipp32f**)(lPyr-&amp;gt;pImage);&lt;BR /&gt; int *lStep = lPyr-&amp;gt;pStep;&lt;BR /&gt; &lt;BR /&gt; // allocate structures to calculate pyramid layers&lt;BR /&gt; int mode = IPPI_INTER_LINEAR;&lt;BR /&gt;&lt;BR /&gt; ippiPyramidLayerDownInitAlloc_32f_C1R(gState, srcRoi, rate, pKernel, kerSize, mode);&lt;BR /&gt; ippiPyramidLayerUpInitAlloc_32f_C1R(lState, srcRoi, rate, pKernel, kerSize, mode);&lt;BR /&gt;&lt;BR /&gt; // build Gaussian pyramid with level+1 layers&lt;BR /&gt; gImage[0] = pSrc;&lt;BR /&gt; gStep[0] = srcStep;&lt;BR /&gt; &lt;BR /&gt; int i = 0, nStep;&lt;BR /&gt; Ipp32f *ptr = ippiMalloc_32f_C1(srcRoi.width, srcRoi.height, &amp;amp;nStep);&lt;BR /&gt;&lt;BR /&gt; ShowImage(pRoi&lt;I&gt;, gImage&lt;I&gt;, gStep&lt;I&gt;);&lt;BR /&gt; for (i=1; i&amp;lt;=level; i++) &lt;BR /&gt; {&lt;BR /&gt; gImage&lt;I&gt; = ippiMalloc_32f_C1(pRoi&lt;I&gt;.width, pRoi&lt;I&gt;.height, gStep+i); &lt;BR /&gt;  resultStats = ippiPyramidLayerDown_32f_C1R(gImage[i-1], gStep[i-1], pRoi[i-1],&lt;BR /&gt; gImage&lt;I&gt;, gStep&lt;I&gt;, pRoi&lt;I&gt;, *gState);&lt;BR /&gt;  ShowImage(pRoi&lt;I&gt;, gImage&lt;I&gt;, gStep&lt;I&gt;);&lt;BR /&gt;&lt;BR /&gt;  lImage[i-1] = ippiMalloc_32f_C1(pRoi[i-1].width, pRoi[i-1].height, lStep+i-1);&lt;BR /&gt;  resultStats = ippiPyramidLayerUp_32f_C1R(gImage&lt;I&gt;, gStep&lt;I&gt;, pRoi&lt;I&gt;, &lt;BR /&gt;   ptr, nStep, pRoi[i-1], *lState);&lt;BR /&gt;  // build Laplacian pyramid &lt;BR /&gt;  ippiSub_32f_C1R(gImage[i-1], gStep[i-1], &lt;BR /&gt;   ptr, nStep, lImage[i-1], lStep[i-1], pRoi[i-1]);&lt;BR /&gt; ShowImage(pRoi[i-1], lImage[i-1], lStep[i-1]);&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; // reconstruction&lt;BR /&gt; for (i=level; i&amp;gt;0; i--)&lt;BR /&gt; {&lt;BR /&gt; resultStats = ippiPyramidLayerUp_32f_C1R(gImage&lt;I&gt;, gStep&lt;I&gt;, pRoi&lt;I&gt;, &lt;BR /&gt;   ptr, nStep, pRoi[i-1], *lState);&lt;BR /&gt;  ShowImage(pRoi[i-1], ptr, nStep);&lt;BR /&gt;  ippiAdd_32f_C1R(ptr, nStep, lImage[i-1], lStep[i-1], gImage[i-1], gStep[i-1], pRoi[i-1]);&lt;BR /&gt;  ShowImage(pRoi[i-1], gImage[i-1], gStep[i-1]); &lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; ippiFree(ptr);&lt;BR /&gt;&lt;BR /&gt; ippiPyramidLayerDownFree_32f_C1R(*gState); &lt;BR /&gt; ippiPyramidLayerUpFree_32f_C1R(*lState);&lt;BR /&gt;&lt;BR /&gt; for (i=1; i&amp;lt;=level; i++)&lt;BR /&gt; {&lt;BR /&gt; ippiFree(gImage&lt;I&gt;);&lt;BR /&gt;   ippiFree(lImage[i-1]);&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; ippiPyramidFree (gPyr);&lt;BR /&gt; ippiPyramidFree (lPyr);&lt;BR /&gt;&lt;BR /&gt; return 0;&lt;BR /&gt;}&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/FONT&gt;</description>
      <pubDate>Fri, 21 Mar 2008 12:33:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Universal-pyramid-help/m-p/899703#M12608</guid>
      <dc:creator>mingzhong_yu</dc:creator>
      <dc:date>2008-03-21T12:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: Universal pyramid help</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Universal-pyramid-help/m-p/899704#M12609</link>
      <description>&lt;P&gt;Hi, all&lt;/P&gt;
&lt;P&gt;The problem is caused by mistake in &lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;ippiSub_32f_C1R(gImage[i-1], gStep[i-1], &lt;BR /&gt;   ptr, nStep, lImage[i-1], lStep[i-1], pRoi[i-1]);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;which should be &lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;ippiSub_32f_C1R(ptr, nStep,&lt;BR /&gt;gImage[i-1], gStep[i-1], lImage[i-1], lStep[i-1], pRoi[i-1]);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Mar 2008 11:49:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Universal-pyramid-help/m-p/899704#M12609</guid>
      <dc:creator>mingzhong_yu</dc:creator>
      <dc:date>2008-03-25T11:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: Universal pyramid help</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Universal-pyramid-help/m-p/899705#M12610</link>
      <description>&lt;P&gt;Hi, all&lt;/P&gt;
&lt;P&gt;The problem is caused by mistake in &lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;ippiSub_32f_C1R(gImage[i-1], gStep[i-1], &lt;BR /&gt;   ptr, nStep, lImage[i-1], lStep[i-1], pRoi[i-1]);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;which should be &lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;ippiSub_32f_C1R(ptr, nStep,&lt;BR /&gt;gImage[i-1], gStep[i-1], lImage[i-1], lStep[i-1], pRoi[i-1]);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Mar 2008 11:49:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Universal-pyramid-help/m-p/899705#M12610</guid>
      <dc:creator>mingzhong_yu</dc:creator>
      <dc:date>2008-03-25T11:49:18Z</dc:date>
    </item>
  </channel>
</rss>

