Community
cancel
Showing results for 
Search instead for 
Did you mean: 
bgy
Beginner
54 Views

Unable to resize an image with a height = 1 and yFactor = 1

Hello,

My first intention is to convert a color LUT for 8 bits indexed image to a color LUT for 16 bits indexed image. I want to interpolate linearly missing colors. So i consider the initial lut like a color image of size 256x1 and try to expand it to a 65536x1 image with linear interpolation.

But when using the function ippiResizeSqrPixel_8u_AC4R, the return status is -23
ippStsResizeFactorErr = -23, /* Resize factor(s) is less than or equal to zero */

I do not understand this error because my xFactor is 256.0 and the yFactor is 1.0. Neither of factors is negative or equals to 0.

Perhaps it comes from the size of the images :
srcimage has a size of 256x1
dstimage has a size of 65536x1

[cpp]    IppiSize srcSize = {0x100,1};
    IppiSize dstSize = {0x10000,1};
    IppiRect srcRoi = {0,0,0x100,1};
    IppiRect dstRoi = {0,0,0x10000,1};

    ippiResizeGetBufSize( srcRoi, dstRoi, 4, IPPI_INTER_LINEAR, &bufsize );
    buf = ippsMalloc_8u( bufsize );
    status = ippiResizeSqrPixel_8u_AC4R(srcData,srcSize,0x100*4,srcRoi,dstData,0x10000*4,dstRoi,256.0,1.0,0,0,IPPI_INTER_LINEAR,buf);
    printf("%d\n",status);
    ippsFree(buf);[/cpp]

Regards,

Benoit GY.

0 Kudos
3 Replies
Ying_H_Intel
Employee
54 Views

Hello Benoit,

Could you please tell the IPP version information?

if you have IPP for windows, You can run the ippiDemo.exe , i.e under C:\Program Files\Intel\IPP\6.1.x.xx\ia32\demo.

See the vesion information at Help menu andat the same time, seeif the ippiResizeSqrPixel_8u_AC4R works correctly.

Best Regards,

Ying

bgy
Beginner
54 Views

Could you please tell the IPP version information?

Ipp for linux ia-32, Date posted: 26 Oct 2009 Version: 6.1 Build: 2

I will make a standalone program, so I could post it entirely.

bgy
Beginner
54 Views

I finally found the problem, it was on my side, I free a pointer before using it. So my use of jni was the cause of the trouble.

[cpp]    jdouble *at = (*env)->GetDoubleArrayElements(env, mxx, ©);
    const double coeffs[2][3] = {{at[0],at[1],at[2]},{at[3],at[4],at[5]}};
    (*env)->ReleaseDoubleArrayElements(env, mxx, at, 0);

    printf("%gn",at[0]); // print garbage (because I have release the at pointer) like 9.47691e+226
    printf("%gn",coeffs[0][0]); // print 256 as expected[/cpp]

Thanks for your fast answer. I will try to make a simple example before posting next time. It is worth doing.
Reply