Difference between revisions of "Function:Dehaze"

From CUVI Wiki
 
(4 intermediate revisions by the same user not shown)
Line 14: Line 14:
|}
|}


===Parameters===
====Parameters====
 
{|
|style="font-size:75%;"|
{|class="wikitable"
{|class="wikitable"
|-
|-
Line 45: Line 46:
| const 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 60: Line 62:
| 16uC3
| 16uC3
| 16uC3
| 16uC3
|}
|}
|}


===Sample===
====Sample====
{|
[[File:Bliz.jpg|none|frame|Input]]
|-
<br/>
|[[File:Bliz.jpg|frame|Input]]
[[File:Nobliz.jpg|none|frame|Output]]
|[[File:Nobliz.jpg|frame|Output]]
<br/>
|}


===Example===
====Example====
{|
{|
|style="font-size:150%;"|
|style="font-size:100%;"|
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
CuviImage input("D:/blizzard.jpg", CUVI_LOAD_IMAGE_COLOR_KEEP_DEPTH), output;
CuviImage input("D:/blizzard.jpg", CUVI_LOAD_IMAGE_COLOR_KEEP_DEPTH), output;

Latest revision as of 20:55, 18 October 2022

Makes sense of hazy images. Note this function is ideal for extreme blizzard and very low visibility. For small hazes, we prefer using Function:adjust.

Function

CuviStatus cuvi::colorOperations::dehaze(const CuviImage& src,
                                         CuviImage& dst,
                                         int max0,
                                         int max1,
                                         int max2,
                                         const CuviStream& stream = CuviStream());

Parameters

Name Type Description
src const CuviImage& Input Image
dst CuviImage& Output Image
max0 int Maximum Value to consider in Channel 1
max1 int Maximum Value to consider in Channel 2
max2 int Maximum Value to consider in Channel 3
stream const CuviStream& GPU stream ID for execution

Image Type Support

Input Output
8uC3 8uC3
16uC3 16uC3

Sample

Error creating thumbnail: Unable to save thumbnail to destination
Input


Error creating thumbnail: Unable to save thumbnail to destination
Output


Example

CuviImage input("D:/blizzard.jpg", CUVI_LOAD_IMAGE_COLOR_KEEP_DEPTH), output;
 
//Perform dehaze. For most practical purposes the max values will be container's max. 
cuvi::colorOperations::dehaze(input, output, 255, 255, 255);

//Save Output to file
cuvi::io::saveImage(output, "D:/sense.jpg");