Difference between revisions of "Function:AbsDiff"

From CUVI Wiki
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
Computes absolute difference between pixels of 2 images. Each channel is processed individually.
Computes absolute difference between pixels of 2 images. Each channel is processed individually.
===Function===
====Function====
{|
{|
|style="font-size:150%;"|
|style="font-size:100%;"|
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
CuviStatus absDiff(const CuviImage& src1,
CuviStatus absDiff(const CuviImage& src1,
Line 11: Line 11:
</syntaxhighlight>
</syntaxhighlight>
|}
|}
===Parameters===


====Parameters====
{|
|style="font-size:75%;"|
{|class="wikitable"
{|class="wikitable"
|-
|-
Line 34: Line 36:
| CuviStream&
| CuviStream&
| GPU stream ID for execution
| GPU stream ID for execution
 
|}
|}
|}


===Image Type Support===
====Image Type Support====


{| class="wikitable"
{| class="wikitable"
Line 102: Line 104:
|}
|}


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



Latest revision as of 18:32, 18 October 2022

Computes absolute difference between pixels of 2 images. Each channel is processed individually.

Function

CuviStatus absDiff(const CuviImage& src1,
                   const CuviImage& src2,
                   CuviImage& dst,
                   const CuviStream& stream = CuviStream());

Parameters

Name Type Description
src1 const CuviImage& First Input Image
src2 const CuviImage& Second Input Image
dst CuviImage& Resultant Image
stream CuviStream& GPU stream ID for execution

Image Type Support

Input 1 Input 2 Output
8u 8u 8u
16u 16u 16u
32f 32f 32f
8u 8u 16u
8u 8u 32f
16u 16u 32f
8u 16u 16u
16u 8u 16u
8u 32f 32f
32f 8u 32f
8u 16u 32f
16u 8u 32f
16u 32f 32f
32f 16u 32f

Example

CuviImage gimg1 = cuvi::io::loadImage(path);
CuviImage gimg2 = cuvi::io::loadImage(path);
CuviImage gout;

//Compute absolute difference
cuvi::arithmeticLogical::absDiff(gimg1,gimg2,gout);