$extrastylesheet
Olena  User documentation 2.1
An Image Processing Platform
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Data Manipulation

Functions

template<typename I , typename O >
void mln::data::abs (const Image< I > &input, Image< O > &output)
template<typename I >
void mln::data::abs_inplace (Image< I > &input)
template<typename I , typename F >
void mln::data::apply (Image< I > &input, const Function_v2v< F > &f)
template<typename V , typename I >
mln::trait::ch_value< I, V >::ret mln::data::convert (const V &v, const Image< I > &input)
template<typename I , typename D >
void mln::data::fill (Image< I > &ima, const D &data)
template<typename I , typename J >
void mln::data::paste (const Image< I > &input, Image< J > &output)
template<typename I , typename J >
void mln::data::paste_without_localization (const Image< I > &input, Image< J > &output)
template<typename I >
void mln::data::replace (Image< I > &input, const typename I::value &old_value, const typename I::value &new_value)
template<typename V , typename I >
mln::trait::ch_value< I, V >::ret mln::data::saturate (V v, const Image< I > &input)
template<typename I , typename V >
mln::trait::ch_value< I, V >::ret mln::data::saturate (const Image< I > &input, const V &min, const V &max)
template<typename I >
void mln::data::saturate_inplace (Image< I > &input, const typename I::value &min, const typename I::value &max)
template<typename I , typename J >
void mln::data::split (const Image< I > &input, Image< J > &r, Image< J > &g, Image< J > &b)
template<typename V , typename I >
mln::trait::ch_value< I, V >::ret mln::data::stretch (const V &v, const Image< I > &input)
template<typename I , typename O >
void mln::data::to_enc (const Image< I > &input, Image< O > &output)
template<typename I , typename F >
mln::trait::ch_value< I,
typename F::result >::ret 
mln::data::transform (const Image< I > &input, const Function_v2v< F > &f)
template<typename I1 , typename I2 , typename F >
mln::trait::ch_value< I1,
typename F::result >::ret 
mln::data::transform (const Image< I1 > &input1, const Image< I2 > &input2, const Function_vv2v< F > &f)
template<typename V , typename I >
mln::trait::ch_value< I, V >::ret mln::data::wrap (const V &v, const Image< I > &input)

Detailed Description

All routines related to Image Data Manipulation.

Function Documentation

template<typename I , typename O >
void mln::data::abs ( const Image< I > &  input,
Image< O > &  output 
)

Apply the absolute value (abs) function to image pixel values.

Parameters
[in]inputThe input image.
[out]outputThe output image.
template<typename I >
void mln::data::abs_inplace ( Image< I > &  input)

Apply the absolute value (abs) function to image pixel values.

Parameters
[in,out]inputThe input image.
template<typename I , typename F >
void mln::data::apply ( Image< I > &  input,
const Function_v2v< F > &  f 
)

Apply a function-object to the image input.

Parameters
[in,out]inputThe input image.
[in]fThe function-object.

This routine runs:
for all p of input, input(p) = f( input(p) )

This routine is equivalent to data::tranform(input, f, input) but it is faster since a single iterator is required.

template<typename V , typename I >
mln::trait::ch_value< I , V >::ret mln::data::convert ( const V &  v,
const Image< I > &  input 
)

Convert the image input by changing the value type.

Parameters
[in]vA value of the destination type.
[in]inputThe input image.
template<typename I , typename D >
void mln::data::fill ( Image< I > &  ima,
const D &  data 
)

Fill the whole image ima with the data provided by aux.

Parameters
[in,out]imaThe image to be filled.
[in]dataThe auxiliary data to fill the image ima.
Precondition
ima has to be initialized.
template<typename I , typename J >
void mln::data::paste ( const Image< I > &  input,
Image< J > &  output 
)

Paste the contents of image input into the image output.

Parameters
[in]inputThe input image providing pixels values.
[in,out]outputThe image in which values are assigned.

This routine runs:
for all p of input, output(p) = input(p).

Warning
The definition domain of input has to be included in the one of output; so using mln::safe_image does not make pasting outside the output domain work.
Precondition
input.domain <= output.domain
template<typename I , typename J >
void mln::data::paste_without_localization ( const Image< I > &  input,
Image< J > &  output 
)

Paste the contents of image input into the image output without taking into account the localization of sites.

Parameters
[in]inputThe input image providing pixels values.
[in,out]outputThe image in which values are assigned.
template<typename I >
void mln::data::replace ( Image< I > &  input,
const typename I::value &  old_value,
const typename I::value &  new_value 
)

Replace old_value by new_value in the image input.

Parameters
[in]inputThe input image.
[in]old_valueThe value to be replaced...
[in]new_value...by this one.
template<typename V , typename I >
mln::trait::ch_value< I , V >::ret mln::data::saturate ( v,
const Image< I > &  input 
)

Apply the saturate function to image pixel values.

Parameters
[in]vA value of the output type.
[in]inputThe input image.

The saturation is based on the min and max values of the output value type. This assumes that the range of values in the input image is larger than the one of the output image.

template<typename I , typename V >
mln::trait::ch_value< I , V >::ret mln::data::saturate ( const Image< I > &  input,
const V &  min,
const V &  max 
)

Apply the saturate function to image pixel values.

Parameters
[in]inputThe input image.
[in]minThe minimum output value.
[in]maxThe maximum output value.
template<typename I >
void mln::data::saturate_inplace ( Image< I > &  input,
const typename I::value &  min,
const typename I::value &  max 
)

Apply the saturate function to image pixel values.

Parameters
[in,out]inputThe input image.
[in]minThe minimum output value.
[in]maxThe maximum output value
template<typename I , typename J >
void mln::data::split ( const Image< I > &  input,
Image< J > &  r,
Image< J > &  g,
Image< J > &  b 
)

Split a color RGB image into 3 images.

template<typename V , typename I >
mln::trait::ch_value< I , V >::ret mln::data::stretch ( const V &  v,
const Image< I > &  input 
)

Stretch the values of input so that they can be stored in output.

Parameters
[in]vA value to set the output value type.
[in]inputThe input image.
Returns
A stretch image with values of the same type as v.
Precondition
input.is_valid
template<typename I , typename O >
void mln::data::to_enc ( const Image< I > &  input,
Image< O > &  output 
)

Set the output image with the encoding values of the image input pixels.

Parameters
[in]inputThe input image.
[out]outputThe result image.
Precondition
output.domain >= input.domain
template<typename I , typename F >
mln::trait::ch_value< I , typename F ::result >::ret mln::data::transform ( const Image< I > &  input,
const Function_v2v< F > &  f 
)

Transform the image input through a function f.

Parameters
[in]inputThe input image.
[in]fThe function.

This routine runs:
for all p of input, output(p) = f( input(p) ).

template<typename I1 , typename I2 , typename F >
mln::trait::ch_value< I1 , typename F ::result >::ret mln::data::transform ( const Image< I1 > &  input1,
const Image< I2 > &  input2,
const Function_vv2v< F > &  f 
)

Transform two images input1 input2 through a function f.

Parameters
[in]input1The 1st input image.
[in]input2The 2nd input image.
[in]fThe function.

This routine runs:
for all p of input, output(p) = f( input1(p), input2(p) ).

template<typename V , typename I >
mln::trait::ch_value< I , V >::ret mln::data::wrap ( const V &  v,
const Image< I > &  input 
)

Routine to wrap values such as 0 -> 0 and [1, lmax] maps to [1, Lmax] (using modulus).

Parameters
[in]vThe target value type.
[in]inputInput image.
Returns
An image with wrapped values.