Difference between revisions of "Function:HaarFwd"

From CUVI Wiki
Line 5: Line 5:
|style="font-size:150%;"|
|style="font-size:150%;"|
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
CuviStatus haarFwd(CuviImage* srcImage,
CuviStatus haarFwd(const CuviImage& src,
                   CuviImage* dstApprox,
                   CuviImage& dstApprox,
                   CuviImage* dstDetailX,
                   CuviImage& dstDetailX,
                   CuviImage* dstDetailY,
                   CuviImage& dstDetailY,
                   CuviImage* dstDetailXY,
                   CuviImage& dstDetailXY,
                   CuviStream* stream = NULL);
                   const CuviStream& stream = CuviStream());
</syntaxhighlight>
</syntaxhighlight>
|}
|}
Line 21: Line 21:
! Description
! Description
|-
|-
| srcImage
| src
| CuviImage*
| const CuviImage&
| Input image
| Input image
|-
|-
| dstApprox
| dstApprox
| CuviImage*
| CuviImage&
| Output approximation image
| Output approximation image
|-
|-
| dstDetailX
| dstDetailX
| CuviImage*
| CuviImage&
| Output horizontal detail image
| Output horizontal detail image
|-
|-
| dstDetailY
| dstDetailY
| CuviImage*
| CuviImage&
| Output vertical detail image
| Output vertical detail image
|-
|-
| dstDetailXY
| dstDetailXY
| CuviImage*
| CuviImage&
| Output diagonal detail image
| Output diagonal detail image
|-
|-
| stream
| stream
| CuviStream*
| const CuviStream&
| GPU stream ID for execution
| GPU stream ID for execution


Line 55: Line 55:
|-
|-
| 8uC1
| 8uC1
| 32fC1 x 4
| 8uC1 x 4
|-
| 8uC3
| 8uC3 x 4
|}
|}


Line 72: Line 75:


//Input Image
//Input Image
CuviImage *gimg = new CuviImage(size,depth,nChannels);
CuviImage gimg = cuvi::io::loadImage(path);


//Four output images
//Four output images
CuviImage *a = new CuviImage(sizeHalf,32,1);
CuviImage a, x, y, xy;
CuviImage *x = new CuviImage(sizeHalf,32,1);
CuviImage *y = new CuviImage(sizeHalf,32,1);
CuviImage *xy = new CuviImage(sizeHalf,32,1);
 
//Populate the GPU image with pixel data
gimg->upload(hostImg->imageData,hostImg->widthStep);


//compute one-level haar wavelet decomposition
//compute one-level haar wavelet decomposition

Revision as of 20:07, 18 April 2013

Performs one-level wavelet decomposition of an image using haar basis. The four resultant images are half the width and half the height of the original image

Function

CuviStatus haarFwd(const CuviImage& src,
                   CuviImage& dstApprox,
                   CuviImage& dstDetailX,
                   CuviImage& dstDetailY,
                   CuviImage& dstDetailXY,
                   const CuviStream& stream = CuviStream());

Parameters

Name Type Description
src const CuviImage& Input image
dstApprox CuviImage& Output approximation image
dstDetailX CuviImage& Output horizontal detail image
dstDetailY CuviImage& Output vertical detail image
dstDetailXY CuviImage& Output diagonal detail image
stream const CuviStream& GPU stream ID for execution

Image Type Support

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

Sample

File:Haar.jpg


Example

//Input Image
CuviImage gimg = cuvi::io::loadImage(path);

//Four output images
CuviImage a, x, y, xy;

//compute one-level haar wavelet decomposition
cuvi::imageTransforms::haarFwd(gimg,a,x,y,xy);