Documentation
|
|
The C++ interface for resize. More...
| array | resize (const float scale, const array &image, const char method='L') |
| Resize an image based on a scaling factor (uniform) More... | |
| array | resize (const float scale_x, const float scale_y, const array &image, const char method='L') |
| Resize an image based on two scale factors (non-uniform) More... | |
| array | resize (const unsigned height, const unsigned width, const array &image, const char method='L') |
| Resize an image to a specified width and height in pixels. More... | |
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:
| array af::resize | ( | const float | scale, |
| const array & | image, | ||
| const char | method = 'L' |
||
| ) |
Resize an image based on a scaling factor (uniform)
| [in] | scale | uniform scale factor (e.g. "1.1" scales image up 10%, 0.6 scales image down to 60%). Height and width scaled uniformly. |
| [in] | image | the image to resize |
| [in] | method | interpolation type ('N' Nearest | 'L' bilinear) |
| array af::resize | ( | const float | scale_x, |
| const float | scale_y, | ||
| const array & | image, | ||
| const char | method = 'L' |
||
| ) |
Resize an image based on two scale factors (non-uniform)
| [in] | scale_x | scale factor for first dimension (>= 0) |
| [in] | scale_y | scale factor for second dimension (>= 0) |
| [in] | image | the image to resize |
| [in] | method | interpolation type ('N' Nearest Neighbor | 'L' linear) |
| array af::resize | ( | const unsigned | height, |
| const unsigned | width, | ||
| const array & | image, | ||
| const char | method = 'L' |
||
| ) |
Resize an image to a specified width and height in pixels.
| [in] | height | output height in pixels |
| [in] | width | output width in pixels |
| [in] | image | the image to resize |
| [in] | method | interpolation type ('N' Nearest | 'L' bilinear) |