Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

CV #2 Digital Image, Fundamentals

Download as pdf or txt
Download as pdf or txt
You are on page 1of 43

Computer Vision

2023-24 First Semester, M.Tech (AIML)

Session #2:
Digital Image Fundamentals
Instructors, CV course

S. P. Vimal | CSIS Department | WILP | BITS – Pilani (vimalsp@wilp.bits-pilani.ac.in)


Acknowledgement: Slide Materials adopted from - Intro to Computer Vision (Cornell Tech); Noah Snavely and prepared by the lead instructor
Prof S P Vimal
Topics
● Image Representation
● Image Digitization ( Sampling & Quantization)
● Digital Image Properties

Acknowledgement: Slide Materials adopted from - Intro to Computer Vision (Cornell Tech); Noah Snavely
2
3
4
5
6
Image representation for analysis

7
Representations

8
3D vision tasks and algorithmic components

9
Ref: https://medium.com/@nrmin.mrdova.01/pinhole-camera-842ce79329b7
10
Pinhole Camera inverting image

11
Simple Image Formation Model

12
Image Formation in the Eye

13
Digital Image Acquisition

14
Quiz

Why do we use lenses when we have pin-hole camera?

Cameras with lenses are easier to manufacturer when compared to pin-hole cameras
Lenses gather more light than pinhole cameras, reducing exposure time
Lenses can be stacked to produce a clear image of the scene
Lenses keep parallel lines from the scene, parallel in the image

15
Simple Image Formation Model

● We denote images by two-dimensional functions of the form


f(x, y).
○ Value of f at spatial coordinates (x, y) is a scalar quantity;
○ Physical meaning of f(x,y) is determined by the source of the image, and whose
values are proportional to energy radiated by a physical source (e.g.,
electromagnetic waves);

● Function f(x, y) is characterized by two components:


○ Amount of source illumination incident on the scene being viewed i(x,y), and
○ Amount of illumination reflected by the objects in the scene r(x,y).

16
0 is total absorption and 1 is total reflectance
Simple Image Formation Model - Grayscale Image

● Let the intensity (gray level) of a monochrome image at any


coordinates (x, y) be denoted by

● For a gray scale, the range is scaled between [0, L-1] ;


○ All intermediate values from 0 to L-1 are shades of gray varying from black
to white.

17
Sampling and Quantization

Continuous image A scan line showing intensity variations


along line AB in the continuous image

Sampling and quantization. Digital scan line

18
Digitizing the coordinate values is called sampling ; Digitizing the amplitude values is called quantization.
Sampling and Quantization

Continuous image projected Result of image sampling and


onto a sensor array quantization

19
Matrix Representation of an Image

20
Spatial & Intensity Resolution

930 dpi 300 dpi


● Spatial resolution is a measure of
the smallest discernible detail in
an image;

● Intensity resolution similarly refers


to the smallest discernible change
in intensity level
150 dpi 72 dpi

21
Spatial & Intensity Resolution

256-level 128-level
● Spatial resolution is a measure
of the smallest discernible detail
in an image;

● Intensity resolution similarly


refers to the smallest discernible
change in intensity level
64-level 32-level

All images have spatial resolution 2022 × 1800 22


Spatial & Intensity Resolution

16-level 8-level
● Spatial resolution is
a measure of the
smallest discernible
detail in an image;

● Intensity resolution
similarly refers to the
smallest discernible
change in intensity 4-level 2-level
level

All images have spatial resolution 2022 × 1800 23


Distance measurement

24
Distance Measurement

25
What is an image?

A grid (matrix) of intensity values

26
What is an image?

Can think of a (grayscale) image as a function f from R2 to R:


f (x,y) gives the intensity at position (x,y)

27
Image Transformations

As with any function, we can apply operators to an image

28
Image Histogram

Un-normalized histogram :

Note: nk is the number of pixels in f with intensity rk

Normalized histogram :

Note: M and N are the number of image rows and columns


The sum of p(rk) for all values of k is always 1
Mostly, we work with normalized histograms
29
Elementary Intensity Transformations

A digital mammogram and its Negative image


30
Elementary Intensity Transformations

Log Transformations

Fourier spectrum displayed as a


grayscale image and the result of
applying the log transformation in
with c = 1.

Both images are scaled to the


range [0, 255].

31
Elementary Intensity Transformations

Log Transformations

Fourier spectrum displayed as a


grayscale image and the result of
applying the log transformation in
with c = 1.

Both images are scaled to the


range [0, 255].

32
Elementary Intensity Transformations

Power-Law Transformations

● c and ˠ are positive constants

33
Elementary Intensity Transformations
Power-Law Transformations- Applications
Gamma correction
● Cathode ray tube (CRT) devices have an
intensity-to-voltage response that is a
power function, with exponents varying
from approximately 1.8 to 2.5.

34
Elementary Intensity Transformations
Power-Law Transformations- Applications
Gamma correction
● Cathode ray tube (CRT) devices have an
intensity-to-voltage response that is a
power function, with exponents varying
from approximately 1.8 to 2.5.

● Gamma correction consists of using the


transformation

35
Elementary Intensity Transformations
Power-Law Transformations- Applications
Gamma correction
● Cathode ray tube (CRT) devices have an
intensity-to-voltage response that is a
power function, with exponents varying
from approximately 1.8 to 2.5.

● Gamma correction consists of using the


transformation

36
Elementary Intensity Transformations
Power-Law Transformations- Applications
Medical Imaging
(a) Magnetic resonance image (MRI) of a
fractured human spine (the region of the fracture
is enclosed by the circle).

(b)–(d) Results of applying the transformation


with c = 1 and g = 0.6, 0.4, and 0.3, respectively.
(Original image courtesy of Dr. David R. Pickens,
Department of Radiology and Radiological
Sciences, Vanderbilt University Medical Center.)

37
Elementary Intensity Transformations
Power-Law Transformations- Applications
Aerial Imaging

(a) Aerial image.


(b)–(d) Results of applying the transformation in with 𝛄 =
3.0, 4.0, and 5.0, respectively. (c = 1 in all cases.)

(Original image, courtesy of NASA.)

38
Elementary Intensity Transformations
Contrast Stretching; Thresholding

(a) Piecewise linear transformation function.


(b) A low-contrast electron microscope image of pollen,
magnified 700 times.
(c) Result of contrast stretching.
(d) Result of thresholding.

39
Contrast Stretching

40
Elementary Intensity Transformations
Intensity Level Slicing

Highlights range [ A, B] and reduces This function highlights range [ A, B] and


all other intensities to a lower level. leaves other intensities unchanged.
41
• Readings:
Digital Image Processing, Rafael C. Gonzalez & Richard E woods, Third Ed, Chapter 2

References for hands-on work:


https://www.geeksforgeeks.org/log-transformation-of-an-image-using-python-and-openc
v/
https://www.kaggle.com/code/gauravduttakiit/image-processing-notebook

42
Thank you

43

You might also like