Top Banner
Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Department of Computer Engineering Bilkent University [email protected]
53

Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Oct 05, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Digital Image Fundamentals

Selim Aksoy

Department of Computer EngineeringDepartment of Computer Engineering

Bilkent University

[email protected]

Page 2: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Imaging process

� Light reaches surfaces in 3D.surfaces in 3D.

� Surfaces reflect.

� Sensor element receives light energy.

� Intensity is important.

� Angles are important.

CS 484, Fall 2012 ©2012, Selim Aksoy 2

� Angles are important.

� Material is important.

Adapted from Rick Szeliski

Page 3: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Physical parameters

� Geometric

� Type of projection

Camera pose� Camera pose

� Optical

� Sensor’s lens type

� Focal length, field of view, aperture

� Photometric

� Type, direction, intensity of light reaching sensor

� Surfaces’ reflectance properties

� Sensor

� Sampling, etc.

CS 484, Fall 2012 ©2012, Selim Aksoy 3

Adapted from Trevor Darrell, UC Berkeley

Page 4: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Image acquisition

CS 484, Fall 2012 ©2012, Selim Aksoy 4Adapted from Gonzales and Woods

Page 5: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Image acquisition

CS 484, Fall 2012 ©2012, Selim Aksoy 5

Adapted from Rick Szeliski

Page 6: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Camera calibration

World frame

� Camera’s extrinsic and intrinsic parameters are needed to

Camera frame

� Camera’s extrinsic and intrinsic parameters are needed to calibrate the geometry.

� Extrinsic: camera frame ↔ world frame

� Intrinsic: image coordinates relative to camera ↔ pixel

coordinates

CS 484, Fall 2012 ©2012, Selim Aksoy 6

Adapted from Trevor Darrell, UC Berkeley

Page 7: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Perspective effects

CS 484, Fall 2012 ©2012, Selim Aksoy 7

Adapted from Trevor Darrell, UC Berkeley

Page 8: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Aperture

� Aperture size affects the image we would get.

LargerLarger

CS 484, Fall 2012 ©2012, Selim Aksoy 8

Smaller

Adapted from Trevor Darrell, UC Berkeley

Page 9: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Focal length

� Field of view depends on focal length.

As f gets smaller, image � As f gets smaller, image becomes more wide angle

� more world points project onto the finite image plane

� As f gets larger, image becomes more telescopic

smaller part of the world � smaller part of the world projects onto the finite image plane

CS 484, Fall 2012 ©2012, Selim Aksoy 9

Adapted from Trevor Darrell, UC Berkeley

Page 10: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Sampling and quantization

CS 484, Fall 2012 ©2012, Selim Aksoy 10

Page 11: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Sampling and quantization

CS 484, Fall 2012 ©2012, Selim Aksoy 11

Page 12: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Problems with arrays

� Blooming: difficult to insulate adjacent sensing elements.sensing elements.

� Charge often leaks from hot cells to neighbors, making bright regions larger.

CS 484, Fall 2012 ©2012, Selim Aksoy 12

Adapted from Shapiro and Stockman

Page 13: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Problems with arrays

� Clipping: dark grid intersections at left were actually brightest were actually brightest of scene.

� In A/D conversion the bright values were clipped to lower values.

CS 484, Fall 2012 ©2012, Selim Aksoy 13

values.

Adapted from Shapiro and Stockman

Page 14: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Problems with lenses

CS 484, Fall 2012 ©2012, Selim Aksoy 14

Adapted from Rick Szeliski

Page 15: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Image representation

� Images can be represented by 2D functions of the form functions of the form f(x,y).

� The physical meaning of the value of f at spatial coordinates (x,y) is determined by

x

y

f(x,y)

CS 484, Fall 2012 ©2012, Selim Aksoy 15

(x,y) is determined by the source of the image.

Adapted from Shapiro and Stockman

Page 16: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Image representation

� In a digital image, both the coordinates and the image value become discrete quantities.

� Images can now be represented as 2D arrays (matrices) of integer values: I[i,j] (or I[r,c]).

� The term gray level is used to describe monochromatic intensity.

CS 484, Fall 2012 ©2012, Selim Aksoy 16

Page 17: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Spatial resolution

� Spatial resolution is the smallest discernible detail in an image.

� Sampling is the principal factor determining spatial � Sampling is the principal factor determining spatial resolution.

CS 484, Fall 2012 ©2012, Selim Aksoy 17

Page 18: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Spatial resolution

CS 484, Fall 2012 ©2012, Selim Aksoy 18

Page 19: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Spatial resolution

CS 484, Fall 2012 ©2012, Selim Aksoy 19

Page 20: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Gray level resolution

� Gray level resolution refers to the smallest discernible change in gray level (often power of 2).

CS 484, Fall 2012 ©2012, Selim Aksoy 20

Page 21: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Bit planes

CS 484, Fall 2012 ©2012, Selim Aksoy 21

Page 22: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Electromagnetic (EM) spectrum

CS 484, Fall 2012 ©2012, Selim Aksoy 22

Page 23: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Electromagnetic (EM) spectrum

� The wavelength of an EM wave required to “see” an object must be of the same size as or smaller than the object.than the object.

CS 484, Fall 2012 ©2012, Selim Aksoy 23

Page 24: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Other types of sensors

