You are on page 1of 24

Image as Functions

Lecture 2
By: Sarah M. Ayyad

Back Next
Image as Functions

I(x, y)

Back Next
Image as Functions

Back Next
Image as Functions

Back Next
Image as Functions
Now, I can make computation to this function to make the image
looks smoother (blurring) >> this process called image processing.
Image as Functions
• In most general form An image is a function of form R2 𝑡𝑜 R.
• F(x, y) gives the intensity of a value at position (x, y).

It is defined in a limited range.

f:[a,b] x [c,d] → [min,max]


x ranges from a → b
y ranges from c → d

Back Next
Color Image
Color image is considered three functions “stacked” together.
We can write this as a “vector-valued” function.
𝑟(𝑥, 𝑦)
F(x, y) = 𝑔(𝑥, 𝑦)
𝑏(𝑥, 𝑦)

Each pixel in the function is a vector of three numbers.

Back Next
Define an image as a function

Image is a collection of light intensities at different locations.

Back Next
Define an image as a function
X (Horizontal
dimension)

y (Vertical
dimension)

Any location in the image can be specified using x value and y value.

Back Next
Define an image as a function
X (Horizontal
15 dimension)

Assume
Intensities
from 0 to 10

165
y (Vertical
dimension)
10 210

f:[a,b] x [c,d] → [min,max]


Back Next
f:[10,210] x [15,165] → [0,10]
Define a color image as a function
▪ The color image is also a function.
▪ The value at each location is no longer a single
number that represents the light intensity.
Instead
It can be a vector that holds three different intensities for three color
components (R,G,B).

A color image is a function of form R2 𝑡𝑜 R3 .

Back Tuple of 3 Next


2-D
values
Representation of the picture on the
screen

In general, images are represented as a


matrix of integer values.
Back Next
Digital Images in Computer Vision
i

2D

▪ In computer vision we typically operate on digital (discrete) images.


▪ We have two separate processes of discretization to covert a
continuous image f(x , y) to a digital form, which are sampling, and
Back quantization. Next
Reading Images in Matlab

To load and display an image


Reading specific channel of an image

Color
plane
rows columns

Note: Matlab indexing starts from 1.


Color plane in Matlab >> 1 red
2 green
3 blue
Reading specific channel of an image

Brighter areas indicates higher red values &


Darker areas indicates lower red values.
Finding the size of an image

400 : height
600 : width
3: no. of color planes/channels

Finding a value at specific location


Extract larger portion of an image
Arithmetic operations on images: Addition

Example of image addition to produce an artistic effect.


Adding two images

Note: They must be the same size


Adding two images

The results of summation turns to be brighter??


This indicates that we should scale down the image
intensity values.

If we want the maximum possible value in the summed


image to be the same as the maximum possible value in
each of these source images >>> divide the intensities by 2
Adding two images

Which one is best?


Adding two images (The correct way)

The key to solve this >> these images are type uint8 >> so their pixel values range from 0 to 255.
Assume their sizes are 183, 152, respectively.

183 152
First method >> + = 92 + 76 = 168 (this way is better that it preserves pixel values)
2 2
183+152 335 (𝑙𝑎𝑟𝑔𝑒𝑟 𝑡ℎ𝑎𝑛 255) 255 (𝑡𝑟𝑢𝑛𝑐𝑎𝑡𝑖𝑜𝑛)
Second method >> ≫ >> =128
2 2 2
Multiplying images by a number
Multiplying with numbers larger than 1 will make the image brighter

1.5

You might also like