Difference between revisions of "Function:HaarInv"

From CUVI Wiki
(Created page with "__NOTOC__ Performs one-level haar wavelet reconstruction of an image ===Function=== {| |style="font-size:150%;"| <syntaxhighlight lang="cpp"> CuviStatus haarInv(CuviImage* src...")
 
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
Performs one-level haar wavelet reconstruction of an image
Performs one-level haar wavelet reconstruction of an image
===Function===
====Function====
{|
{|
|style="font-size:150%;"|
|style="font-size:100%;"|
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
CuviStatus haarInv(CuviImage* srcApprox,
CuviStatus haarInv(const CuviImage& srcApprox,
                   CuviImage* srcDetailX,
                   const CuviImage& srcDetailX,
                   CuviImage* srcDetailY,
                   const CuviImage& srcDetailY,
                   CuviImage* srcDetailXY,
                   const CuviImage& srcDetailXY,
                   CuviImage* dstImage,
                   CuviImage& dstImage,
                   CuviStream* stream = NULL);
                   const CuviStream& stream = CuviStream());
</syntaxhighlight>
</syntaxhighlight>
|}
|}
===Parameters===


====Parameters====
{|
|style="font-size:75%;"|
{|class="wikitable"
{|class="wikitable"
|-
|-
Line 22: Line 24:
|-
|-
| srcApprox
| srcApprox
| CuviImage*
| const CuviImage&
| Input approximation image
| Input approximation image
|-
|-
| srcDetailX
| srcDetailX
| CuviImage*
| const CuviImage&
| Input horizontal detail image
| Input horizontal detail image
|-
|-
| srcDetailY
| srcDetailY
| CuviImage*
| const CuviImage&
| Input vertical detail image
| Input vertical detail image
|-
|-
| srcDetailXY
| srcDetailXY
| CuviImage*
| const CuviImage&
| Input diagonal detail image
| Input diagonal detail image
|-
|-
| dstImage
| dstImage
| CuviImage*
| CuviImage&
| Reconstructed image
| Reconstructed image
|-
|-
| stream
| stream
| CuviStream*
| const CuviStream&
| GPU stream ID for execution
| GPU stream ID for execution
 
|}
|}
|}


===Image Type Support===
====Image Type Support====
 
{|
|style="font-size:75%;"|
{| class="wikitable"
{| class="wikitable"
|-
|-
Line 54: Line 57:
! Output
! Output
|-
|-
| 32fC1 x 4
| 8uC1 x 4
| 8uC1
| 8uC1
|-
| 8uC3 x 4
| 8uC3
|}
|}
===Sample===
{|
|-
|[[File:Haar.jpg]]
|}
|}


====Sample====
[[File:HaarFwdApp.jpg|none|frame|Input Approx]]
<br/>
[[File:HaarFwdDetailX.jpg|none|frame|Input X Component]]
<br/>
[[File:HaarFwdDetailY.jpg|none|frame|Input Y Component]]
<br/>
[[File:HaarFwdDetailXY.jpg|none|frame|Input XY Component]]
<br/>
[[File:Haarin.jpg|none|frame|Resultant Image]]


 
====Example====
===Example===
{|
{|
|style="font-size:150%;"|
|style="font-size:100%;"|
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">


//Four input images
//Four input images
CuviImage *a = new CuviImage(sizeHalf,32,1);
CuviImage a = cuvi::io::loadImage(path);
CuviImage *x = new CuviImage(sizeHalf,32,1);
CuviImage x = cuvi::io::loadImage(path);
CuviImage *y = new CuviImage(sizeHalf,32,1);
CuviImage y = cuvi::io::loadImage(path);
CuviImage *xy = new CuviImage(sizeHalf,32,1);
CuviImage xy = cuvi::io::loadImage(path);


//Destination Image
//Destination Image
CuviImage *gout = new CuviImage(size,depth,nChannels);
CuviImage gout;


//Populate the input GPU images with pixel data
a->upload(hostImgA->imageData,hostImgA->widthStep);
x->upload(hostImgX->imageData,hostImgX->widthStep);
y->upload(hostImgY->imageData,hostImgY->widthStep);
xy->upload(hostImgXY->imageData,hostImgXY->widthStep);


//Performs one-level haar wavelet reconstruction of an image
//Performs one-level haar wavelet reconstruction of an image

Latest revision as of 11:01, 19 October 2022

Performs one-level haar wavelet reconstruction of an image

Function

CuviStatus haarInv(const CuviImage& srcApprox,
                   const CuviImage& srcDetailX,
                   const CuviImage& srcDetailY,
                   const CuviImage& srcDetailXY,
                   CuviImage& dstImage,
                   const CuviStream& stream = CuviStream());

Parameters

Name Type Description
srcApprox const CuviImage& Input approximation image
srcDetailX const CuviImage& Input horizontal detail image
srcDetailY const CuviImage& Input vertical detail image
srcDetailXY const CuviImage& Input diagonal detail image
dstImage CuviImage& Reconstructed image
stream const CuviStream& GPU stream ID for execution

Image Type Support

Input Output
8uC1 x 4 8uC1
8uC3 x 4 8uC3

Sample

Input Approx


Input X Component


Input Y Component


Input XY Component


Resultant Image

Example

//Four input images
CuviImage a = cuvi::io::loadImage(path);
CuviImage x = cuvi::io::loadImage(path);
CuviImage y = cuvi::io::loadImage(path);
CuviImage xy = cuvi::io::loadImage(path);

//Destination Image
CuviImage gout;


//Performs one-level haar wavelet reconstruction of an image
cuvi::imageTransforms::haarInv(a,x,y,xy,gout);