Difference between revisions of "Function:FocusStack"

From CUVI Wiki
Line 63: Line 63:
|[[File:Fs-in-2.jpg|frame| Input image with background focused]]
|[[File:Fs-in-2.jpg|frame| Input image with background focused]]
|-
|-
|[[File:Resizein2.jpg|frame|Input Image (Width = W, Height = H)]]
|[[File:Focused.jpg|frame| Focus-Stacked Image]]
|[[File:Resizeout2.jpg|frame| Resized Image (width = 1.2*W, height= 1.75*H)]]
 
|}
|}



Revision as of 06:28, 28 April 2021

Stacks multiple images into a single image. Images need to be aligned.

Function

CuviStatus focusStack(const CuviImage* ImgArr,
                  const int numImages
                  CuviImage& sharpImage,
                  CuviFilter denoiseFilter
                  const CuviStream& stream = CuviStream());

Parameters

Name Type Description
ImgArr const CuviImage* Input images array
numImages const int Number of images
sharpImage CuviImage& Resultant image
denoiseFilter CuviFilter Filter to remove noise
stream const CuviStream& GPU stream ID for execution

Image Type Support

Input Output
8uC3 x N 8uC3
16uC3 x N 16uC3

Samples

Error creating thumbnail: Unable to save thumbnail to destination
Input image with foreground focused
Error creating thumbnail: Unable to save thumbnail to destination
Input image with background focused
Error creating thumbnail: Unable to save thumbnail to destination
Focus-Stacked Image

Example

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.type());


//Re-sizing input image to fit output container using bicubic interpolation
cuvi::geometryTransforms::resize(gimg,gout, CUVI_INTER_CUBIC);