SMIL  0.8
 All Classes Functions Variables Groups Pages
Arithmetic operations
+ Collaboration diagram for Arithmetic operations:

Functions

template<class T >
RES_T absDiff (const Image< T > &imIn1, const Image< T > &imIn2, Image< T > &imOut)
 Absolute difference ("vertical distance") between two images. More...
 
template<class T >
RES_T add (const Image< T > &imIn1, const Image< T > &imIn2, Image< T > &imOut)
 Addition. More...
 
template<class T >
RES_T addNoSat (const Image< T > &imIn1, const Image< T > &imIn2, Image< T > &imOut)
 Addition (without saturation check) More...
 
template<class T >
RES_T clone (const Image< T > &imIn, Image< T > &imOut)
 Clone an image. More...
 
template<class T1 , class T2 >
RES_T compare (const Image< T1 > &imIn1, const char *compareType, const Image< T1 > &imIn2, const Image< T2 > &trueIm, const Image< T2 > &falseIm, Image< T2 > &imOut)
 Compare two images (or an image and a value) More...
 
template<class T1 , class T2 >
RES_T copy (const Image< T1 > &imIn, size_t startX, size_t startY, size_t startZ, size_t sizeX, size_t sizeY, size_t sizeZ, Image< T2 > &imOut, size_t outStartX=0, size_t outStartY=0, size_t outStartZ=0)
 Copy image. More...
 
template<class MCT1 , class T2 >
RES_T copyChannel (const Image< MCT1 > &imIn, const UINT &chanNum, Image< T2 > &imOut)
 Copy a channel of multichannel image into a single channel image. More...
 
template<class T1 , class MCT2 >
RES_T copyToChannel (const Image< T1 > &imIn, const UINT &chanNum, Image< MCT2 > &imOut)
 Copy a single channel image into a channel of multichannel image. More...
 
template<class T >
RES_T diff (const Image< T > &imIn1, const Image< T > &imIn2, Image< T > &imOut)
 Difference between two images.
 
template<class T >
RES_T div (const Image< T > &imIn1, const Image< T > &imIn2, Image< T > &imOut)
 Division.
 
