introduction to digital imageintroduction to digital image ... · digital image 3 digital image...

32
Introduction to Digital Image Introduction to Digital Image Processing SGN-6106 Computational Systems Biology I Sari Peltonen Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing 10.2.2009

Upload: others

Post on 28-May-2020

17 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

Introduction to Digital ImageIntroduction to Digital Image Processingg

SGN-6106 Computational Systems Biology I

Sari Peltonen

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing 10.2.2009

Page 2: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

What is digital image processing?2

What is digital image processing?

An image may be defined as a two-dimensional function, , where and are spatial (plane) coordinates, and the amplitude of at any i f di i ll d h i i l l f h i

( , )f x yx y

( )f

pair of coordinates is called the intensity or gray level of the image at that point.

When , and the intensity values of are all finite, discrete quantities,

( , )x y

,x y f, y , q ,we call the image a digital image.

The field of digital image processing refers to processing digital images b f di it l t

, y f

by means of a digital computer.

Note that a digital image is composed of a finite number of elements, each of which has a particular location and value.p

These elements are called picture elements, image elements, pels, and pixels.

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing 10.2.2009

Page 3: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

Digital image3

Digital image

Fig. 1. A digital image (on the left) and pixels in the marked area (on the right).

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing 10.2.2009

Page 4: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

Digital image acquisition4

Digital image acquisition

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing 10.2.2009

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 5: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

Sampling and quantization5

Sampling and quantization

Often gray scale images are represented so that the pixel values are integers on interval where is considered black and

hi h l[ ]0, 1 ,L − 0 1L −

white on the gray scale.

All intermediate values are shades of gray varying from black to white.

D i d li h d id i hDue to processing, storage and sampling hardware considerations, the number of gray levels typically is an integer power of 2, i.e.

Another common way to represent gray scale images is to normalize the

2 .kL =

y p g y gvalues on the interval

If we have a continuous image that we want to convert to digital form, we h t l th i i b th di t d i lit d

[ ]0,1 .

have to sample the image in both coordinates and in amplitude.

Digitizing the coordinate values is called sampling.

Digiti ing amplit de al es is called q anti ation

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing

Digitizing amplitude values is called quantization.

10.2.2009

Page 6: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

Sampling and quantization6

Sampling and quantization

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing 10.2.2009

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 7: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

Sampling and quantization7

Sampling and quantization

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing 10.2.2009

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 8: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

Imaging by humans and machines8

Imaging by humans and machines

Vision is the most advanced of our senses, so it is not surprising that images play the single most important role in human perception.

However, unlike humans, who are limited to the visual band of the electromagnetic (EM) spectrum, imaging machines cover almost the entire EM spectrum, ranging from gamma to radio waves.p , g g g

Machines can operate on images generated by sources that humans are not accustomed to associating with images, e.g., ultrasound, electron

i d t t d imicroscopy and computer-generated images.

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing 10.2.2009

Page 9: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

The electromagnetic spectrum9

The electromagnetic spectrum

http://www.lakeeriewx.com/CaseStudies/RadarSunSpikes/EM Spectrum3-new.jpg

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing 10.2.2009

p p _ p jpg

Page 10: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

Examples of application areas10

Examples of application areas

Digital image processing encompasses a wide and varied field of applications:

Gamma rays nuclear medicine (e g positron emission tomography (PET)) andGamma rays nuclear medicine (e.g. positron emission tomography (PET)) and astronomy

X-rays medical diagnostics (e.g. angiography, computerized tomography (CT)), i d i l i iindustrial inspection, astronomy

Ultraviolet band lithography, industrial inspection, fluorescence microscopy, lasers, biological imaging, astronomy, g g g, y

visible band light microscopy, astronomy, remote sensing, industry, and monitoring, surveillance etc.

Infrared band remote sensing, imaging in dark

Microwave band radar imaging

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing

Radio band medicine (magnetic resonance imaging (MRI)), astronomy

10.2.2009

Page 11: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

Human visual perception11

Human visual perception

Although the field of digital image processing is built on a foundation of mathematical and probabilistic formulations, human intuition and analysis l l l i h h i f h i h d hiplay a central role in the choice of one technique versus another, and this

choice often is made based on subjective, visual judgments.

Hence, developing a basic understanding of human visual perception is , p g g p pimportant.

When the eye is properly focused, light from an object outside the eye is i d th ti P tt i i i ff d d b th di t ib ti fimaged on the retina. Pattern vision is afforded by the distribution of discrete light receptors over the surface of the retina.

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing 10.2.2009

