Difference between revisions of "Function:Resize"
From CUVI Wiki
| Line 5: | Line 5: | ||
|style="font-size:150%;"| | |style="font-size:150%;"| | ||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
CuviStatus resize(CuviImage | CuviStatus resize(const CuviImage& src, | ||
CuviImage | CuviImage& dst, | ||
CuviStream | const CuviStream& stream = CuviStream()); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
| Line 20: | Line 20: | ||
! Description | ! Description | ||
|- | |- | ||
| | | src | ||
| CuviImage | | const CuviImage& | ||
| Input Image | | Input Image | ||
|- | |- | ||
| | | dst | ||
| CuviImage | | CuviImage& | ||
| Output Image | | Output Image | ||
|- | |- | ||
| stream | | stream | ||
| CuviStream | | const CuviStream& | ||
| GPU stream ID for execution | | GPU stream ID for execution | ||
| Line 54: | Line 54: | ||
| 16uC3 | | 16uC3 | ||
| 16uC3 | | 16uC3 | ||
|- | |||
| 32fC1 | |||
| 32fC1 | |||
|- | |||
| 32fC3 | |||
| 32fC3 | |||
|} | |} | ||
| Line 75: | Line 81: | ||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
CuviImage gimg = cuvi::io::loadImage(path); | |||
const Cuvi32f xScale = 0.5f, yScale = 0.7f; | |||
const Cuvi32s newWidth = static_cast<Cuvi32s>(gimg.width() * xScale); | |||
const Cuvi32s newHeight = static_cast<Cuvi32s>(gimg.height() * yScale); | |||
CuviImage gout(newWidth,newHeight,gimg.depth(),gimg.channels()); | |||
//Resizing input image to fit output container | //Resizing input image to fit output container | ||
Revision as of 08:06, 19 April 2013
Resizes input image to fit into the output image size. The function used linear interpolation
Function
|
Parameters
| Name | Type | Description |
|---|---|---|
| src | const CuviImage& | Input Image |
| dst | CuviImage& | Output Image |
| stream | const CuviStream& | GPU stream ID for execution |
Image Type Support
| Input | Output |
|---|---|
| 8uC1 | 8uC1 |
| 8uC3 | 8uC3 |
| 16uC1 | 16uC1 |
| 16uC3 | 16uC3 |
| 32fC1 | 32fC1 |
| 32fC3 | 32fC3 |
Samples
Example
|



