imadd函式的使用
imadd Add two images or add constant to image.
Z = imadd(X,Y) adds each element in array X to the corresponding
element in array Y and returns the sum in the corresponding element
of the output array Z. X and Y are real, nonsparse, numeric arrays
or logical arrays with the same size and class, or Y is a scalar
double. Z has the same size and class as X unless X is logical, in
which case Z is double.
If Z is an integer array, then elements in the output that exceed the
range of the integer type are truncated, and fractional values are
rounded.
You can use the expression X+Y instead of imadd.
Example 1
---------
Add two images together:
I = imread('rice.png');
J = imread('cameraman.tif');
K = imadd(I,J);
figure, imshow(K)
Example 2
---------
Add a constant to an image:
I = imread('rice.png');
Iplus50 = imadd(I,50);
figure, imshow(I), figure, imshow(Iplus50)
See also imabsdiff, imcomplement, imdivide, imlincomb, immultiply,
imsubtract.
Reference page in Help browser
doc imadd