Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

ipprWarpAffine bug

Ken_Thornton
Beginner
818 Views

 

I'm running tests on ipprWarpAffine and get failures for certain permutation matrices. 

My IPP build is 58644 (April 6, 2018). I'm running on Windows 7 (Intel Core i7) and using the ia32_win IPP libraries.

Below is a simple example to illustrate the problem.

 

void TestWarpAffine()
{
	double coefs[3][4] ={{0.0, 0.0, 1.0, 0.0}, {1.0, 0.0, 0.0, 0.0}, {0.0, 1.0, 0.0, 0.0}};
	unsigned char in[27] ={0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26};
	unsigned char out[27] ={0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

	IpprVolume srcSize ={3,3,3}, dstSize ={3,3,3};
	IpprCuboid srcVOI ={0,0,0,3,3,3}, dstVOI ={0,0,0,3,3,3};

	//Step 1: Allocate buffer
	int nBufferSize = 0;
	IppStatus sts = ipprWarpAffineGetBufSize(srcSize, srcVOI, dstVOI, coefs, 1, ippLinear, &nBufferSize); //1 means 1 channel
	ASSERT(sts == ippStsOk && nBufferSize >= 0);
	nBufferSize = __max(nBufferSize, 10); //Protect against allocating 0 bytes
	Ipp8u* pBuffer = ippsMalloc_8u(nBufferSize);
	ASSERT(pBuffer != NULL);

	//Step 2: Warp
	sts = ipprWarpAffine_8u_C1V(in, srcSize, 3, 9, srcVOI, out, 3, 9, dstVOI, coefs, ippLinear, pBuffer); //3 bytes between rows, 9 bytes between planes
	ippsFree(pBuffer);
	ASSERT(sts == ippStsOk); //Will get sts == -56

	const IppLibraryVersion* pVer = ippGetLibVersion();
}

 

0 Kudos
5 Replies
Gennady_F_Intel
Moderator
818 Views

is that 64 or 32 bit code or both?

0 Kudos
Gennady_F_Intel
Moderator
818 Views

-56 error code means that ippStsCoeffErr          determinant of the transform matrix Aij is equal to zero. if you will fix this - your case will work.

0 Kudos
Ken_Thornton
Beginner
816 Views
Gennady,
No the determinant is 1, not 0. So it is invertible.
 
 
If p is a 3D point in the source volume and q is a 3D point in the destination volume:
 
      | 0 0 1 |       | 0 |
q = | 1 0 0 | p + | 0 |
      | 0 1 0 |       | 0 |
 
The inverse transformation is:
 
       | 0 1 0 |
p =  | 0 0 1 | q
       | 1 0 0 |
            
                                       -1
            | 0 1 0 |      | 0 0 1 |
Since   | 0 0 1 |  =  | 1 0 0 |
            | 1 0 0 |      | 0 1 0 |

 

0 Kudos
Gennady_F_Intel
Moderator
816 Views

Ken, we confirmed the problem and will add the fix into one of the nearest updates. We will keep you updated with the status of this issue. Thanks for report. 

0 Kudos
Gennady_F_Intel
Moderator
816 Views

the fix of the problem available since IPP 2019 u1 and the latest 2020 versions as well.

0 Kudos
Reply