CS 484, Fall 2012 ©2012, Selim Aksoy 24

Page 25: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Other types of sensors

CS 484, Fall 2012 ©2012, Selim Aksoy 25

Page 26: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Other types of sensorsblue green red

CS 484, Fall 2012 ©2012, Selim Aksoy 26

near ir middle ir thermal ir middle ir

Page 27: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Other types of sensors

CS 484, Fall 2012 ©2012, Selim Aksoy 27

Page 28: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Other types of sensors

CS 484, Fall 2012 ©2012, Selim Aksoy 28

Page 29: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Other types of sensors

CS 484, Fall 2012 ©2012, Selim Aksoy 29

Page 30: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Other types of sensors

CS 484, Fall 2012 ©2012, Selim Aksoy 30

Page 31: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Other types of sensors

CS 484, Fall 2012 ©2012, Selim Aksoy 31

Page 32: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Other types of sensors

CS 484, Fall 2012 ©2012, Selim Aksoy 32

Page 33: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Other types of sensors

CS 484, Fall 2012 ©2012, Selim Aksoy 33

Page 34: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Other types of sensors

CS 484, Fall 2012 ©2012, Selim Aksoy 34

Page 35: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Other types of sensors

CS 484, Fall 2012 ©2012, Selim Aksoy 35

©IEEE

Page 36: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Image enhancement

� The principal objective of enhancement is to process an image so that the result is more suitable than the original for a specific application.suitable than the original for a specific application.

� Enhancement can be done in

� Spatial domain,

� Frequency domain.

� Common reasons for enhancement include

CS 484, Fall 2012 ©2012, Selim Aksoy 36

� Improving visual quality,

� Improving machine recognition accuracy.

Page 37: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Image enhancement

� First, we will consider point processing where enhancement at any point depends only on the image value at that point.image value at that point.

� For gray level images, we will use a transformation function of the form

s = T(r)where “r” is the original pixel value and “s” is the new value after enhancement.

CS 484, Fall 2012 ©2012, Selim Aksoy 37

new value after enhancement.

Page 38: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Image enhancement

CS 484, Fall 2012 ©2012, Selim Aksoy 38

Page 39: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Image enhancement

CS 484, Fall 2012 ©2012, Selim Aksoy 39

Page 40: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Image enhancement

CS 484, Fall 2012 ©2012, Selim Aksoy 40

Page 41: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Image enhancement

CS 484, Fall 2012 ©2012, Selim Aksoy 41

Page 42: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Image enhancement

CS 484, Fall 2012 ©2012, Selim Aksoy 42

Page 43: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Image enhancement

� Contrast stretching:

CS 484, Fall 2012 ©2012, Selim Aksoy 43

Page 44: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Image enhancement

CS 484, Fall 2012 ©2012, Selim Aksoy 44

Page 45: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Histogram processing

CS 484, Fall 2012 ©2012, Selim Aksoy 45

Page 46: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Histogram processing

� Intuitively, we expect that an image whose pixels

� tend to occupy the entire range of possible gray levels,

� tend to be distributed uniformly

will have a high contrast and show a great deal of gray level detail.

� It is possible to develop a transformation function that can achieve this effect using histograms.

CS 484, Fall 2012 ©2012, Selim Aksoy 46

Page 47: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Histogram equalization

CS 484, Fall 2012 ©2012, Selim Aksoy 47

http://fourier.eng.hmc.edu/e161/lectures/contrast_transform/node3.html

Page 48: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Histogram equalization

CS 484, Fall 2012 ©2012, Selim Aksoy 48

Page 49: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Histogram equalization

CS 484, Fall 2012 ©2012, Selim Aksoy 49

Adapted from Wikipedia

Page 50: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Histogram equalization

CS 484, Fall 2012 ©2012, Selim Aksoy 50

Original RGB image Histogram equalization of each individual band/channel

Histogram stretching by removing 2% percentile from each individual

band/channel

Page 51: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Enhancement using arithmetic operations

CS 484, Fall 2012 ©2012, Selim Aksoy 51

Page 52: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Image formats

� Popular formats:

� BMP Microsoft Windows bitmap image

� EPS Adobe Encapsulated PostScript

� GIF CompuServe graphics interchange format

� JPEG Joint Photographic Experts Group

� PBM Portable bitmap format (black and white)

� PGM Portable graymap format (gray scale)

PPM Portable pixmap format (color)

CS 484, Fall 2012 ©2012, Selim Aksoy 52

� PPM Portable pixmap format (color)

� PNG Portable Network Graphics

� PS Adobe PostScript

� TIFF Tagged Image File Format

Page 53: Digital Image Fundamentals - Bilkent Universitysaksoy/courses/cs484-Fall2012/slides/cs484... · Digital Image Fundamentals Selim Aksoy Department of Computer Engineering Bilkent University

Image formats

� ASCII or binary

� Number of bits per pixel (color depth)� Number of bits per pixel (color depth)

� Number of bands

� Support for compression (lossless, lossy)

� Support for metadata

� Support for transparency

Format conversion

CS 484, Fall 2012 ©2012, Selim Aksoy 53

� Format conversion

� …http://en.wikipedia.org/wiki/Graphics_file_format_summary

http://en.wikipedia.org/wiki/Comparison_of_graphics_file_formats