Part Number: TDA3XEVM
Tool/software: Code Composer Studio
Hello,
I am using existing vxlib for resizing a image.The location of the Vxlib is :
C:\PROCESSOR_SDK_VISION_03_03_00_00\ti_components\algorithms\vxlib_c66x_1_1_1_0\packages\ti\vxlib\src\vx\VXLIB_scaleImageBilinear_i8u_o8u.
The function is :VXLIB_scaleImageBilinear_i8u_o8u
My input image is 384×288,output is 768×576.
My codes are below:
unsigned short srcWidth = 384, dstWidth = 768;
unsigned short srcHeight = 288, dstHeight = 576;
float xs = (float)srcWidth /(float)dstWidth;
float ys = (float)srcHeight/(float)dstHeight;
unsigned short srcStride = 390, dstStride = 770;
unsigned int srcBufWidth = VXLIB_max(srcStride, ((dstWidth+2) * xs)+2);
unsigned int srcBufHeight = ((dstHeight+2) * ys) + 2;
unsigned int srcBufXstart = (srcBufWidth - srcWidth)/2;
unsigned int srcBufYstart = (srcBufHeight- srcHeight)/2;
VXLIB_bufParams2D_t src_addr, dst_addr;
float xScale, yScale;
int status_opt = 0;
src_addr.dim_x = srcBufWidth;
src_addr.dim_y = srcBufHeight;
src_addr.stride_y = srcBufWidth;
src_addr.data_type = VXLIB_UINT8;
dst_addr.dim_x = dstWidth;
dst_addr.dim_y = dstHeight;
dst_addr.stride_y = dstStride;
dst_addr.data_type = VXLIB_UINT8;
xScale = (float)srcWidth/(float)dstWidth;
yScale = (float)srcHeight/(float)dstHeight;
status_opt = VXLIB_scaleImageBilinear_i8u_o8u((Uint8 *)buffTemp, &src_addr, (Uint8 *)outputPtr, &dst_addr, xScale, yScale, -srcBufXstart, -srcBufYstart, 0, 0);
The result is wrong.
I guess some parameter is not right,I am wondering how to set srcStride and dstStride?
Will you help me?
Thank you.