Enlarge or shrink an image. More...

Modules

 resize
 The C++ interface for resize.
 
 af_resize
 The C interface for resize.
 

Detailed Description

Enlarge or shrink an image.

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