Quantcast
Channel: Intel® Integrated Performance Primitives
Viewing all articles
Browse latest Browse all 1294

Bug in ippiErodeBorder_1u_C1R, ippiDilateBorder_1u_C1R

$
0
0

Hi,

I think I found a bug in ippiErodeBorder_1u_C1R and ippiDilateBorder_1u_C1R. 8u versions work fine. I have IPP 2017 update 3. Code:

#include <iostream>
#include "ipp.h"

int main()
{
   IppiSize roiSize = { 3, 1 };
   IppiSize maskSize = { 3, 1 };
   int iSpecSize, iBufferSize;
   IppStatus sts;

   sts = ippiMorphologyBorderGetSize_1u_C1R(roiSize, maskSize, &iSpecSize, &iBufferSize);

   IppiMorphState *pSpec = (IppiMorphState*)ippsMalloc_8u(iSpecSize);
   Ipp8u *pBuffer = ippsMalloc_8u(iBufferSize);

   Ipp8u pMask[3] = { 1, 1, 1 };

   sts = ippiMorphologyBorderInit_1u_C1R(roiSize, pMask, maskSize, pSpec, pBuffer);

   Ipp8u pSrc[1] = { 224 };
   Ipp8u pDst[1];

   sts = ippiErodeBorder_1u_C1R(pSrc, 1, 0, pDst, 1, 0, roiSize, ippBorderRepl, 0, pSpec, pBuffer);
   //sts = ippiDilateBorder_1u_C1R(pSrc, 1, 0, pDst, 1, 0, roiSize, ippBorderRepl, 0, pSpec, pBuffer);

   std::cout << (int)pDst[0] << std::endl;
   std::cin.get();

   return 0;
}

 

Input is 224 which is 1110 0000. Roi size is 3x1 and mask size is 3x1 with {1, 1, 1}, so the resulting first three bits with ippBorderRepl should be 111 for both erode and dilate. Instead, I get 200, which is 1100 1000.

Thanks,

Michal


Viewing all articles
Browse latest Browse all 1294

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>