You are on page 1of 32

Escuela Profesional de

Ciencia de la Computación

ICC Fase 1

Computer graphics
Image Arithmetic

MSc. Vicente Machaca Arceda

Universidad Nacional de San Agustín de Arequipa

May 16, 2020

MSc. Vicente Machaca Arceda (UNSA) 1704146 1 / 29


Overview

1 Introduction
Objectives

2 Pixel multiplication
Definition
Examples

3 Pixel division
Definition
Change detection
Change detection
vmachacaa@unsa.edu.pe

4 Blending
Definition

MSc. Vicente Machaca Arceda (UNSA) 1704146 2 / 29


Introduction Objectives

Table of Contents

1 Introduction
Objectives

2 Pixel multiplication
Definition
Examples

3 Pixel division
Definition
Change detection
Change detection
vmachacaa@unsa.edu.pe

4 Blending
Definition

MSc. Vicente Machaca Arceda (UNSA) 1704146 3 / 29


Introduction Objectives

Objectives

Understand about the arithmetic between images.


vmachacaa@unsa.edu.pe

MSc. Vicente Machaca Arceda (UNSA) 1704146 4 / 29


Introduction Objectives

Objectives

Understand about the arithmetic between images.


Learn addition, subtraction, multiplication, division and
blending between images.
vmachacaa@unsa.edu.pe

MSc. Vicente Machaca Arceda (UNSA) 1704146 4 / 29


Pixel multiplication Definition

Table of Contents

1 Introduction
Objectives

2 Pixel multiplication
Definition
Examples

3 Pixel division
Definition
Change detection
Change detection
vmachacaa@unsa.edu.pe

4 Blending
Definition

MSc. Vicente Machaca Arceda (UNSA) 1704146 5 / 29


Pixel multiplication Definition

Pixel multiplication
Definition

The first form takes two input images and produces an output
image in which the pixel values are just those of the first image,
multiplied by the values of the corresponding values in the
second image. The second form takes a single input image and
produces output in which each pixel value is multiplied by a
specified constant.
vmachacaa@unsa.edu.pe

MSc. Vicente Machaca Arceda (UNSA) 1704146 6 / 29


Pixel multiplication Definition

Pixel multiplication
Definition

Q(i, j) = P1 (i, j) ∗ P2 (i, j) (1)


vmachacaa@unsa.edu.pe

MSc. Vicente Machaca Arceda (UNSA) 1704146 7 / 29


Pixel multiplication Definition

Pixel multiplication
Definition

Q(i, j) = P1 (i, j) ∗ P2 (i, j) (1)

Q(i, j) = P1 (i, j) ∗ C (2)


vmachacaa@unsa.edu.pe

MSc. Vicente Machaca Arceda (UNSA) 1704146 7 / 29


Pixel multiplication Examples

Table of Contents

1 Introduction
Objectives

2 Pixel multiplication
Definition
Examples

3 Pixel division
Definition
Change detection
Change detection
vmachacaa@unsa.edu.pe

4 Blending
Definition

MSc. Vicente Machaca Arceda (UNSA) 1704146 8 / 29


Pixel multiplication Examples

Pixel multiplication
Examples
vmachacaa@unsa.edu.pe

Figure: Original image. Figure: Original image * 3.

MSc. Vicente Machaca Arceda (UNSA) 1704146 9 / 29


Pixel multiplication Examples

Pixel multiplication
Examples
vmachacaa@unsa.edu.pe

Figure: Original image. Figure: Original image * 3.

MSc. Vicente Machaca Arceda (UNSA) 1704146 10 / 29


Pixel multiplication Examples

Pixel multiplication
Examples

Figure: Original image. Figure: Original image * 3.


vmachacaa@unsa.edu.pe

MSc. Vicente Machaca Arceda (UNSA) 1704146 11 / 29


Pixel division Definition

Table of Contents

1 Introduction
Objectives

2 Pixel multiplication
Definition
Examples

3 Pixel division
Definition
Change detection
Change detection
vmachacaa@unsa.edu.pe

4 Blending
Definition

MSc. Vicente Machaca Arceda (UNSA) 1704146 12 / 29


Pixel division Definition

Pixel division
Definition

The image division operator normally takes two images as input


and produces a third whose pixel values are just the pixel values
of the first image divided by the corresponding pixel values of
the second image.
vmachacaa@unsa.edu.pe

MSc. Vicente Machaca Arceda (UNSA) 1704146 13 / 29


Pixel division Definition

Pixel division
Definition

