Intel® Integrated Performance Primitives
Community support and discussions relating to developing high-performance vision, signal, security, and storage applications.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.

ippiAbsDiff_32f_C1R gives ippStsStepErr

vikingsooner
Beginner
145 Views

I'm calling ippiAbsDiff_32f_C1R and it returns ippStsStepErr. Not sure why because I am pretty sure I'm passing in the correct parameters.

My C# code:

#if( x64 )
internal const string libname = "ippcvem64t-6.0.dll";
#else
internal const string libname = "ippcv-6.0.dll";
#endif

[SuppressUnmanagedCodeSecurity]
[DllImport(ipp.cv.libname)]
public static extern
IppStatus ippiAbsDiff_32f_C1R(float[] pSrc1, int src1Step, float[] pSrc2, int src2Step, float[] pDst, int dstStep,
IppiSize roiSize);

public static float[] AbsoluteDifferenceGrayscale(float[] image1, float[] image2, Size imageSize)
{
float[] result = new float[image1.Length];
IppStatus status = ippiAbsDiff_32f_C1R(image1, imageSize.Width, image2, imageSize.Width,
result, imageSize.Width, new IppiSize(imageSize.Width, imageSize.Height));
ThrowExceptionForStatus(status);
return result;
}

image1 and image2 are a size of 19200 and imageSize is 160x120.

0 Kudos
1 Solution
matthieu_darbois
New Contributor III
145 Views

Hi,

I think you misunderstood the step parameter. It isn't the width of the image but the length between two lines in bytes. So in your case, where there's no padding, that would be 160*sizeof(float) = 160 * 4

Regards,

Matthieu

View solution in original post

1 Reply
matthieu_darbois
New Contributor III
146 Views

Hi,

I think you misunderstood the step parameter. It isn't the width of the image but the length between two lines in bytes. So in your case, where there's no padding, that would be 160*sizeof(float) = 160 * 4

Regards,

Matthieu

Reply