Difference between revisions of "Function:Adjust"

From CUVI Wiki
 
(34 intermediate revisions by the same user not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
==Adjust Image==
Maps the values of the input image evenly in the intensity map such that the pixel values of the adjusted image is spread across the intensity map of the image container.  The function adjusts of CUVI maps the intensities of the image between LOW_IN and HIGH_IN to the LOW_OUT and HIGH_OUT. By default all the values of the input images are mapped across the full intensity map.
Maps the values of the input image evenly in the intensity map such that the pixel values of the adjusted image is spread across the intensity map of the image container.  The function adjusts of CUVI maps the intensities of the image between LOW_IN and HIGH_IN to the LOW_OUT and HIGH_OUT. By default all the values of the input images are mapped across the full intensity map.


===Function===
====Function====
{|
{|
|style="font-size:125%;"|
|style="font-size:100%;"|
<syntaxhighlight lang="c">
<syntaxhighlight lang="cpp">
CUVI_EXPORTS CuviStatus adjust(CuviImage* src,
CuviStatus adjust(CuviImage& src,
      Cuvi32f LOW_IN=0,
          const CuviScalar& LOW_IN=0.0f,
      Cuvi32f HIGH_IN=1,
  const CuviScalar& HIGH_IN=1.0f,
      Cuvi32f LOW_OUT=0,
  const CuviScalar& LOW_OUT=0.0f,
      Cuvi32f HIGH_OUT=1);
  const CuviScalar& HIGH_OUT=1.0f,
                  const CuviStream& stream = CuviStream());
</syntaxhighlight>
</syntaxhighlight>
|}
|}
===Parameters===
Name Type Description
image CuviImage* Input Image
LOW_IN Cuvi32f Values above this point are mapped. If it’s 0.5 than all the values in the input image between an intensity value of 50% and HIGH_IN are mapped in output.
HIGH_IN Cuvi32f Values below this point are mapped
LOW_OUT Cuvi32f Output image doesn’t use the values below this point from the intensity map
HIGH_OUT Cuvi32f Output image doesn’t use the values above this point from the intensity map


====Parameters====
{|
|style="font-size:75%;"|
{|class="wikitable"
|-
! Name
! Type
! Description
|-
| src
| CuviImage&
| Input Image
|-
| LOW_IN
| const CuviScalar&
| Values above this point are mapped. If it’s 0.5 than all the values in the input image between an intensity value of 50% and HIGH_IN are mapped in output
|-
| HIGH_IN
| const CuviScalar&
| Values below this point are mapped.
|-
| LOW_OUT
| const CuviScalar&
| Output image doesn’t use the values below this point from the intensity map
|-
| HIGH_OUT
| const CuviScalar&
| Output image doesn’t use the values above this point from the intensity map
|-
| stream
| const CuviStream&
| GPU stream ID for execution
|}
|}


===Image Type Support===
====Image Type Support====
{|
{|
|style="font-size:75%;"|
{| class="wikitable"
|-
|-
|
! Input
!Input
! Output
|
!Output
|-
|-
|
| 8uC1
8uC1
| 8uC1
|
8uC3
|-
|-
|
| 8uC3
8uC1
| 8uC3
|
|}
8uC3
|}
|}


====Sample====
[[File:02_before.jpg|none|frame|Input Image]]
<br/>
[[File:02_imadjust.jpg|none|frame|Adjusted Image]]
<br/>


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


//Read an image from the disk
CuviImage image = cuvi::io::loadImage(path);


//Adjust!
cuvi::colorOperations::adjust(image);


===Samples===
</syntaxhighlight>
 
|}
Input Image Adjusted Image
 
Input Image     Adjusted Image
 
 
===Example===

Latest revision as of 05:50, 20 October 2022

Maps the values of the input image evenly in the intensity map such that the pixel values of the adjusted image is spread across the intensity map of the image container. The function adjusts of CUVI maps the intensities of the image between LOW_IN and HIGH_IN to the LOW_OUT and HIGH_OUT. By default all the values of the input images are mapped across the full intensity map.

Function

CuviStatus adjust(CuviImage& src,
	          const CuviScalar& LOW_IN=0.0f,
		  const CuviScalar& HIGH_IN=1.0f,
		  const CuviScalar& LOW_OUT=0.0f,
		  const CuviScalar& HIGH_OUT=1.0f,
                  const CuviStream& stream = CuviStream());

Parameters

Name Type Description
src CuviImage& Input Image
LOW_IN const CuviScalar& Values above this point are mapped. If it’s 0.5 than all the values in the input image between an intensity value of 50% and HIGH_IN are mapped in output
HIGH_IN const CuviScalar& Values below this point are mapped.
LOW_OUT const CuviScalar& Output image doesn’t use the values below this point from the intensity map
HIGH_OUT const CuviScalar& Output image doesn’t use the values above this point from the intensity map
stream const CuviStream& GPU stream ID for execution

Image Type Support

Input Output
8uC1 8uC1
8uC3 8uC3

Sample

Input Image


Adjusted Image


Example

//Read an image from the disk
CuviImage image = cuvi::io::loadImage(path);

//Adjust!
cuvi::colorOperations::adjust(image);