0% found this document useful (0 votes)
15 views16 pages

Arithmetic Operations

This document discusses various arithmetic operations that can be performed on digital images, including addition, subtraction, multiplication, division, and blending. It provides examples of how each operation is carried out on images at the pixel level. Some key points covered include: - Arithmetic operations allow combining two images or modifying a single image with a constant value. - The results must be within the allowed data range determined by the image type (e.g. 0-255 for 8-bit images) or they will be clipped. - Examples demonstrate how different pixel values are combined through addition, subtraction, multiplication and division on sample 2x2 images.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views16 pages

Arithmetic Operations

This document discusses various arithmetic operations that can be performed on digital images, including addition, subtraction, multiplication, division, and blending. It provides examples of how each operation is carried out on images at the pixel level. Some key points covered include: - Arithmetic operations allow combining two images or modifying a single image with a constant value. - The results must be within the allowed data range determined by the image type (e.g. 0-255 for 8-bit images) or they will be clipped. - Examples demonstrate how different pixel values are combined through addition, subtraction, multiplication and division on sample 2x2 images.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Arithmetic Operations in Digital Image Processing

Prepared by:
Team of Lecturers
Department of Electrical Engineering
Overview

There are such cases where we need to combine two different images altogether.

This can be performed by utilizing arithmetic operations.

These operations include image addition, subtraction, multiplication, division, and


blending.

1
One thing should be taken into
consideration
During the arithmetic operation, ensure that the result does not go beyond the allowed range. If
the result goes beyond, the pixel value is set to the maximum allowed range.

If a particular level is set, the value of each element cannot exceed that level.

Data Type Data Range


Uint8 0-255
Uint16 0-65,535
Uint32 0-4,294,967,295

Data type and allowed ranges

2
Image Addition

Two images can be added in a direct manner, as given by


𝑔 𝑥, 𝑦 = 𝑓1 𝑥, 𝑦 + 𝑓2 (𝑥, 𝑦)

Similarly, it is possible to add a constant value to a single image, as follows:

𝑔 𝑥, 𝑦 = 𝑓1 𝑥, 𝑦 + 𝑘

The higher the pixel value from


zero, the brighter the image will be

3
Image Addition
For instance,

10 12 5 7 15 19
+ =
9 14 9 3 18 17

+ 50 =

4
Image Addition
Another example,

+ =

5
Image Subtraction

Two images can be subtracted in a direct manner, as given by


𝑔 𝑥, 𝑦 = 𝑓1 𝑥, 𝑦 − 𝑓2 (𝑥, 𝑦)

Similarly, it is possible to subtract a constant value to a single image, as follows:

𝑔 𝑥, 𝑦 = 𝑓1 𝑥, 𝑦 − 𝑘

The higher the pixel value from


zero, the brighter the image will be

6
Image Subtraction
For instance,

10 12 5 7 5 5
- =
9 14 9 3 0 11

- 50 =

7
Image Subtraction
Another example,

- =

8
Image Division

Two images can be divided in a direct manner, as given by


𝑓1 𝑥, 𝑦
𝑔 𝑥, 𝑦 =
𝑓2 (𝑥, 𝑦)

Similarly, it is possible to divide a constant value to a single image, as follows:


𝑓1 𝑥, 𝑦
𝑔 𝑥, 𝑦 =
𝑘

The higher the pixel value from


zero, the brighter the image will be

9
Image Division

÷ =

10
Image Multiplication

Two images can be multiplied in a direct manner, as given by


𝑔 𝑥, 𝑦 = 𝑓1 𝑥, 𝑦 𝑥 𝑓2 (𝑥, 𝑦)

Similarly, it is possible to multiply a constant value to a single image, as follows:

𝑔 𝑥, 𝑦 = 𝑓1 𝑥, 𝑦 𝑥 𝑘

The higher the pixel value from


zero, the brighter the image will be

11
Image Multiplication

x =

12
Example
Consider the following 2 x 2, 8 level images A and B. Find out A + B, A – B, A x B, and A/B.

10 12 5 7
A= B=
9 14 9 3

13
References
Sridhar, S. (2016). Digital Image Processing (2nd ed.). Oxford University Press.
Thank You

15

You might also like