Q(i, j) = P1 (i, j)/P2 (i, j) (3)


vmachacaa@unsa.edu.pe

MSc. Vicente Machaca Arceda (UNSA) 1704146 14 / 29


Pixel division Definition

Pixel division
Definition

Q(i, j) = P1 (i, j)/P2 (i, j) (3)

Q(i, j) = P1 (i, j)/C (4)


vmachacaa@unsa.edu.pe

MSc. Vicente Machaca Arceda (UNSA) 1704146 14 / 29


Pixel division Change detection

Table of Contents

1 Introduction
Objectives

2 Pixel multiplication
Definition
Examples

3 Pixel division
Definition
Change detection
Change detection
vmachacaa@unsa.edu.pe

4 Blending
Definition

MSc. Vicente Machaca Arceda (UNSA) 1704146 15 / 29


Pixel division Change detection

Pixel division
Change detection

We could use division to detect changes between frames.


vmachacaa@unsa.edu.pe

Figure: Frame 1. Figure: Frame 2.

MSc. Vicente Machaca Arceda (UNSA) 1704146 16 / 29


Pixel division Change detection

Pixel division
Change detection
vmachacaa@unsa.edu.pe

Figure: (Frame 1 / Frame 2)*30. Figure: After contrast stretching.

MSc. Vicente Machaca Arceda (UNSA) 1704146 17 / 29


Pixel division Change detection

Table of Contents

1 Introduction
Objectives

2 Pixel multiplication
Definition
Examples

3 Pixel division
Definition
Change detection
Change detection
vmachacaa@unsa.edu.pe

4 Blending
Definition

MSc. Vicente Machaca Arceda (UNSA) 1704146 18 / 29


Pixel division Change detection

Pixel division
Segmentation of Characters

Suppose we want to segment the characters, the result will be:


vmachacaa@unsa.edu.pe

Figure: Photo. Figure: Thresholding (θ = 127).

MSc. Vicente Machaca Arceda (UNSA) 1704146 19 / 29


Pixel division Change detection

Pixel division
Segmentation of Characters

newMax − newMin
I 0 = (I − min) + newMin
max − min
vmachacaa@unsa.edu.pe

Figure: Division and scaling to [0-255]

MSc. Vicente Machaca Arceda (UNSA) 1704146 20 / 29


Pixel division Change detection

Pixel division
Segmentation of Characters
vmachacaa@unsa.edu.pe

Figure: Division. Figure: Thresholding (θ = 170).

MSc. Vicente Machaca Arceda (UNSA) 1704146 21 / 29


Blending Definition

Table of Contents

1 Introduction
Objectives

2 Pixel multiplication
Definition
Examples

3 Pixel division
Definition
Change detection
Change detection
vmachacaa@unsa.edu.pe

4 Blending
Definition

MSc. Vicente Machaca Arceda (UNSA) 1704146 22 / 29


Blending Definition

Blending
Definition

This operator forms a blend of two input images of the same


size. Similar to pixel addition, the value of each pixel in the
output image is a linear combination of the corresponding pixel
values in the input images. The coefficients of the linear
combination are user-specified.

Q(i, j) = X ∗ P1 (i, j) + (1 − X ) ∗ P2 (i, j) (5)


vmachacaa@unsa.edu.pe

MSc. Vicente Machaca Arceda (UNSA) 1704146 23 / 29


Blending Definition

Blending
Examples
vmachacaa@unsa.edu.pe

Figure: The images for blending

MSc. Vicente Machaca Arceda (UNSA) 1704146 24 / 29


Blending Definition

Blending
Examples
vmachacaa@unsa.edu.pe

Figure: Blending with X = 0.25.

MSc. Vicente Machaca Arceda (UNSA) 1704146 25 / 29


Blending Definition

Blending
Examples
vmachacaa@unsa.edu.pe

Figure: Blending with X = 0.5.

MSc. Vicente Machaca Arceda (UNSA) 1704146 26 / 29


Blending Definition

Blending
Examples
vmachacaa@unsa.edu.pe

Figure: Blending with X = 0.75.

MSc. Vicente Machaca Arceda (UNSA) 1704146 27 / 29


Blending Definition

Blending
Examples

Figure: Blending.
vmachacaa@unsa.edu.pe

MSc. Vicente Machaca Arceda (UNSA) 1704146 28 / 29


Blending Definition

Questions?
vmachacaa@unsa.edu.pe

MSc. Vicente Machaca Arceda (UNSA) 1704146 29 / 29

You might also like