0% found this document useful (0 votes)
115 views

Image Arithmetic: - Imabsdif - Imadd - Imcomplement - Imdivide - Imlincomb - Immultiply - Imsubtract

This document discusses various image arithmetic operations that can be performed in MATLAB, including adding, subtracting, multiplying, and dividing images. It provides examples of how to use the imadd, imsubtract, immultiply, and imdivide functions to combine two images, brighten or darken an image, scale an image's contrast, and compute a ratio between images. The document also briefly introduces other image arithmetic functions like imlincomb and their uses.

Uploaded by

shivanshu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
115 views

Image Arithmetic: - Imabsdif - Imadd - Imcomplement - Imdivide - Imlincomb - Immultiply - Imsubtract

This document discusses various image arithmetic operations that can be performed in MATLAB, including adding, subtracting, multiplying, and dividing images. It provides examples of how to use the imadd, imsubtract, immultiply, and imdivide functions to combine two images, brighten or darken an image, scale an image's contrast, and compute a ratio between images. The document also briefly introduces other image arithmetic functions like imlincomb and their uses.

Uploaded by

shivanshu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPSX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Image Arithmetic

imabsdif
imadd
imcomplement
imdivide

imlincomb
immultiply
imsubtract

Adding Images
I = imread(rice.tif);
J = imread(cameraman.tif);
K = imadd(I, J);
imshow(K)

Brighten an image results saturation


RGB = imread(flowers.tif);
RGB2 = imadd(RGB, 50);
subplot(1, 2, 1); imshow(RGB);
subplot(1, 2, 2); imshow(RGB2);

Adding Images (cont.)

Adding Images (cont.)

Subtracting Images
Background of a scene
rice = imread(rice.tif);
background = imopen(rice, strel(disk, 15));
rice2 = imsubtract(rice, background);
imshow(rice), figure, imshow(rice2);

Negative values
imabsdif

Subtracting Images (cont.)

Multiplying Images
Scaling: multiply by a constant
(brightens >1, darkens <1)

Preserves relative contrast


I = imread(moon.tif);
J = immultiply(I, 1.2);
imshow(I);
figure, imshow(J)

Multiplying Images (cont.)

Dividing Images (Ratioing)


I = imread(rice.tif);
background = imopen(I, strel(disk, 15));
Ip = imdivide(I, background);
imshow(Ip, [])

Linear combination only truncates


the final result
K = imlincomb(.5, I, .5, I2);

Dividing Images (cont.)

THANK YOU

You might also like