Difference between revisions of "Function:Resize"

From CUVI Wiki
(Created page with "__NOTOC__ Resizes input image to fit into the output image size. The function used linear interpolation ===Function=== {| |style="font-size:150%;"| <syntaxhighlight lang="cpp"...")
 
Line 87: Line 87:


//Resizing input image to fit output container  
//Resizing input image to fit output container  
cuvi::GeometryTransforms::resize(gimg,gout);
cuvi::geometryTransforms::resize(gimg,gout);


</syntaxhighlight>
</syntaxhighlight>
|}
|}

Revision as of 16:13, 26 April 2012

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

Error creating thumbnail: Unable to save thumbnail to destination
Input Image (Width = W, Height = H)
Error creating thumbnail: Unable to save thumbnail to destination
Resized Image (width =0.78625*W, height= 0.78625*H)
Error creating thumbnail: Unable to save thumbnail to destination
Input Image (Width = W, Height = H)
Error creating thumbnail: Unable to save thumbnail to destination
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);