Mathematical operations in image processing
-
Upload
asad-ali -
Category
Art & Photos
-
view
98 -
download
4
Transcript of Mathematical operations in image processing
![Page 1: Mathematical operations in image processing](https://reader030.fdocuments.in/reader030/viewer/2022032421/55a6ac6b1a28abee018b4834/html5/thumbnails/1.jpg)
Digital Image ProcessingAsad Ali. From BCS 6th
3395
![Page 2: Mathematical operations in image processing](https://reader030.fdocuments.in/reader030/viewer/2022032421/55a6ac6b1a28abee018b4834/html5/thumbnails/2.jpg)
What is Image Arithmetic?
Image arithmetic is the implementation of standard
arithmetic operations
![Page 3: Mathematical operations in image processing](https://reader030.fdocuments.in/reader030/viewer/2022032421/55a6ac6b1a28abee018b4834/html5/thumbnails/3.jpg)
What is Image Arithmetic?
Image arithmetic is the implementation of standard
arithmetic operations, such as
• Addition
![Page 4: Mathematical operations in image processing](https://reader030.fdocuments.in/reader030/viewer/2022032421/55a6ac6b1a28abee018b4834/html5/thumbnails/4.jpg)
What is Image Arithmetic?
Image arithmetic is the implementation of standard
arithmetic operations, such as
• Addition
• Subtraction
![Page 5: Mathematical operations in image processing](https://reader030.fdocuments.in/reader030/viewer/2022032421/55a6ac6b1a28abee018b4834/html5/thumbnails/5.jpg)
What is Image Arithmetic?
Image arithmetic is the implementation of standard
arithmetic operations, such as
• Addition
• Subtraction
• Multiplication
![Page 6: Mathematical operations in image processing](https://reader030.fdocuments.in/reader030/viewer/2022032421/55a6ac6b1a28abee018b4834/html5/thumbnails/6.jpg)
What is Image Arithmetic?
Image arithmetic is the implementation of standard
arithmetic operations, such as
• Addition
• Subtraction
• Multiplication
• Division
![Page 7: Mathematical operations in image processing](https://reader030.fdocuments.in/reader030/viewer/2022032421/55a6ac6b1a28abee018b4834/html5/thumbnails/7.jpg)
IA JUICED UP!!
![Page 8: Mathematical operations in image processing](https://reader030.fdocuments.in/reader030/viewer/2022032421/55a6ac6b1a28abee018b4834/html5/thumbnails/8.jpg)
Usage of Image Arithmetic
Image arithmetic has many uses in image processing both as a preliminary step in more complex operations and by itself.
For example:
Image subtraction can be used to detect differences
between two or more images of the same scene or
object.
![Page 9: Mathematical operations in image processing](https://reader030.fdocuments.in/reader030/viewer/2022032421/55a6ac6b1a28abee018b4834/html5/thumbnails/9.jpg)
HOW/WHERE you can useImage Arithmetic?
You can do image arithmetic using the MATLAB arithmetic
operators.
![Page 10: Mathematical operations in image processing](https://reader030.fdocuments.in/reader030/viewer/2022032421/55a6ac6b1a28abee018b4834/html5/thumbnails/10.jpg)
HOW/WHERE you can useImage Arithmetic?
You can do image arithmetic using the MATLAB arithmetic
operators.
But:-
Wait Wait Wait..!!!!!
![Page 11: Mathematical operations in image processing](https://reader030.fdocuments.in/reader030/viewer/2022032421/55a6ac6b1a28abee018b4834/html5/thumbnails/11.jpg)
HOW/WHERE you can useImage Arithmetic?
You can do image arithmetic using the MATLAB arithmetic
operators.
But remember to:
• Convert the images to class.
AND
• Double to use these operators.
![Page 12: Mathematical operations in image processing](https://reader030.fdocuments.in/reader030/viewer/2022032421/55a6ac6b1a28abee018b4834/html5/thumbnails/12.jpg)
Adding Images
To add two images or add a constant value to an image.
![Page 13: Mathematical operations in image processing](https://reader030.fdocuments.in/reader030/viewer/2022032421/55a6ac6b1a28abee018b4834/html5/thumbnails/13.jpg)
Adding Images
To add two images or add a constant value to an image.
• [imadd] functionadds the value of each pixel in one of the input images with the
corresponding pixel in the other input image and returns the
sum in the corresponding pixel of the output image.
![Page 14: Mathematical operations in image processing](https://reader030.fdocuments.in/reader030/viewer/2022032421/55a6ac6b1a28abee018b4834/html5/thumbnails/14.jpg)
USAGE of Adding Images
Image addition has many uses in image processing.
For example:
The following code fragment uses addition to superimpose one
image on top of another. The images must be the same size and
class. You can brighten your image too.
![Page 15: Mathematical operations in image processing](https://reader030.fdocuments.in/reader030/viewer/2022032421/55a6ac6b1a28abee018b4834/html5/thumbnails/15.jpg)
USAGE of Adding Images
Image addition has many uses in image processing.
For example:
The following code fragment uses addition to superimpose one
image on top of another. The images must be the same size and
class. You can brighten your image too.
I = imread(‘pic1.tif');
J = imread(‘pic2.tif');
K = imadd(I,J);
imshow(K)
![Page 16: Mathematical operations in image processing](https://reader030.fdocuments.in/reader030/viewer/2022032421/55a6ac6b1a28abee018b4834/html5/thumbnails/16.jpg)
USAGE of Adding Images
Image addition has many uses in image processing.
For example:
The following code fragment uses addition to superimpose one
image on top of another. The images must be the same size and
class. You can brighten your image too.
I = imread(‘pic1.tif');
J = imread(‘pic2.tif');
K = imadd(I,J);
imshow(K)
![Page 17: Mathematical operations in image processing](https://reader030.fdocuments.in/reader030/viewer/2022032421/55a6ac6b1a28abee018b4834/html5/thumbnails/17.jpg)
Multiplying Images
[immultiply] function.This does an element-by-element multiplication (.*) of each corresponding pixel in a pair
of input images and returns the product of these multiplications
in the corresponding pixel in an output image.
![Page 18: Mathematical operations in image processing](https://reader030.fdocuments.in/reader030/viewer/2022032421/55a6ac6b1a28abee018b4834/html5/thumbnails/18.jpg)
Multiplying Images
[immultiply] function.This does an element-by-element multiplication (.*) of each corresponding pixel in a pair
of input images and returns the product of these multiplications
in the corresponding pixel in an output image.
Scaling image processing operations.
Scaling brightens an image; a factor less than one darkens an image.
Scaling generally produces a much more natural brightening/darkening effect than simply adding an offset to the
pixels, since it preserves the relative contrast of the image better. For example, this code scales an image by a constant factor.
![Page 19: Mathematical operations in image processing](https://reader030.fdocuments.in/reader030/viewer/2022032421/55a6ac6b1a28abee018b4834/html5/thumbnails/19.jpg)
Multiplying Images Example Code
I = imread(‘pic.tif');
J = immultiply(I,1.2);
imshow(I);
figure, imshow(J);
![Page 20: Mathematical operations in image processing](https://reader030.fdocuments.in/reader030/viewer/2022032421/55a6ac6b1a28abee018b4834/html5/thumbnails/20.jpg)
Summary of Image Arithmetic Functions
Function Description
imabsdiff Absolute difference of two images
Imadd Add two images
imcomplement Complement an image
imdivide Divide two images
imlincomb Compute linear combination of two images
immultiply Multiply two images
imsubtract Subtract two images