template<class T1 , class T2 >
 ENABLE_IF (!IS_SAME(T1, UINT8)&&!IS_SAME(T1, UINT16), RES_T) applyLookup(const Image< T1 > &imIn
 Apply a lookup map.
 
template<class T >
RES_T equ (const Image< T > &imIn1, const Image< T > &imIn2, Image< T > &imOut)
 Equality operator. More...
 
template<class T >
bool equ (const Image< T > &imIn1, const Image< T > &imIn2)
 Test equality between two images. More...
 
template<class T >
RES_T fill (Image< T > &imOut, const T &value)
 Fill an image with a given value. More...
 
template<class T >
RES_T grt (const Image< T > &imIn1, const Image< T > &imIn2, Image< T > &imOut)
 Greater operator.
 
template<class T >
RES_T grtOrEqu (const Image< T > &imIn1, const Image< T > &imIn2, Image< T > &imOut)
 Greater or equal operator.
 
template<class T >
RES_T inf (const Image< T > &imIn1, const T &value, Image< T > &imOut)
 Inf of two images.
 
template<class T >
RES_T inv (const Image< T > &imIn, Image< T > &imOut)
 Invert an image. More...
 
template<class T >
RES_T logicAnd (const Image< T > &imIn1, const Image< T > &imIn2, Image< T > &imOut)
 Logic AND operator.
 
template<class T >
RES_T logicOr (const Image< T > &imIn1, const Image< T > &imIn2, Image< T > &imOut)
 Logic OR operator.
 
template<class T >
RES_T logicXOr (const Image< T > &imIn1, const Image< T > &imIn2, Image< T > &imOut)
 Logic XOR operator.
 
template<class T >
RES_T low (const Image< T > &imIn1, const Image< T > &imIn2, Image< T > &imOut)
 Lower operator.
 
template<class T >
RES_T lowOrEqu (const Image< T > &imIn1, const Image< T > &imIn2, Image< T > &imOut)
 Lower or equal operator.
 
template<class T >
RES_T mask (const Image< T > &imIn, const Image< T > &imMask, Image< T > &imOut)
 Image mask. More...
 
template<class T1 , class MCT2 >
RES_T mergeChannels (const Image< T1 > &imIn, Image< MCT2 > &imOut)
 Merge slices of a 3D image into a multichannel image. More...
 
template<class T >
RES_T mul (const Image< T > &imIn1, const Image< T > &imIn2, Image< T > &imOut)
 Multiply.
 
template<class T >
RES_T mulNoSat (const Image< T > &imIn1, const Image< T > &imIn2, Image< T > &imOut)
 Multiply (without type max check)
 
template<class T >
RES_T randFill (Image< T > &imOut)
 Fill an image with random values. More...
 
template<class MCT1 , class T2 >
RES_T splitChannels (const Image< MCT1 > &imIn, Image< T2 > &im3DOut)
 Split channels of multichannel image to a 3D image with each channel on a Z slice. More...
 
template<class T >
RES_T sub (const Image< T > &imIn1, const Image< T > &imIn2, Image< T > &imOut)
 Subtraction. More...
 
template<class T >
RES_T subNoSat (const Image< T > &imIn1, const Image< T > &imIn2, Image< T > &imOut)
 Subtraction (without type minimum check) More...
 
template<class T >
RES_T sup (const Image< T > &imIn1, const Image< T > &imIn2, Image< T > &imOut)
 Sup of two images.
 
template<class T1 , class T2 >
RES_T test (const Image< T1 > &imIn1, const Image< T2 > &imIn2, const Image< T2 > &imIn3, Image< T2 > &imOut)
 Test. More...
 
template<class T1 , class T2 >
void copyLine (const typename Image< T1 >::lineType lIn, const size_t size, typename Image< T2 >::lineType lOut)
 copy line
 

Detailed Description

Function Documentation

RES_T smil::absDiff ( const Image< T > &  imIn1,
const Image< T > &  imIn2,
Image< T > &  imOut 
)

Absolute difference ("vertical distance") between two images.

Returns
abs(p1-p2) for each pixels pair.
RES_T smil::add ( const Image< T > &  imIn1,
const Image< T > &  imIn2,
Image< T > &  imOut 
)

Addition.

Addition between two images (or between an image and a constant value)

Parameters
imIn1input image 1
imIn2(or val) input image 2 (or constant value)
imOutoutput image
See Also
Image::operator+
RES_T smil::addNoSat ( const Image< T > &  imIn1,
const Image< T > &  imIn2,
Image< T > &  imOut 
)

Addition (without saturation check)

Addition between two images (or between an image and a constant value) without checking the saturation

Parameters
imIn1input image 1
imIn2 (or val)input image 2 (or constant value)
imOutoutput image
RES_T smil::clone ( const Image< T > &  imIn,
Image< T > &  imOut 
)

Clone an image.

Set same size and copy contents

RES_T smil::compare ( const Image< T1 > &  imIn1,
const char *  compareType,
const Image< T1 > &  imIn2,
const Image< T2 > &  trueIm,
const Image< T2 > &  falseIm,
Image< T2 > &  imOut 
)

Compare two images (or an image and a value)

RES_T smil::copy ( const Image< T1 > &  imIn,
size_t  startX,
size_t  startY,
size_t  startZ,
size_t  sizeX,
size_t  sizeY,
size_t  sizeZ,
Image< T2 > &  imOut,
size_t  outStartX = 0,
size_t  outStartY = 0,
size_t  outStartZ = 0 
)

Copy image.

Copy an image (or a zone) into an output image

Parameters
imIninput image
startX startY [startZ](optional) start position of the zone in the input image
sizeX sizeY [sizeZ](optional) size of the zone in the input image
imOutoutput image
outStartX outStartY [outStartZ](optional) position to copy the selected zone in the output image (default is the origin (0,0,0))
Examples:
copy_crop.py
RES_T smil::copyChannel ( const Image< MCT1 > &  imIn,
const UINT &  chanNum,
Image< T2 > &  imOut 
)

Copy a channel of multichannel image into a single channel image.

Examples:
multichannel_operations.py
RES_T smil::copyToChannel ( const Image< T1 > &  imIn,
const UINT &  chanNum,
Image< MCT2 > &  imOut 
)

Copy a single channel image into a channel of multichannel image.

Examples:
multichannel_operations.py
RES_T smil::equ ( const Image< T > &  imIn1,
const Image< T > &  imIn2,
Image< T > &  imOut 
)

Equality operator.

Returns
[imOut] image with imOut(x)=max(T) when imIn1(x)=imIn2(x) and 0 otherwise
bool smil::equ ( const Image< T > &  imIn1,
const Image< T > &  imIn2 
)

Test equality between two images.

Returns
True if imIn1=imIn2, False otherwise
RES_T smil::fill ( Image< T > &  imOut,
const T &  value 
)

Fill an image with a given value.

Parameters
imOutOutput image.
valueThe value to fill.
Vectorized
Parallelized
See Also
Image::operator<<
RES_T smil::inv ( const Image< T > &  imIn,
Image< T > &  imOut 
)

Invert an image.

Parameters
imInInput image.
imOutOutput image.
See Also
Image::operator~
RES_T smil::mask ( const Image< T > &  imIn,
const Image< T > &  imMask,
Image< T > &  imOut 
)

Image mask.

Returns an image imOut where

  • imOut(x)=imIn(x) if imMask(x)!=0
  • imOut(x)=0 otherwise
RES_T smil::mergeChannels ( const Image< T1 > &  imIn,
Image< MCT2 > &  imOut 
)

Merge slices of a 3D image into a multichannel image.

Examples:
multichannel_operations.py
RES_T smil::randFill ( Image< T > &  imOut)

Fill an image with random values.

Parameters
imOutOutput image.
See Also
Image::operator<<
RES_T smil::splitChannels ( const Image< MCT1 > &  imIn,
Image< T2 > &  im3DOut 
)

Split channels of multichannel image to a 3D image with each channel on a Z slice.

Examples:
multichannel_operations.py
RES_T smil::sub ( const Image< T > &  imIn1,
const Image< T > &  imIn2,
Image< T > &  imOut 
)

Subtraction.

Subtraction between two images (or between an image and a constant value)

Parameters
imIn1input image 1
imIn2 (or val)input image 2 (or a constant value)
imOutoutput image containing imIn1-imIn2 (or imIn1-val)
RES_T smil::subNoSat ( const Image< T > &  imIn1,
const Image< T > &  imIn2,
Image< T > &  imOut 
)

Subtraction (without type minimum check)

Subtraction between two images (or between an image and a constant value)

Parameters
imIn1input image 1
imIn2 (or val)input image 2 (or a constant value)
imOutoutput image containing imIn1-imIn2 (or imIn1-val)
RES_T smil::test ( const Image< T1 > &  imIn1,
const Image< T2 > &  imIn2,
const Image< T2 > &  imIn3,
Image< T2 > &  imOut 
)

Test.

If imIn1(x)!=0, imOut(x)=imIn2(x)
imOut(x)=imIn3(x) otherwise.

Can also be used with constant values and result of operators.

Examples
test(im1>100, 255, 0, im2)