Function:FocusStack

From CUVI Wiki
Revision as of 06:24, 28 April 2021 by Jawad (talk | contribs) (→‎Function)

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 (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

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);