I am using Ipp6.0 version, The input and output image(Dicom image) only have one channel, 16bits per pixel. After Resize with ippiResizeSqrPixel_32f_C1R function, the interpolated image has about 0.5 pixel shift.
Some parameters for my test: original image size: 512*512; ResizeFactor=2.0; pfImageIn, pfImageOut is a memory block allocated with new operator
Here is part of my code, waiting for your help:
int iColSrc = iImgCol; // original image's width
int iLinSrc = iImgLin; // original image's height
int iColDst = short((float)iColSrc * fResizeCol) ; // dest image's width
int iLinDst = short((float)iLinSrc * fResizeLin) ; // dest image's height
IppiSize size = {iColSrc, iLinSrc};
IppiRect srect = { 0, 0, iColSrc, iLinSrc };
IppiRect drect = { 0, 0, iColDst, iLinDst };
Ipp8u *buf;
int bufsize;
//calculation of work buffer size
ippStatus = ippiResizeGetBufSize(srect,drect,1,iInterType,&bufsize);
buf = ippsMalloc_8u(bufsize);
if(NULL==buf)
{
iErrType = MemoryErr;
return false;
}
// resize m_pfImageIn
ippStatus = ippiResizeSqrPixel_32f_C1R(pfImageIn, size, iColSrc*(int)(sizeof(Ipp32f)), srect,
pfImageOut, iColDst*(int)(sizeof(Ipp32f)), drect,
fResizeCol, fResizeLin, 0, 0, iInterType, buf);
Link Copied
Hell Kangscut,
What interpolation type are you using? (theiInterTypevalue) . Can youprovide the test image (bmp format if possible) so we can reproduce the issue.
Additionally, the latest IPP version is6.1 update 4, which can be getten following the guide onIPP Downloads, Registration and Licensing.How about the result iftry the new version?
Regards,
Ying
To answer to your question...are you using windows bitmap?
if yes you have to know that the windows Bitmap format require that address of each image row should be aligned onfour bytes resulting in one padding byte at the each image row end in case of odd image width.
i previously have your same problem of shifting
DPD200141560 | BZIP2 with ipp_ prefixes |
DPD200140668 | ippiResizeSqrPixel_8u_C1R has differing results depending on CPU (rounding error problem) |
For more complete information about compiler optimizations, see our Optimization Notice.