- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1. I want to calculate the average of y.
2. When the size of the mask is an even number, it is incorrect.
(Pen3 i820 WinXpSp1 IPP4.1.22)
3. Is there something alternative proposal?
// sample code
void main(void)
{
Ipp32f *pSrc; int SrcW, SrcH, SrcS;
Ipp32f *pDst; int DstW, DstH, DstS;
Ipp32f *pMsk; int MskSize;
Ipp32f *pTmp; int yAnchor, x;
IppStatus Status;
IppiSize SrcSize, DstSize;
SrcW = 5; SrcH = 4;
pSrc = ippiMalloc_32f_C1(SrcW, SrcH, &SrcS);
SrcSize.width = SrcW; SrcSize.height = SrcH;
Status = ippiSet_32f_C1R(1.0f, pSrc, SrcS, SrcSize);
MskSize = SrcH;
pMsk = ippsMalloc_32f(MskSize);
Status = ippsSet_32f(1.0f / MskSize, pMsk, MskSize);
DstW = SrcW; DstH = 1;
pDst = ippiMalloc_32f_C1(DstW, DstH, &DstS);
yAnchor = (MskSize - 1) / 2;
pTmp = pSrc + (SrcS / sizeof(Ipp32f)) * yAnchor;
DstSize.width = DstW; DstSize.height = DstH;
Status = ippiFilterColumn_32f_C1R(
pTmp, SrcS, pDst, DstS, DstSize,
pMsk, MskSize, yAnchor);
printf("Status = %d ", Status);
pTmp = pDst;
for ( x = 0; x < DstW; x++ )
{
printf("%f ", *pTmp); pTmp++;
}
ippiFree(pDst);
ippsFree(pMsk);
ippiFree(pSrc);
printf("push any key "); getch();
}
2. When the size of the mask is an even number, it is incorrect.
(Pen3 i820 WinXpSp1 IPP4.1.22)
3. Is there something alternative proposal?
// sample code
void main(void)
{
Ipp32f *pSrc; int SrcW, SrcH, SrcS;
Ipp32f *pDst; int DstW, DstH, DstS;
Ipp32f *pMsk; int MskSize;
Ipp32f *pTmp; int yAnchor, x;
IppStatus Status;
IppiSize SrcSize, DstSize;
SrcW = 5; SrcH = 4;
pSrc = ippiMalloc_32f_C1(SrcW, SrcH, &SrcS);
SrcSize.width = SrcW; SrcSize.height = SrcH;
Status = ippiSet_32f_C1R(1.0f, pSrc, SrcS, SrcSize);
MskSize = SrcH;
pMsk = ippsMalloc_32f(MskSize);
Status = ippsSet_32f(1.0f / MskSize, pMsk, MskSize);
DstW = SrcW; DstH = 1;
pDst = ippiMalloc_32f_C1(DstW, DstH, &DstS);
yAnchor = (MskSize - 1) / 2;
pTmp = pSrc + (SrcS / sizeof(Ipp32f)) * yAnchor;
DstSize.width = DstW; DstSize.height = DstH;
Status = ippiFilterColumn_32f_C1R(
pTmp, SrcS, pDst, DstS, DstSize,
pMsk, MskSize, yAnchor);
printf("Status = %d ", Status);
pTmp = pDst;
for ( x = 0; x < DstW; x++ )
{
printf("%f ", *pTmp); pTmp++;
}
ippiFree(pDst);
ippsFree(pMsk);
ippiFree(pSrc);
printf("push any key "); getch();
}
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
there is answer from our expert:
seemsyou forget (or misread) that arbitrary kernels for filtering operations are used in inverse order (the same as for FIR), therefore anchor should be treated in inverse order too:
pTmp = pSrc + (SrcS /
sizeof(Ipp32f)) * ( MskSize - yAnchor - 1 );The best way for calculating average is FilterBox or SumColumn function they are faster because dont use muls.
Regards,
Vladimir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks.
I understood it.
Thanks.
I understood it.
Thanks.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page