Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.

Problem with PyramidLayerDown_16u_C1R

juergenbohl
Beginner
658 Views

I am having some trouble with Universal Pyramids, the 16bit-versions in particular.

First of all, I get a crash (heap-corruption) if calling "ippiPyramidLayerDownInitAlloc_*" with a width less than the kernel size. In the example below, it crashes if called with sourceWidth=4 (and destWidth=2). This isn't really nice behavior (and seems not to be limited to the 16u_C1R-version) - it probably should either return an error or "just work" (btw, ippiPyrDown_Gauss5x5 seems not to have trouble with this).
Ok, this is annoying but can be worked around quite easily, but the other problem is more severe: I get strange results for 16bit-grayscale images. See the uploaded example images. The result ("Out_PyrDown.png") looks "strange" and note the vertical stripe on the right hand side. This is especially problematic because there is no alternative (that I am aware of) since ippiPyrDown_Gauss5x5_ does not exist in a 16u_C1R-version.

I am experiencing this problem with IPP7.0, 7.1 and 7.1 update 1.

 

Any help would be greatly appreciated.

 

Example code:

 [cpp]

bool PyrDown_Gray16(void* sourceBuffer,int sourceStride,int sourceWidth,int sourceHeight,void* destinationBuffer,int destinationStride,int destWidth,int destHeight)

{  

IppiSize destSize;  

IppiSize srcSize = {sourceWidth,sourceHeight};  

IppStatus status = ippiGetPyramidDownROI(srcSize,&destSize,2.0f);  

if (destSize.width!=destWidth || destSize.height!= destHeight)  {   return false;  }

IppiPyramidDownState_16u_C1R* ptrPyramidState_16u_C1R;

static Ipp16s kernel[5] = {1,4,6,4,1};

status = ippiPyramidLayerDownInitAlloc_16u_C1R( &ptrPyramidState_16u_C1R,srcSize,2.0f,kernel,5,IPPI_INTER_LINEAR);  

status = ippiPyramidLayerDown_16u_C1R( (Ipp16u*)sourceBuffer,sourceStride,srcSize,(Ipp16u*)destinationBuffer,destinationStride,destSize,ptrPyramidState_16u_C1R);  

status = ippiPyramidLayerDownFree_16u_C1R(ptrPyramidState_16u_C1R);  

return true;

}

[/cpp]

0 Kudos
1 Reply
Yang_Y_1
Beginner
658 Views

I have the same problem and google it on website and no solution is found so far.

Did anyone solve it?

0 Kudos
Reply