imadd
将两个图像相加或在图像中添加常量
说明
示例
将两个 uint8 数组相加
此示例说明如何将两个 uint8
数组相加并截断超过 255 的值。
X = uint8([ 255 0 75; 44 225 100]); Y = uint8([ 50 50 50; 50 50 50 ]); Z = imadd(X,Y)
Z = 2x3 uint8 matrix
255 50 125
94 255 150
将两个图像相加并指定输出类
将两个灰度 uint8
图像读入工作区中。
I = imread('rice.png'); J = imread('cameraman.tif');
将这两个图像相加。将输出指定为 uint16
类型以避免截断结果。
K = imadd(I,J,'uint16');
显示结果。
imshow(K,[])
在图像中添加常量
将图像读入工作区。
I = imread('rice.png');
在图像中添加一个常量。
J = imadd(I,50);
显示原始图像和结果。
imshow(I)
figure imshow(J)
输入参数
输出参量
版本历史记录
在 R2006a 之前推出
另请参阅
imabsdiff
| imcomplement
| imdivide
| imlincomb
| immultiply
| imsubtract
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)