Page 12: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

Human eye12

Human eye

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing 10.2.2009

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 13: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

Receptors: cones and rods13

Receptors: cones and rods

Cones 6-7 million, located primarily in the central portion of the retina (fovea), highly sensitive to color, three principal sensing categories

di hl d d bl lcorresponding roughly to red, green and blue color

Humans can resolve fine details with these cones largely because each one is connected to its own nerve end. Muscles controlling the eye rotate the g yeyeball until the image of an object of interest falls on the fovea. Cone vision is called photopic or bright-light vision.

R d 75 150 illi di t ib t d th ti l f l dRods 75-150 million, distributed over the retinal surface, several rods are connected to a single nerve

Rods serve to give a general, overall picture of the field of view. They are g g p ynot involved in color vision and are sensitive to low levels of illumination. For example, objects that appear brightly colored in daylight when seen by moonlight appear as colorless forms because only the rods are

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing

stimulated. This phenomenon is known as scotopic or dim-light vision.

10.2.2009

Page 14: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

Properties of visual system14

Properties of visual system

In an ordinary photographic camera, the lens has a fixed focal length, and focusing at various distances is achieved by varying the distance between h l d h i i l h h fil ( i i hi i hthe lens and the imaging plane, where the film (or imaging chip in the

case of a digital camera) is located.

In the human eye, the converse is true; the distance between the lens and y , ;the imaging region (the retina) is fixed, and the focal length needed to achieve proper focus is obtained by varying the shape of the lens.

Th f li ht i t it l l t hi h th h i l tThe range of light intensity levels to which the human visual system can adapt is enormous (on the order of ) from the scotopic threshold to the glare limit.

1010

Visual system cannot operate over such a range simultaneously. Rather, it accomplishes this large variation by changing its overall sensitivity, a phenomenon known as brightness adaptation.

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing 10.2.2009

Page 15: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

Image processing levels15

Image processing levels

Low-level processes involve primitive operations such as image preprocessing to reduce noise, contrast enhancement, and image h i I d isharpening. Inputs and outputs are images.

Mid-level processing on images involves tasks such as segmentation (partitioning an image into regions or objects), description of those objects (p g g g j ), p jto reduce them to a form suitable for computer processing, and classification (recognition) of individual objects. Inputs generally are images, but outputs are attributes extracted from those images (e.g., edges, g p g ( g gcontours, and the identity of individual objects).

High-level processing involves “making sense” of an ensemble of recognized objects as in image analysis and at the far end of therecognized objects, as in image analysis, and, at the far end of the continuum, performing the cognitive functions normally associated with vision.

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing 10.2.2009

Page 16: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

Image enhancement16

Image enhancement

Image enhancement is the process of manipulating an image so that the result is more suitable than the original for a specific application. The

d ifi i i h b i bli h h hword specific is important here, because it establishes at the outset that enhancement techniques are problem oriented. Thus, for example, a method that is quite useful for enhancing X-ray images may not be the b t h f h i t llit i t k i th i f d b d fbest approach for enhancing satellite images taken in the infrared band of the electromagnetic spectrum.

Enhancement is based on human subjective preferences regarding what j p g gconstitutes a “good” enhancement result.

Image enhancement methods fall into two broad categories: spatial domain methods and frequency domain methods Frequency domaindomain methods and frequency domain methods. Frequency domain processing techniques are based on modifying the discrete Fourier transform (DFT) of the image.

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing 10.2.2009

Page 17: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

Neighborhood operations17

Neighborhood operations

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing 10.2.2009

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 18: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

Histogram18

Histogram

The histogram of a digital image with gray levels in the range is a discrete function where is the kth gray level and is the

b f i l i h i h i l l

[ ]0, 1 ,L −( ) ,k kh r n= kr kn

number of pixels in the image having gray level

Often the histogram is normalized by dividing each value by the total number of pixels in the image.

.kr

p g

For image of size the normalized histogram is

The sum of all components of a normalized histogram is equal to 1.

M N× ( ) /( ).k kp r n MN=

p g q

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing 10.2.2009

Page 19: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

Histogram examples19

Histogram examples

High-contrasti

Histograms

image

DarkDarkimage

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing 10.2.2009

Page 20: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

Histogram examples20

Histogram examples

Bright

Histograms

image

Low-contrastLow contrastimage

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing 10.2.2009

Page 21: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

Histogram equalization21

Histogram equalization

Histogram equalization or histogram linearization can be obtained by applying the transformation function

0( 1) ( ).

k

k jj

s L p r=

= − ∑

On the next two slides are the results of performing histogram equalization on the preceding four images.

Hi li i d d h hi f h i iHistogram equalization tends to spread the histogram of the input image so that the levels of the histogram-equalized image will span a fuller range of the gray scale.

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing 10.2.2009

Page 22: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

Histogram equalization results22

Histogram equalization results

High-contrasti

Histograms

image

DarkDarkimage

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing 10.2.2009

Page 23: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

Histogram equalization results23

Histogram equalization results

Bright

Histograms

image

Low-contrastLow contrastimage

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing 10.2.2009

Page 24: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

Filtering and thresholding example24

Filtering and thresholding example

Target is to find only the large objects from the image and neglect the small ones. Result is a binary image: objects are white and backgroundi bl kis black.

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing 10.2.2009

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 25: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

Linear vs nonlinear filtering25

Linear vs. nonlinear filtering

Nonlinear filtering gives superior results to linear filtering in removal of impulsive noise (white and black dots superimposed on the image).

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing 10.2.2009

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 26: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

Image restoration26

Image restoration

Image restoration is an area that also deals with improving the appearance of an image.

Unlike enhancement, image restoration is objective, in the sense that restoration techniques tend to be based on mathematical or probabilistic models of image degradation. g g

© 1992–2008 R. C. Gonzalez & R. E. Woods

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing 10.2.2009

Page 27: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

Color images: RGB color model27

Color images: RGB color model

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing 10.2.2009

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 28: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

RGB component images28

RGB component images

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing 10.2.2009

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 29: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

Morphology and segmentation29

Morphology and segmentation

Morphological processing deals with tools for extracting image components that are useful in the representation and description of shape.

Segmentation procedures partition an image into its constituent parts or objects.

A i i f h diffi l k i di i lAutonomous segmentation is one of the most difficult tasks in digital image processing.

A rugged segmentation procedure brings the process a long way toward gg g p g p g ysuccessful solution of imaging problems that require objects to be identified individually.

W k ti t ti l ith l t l tWeak or erratic segmentation algorithms almost always guarantee eventual failure.

In general, the more accurate the segmentation, the more likely

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing

g g yrecognition is to succeed.

10.2.2009

Page 30: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

Representation30

Representation

Representation almost always follows the output of a segmentationstage, which usually is raw pixel data, constituting either the boundary of

i (i h f i l i i i f h )a region (i.e., the set of pixels separating one image region from another) or all the points in the region itself.

In either case, converting the data to a form suitable for computer , g pprocessing is necessary.

The first decision that must be made is whether the data should be t d b d l t irepresented as a boundary or as a complete region.

Boundary representation is appropriate when the focus is on external shape characteristics, such as corners and inflections.p

Regional representation is appropriate when the focus is on internal properties, such as texture or skeletal shape.

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing

In some applications, these representations complement each other.

10.2.2009

Page 31: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

Description and recognition31

Description and recognition

Choosing a representation is only part of the solution for transforming raw data into a form suitable for subsequent computer processing.

A method must also be specified for describing the data so that features of interest are highlighted.

D i i l ll d f l i d l i h i ibDescription, also called feature selection, deals with extracting attributes that result in some quantitative information of interest or are basic for differentiating one class of objects from another.

Recognition is the process that assigns a label (e.g., “vehicle”) to an object based on its descriptors.

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing 10.2.2009

Page 32: Introduction to Digital ImageIntroduction to Digital Image ... · Digital image 3 Digital image Fig. 1. A digital image (on the left) and pixels in the marked area (on the right)

Image processing at TUT32

Image processing at TUT

For example:

SGN-3016 Digital Image Processing I 5 crSGN 3016 Digital Image Processing I, 5 crSGN-3010 Digitaalinen kuvankäsittely I, 5 cr

SGN-3057 Digital Image Processing II, 6 cr

SGN-3106 Digital Video Processing, 4 cr

SGN-3156 Video Compression, 4 cr

SGN-3507 Introduction to Medical Image Processing, 5 cr

SGN-3636 Human visual system

SGN-3906 Graduate Seminar on Medical Image Processing, 5 cr

Department of Signal Processing Sari Peltonen, Introduction to Digital Image Processing 10.2.2009