SMIL  1.0.3
Comparison functions

Detailed Description

+ Collaboration diagram for Comparison functions:

Functions

template<class T1 , class T2 >
RES_T test (const Image< T1 > &imIn, const Image< T2 > &imInT, const Image< T2 > &imInF, Image< T2 > &imOut)
 test() - Test More...
 
template<class T1 , class T2 >
RES_T test (const Image< T1 > &imIn, const Image< T2 > &imInT, const T2 &value, Image< T2 > &imOut)
 test() - Test More...
 
template<class T1 , class T2 >
RES_T test (const Image< T1 > &imIn, const T2 &value, const Image< T2 > &imInF, Image< T2 > &imOut)
 test() - Test More...
 
template<class T1 , class T2 >
RES_T test (const Image< T1 > &imIn, const T2 &valueT, const T2 &valueF, Image< T2 > &imOut)
 test() - Test 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() - Compare each pixel of two images (or an image and a value) More...
 
template<class T1 , class T2 >
RES_T compare (const Image< T1 > &imIn1, const char *compareType, const Image< T1 > &imIn2, const T2 &trueVal, const Image< T2 > &falseIm, Image< T2 > &imOut)
 compare() - Compare each pixel of two images (or an image and a value) 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 T2 &falseVal, Image< T2 > &imOut)
 compare() - Compare each pixel of two images (or an image and a value) More...
 
template<class T1 , class T2 >
RES_T compare (const Image< T1 > &imIn1, const char *compareType, const Image< T1 > &imIn2, const T2 &trueVal, const T2 &falseVal, Image< T2 > &imOut)
 compare() - Compare each pixel of two images (or an image and a value) More...
 
template<class T1 , class T2 >
RES_T compare (const Image< T1 > &imIn, const char *compareType, const T1 &value, const Image< T2 > &trueIm, const Image< T2 > &falseIm, Image< T2 > &imOut)
 compare() - Compare each pixel of two images (or an image and a value) More...
 
template<class T1 , class T2 >
RES_T compare (const Image< T1 > &imIn, const char *compareType, const T1 &value, const T2 &trueVal, const Image< T2 > &falseIm, Image< T2 > &imOut)
 compare() - Compare each pixel of two images (or an image and a value) More...
 
template<class T1 , class T2 >
RES_T compare (const Image< T1 > &imIn, const char *compareType, const T1 &value, const Image< T2 > &trueIm, const T2 &falseVal, Image< T2 > &imOut)
 compare() - Compare each pixel of two images (or an image and a value) More...
 
template<class T1 , class T2 >
RES_T compare (const Image< T1 > &imIn, const char *compareType, const T1 &value, const T2 &trueVal, const T2 &falseVal, Image< T2 > &imOut)
 compare() - Compare each pixel of two images (or an image and a value) More...
 

Function Documentation

◆ test() [1/4]

RES_T smil::test ( const Image< T1 > &  imIn,
const Image< T2 > &  imInT,
const Image< T2 > &  imInF,
Image< T2 > &  imOut 
)

test() - Test

The result is a image where :

  • imOut(x) = (imIn(x) != 0 ? imInT(x] : imInF(x))
Parameters
[in]imIn: input image
[in]imInT: input image with values to set when true
[in]imInF: input image with values to set when false
[out]imOut: output image
Note
Can also be used with constant values and result of operators.
Example
import smilPython as sp
...
sp.test(imIn > 100, 255, 0, imOut)

◆ test() [2/4]

RES_T smil::test ( const Image< T1 > &  imIn,
const Image< T2 > &  imInT,
const T2 &  value,
Image< T2 > &  imOut 
)

test() - Test

The result is a image where :

  • imOut(x) = (imIn(x) != 0 ? imInT(x] : value)
Parameters
[in]imIn: input image
[in]imInT: input image with values to set when true
[in]value: input value to set when false
[out]imOut: output image

◆ test() [3/4]

RES_T smil::test ( const Image< T1 > &  imIn,
const T2 &  value,
const Image< T2 > &  imInF,
Image< T2 > &  imOut 
)

test() - Test

The result is a image where :

  • imOut(x) = (imIn(x) != 0 ? value : imInF(x])
Parameters
[in]imIn: input image
[in]value: input value to set when true
[in]imInF: input image with values to set when false
[out]imOut: output image

◆ test() [4/4]

RES_T smil::test ( const Image< T1 > &  imIn,
const T2 &  valueT,
const T2 &  valueF,
Image< T2 > &  imOut 
)

test() - Test

The result is a image where :

  • imOut(x) = (imIn(x) != 0 ? value : imInF(x])
Parameters
[in]imIn: input image
[in]valueT: input value to set when true
[in]valueF: input value to set when false
[out]imOut: output image

◆ compare() [1/8]

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() - Compare each pixel of two images (or an image and a value)

