| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Video and Image Processing Blockset |
| Contents | Index |
| Learn more about Video and Image Processing Blockset |
Conversions

The Image Complement block computes the complement of a binary, intensity, or RGB image. For binary images, the block replaces pixel values equal to 0 with 1 and pixel values equal to 1 with 0. For an intensity or RGB image, the block subtracts each pixel value from the maximum value that can be represented by the input data type and outputs the difference.
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 double or single precision floating-point, 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 | Input/Output | Supported Data Types | Complex Values Supported |
|---|---|---|---|
Input | Vector or matrix of intensity values |
| No |
Output | Complement of a binary, intensity, or RGB image | Same as Input port | No |
The dimensions, data type, complexity, and frame status of the input and output signals are the same.
The Image Complement dialog box appears as shown in the following figure.

Video and Image Processing Blockset software | |
Video and Image Processing Blockset software | |
Video and Image Processing Blockset software | |
Image Processing Toolbox software |
![]() | Hough Transform | Image Data Type Conversion | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |