Difference between revisions of "Function:LUT"

From CUVI Wiki
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
Remaps image values according to look up table.
Remaps image values according to look up table.
===Function===
====Function====
{|
{|
|style="font-size:150%;"|
|style="font-size:100%;"|
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">


Line 13: Line 13:
</syntaxhighlight>
</syntaxhighlight>
|}
|}
===Parameters===


====Parameters====
{|
|style="font-size:75%;"|
{|class="wikitable"
{|class="wikitable"
|-
|-
Line 36: Line 38:
| CuviStream&
| 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 48: Line 51:
|-
|-
| 8uC3
| 8uC3
|-
| 16uC1
|}
|}
|}


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



Latest revision as of 16:24, 31 October 2022

Remaps image values according to look up table.

Function

CuviStatus LUT(const CuviImage& src,
               const CuviImage& mapping,
               CuviImage& dst,
               const CuviStream& stream = CuviStream());

Parameters

Name Type Description
src CuviImage& Input Image
mapping CuviImage& The look-up table
dst CuviImage& Resultant Image
stream CuviStream& GPU stream ID for execution

Image Type Support

Type
8uC1
8uC3
16uC1

Example

CuviImage input = cuvi::io::loadImage(path), output;

//Create LUT on host
const int mappingSize = 256;

unsigned char mappingValues[mappingSize];

//Initialize LUT with values which invert the image values
for(int i=0; i<mappingSize; i++)
    mappingValues[i] = 255 - i;

//Create and upload LUT matrix on device
CuviImage mapping(mappingSize,1, CUVI_8UC1);
mapping.upload(mappingValues, sizeof(mappingValues));

cuvi::colorOperations::LUT( input, mapping, output );