Difference between revisions of "Function:UnderwaterFilter"

From CUVI Wiki
(Created page with "__NOTOC__ Removes haze and brings out the real colors in underwater photography. Apart from removing haze, it also enhances the colors of haze-less images and is so additive t...")
 
 
(4 intermediate revisions by the same user not shown)
Line 30: Line 30:
| params
| params
| CuviEnhacementParams
| CuviEnhacementParams
| Includes '''bool''' autoColor, '''Cuvi32i''' filterStrength and '''Cuvi64f''' deGalreAmount.
| '''bool''' autoColor, '''Cuvi32i''' filterStrength, '''Cuvi64f''' deGalreAmount.
|-
|-
| stream
| stream
Line 47: Line 47:
| 8uC3
| 8uC3
| 8uC3
| 8uC3
|-
| 16uC3
| 16uC3
|}
|}


Line 55: Line 52:
{|
{|
|-
|-
|[[File:Dark.jpg|frame|Input]]
|[[File:Haze.jpg|frame|Input]]
|[[File:Light.jpg|frame|Output]]
|[[File:Nohaze.jpg|frame|Output]]
|}
|}


Line 63: Line 60:
|style="font-size:150%;"|
|style="font-size:150%;"|
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
CuviImage input("D:/lowlight.jpg", CUVI_LOAD_IMAGE_COLOR_KEEP_DEPTH), output;
       
        CuviImage input("D:/undersea.jpg", CUVI_LOAD_IMAGE_COLOR_KEEP_DEPTH);
//Perform low-light enhancement
CuviImage output;
cuvi::colorOperations::lowlight(input, output);


//Save Output to file
cuvi::io::saveImage(output, "D:/enhanced.jpg");
CuviEnhancementParams p;
p.autoColor = false;
p.filterStrength = 2;
p.deGalreAmount =  0.657;
        //Filter
        CuviStatus s;
s = cuvi::imageFiltering::underwaterFilter(input, output, p);
        //Print error status
cout << "Status: " << s <<endl;
        //Save output to file
cuvi::io::saveImage(out, "D:/output_image.jpg");


</syntaxhighlight>
</syntaxhighlight>
|}
|}

Latest revision as of 19:05, 27 March 2018

Removes haze and brings out the real colors in underwater photography. Apart from removing haze, it also enhances the colors of haze-less images and is so additive that you start using it on every underwater photo by default.

Function

CuviStatus cuvi::imageFiltering::underwaterFilter(const CuviImage& src,
                                                  CuviImage& dst,
                                                  CuviEnhamcementParams params = CuviEnhancementParams(),
                                                  const CuviStream& stream = CuviStream());

Parameters

Name Type Description
src const CuviImage& Input Image
dst CuviImage& Output Image
params CuviEnhacementParams bool autoColor, Cuvi32i filterStrength, Cuvi64f deGalreAmount.
stream const CuviStream& GPU stream ID for execution

Image Type Support

Input Output
8uC3 8uC3

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:/undersea.jpg", CUVI_LOAD_IMAGE_COLOR_KEEP_DEPTH);
	CuviImage output;

	
	CuviEnhancementParams p;
	p.autoColor = false;
	p.filterStrength = 2;
	p.deGalreAmount =  0.657;
	
        //Filter
        CuviStatus s;
	s = cuvi::imageFiltering::underwaterFilter(input, output, p);
	
        //Print error status
	cout << "Status: " << s <<endl;
        //Save output to file
	cuvi::io::saveImage(out, "D:/output_image.jpg");