Difference between revisions of "Function:Adjust"

From CUVI Wiki
Line 23: Line 23:
|-
|-
| src
| src
| CuviImage*
| CuviImage&
| Input Image
| Input Image
|-
|-
| LOW_IN
| LOW_IN
| Cuvi32f
| 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
| 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
| Cuvi32f
| const CuviScalar&
| Values below this point are mapped
| Values below this point are mapped
|-
|-
| LOW_OUT
| LOW_OUT
| Cuvi32f
| const CuviScalar&
| Output image doesn’t use the values below this point from the intensity map
| Output image doesn’t use the values below this point from the intensity map
|-
|-
| HIGH_OUT
| HIGH_OUT
| Cuvi32f
| const CuviScalar&
| Output image doesn’t use the values above this point from the intensity map
| Output image doesn’t use the values above this point from the intensity map
|-
|-
| stream  
| stream  
| CuviStream*
| const CuviStream&
| GPU stream ID for execution
| GPU stream ID for execution



Revision as of 05:24, 18 April 2013

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,
	          Cuvi32f LOW_IN=0.0f,
		  Cuvi32f HIGH_IN=1.0f,
		  Cuvi32f LOW_OUT=0.0f,
		  Cuvi32f HIGH_OUT=1.0f,
                  CuviStream* stream = NULL);

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

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

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

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