The C++ interface for rotate. More...

array rotate (const array &image, const float theta, bool iscrop=true)
 

Detailed Description

The C++ interface for rotate.

Rotate the input image by theta radians. Positive indicates clockwise rotatoin and a negative angle rotates the image counter-clockwise.

// Rotate an image counter-clockwise 60 degrees
// and set output size to be same as input (cropping)
array img_out_crop = rotate(img_in, -Pi/3.f);
// Perform the same transformation but skip the cropping
// operation. The output will be larger than the input
array img_out_nocrop = rotate(img_in, -Pi/3.f, false);
// Rotate an image clockwise 90 degrees
// and adjust output image size as needed (no cropping)
array img_out = rotate(img_in, Pi/2.f, false);
img_in
img_in
img_out_nocrop
img_out_nocrop
img_out_crop
img_out_crop
img_out
img_out

Function Documentation

array af::rotate ( const array &  image,
const float  theta,
bool  iscrop = true 
)
Parameters
[in]image
[in]thetaclockwise rotation angle in radians.
[in]iscropuse in-place rotation and crop outlying pixels (true, default), else enlarge image domain to fit rotation (false)
Returns
rotated image (same size as input when crop=true, enlarged when crop=false)
Note
rotations in increments of pi/2 are fast
Examples:
examples/image_processing/image_demo.cpp.