Compute the complement of pixel values in binary or intensity images
Computer Vision Toolbox / Conversions
The Image Complement block computes the complement of a binary or intensity image.
For binary images, the block replaces pixel values equal to
1 and pixel values equal to
0. In the output image, black and white are reversed. For intensity
images, the block subtracts each pixel value from the maximum value that can be represented by
the input data type and outputs the difference. In the output image, dark areas become lighter
and light areas become darker.
For example, suppose the input pixel values are given by x(i) and the output pixel values are given by y(i). If the data type of the input is boolean, double or single, the block outputs y(i) = 1.0-x(i). If the input is an 8-bit unsigned integer, the block outputs y(i) = 255-x(i).
Port_1 — Input image
Specify an input image as a matrix of intensity values.
Port_1 — Output image
The complement of the binary or intensity input image is returned as a matrix of intensity values. The size and data type of the output image are the same as those of the input image.