SMIL 1.1.1
Loading...
Searching...
No Matches
Value range conversion

Detailed Description

+ Collaboration diagram for Value range conversion:

Functions

template<class T >
RES_T fill (Image< T > &imOut, const T &value)
 fill() - Fill an image with a given value.
 
template<class T >
RES_T randFill (Image< T > &imOut)
 randFill() - Fill an image with random values.
 
template<class T1 , class T2 >
RES_T cast (const Image< T1 > &imIn, Image< T2 > &imOut)
 cast() - Cast from an image type to another
 
template<class T1 , class T2 >
RES_T scaleRange (const Image< T1 > &imIn, const T1 inMin, const T1 inMax, const T2 outMin, const T2 outMax, Image< T2 > &imOut)
 scaleRange() - Linear conversion of pixels values to the range [Min, Max]
 
template<class T1 , class T2 >
RES_T scaleRange (const Image< T1 > &imIn, const T2 Min, const T2 Max, Image< T2 > &imOut, bool onlyNonZero)
 scaleRange() - Linear conversion of pixel values to the range [Min, Max]
 
template<class T1 , class T2 >
RES_T scaleRange (const Image< T1 > &imIn, Image< T2 > &imOut, bool onlyNonZero)
 scaleRange() - Linear conversion of pixels values to the domain range
 
template<class T1 , class T2 >
RES_T sCurve (const Image< T1 > &imIn, const T1 pivot, const double ratio, Image< T2 > &imOut)
 sCurve() - S Curve transform
 

Function Documentation

◆ fill()

template<class T >
RES_T fill ( Image< T > &  imOut,
const T &  value 
)

fill() - Fill an image with a given value.

Parameters
[out]imOutOutput image.
[in]valueThe value to fill.
\htmlonly    <table border=0>    <tr><td><img src="vectorized.png" /> </td><td>Vectorized</td></tr>    </table>    \endhtmlonly
\htmlonly    <table border=0>    <tr><td><img src="parallelized.png" /> </td><td>Parallelized</td></tr>    </table>    \endhtmlonly
See also
Image::operator<<

◆ randFill()

template<class T >
RES_T randFill ( Image< T > &  imOut)

randFill() - Fill an image with random values.

Parameters
[in,out]imOutOutput image.
See also
Image::operator<<

◆ cast()

template<class T1 , class T2 >
RES_T cast ( const Image< T1 > &  imIn,
Image< T2 > &  imOut 
)

cast() - Cast from an image type to another

Copies the content of imIn into imOut scaling pixel values to the data type of imOut.

Parameters
[in]imIn: input image
[out]imOut: output image
Note
imOut shall be a previously allocated image with the same size of imIn.

◆ scaleRange() [1/3]

template<class T1 , class T2 >
RES_T scaleRange ( const Image< T1 > &  imIn,
const T1  inMin,
const T1  inMax,
const T2  outMin,
const T2  outMax,
Image< T2 > &  imOut 
)

scaleRange() - Linear conversion of pixels values to the range [Min, Max]

Values in the input image are linearly mapped into the output image with the following rules :

  • if imIn(x) <= inMin, imOut(x) will be mapped in the range [0, outMin]
  • if inMin < imIn(x) <= inMax, imOut(x) will be mapped in the range [outMin, outMax]
  • if imIn(x) > inMax, imOut(x) will be mapped in the range [outMax, max(T2)]
Parameters
[in]imIn: input Image
[in]inMin,inMax: control range in the input image
[in]outMin,outMax: control range in the output image
[out]imOut: output Image

◆ scaleRange() [2/3]

template<class T1 , class T2 >
RES_T scaleRange ( const Image< T1 > &  imIn,
const T2  Min,
const T2  Max,
Image< T2 > &  imOut,
bool  onlyNonZero 
)

scaleRange() - Linear conversion of pixel values to the range [Min, Max]

Maps a range of values in the input image into the range [Min, Max] in the output image.

If onlyNonZero is true uses [minVal(), maxVal()] as the range of values in the input image, otherwise, uses the full range of values.

Parameters
[in]imIn: input image
[in]Min: Minimum value in the output image
[in]Max: Maximum value in the output image
[out]imOut: output Image
[in]onlyNonZero: defines how to find input image range of values

◆ scaleRange() [3/3]

template<class T1 , class T2 >
RES_T scaleRange ( const Image< T1 > &  imIn,
Image< T2 > &  imOut,
bool  onlyNonZero 
)

scaleRange() - Linear conversion of pixels values to the domain range

Maps a range in the input image into the range [min(T2), max(T2)] in the output image.

If onlyNonZero is true uses [minVal(), maxVal()] as the range of values in the input image, otherwise, uses the full range of values.

Parameters
[in]imIn: input Image
[out]imOut: output Image
[in]onlyNonZero: defines how to find input image range of values

◆ sCurve()

template<class T1 , class T2 >
RES_T sCurve ( const Image< T1 > &  imIn,
const T1  pivot,
const double  ratio,
Image< T2 > &  imOut 
)

sCurve() - S Curve transform

This function emulates the S Curve caracteristic of film photography.

Use a sigmoid function centered at pivot with derivative ratio.

One use of this filter is to set (increase or decrease) the contrast in the neighborhood of the pivot.

Parameters
[in]imIn: input Image
[in]pivot:
  • if 0, takes the median of the histogram of input image as pivot
  • otherwise, use this value
[in]ratio: derivative of output image at pivot value
[out]imOut: output Image