Difference between revisions of "Function:Dehaze"

From CUVI Wiki
Line 66: Line 66:


===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===

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");