0% found this document useful (0 votes)
54 views71 pages

2 Vision Lec 2

This document provides an overview of a lecture on computer vision and ethics. It discusses computer vision systems and their components, including data collection, pre-processing, segmentation, feature extraction, and decision making. Examples of computer vision applications are given such as special effects, 3D modeling, and self-driving cars. The pinhole camera model is explained as it relates to modeling the projection of 3D scenes onto 2D images.

Uploaded by

Kareem Samir
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)
54 views71 pages

2 Vision Lec 2

This document provides an overview of a lecture on computer vision and ethics. It discusses computer vision systems and their components, including data collection, pre-processing, segmentation, feature extraction, and decision making. Examples of computer vision applications are given such as special effects, 3D modeling, and self-driving cars. The pinhole camera model is explained as it relates to modeling the projection of 3D scenes onto 2D images.

Uploaded by

Kareem Samir
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/ 71

Lecture-2

By : Dr. Shimaa Saber

1
Course Ethics
Agenda

Revision on Computer Vision

Revision on Computer Vision System

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.

 Detecting and Recognizing a face.


 Understanding spoken words.
 Reading handwriting.
 Distinguishing fresh food from its smell.

We would like to give similar capabilities to


machines
5
Computer Vision meaning
 Computer vision can be defined as a scientific field that
extracts information from digital images. The type of
information gained from an image can vary from
identification, space measurements for navigation, or
augmented reality applications.

 Computer vision is building algorithms that can understand


the content of images and use it for other applications.

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.

3D modeling • Computer vision is used to combine all the photos


into a single 3D model.

• Recognize the location where a photo was taken.


Scene With computer vision, we can do a search on
recognition Google using an image as the query.
• Autonomous driving is one of the hottest
Self-driving applications of computer vision. Companies like
cars Tesla, Google, or General Motors compete to be
7 the first to build a fully autonomous car,
Examples of applications
Optical • Handwritten: sorting letters by postal code,
Character input device for PDAs.
Recognition • Printed texts: reading machines for blind
(OCR) people, digitalization of text documents.
• Face recognition, verification, retrieval.
Biometrics • Finger prints recognition.
• Speech recognition.
Diagnostic • Medical diagnosis: X-Ray, EKG analysis.
systems • Machine diagnostics, waster detection.
• Automated Target Recognition (ATR).
Military
applications • Image segmentation and analysis (recognition
from aerial or satellite photographs).
8
Revision on Computer Vision System

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

15 Decision Making Edges Corners


Computer Vision System
Real world
 classifying a detected object into different categories.
Sensor

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

 Take care of:

 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.

World Camera Digitizer Digital


Image

22 Camera Image Digitalization


Camera Model

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.

World Camera Digitizer Digital


Image

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

• Images capture two kinds of information:

– Geometric: points, lines, curves, etc.

– Photometric: intensity, color.

28
Camera Model
 The camera is one of the most essential tools
in computer vision.

 Camera models approximate the Complex 3D-2D


relationships

 Goal of Camera Model


To model basic geometry of projection of 3D points, curves,
and surfaces onto a 2D surface, the view plane or image plane.

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:

Image height (y) = 3 cm


focal length (f) = 5 cm
Distance ( z) =10 cm

𝑌
𝑦 =𝑓 ∗
𝑧
𝑌
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.

Object distance from pinhole, (z)=200m


Image distance from the pinhole, (f)=20cm=0.2m
Image height, (y)=1cm=0.01m
𝑌
𝑦 =𝑓 ∗
𝑧
𝑌
0.01 = 0.2 ∗
200
Y = 10 m
36
Pinhole camera model

What is The effects


of aperture size on
the image?

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.

World Camera Digitizer Digital


Image

Image Digitalization
44
Image Digitization
 Two stages in the digitization process:
 Sampling
 Quantization

j
f x 1 2 3 4 5

1 100 100 100 100 100

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

Continuous Image Digital Image

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)).

• (Given a continuous image, f(x,y), digitizing the


coordinate values is called sampling and digitizing the
amplitude (intensity) values is called quantization.)
Sampling
 When a continuous scene is imaged on the sensor, the continuous
image is divided into discrete elements - picture elements
(pixels)
Quantization
 Choose number of gray levels (according to number of assigned
bits)
 Divide continuous range of intensity values
Image Type

Binary Gray Color

49
Images Types
 Binary image :

each pixel has one of


only two discrete
values: 1 or 0.

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

 True color Images :

 Each pixel is specified by three


values ( red, blue, and green)
components of the pixel's color.

 MATLAB store truecolor images as


3 data array .
 size(RGB) = [m,n,c]
 values 0:255 or 0:1
52
RGB information in separate “channels”

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.

𝑯𝒊𝒈𝒉 𝒓𝒆𝒔𝒐𝒍𝒖𝒕𝒊𝒐𝒏 𝑳𝒐𝒘 𝒓𝒆𝒔𝒐𝒍𝒖𝒕𝒊𝒐𝒏


56
Noisy Image
 Gaussian Noise is caused by random fluctuations in the
signal.
 Gaussian noise occurs during the acquisition process that is
inherent due to the low level of illumination

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

202,599 face images,


10,177 identities,
40 attribute

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

102 flower categories.


Each class consists of
between 40 and 258
images.

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

1,716 car models.

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

 Computer Vision applications

 Computer Vision system

 Data collection “Camera & digitalization”

 Image “quality, types”

 Sample of Datasets

70
71

You might also like