Resizes input image to fit into the output image size. The function used linear interpolation
Function
CuviStatus resize(CuviImage* srcImage,
CuviImage* dstImage,
CuviStream* stream = NULL);
|
Parameters
| Name
|
Type
|
Description
|
| srcImage
|
CuviImage*
|
Input Image
|
| dstImage
|
CuviImage*
|
Output Image
|
| stream
|
CuviStream*
|
GPU stream ID for execution
|
Image Type Support
| Input
|
Output
|
| 8uC1
|
8uC1
|
| 8uC3
|
8uC3
|
| 16uC1
|
16uC1
|
| 16uC3
|
16uC3
|
Samples
Input Image (Width = W, Height = H)
|
Resized Image (width =0.78625*W, height= 0.78625*H)
|
Input Image (Width = W, Height = H)
|
Resized Image (width = 1.2*W, height= 1.75*H)
|
Example
//Input size
CuviSize size = cuviSize(img->width,img->height);
//Defining Output size
CuviSize sizeOut = cuviSize(img->width*0.5,img->height*0.7);
CuviImage* gimg = new CuviImage(size,img->depth,img->nChannels);
CuviImage* gout = new CuviImage(sizeOut,img->depth,img->nChannels);
gimg->upload(img->imageData,img->widthStep);
//Resizing input image to fit output container
cuvi::GeometryTransforms::resize(gimg,gout);
|