The C interface for resize. More...

afError af_resize_S (const unsigned mO, const unsigned nO, float *d_out, const unsigned mI, const unsigned nI, const float *d_in, const unsigned channels, const int type=1)
 Image resizing. More...
 
afError af_resize_D (const unsigned mO, const unsigned nO, double *d_out, const unsigned mI, const unsigned nI, const double *d_in, const unsigned channels, const int type=1)
 Image resize, double precision. More...
 

Detailed Description

The C interface for resize.

The resize function scales an image up or down based on a constant scaling factor or an explicit new size. resize provides two methods for this operation, nearest neighbor interpolation and bilinear interpolation.

The following examples illustrate the difference between the two types of interpolation:

float h_in[] = {1, 2, 3, 4};
array in(2, 2, h_in);
// in = 1 3
// 2 4
array out = resize(2.0f, in, 'N');
// out = 1 1 3 3
// 1 1 3 3
// 2 2 4 4
// 2 2 4 4
array bi_out = resize(2.0f, in, 'L');
// out = 1.00 1.50 2.50 3.00
// 1.25 1.75 2.75 3.25
// 1.75 2.25 3.25 3.75
// 2.00 2.50 3.50 4.00

Function Documentation

afError af_resize_S ( const unsigned  mO,
const unsigned  nO,
float *  d_out,
const unsigned  mI,
const unsigned  nI,
const float *  d_in,
const unsigned  channels,
const int  type = 1 
)

Image resizing.

Parameters
[in]mONumber of rows in output image
[in]nONumber of columns in output image
[out]d_outThe output image
[in]mINumber of rows in input image
[in]nINumber of columns in input image
[in]d_inInput image
[in]channelsspecifies color channels of the image {1 or 3}
[in]typespecifies type of image interpolation {nearest(0),bilinear(1)}Image resize, single precision
afError af_resize_D ( const unsigned  mO,
const unsigned  nO,
double *  d_out,
const unsigned  mI,
const unsigned  nI,
const double *  d_in,
const unsigned  channels,
const int  type = 1 
)

Image resize, double precision.