- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
LONG nHeight = 576;
memset(pImage, 0, nWidth * nHeight * 4);
//really normal data is copied to pImage by memcpy
//but as example, i think, memset to 0 is OK
//Using Ipp8u & ippiMalloc_8u_AC4() gives the same result.
BYTE* pTemp = new BYTE[nWidth * nHeight * 4];
roi.height = nHeight;
roi.width = nWidth;
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ROI can't be equal image size. User has to provide data outside ROI. Correct usage can be seen from the example below:
#include "stdio.h"
#include
int main(void)
{
IppStatus s;
int nWidth = 720;
int nHeight = 576;
IppiSize roi;
Ipp8u *pImage, *pTemp, *pTemp1;
pImage = ippsMalloc_8u((nWidth+2) * (nHeight+2) * 4);
pTemp = ippsMalloc_8u((nWidth+2) * (nHeight+2) * 4);
pTemp1 = ippsMalloc_8u(nWidth * nHeight * 4);
memset(pImage, 0, nWidth * nHeight * 4);
memset(pTemp, 0, nWidth * nHeight * 4);
memset(pTemp1, 0, nWidth * nHeight * 4);
printf("memset - OK ");
//really normal data is copied to pImage by memcpy
//but as example, i think, memset to 0 is OK
//Using Ipp8u & ippiMalloc_8u_AC4()
//gives the same result.
roi.height = nHeight;
roi.width = nWidth;
printf("pImage = %x, size = %x
", (int)pImage, nWidth * nHeight * 4 );
printf("pTemp = %x, size = %x
", (int)pTemp, nWidth * nHeight * 4 );
printf("pTemp1 = %x, size = %x
", (int)pTemp1, nWidth * nHeight * 4 );
s = ippiFilterGauss_8u_AC4R(pImage+nWidth*4+1, nWidth * 4, pTemp, nWidth * 4, roi, ippMskSize3x3);
printf("1-st Gauss - OK ");
s = ippiFilterGauss_8u_AC4R(pTemp+nWidth*4+1, nWidth * 4, pTemp1, nWidth * 4, roi, ippMskSize3x3);
printf("2-nd Gauss - OK ");
ippsFree(pImage);
ippsFree(pTemp);
ippsFree(pTemp1);
return 0;
}
Regards,
Vladimir
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page