Compare each pixel of two images and set the corresponding pixel of imOut to the same pixel of trueIm if result is true or falseIm if not.

Parameters
[in]imIn1: input image
[in]compareType: one of "<", "<=", "==", "!=", ">=", ">"
[in]imIn2: input image (or a constant value)
[in]trueIm: image to take pixel values from when comparison is true
[in]falseIm: image to take pixel values from when comparison is false
[out]imOut: output image
Note
Parameters of kind image in this call (imIn2, trueIm and falseIm) can be replaced by the respective scalar values (value, trueVal and falseVal). See the next function prototypes.

◆ compare() [2/8]

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

compare() - Compare each pixel of two images (or an image and a value)

Compare each pixel of two images and set the corresponding pixel of imOut to trueVal if result is true or falseIm if not.

Parameters
[in]imIn1: input image
[in]compareType: one of "<", "<=", "==", "!=", ">=", ">"
[in]imIn2: input image (or a constant value)
[in]trueVal: value to set when comparison is true
[in]falseIm: image to take pixel values from when comparison is false
[out]imOut: output image

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

See also
the first reference to this function

◆ compare() [3/8]

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

compare() - Compare each pixel of two images (or an image and a value)

Compare each pixel of two images and set the corresponding pixel of imOut to the same pixel of trueIm if result is true or falseVal if not.

Parameters
[in]imIn1: input image
[in]compareType: one of "<", "<=", "==", "!=", ">=", ">"
[in]imIn2: input image
[in]trueIm: image to take pixel values from when comparison is true
[in]falseVal: value to set when comparison is false
[out]imOut: output image

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

See also
the first reference to this function

◆ compare() [4/8]

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

compare() - Compare each pixel of two images (or an image and a value)

Compare each pixel of two images and set the corresponding pixel of imOut to trueVal if result is true or falseVal if not.

Parameters
[in]imIn1: input image
[in]compareType: one of "<", "<=", "==", "!=", ">=", ">"
[in]imIn2: input image
[in]trueVal: value to set when comparison is true
[in]falseVal: value to set when comparison is false
[out]imOut: output image

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

See also
the first reference to this function

◆ compare() [5/8]

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

compare() - Compare each pixel of two images (or an image and a value)

Compare each pixel of an image and a value and set the corresponding pixel of imOut to the same pixel of trueIm if result is true or falseIm if not.

Parameters
[in]imIn: input image
[in]compareType: one of "<", "<=", "==", "!=", ">=", ">"
[in]value: input value
[in]trueIm: image to take pixel values from when comparison is true
[in]falseIm: image to take pixel values from when comparison is false
[out]imOut: output image

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

See also
the first reference to this function

◆ compare() [6/8]

RES_T smil::compare ( const Image< T1 > &  imIn,
const char *  compareType,
const T1 &  value,
const T2 &  trueVal,
const Image< T2 > &  falseIm,
Image< T2 > &  imOut 
)

compare() - Compare each pixel of two images (or an image and a value)

Compare each pixel of an image and a value and set the corresponding pixel of imOut to trueVal if result is true or falseIm if not.

Parameters
[in]imIn: input image
[in]compareType: one of "<", "<=", "==", "!=", ">=", ">"
[in]value: input value
[in]trueVal: value to set when comparison is true
[in]falseIm: image to take pixel values from when comparison is false
[out]imOut: output image

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

See also
the first reference to this function

◆ compare() [7/8]

RES_T smil::compare ( const Image< T1 > &  imIn,
const char *  compareType,
const T1 &  value,
const Image< T2 > &  trueIm,
const T2 &  falseVal,
Image< T2 > &  imOut 
)

compare() - Compare each pixel of two images (or an image and a value)

Compare each pixel of an image and a value and set the corresponding pixel of imOut to the same pixel of trueIm if result is true or falseVal if not.

Parameters
[in]imIn: input image
[in]compareType: one of "<", "<=", "==", "!=", ">=", ">"
[in]value: input value
[in]trueIm: image to take pixel values from when comparison is true
[in]falseVal: value to set when comparison is false
[out]imOut: output image

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

See also
the first reference to this function

◆ compare() [8/8]

RES_T smil::compare ( const Image< T1 > &  imIn,
const char *  compareType,
const T1 &  value,
const T2 &  trueVal,
const T2 &  falseVal,
Image< T2 > &  imOut 
)

compare() - Compare each pixel of two images (or an image and a value)

Compare each pixel of an image and a value and set the corresponding pixel of imOut to trueVal if result is true or falseVal if not.

Parameters
[in]imIn: input image
[in]compareType: one of "<", "<=", "==", "!=", ">=", ">"
[in]value: input value
[in]trueVal: value to set when comparison is true
[in]falseVal: value to set when comparison is false
[out]imOut: output image

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

See also
the first reference to this function