Difference between revisions of "Function:FocusStack"
From CUVI Wiki
m (→Parameters) |
|||
| (11 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
Stacks multiple images into a single image. | Stacks multiple images into a single, all focused image. The input images need to be aligned and in order. The function also returns a depth_info image that contains the information against each pixel where it was picked from the stack. | ||
===Function=== | ===Function=== | ||
{| | {| | ||
|style="font-size:100%;"| | |||
CuviStatus focusStack( | <syntaxhighlight lang="C"> | ||
</ | CUVI_EXPORTS CuviStatus focusStack(CuviImage* images, const int numImages, CuviImage& stack, CuviImage& depth_info, const CuviFilter denoiseFilter, const CuviStream& stream); | ||
</syntaxhighlight> | |||
|} | |} | ||
===Parameters=== | ===Parameters=== | ||
{| | |||
|style="font-size:75%;"| | |||
{|class="wikitable" | |||
|- | |- | ||
! Name | ! Name | ||
| Line 16: | Line 18: | ||
! Description | ! Description | ||
|- | |- | ||
| | | images | ||
| const CuviImage* | | const CuviImage* | ||
| Input images array | | Input images array | ||
| Line 24: | Line 26: | ||
| Number of images | | Number of images | ||
|- | |- | ||
| | | stack | ||
| CuviImage& | | CuviImage& | ||
| Resultant image | | Resultant image | ||
|- | |||
| depth_info | |||
| CuviImage& | |||
| Slice/Depth information against stacked image | |||
|- | |- | ||
| denoiseFilter | | denoiseFilter | ||
| Line 35: | Line 41: | ||
| const CuviStream& | | const CuviStream& | ||
| GPU stream ID for execution | | GPU stream ID for execution | ||
|} | |||
|} | |} | ||
===Image Type Support=== | ====Image Type Support==== | ||
{| | |||
{| class="wikitable" | |style="font-size:75%;"| | ||
{|class="wikitable" | |||
|- | |- | ||
! Input | ! Input | ||
| Line 50: | Line 57: | ||
| 16uC3 x N | | 16uC3 x N | ||
| 16uC3 | | 16uC3 | ||
|} | |||
|} | |} | ||
===Samples=== | ====Samples==== | ||
[[File:Fs-in-1.jpg|none|frame| Input image with foreground focused]] | |||
<br/> | |||
[[File:Fs-in-2.jpg|none|frame| Input image with background focused]] | |||
<br/> | |||
[[File:Focused.jpg|none|frame| Focus-Stacked Image]] | |||
<br/> | |||
===Example=== | ====Code Example==== | ||
{| | {| | ||
|style="font-size:100%;"| | |||
<syntaxhighlight lang="C"> | |||
std::string path = "D:/dataset/fs/imageFolder/"; | std::string path = "D:/dataset/fs/imageFolder/"; | ||
| Line 88: | Line 95: | ||
CuviImage focusImage; | CuviImage focusImage, slice_info; | ||
CuviFilter denoiseFilter = CuviSpecialFilters::gaussian(CuviSize(11, 11), 15.0f); | CuviFilter denoiseFilter = CuviSpecialFilters::gaussian(CuviSize(11, 11), 15.0f); | ||
cuvi::computerVision::focusStack(ImgArr.data(), numImages, focusImage, denoiseFilter); | cuvi::computerVision::focusStack(ImgArr.data(), numImages, focusImage, slice_info, denoiseFilter); | ||
printf("\nSaving to disk.."); | printf("\nSaving to disk.."); | ||
cuvi::io::saveImage(focusImage, result); | cuvi::io::saveImage(focusImage, result); | ||
</ | </syntaxhighlight> | ||
|} | |} | ||
Latest revision as of 08:53, 18 November 2024
Stacks multiple images into a single, all focused image. The input images need to be aligned and in order. The function also returns a depth_info image that contains the information against each pixel where it was picked from the stack.
Function
|
Parameters
|
Image Type Support
|
Samples
Code Example
|


