2 Vision Lec 2
2 Vision Lec 2
1
Course Ethics
Agenda
Data Collection
3
Revision on Computer Vision
meaning, application
4
Human Perception
Humans have highly sophisticated skills for sensing
their environment and acting according to their
observations. e.g.
6
Examples of applications
• Shape and motion capture are new techniques
used in movies like Avatar to animate digital
Special effects
characters by recording the movements played by
a human actor.
9
Computer Vision System
Real world
Sensor
Pre-processing
Segmentation
Feature Extraction
High-level processing
10 Decision Making
Computer Vision System
Real world
Sensor
Pre-processing
Segmentation
Feature Extraction
High-level processing
11 Decision Making
Computer Vision System
Real world
Before a Computer Vision system can be applied
Sensor to image data in order to extract some specific
pattern, it is usually necessary to process the
Pre-processing data in order to assure that it satisfies certain
assumptions implied by the method.
Segmentation
Feature Extraction
High-level processing
12 Decision Making
Noise removing
Computer Vision System
Real world
Before a Computer Vision system can be applied
Sensor to image data in order to extract some specific
pattern, it is usually necessary to process the
Pre-processing data in order to assure that it satisfies certain
assumptions implied by the method.
Segmentation
Feature Extraction
High-level processing
13 Decision Making
Image enhancement
Computer Vision System
Real world
Image Segmentation is the process by which
Sensor a digital image is partitioned into various
subgroups (of pixels) called Image Objects,
Pre-processing which can reduce the complexity of the
image, and thus analyzing the image
Segmentation becomes simpler.
Feature Extraction
High-level processing
14 Decision Making
Computer Vision System
Real world Compute numeric or symbolic information
from the collected data
Sensor
features at various levels of complexity are
Pre-processing extracted from the image data
Segmentation
Feature Extraction
High-level processing
Pre-processing
Segmentation
comparing and combining two different views
Feature Extraction of the same object.
High-level processing
16 Decision Making
Computer Vision System
Real world
Making the final decision required for the
Sensor
application
Pre-processing
Segmentation
Feature Extraction
High-level processing
17 Decision Making
Data Collection
The first step in the computer vision system
18
Computer Vision System
Real world
Sensor
image
Pre-processing
Segmentation
Feature Extraction
Decision Making
19
Data Collection
Depending on the application we can use different types
of sensors to acquire data:
Cameras
Microphones
GPS sensors, gyroscopes
heart rate, perspiration sensors, blood pressure sensors
Noise levels
Data acquisition speed
Amount of collected information
20
What is an image
An image is a projection of a 3D scene into a 2D projection
plane.
21
Digital Image
A digital image is a numeric representation of a two-dimensional image
as a finite set of digital values, called picture elements or pixels.
23
Digital Image
A digital image is a numeric representation of a two-dimensional image
as a finite set of digital values, called picture elements or pixels.
Camera
24
Human eye
Through our eyes, we can see
25
Camera
Camera is computer’s eye that is structurally the same the
eye
– Lens does similarly as our lens and cornea
– Sensor receives the light signals to form images
26
Camera vs. eye
Differences
– Lens focus
• Camera: lens moves closer/further from the film
• Eye: lens changes shape to focus
– Sensitivity to light
• Camera: A film is designed to be uniformly sensitive to light
• Eye: retina is not; has greater sensitivity in dark
27
Imaging
Images are 2D projections of real-world scenes
28
Camera Model
The camera is one of the most essential tools
in computer vision.
29
Pinhole Camera Model
This camera system can be designed by placing a barrier with
a small aperture between the 3D object and a photographic
film or sensor.
30
Pinhole Camera Model
pinhole
3D Object
Virtual image 2D image
Image plane
31
Camera
32
Pinhole camera model
The Internal Camera Matrix
𝑦 𝑌
=
𝑓 𝑧
𝑌
𝑦 =𝑓 ∗
𝑧
f = focal length
Y = object
z = distance
between object and
pinhole
33
Pinhole camera model
𝑌
𝑦 = 𝑓 ∗
𝑧
𝑋
𝑥 = 𝑓 ∗
𝑧
34
The focal length of a lens is the distance between its optical center
and its image plane.
Pinhole camera model
In a pinhole camera, the image of height 3 cm is formed at a
distance of 5 cm. If the object is situated at a distance of 10 cm,
the height of the object is:
𝑌
𝑦 =𝑓 ∗
𝑧
𝑌
3 =5 ∗
10
Y = 6 cm
35
Pinhole camera model
A tree, which is 200 m away from the pinhole, produces an
image of height 1cm, in a pinhole camera of width 20 cm.
Find the height of the tree.
37
Lens Camera Model
In modern cameras, we replace the pinhole with a lens, then
all rays of light that are emitted by some point p are refracted
by the lens such that they converge to a single point P
38
Lens Camera Model
1 1 1
Lens equation = +
𝑓 𝑑𝑜 𝑑𝑖
ℎ𝑖 𝑑𝑖
The magnification m = = −
ℎ𝑜 𝑑𝑜
39
A 4.00-cm tall light bulb is placed a distance of 45.7 cm from
a double convex lens having a focal length of 15.2 cm.
Determine the image distance and the image size.
Solution
ho = 4.00 cm do = 45.7 cm f = 15.2 cm
1 1 1 1 1 1
= + = +
𝑓 𝑑𝑜 𝑑𝑖 15.2 45.7 𝑑𝑖
1 1 1 1
= − = 𝑑𝑖 = 22.8 𝑐𝑚
𝑑𝑖 15.2 45.7 0.0439
ℎ𝑖 𝑑𝑖 ℎ𝑖 22.8
= − = −
ℎ𝑜 𝑑𝑜 4 45.7
ℎ𝑖 = − 1.99
40
Pinhole vs. Lens camera model
41
Lens Camera Model
42
Image Digitalization
43
Digital Image
A digital image is a numeric representation of a two-dimensional image
as a finite set of digital values, called picture elements or pixels.
Image Digitalization
44
Image Digitization
Two stages in the digitization process:
Sampling
Quantization
j
f x 1 2 3 4 5
2 100 0 0 0 100
y 3 100 0 0 0 100
4 100 0 0 0 100
i
5 100 100 100 100 100
45
f(x,y) g(i,j) C
Image Sampling and Quantization
• Sampling and quantization are the two important
processes used to convert continuous analog image into
digital image.
• Image sampling refers to digitization of spatial
coordinates (along x axis) whereas quantization refers
to digitization of gray level values (amplitude (along y
axis)).
49
Images Types
Binary image :
A binary image is
stored as a logical
array.
50
Gray image
gray Images
size(X) = [m,n]
values 0:255 or 0:1
Images Types
53
Image Quality
54
Image Quality
Basically, an image is of good quality if :
a high resolution
Resolution
not noisy
Blurring
not blurred Image
Quality
good contrast. Contrast
Noise
55
Image resolution
Expresses how much detail can be seen in it.
Depends on the number of pixels used to represent a scene.
57
Noisy Image
Salt and pepper Noise is randomly scattered white or black
(or both) pixels over the image.
Occurred due to :
memory cell failure
Malfunctioning of camera’s sensor cells
Errors in image digitizing
58
Noisy Image
Periodic Noise
An image affected by periodic noise will look like a repeating
pattern has been added on top of the original image.
59
Image blurring
Image blurring is caused by incorrect image-capturing
conditions.
Out of-focus camera, or relative motion of the camera and
imaged object.
60
Image Contrast
Contrast can be simply explained as the difference between
maximum and minimum pixel intensity in an image.
61
Dataset examples
62
Example (1): Face Detection Project
Large-scale
CelebFaces
Attributes
(CelebA)
Dataset
63 http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html
Example (1): Face Detection Project
64
Example (2): Dogs Classification Project
Stanford
Dogs
Dataset
categories: 120
images: 20,580
65 http://vision.stanford.edu/aditya86/ImageNetDogs/
Example (3): Flower Category Project
Oxford 102
Flower
Dataset
66 https://www.kaggle.com/datasets/haseeb85/oxford-102-category-flower-dataset
Example (4): Flower Category Project
Fruits 360
dataset
classes : 131
images : 90483
67 https://www.kaggle.com/datasets/moltean/fruits
Example (5): Flower Category Project
The
CompCars
dataset
68 http://mmlab.ie.cuhk.edu.hk/datasets/comp_cars/
Other dataset
http://homepages.inf.ed.ac.uk/rbf/CVonli
ne/Imagedbase.htm
69
Summary
Computer Vision meaning
Sample of Datasets
70
71