主要内容

imcomplement

补充图像

描述

例子

j= imcomplement(计算补充of the image并返回结果j

例子

全部收缩

x = uint8([255 10 75; 44 225 100]);x2 = imcomplement(x)
x2 =2x3 uint8 matrix0 245 180 211 30 155
bw = imread('text.png');bw2 = imcomplement(bw);Imshowpair(BW,BW2,'剪辑'

图包含一个轴对象。轴对象包含类型图像的对象。

i = imread('cameraman.tif');j = imcomplement(i);imshowpair(i,j,'剪辑'

图包含一个轴对象。轴对象包含类型图像的对象。

在工作区中阅读颜色图像。

rgb = imread('yellowlily.jpg');IMShow(RGB)

图包含一个轴对象。轴对象包含类型图像的对象。

显示图像的补充。

c = imcomplement(rgb);imshow(c)

图包含一个轴对象。轴对象包含类型图像的对象。

每一个颜色通道的图像是complement of the corresponding color channel in the original image. Regions that were dark, such as dirt, become light. In the original image, the leaves appear green, and petals appear yellow because of a mixture of red and green signals. In the complement image, the leaves appear purple because the red and blue signals are larger than the green signal. The flower petals appear blue because the blue signal is larger than the red and green channels.

输入参数

全部收缩

输入图像,指定为RGB,灰度或二进制图像。

数据类型:单身的|双倍的|int8|INT16|INT32|UINT8|UINT16|UINT32|逻辑

输出参数

全部收缩

图像补充,指定为RGB,灰度或二进制图像。j具有与输入图像相同的大小和类

更多关于

全部收缩

图像补充

在二进制图像的补充中,零成为零图像,并变成零。黑白相反。

在灰度或颜色图像的补充中,每个像素值是从类支持的最大像素值(或为双重精确图像的1.0)中减去的。万博1manbetx差异用作输出图像中的像素值。在输出图像中,黑暗区域变得更轻,光面积变暗。对于颜色图像,红色变成青色,绿色变成洋红色,蓝色变成黄色,反之亦然。

提示

  • 如果是类的灰度或RGB图像双倍的,然后您可以使用表达式1-i而不是此功能。

  • 如果是二进制图像,然后您可以使用表达式〜I而不是此功能。

扩展功能

在R2006a之前引入