Difference between revisions of "Function:Adjust"

From CUVI Wiki
Line 16: Line 16:
===Parameters===
===Parameters===


{| class="wikitable"
{| style="width:70%;"| class="wikitable"
|-
|-
! Name
! Name
Line 28: Line 28:
| LOW_IN
| LOW_IN
| Cuvi32f
| Cuvi32f
|style="width:70%";| 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
| 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
| HIGH_IN

Revision as of 19:30, 25 April 2012

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.

Function

CUVI_EXPORTS CuviStatus adjust(CuviImage* src,
			       Cuvi32f LOW_IN=0,
			       Cuvi32f HIGH_IN=1,
			       Cuvi32f LOW_OUT=0,
			       Cuvi32f HIGH_OUT=1);

Parameters

Name Type Description
src 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

Image Type Support

Input Output
8uC1 8uC1
8uC3 8uC3

Samples

Error creating thumbnail: Unable to save thumbnail to destination
Input Image
Error creating thumbnail: Unable to save thumbnail to destination
Adjusted Image


Example

//Create an 8-bit Grays-scale CuviImage
CuviImage *gpu_image = new CuviImage(size, depth, channels);

//Populate the Image
gpu_image->upload(imageData);

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