Difference between revisions of "Function:ImageGradients"
From CUVI Wiki
Line 5: | Line 5: | ||
|style="font-size:150%;"| | |style="font-size:150%;"| | ||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
CuviStatus imageGradients(CuviImage | CuviStatus imageGradients(const CuviImage& src, | ||
CuviImage | CuviImage& gradX, | ||
CuviImage | CuviImage& gradY, | ||
CuviGradientKernelType type = CUVI_GRADIENT_SOBEL_3x3, | const CuviGradientKernelType type = CUVI_GRADIENT_SOBEL_3x3, | ||
CuviStream | const CuviStream& stream = CuviStream()); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
Line 22: | Line 22: | ||
! Description | ! Description | ||
|- | |- | ||
| | | src | ||
| CuviImage | | const CuviImage& | ||
| Input image | | Input image | ||
|- | |- | ||
| | | gradX | ||
| CuviImage | | CuviImage& | ||
| Horizontal image gradient | | Horizontal image gradient | ||
|- | |- | ||
| | | gradY | ||
| CuviImage | | CuviImage& | ||
| Vertical image gradient | | Vertical image gradient | ||
|- | |- | ||
| type | | type | ||
| CuviGradientKernelType | | const CuviGradientKernelType | ||
| Supports: | | Supports: | ||
{| | {| | ||
Line 48: | Line 48: | ||
|- | |- | ||
| stream | | stream | ||
| CuviStream | | const CuviStream& | ||
| GPU stream ID for execution | | GPU stream ID for execution | ||
Line 86: | Line 86: | ||
//Container for input Image | //Container for input Image | ||
CuviImage | CuviImage gimg = cuvi::io::loadImage(path); | ||
//Containers for gradients | //Containers for gradients | ||
CuviImage | CuviImage gX, gY; | ||
//function call | //function call | ||
cuvi:: | cuvi::imageFiltering::imageGradients(gimg,gX,gY,CUVI_GRADIENT_CENTRAL_DIFFERENCE); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} |
Latest revision as of 20:27, 18 April 2013
Calculates X and Y gradients of image
Function
|
Parameters
Name | Type | Description | ||||
---|---|---|---|---|---|---|
src | const CuviImage& | Input image | ||||
gradX | CuviImage& | Horizontal image gradient | ||||
gradY | CuviImage& | Vertical image gradient | ||||
type | const CuviGradientKernelType | Supports:
| ||||
stream | const CuviStream& | GPU stream ID for execution |
Image Type Support
Input | Output |
---|---|
8uC1 | 32fC1 |
8uC3 | 32fC3 |
Sample
Error creating thumbnail: Unable to save thumbnail to destination | |
Error creating thumbnail: Unable to save thumbnail to destination |
Error creating thumbnail: Unable to save thumbnail to destination |
Example
|