[mmNeg] [Up] [mmAddm] Operations

mmToggle
Image contrast enhancement or classification by the toggle operator.

Synopsis

Image mmToggle ( const Image& f , const Image& f1 , const Image& f2 , const String& OPTION = "GRAY" );

Input

f Image [ Gray-scale (uint8 or uint16) image ]

f1 Image [ Gray-scale (uint8 or uint16) image ]

f2 Image [ Gray-scale (uint8 or uint16) image ]

OPTION String

Values: 'BINARY' or 'GRAY'.

Default: "GRAY"

Output

y Image

binary image if option is 'BINARY' or same type as f

Description

mmToggle creates the image y that is an enhancement or classification of the image f by the toggle operator, with parameters f1 and f2. If the OPTION is 'GRAY', it performs an enhancement and, if the OPTION is 'BINARY', it performs a binary classification. In the enhancement, a pixel takes the value of the corresponding pixel in f1 or f2, according to a minimum distance criterion from f to f1 or f to f2. In the classification, the pixels in f nearest to f1 receive the value 0 , while the ones nearest to f2 receive the value 1.

Examples

Gray-scale option:


              

Binary option:

Equation

Gray-scale option
Binary option

Limitations

f1 must be less or equal f and f must be less or equal f2.

See also

mmThreshad Threshold (adaptive)
[mmNeg] [Up] [mmAddm]