computational systems biology i introduction to basic ... · computational systems biology i...

33
Institute of Signal Processing Computational Systems Biology I Introduction to basic image processing Antti Pettinen [email protected] Department of Signal Processing, Tampere University of Technology CSB I course, spring 2008 – p. 1

Upload: lykien

Post on 28-Jul-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

I n s t i t u t e o f S i g n a l P r o c e s s i n g

Computational Systems Biology IIntroduction to basic image processing

Antti Pettinen

[email protected]

Department of Signal Processing, Tampere University of Technology

CSB I course, spring 2008 – p. 1

I n s t i t u t e o f S i g n a l P r o c e s s i n g

Introduction

• Image processing can roughly be divided into two mainapplication areas, depending on the interpreter (human ormachine)

• When the interpreter is a human, the focus of processing ison visual pleasantness and on making the desiredinformation clearly observable by a human

• When the interpreter is a machine the processing is done insuch a way that the machine can best extract the desiredinformation, i.e. not necessarily visually pleasant image

CSB I course, spring 2008 – p. 2

I n s t i t u t e o f S i g n a l P r o c e s s i n g

Goals of digital image processing

• Image enhacement for human interpretation• removal of mistakes• enhancement of specific features• restoration, removal of side effects

• Machine vision• "understanding the image", image analysis• segmentation (recognition of basic elements); line

segments, crossings, connected areas)• classifying and combining the elements (artificial

intelligence?)

CSB I course, spring 2008 – p. 3

I n s t i t u t e o f S i g n a l P r o c e s s i n g

Digital Image Processing (DIP)

• Image is a two dimensional function f(x, y), where x and y

are phase plane (spatial plane) coordinates, and the valueof the function f in each point (x, y) is the intensity (e.g.grayscale values, 0 = black, 255 = white)

• When the values of both the f(x, y) and the coordinates x

and y are discrete, the image is digital (image)• Thus, digital image processing is the processing of these

digital images• Digital image processing is tightly connected to other areas,

such as signal processing, physics, mathematics, computerscience, biology, etc.

CSB I course, spring 2008 – p. 4

I n s t i t u t e o f S i g n a l P r o c e s s i n g

DIP cont.

Figure 1: Digital image, original (left) and

zoomed (right)

CSB I course, spring 2008 – p. 5

I n s t i t u t e o f S i g n a l P r o c e s s i n g

The Vision

• The vision is the most developed of human senses,approximately 3/4 of one’s observations are based onvisual perception

• The vision is very adaptable to changes in conditions,however the action is limited to a small frequency range inthe electromagnetic spectrum, called visible region

• Machines do not have this limitation, and almost the wholeelectromagnetic spectrum can be observed (from gammato radio waves)

• With the aid of machines it is possible to produce imagesfrom other sources than electromagnetic radiation, e.g.,from sound waves, electron microscopy, etc. Additionally,synthetic images can be produced with computers.

CSB I course, spring 2008 – p. 6

I n s t i t u t e o f S i g n a l P r o c e s s i n g

History of DIP

• One of the first applications of image processing was thesending of digitized newspaper pictures by submarine cablebetween London and New York (1920)

• This Bartlane cable picture transmission system reducedthe time required to transport a picture across the Atlanticfrom more than a week to less than three hours.

• Eventhough the images were digital, they were notproducts of digital image processing, as, naturally, nocomputer was used in in the production

• The development of digital image processing goes hand inhand with the development of computers, as the digitalimages require lots of memory and computational power

CSB I course, spring 2008 – p. 7

I n s t i t u t e o f S i g n a l P r o c e s s i n g

History of DIP cont.

• The 1960s saw the first computers that could performmeaningful image processing operations

• The first applications and the source of development wasthe space research

• The late 1960s and early 1970s saw the first applications inmedicine, remote sensing and astronomy

• Today the digital image processing has become availablefor practicly everyone (powerful computers, digital cameras,internet)

CSB I course, spring 2008 – p. 8

I n s t i t u t e o f S i g n a l P r o c e s s i n g

Areas of application

• Digital image processing is used in a vast number of areas- so vast that it is impossible to list them here

• Thus, we will go trough some examples from differentwavelength ranges of the electromagnetic spectrum

• Electromagnetic radiation can be thought as progressivesine-waves, with wavelength λ, or as massless particlesprogressing in wavelike motion at the speed of light. Thus,the electromagnetic radiation has both wave and particlenatures. The carrier of electromagnetism is the photon

• The energy of a photon depends on the wavelength

according to the following formula: E =hc

λ= hv, where h is

the Planck constant, v is the frequency, and c is the speedof light

CSB I course, spring 2008 – p. 9

I n s t i t u t e o f S i g n a l P r o c e s s i n g

Areas of application cont.

Figure 2: Classification of electromagnetic

radiation according to frequencies

CSB I course, spring 2008 – p. 10

I n s t i t u t e o f S i g n a l P r o c e s s i n g

Areas of application cont.

• The radio waves have the smallest frequency (smallestenergy and longest wavelength) whereas the gamma rayshave the largest frequency (biggest energy, shortestwavelength)

• The classification partly overlaps in the border regions(grayscales in the Fig. 2)

• The Fig. 2 nicely shows how narrow part of the wholeelectromagnetic spectrum the visible light region actually is

CSB I course, spring 2008 – p. 11

I n s t i t u t e o f S i g n a l P r o c e s s i n g

Areas of application cont.

• Gamma rays: nuclear medicine (e.g. positron-emissiontomography (PET)), astronomy

• X-rays: medical diagnostics (x-ray photography,computerized tomography), manufacturing industry, etc.

• UV: fluorescence microscopy, manufacturing industry,astronomy, etc.

• Visible light: microscopy, satellite images, surveillance,recognition, etc.

• IR: satellite images, night vision• Microwaves: radar• Radio waves: medicine (magnetic resonance imaging

(MRI), astronomy

CSB I course, spring 2008 – p. 12

I n s t i t u t e o f S i g n a l P r o c e s s i n g

Areas of application cont.

• Eventhough the electromagnetic radiation based imaging isthe largest and most versatile in terms of applications, thereare some other important imaging methods

• These include: sound waves, electron microscopy, andsynthetic imaging (images created with computers)

• Sound waves are used to produce e.g. seismographicimages, ultrasound images, and sonar images

• Electron microscopy provides better magnifications(10000x) compared to light microscopy (1000x)

• Synthetic imaging includes fractals and model basedimages (used for testing, modeling, training)

CSB I course, spring 2008 – p. 13

I n s t i t u t e o f S i g n a l P r o c e s s i n g

The visual system

• Usually the image processing method is chosen bysubjective analysis, i.e. based on visual perception of theresults. Thus it is important to understand the basics of thehuman visual system

• The eye is spherical by shape, with diameter of approx. 2cm. The light enters the eye through the cornea, and byusing the ciliary muscle to control the lens, the light isfocused on the retina

• The task of the iris is to control the amount of entering light.The diameter of the pupil varies between approx. 2-8 mm

CSB I course, spring 2008 – p. 14

I n s t i t u t e o f S i g n a l P r o c e s s i n g

The visual system cont.

Figure 3: The eye and a simplified cross-

section

CSB I course, spring 2008 – p. 15

I n s t i t u t e o f S i g n a l P r o c e s s i n g

The visual system cont.

• The image is depicted upside down on the retina, whichincludes two different types of receptors: cones and rods

• In each eye, there are 6-7 million cones (3 different types,all sensitive to different wavelengths, i.e. colors), mainlylocated around the fovea, which is responsible for sharpcentral vision (each cone has its own nerve ending). Thevision produced by cones is referred as photopic vision, asthey require (bright) light.

• The amount of rods is considerably bigger, 75-150million/eye, spread around the whole retina, which, inaddition to multiple rods per nerve ending, causes worseseparation of details compared to the cones. Thus, the rodshelp in producing the overall image and are responsible forscotopic vision (the rods are sensitive also to low amountsof light)

CSB I course, spring 2008 – p. 16

I n s t i t u t e o f S i g n a l P r o c e s s i n g

The visual system cont.

• We can see altogether around 1010 different grayscalelevels, but not at the same time. For a pixel and itsenvironment, we can see only 10-20 levels at a time,producing around 100 levels on grayscale (eye moves andadjusts to new pixels and their environments)

• thousands of different colors, all produced by cones (3different types, i.e. wavelengths):• wavelength mixing:− two different combinations may cause the same

perception− three basic colors can produce all perceptions

CSB I course, spring 2008 – p. 17

I n s t i t u t e o f S i g n a l P r o c e s s i n g

Color image

• Three parameters related to color: brightness, hue, andsaturation

• Monochromatic light (only one wavelength); additive andsubtractive mixing of different wavelengths to producecolors

• Any specific method for associating three numbers (ortristimulus values) with each color is called a color space

• The CIE 1931 color space:• one of the first mathematically defined color spaces,

based on direct measurements of human visualperception

• serves as the basis from which many other colorspaces are defined (RGB etc.)

• chromaticity diagram (hue and saturation) shown in Fig.4

CSB I course, spring 2008 – p. 18

I n s t i t u t e o f S i g n a l P r o c e s s i n g

Color image cont.

Figure 4: The CIE 1931 color space chromaticity diagram. The outercurved boundary is the spectral (or monochromatic) locus, with wavelengthsshown in nanometers. Purple line joins the ends of the spectrum.

CSB I course, spring 2008 – p. 19

I n s t i t u t e o f S i g n a l P r o c e s s i n g

The Visual system: resolution capability

• The resolution capability (separating capability) of thevision is worse for darker backgrounds. Thus, the relativeresolution capability is better in bright light

• The observed brightness is not a simple function of intensity• This can be illustrated by two examples: simultaneous

contrast (Fig. 5) and the Mach bands (Fig. 6)

CSB I course, spring 2008 – p. 20

I n s t i t u t e o f S i g n a l P r o c e s s i n g

Simultaneous contrast

Figure 5: The intensities of the small squares are the same. However,when the intensity of the background is smaller, the small square appears to beof lighter shade

CSB I course, spring 2008 – p. 21

I n s t i t u t e o f S i g n a l P r o c e s s i n g

Simultaneous contrast

Figure 6: Each band has constant intensity. However, the bands seem tobe lighter on the side next to a darker band. Note that the red curve is lifted upfor visualization purposes only

CSB I course, spring 2008 – p. 22

I n s t i t u t e o f S i g n a l P r o c e s s i n g

Frequency responses

• The spatial frequency response: bandpass filter• The temporal frequency response: lowpass filter

Figure 7: Hermann Grid: most observers will see dark spots at the inter-sections of white lines. (bandpass filter)

CSB I course, spring 2008 – p. 23

I n s t i t u t e o f S i g n a l P r o c e s s i n g

Image organization and illusions

• Perceptual grouping• Distance clues: monocular clues, parallax (the apparent

shift of an object against the background that is caused bya change in the observer’s position)

• constancy of perception: approaching car appears to bethe same size independent of distance

• Explanations: pattern filters and 3D-model of the world(constancy of perception)

• Impossible objects: image grammar in our mind

CSB I course, spring 2008 – p. 24

I n s t i t u t e o f S i g n a l P r o c e s s i n g

Image organization and illusions cont.

Figure 8: Object and background

CSB I course, spring 2008 – p. 25

I n s t i t u t e o f S i g n a l P r o c e s s i n g

Image enhancement

• Make the image more useful for a specific purpose• Point enhancement: same operation performed for all pixels• Enhancement in spatial domain: new pixel value depends

also on its neighbors’ values• Enhancement in frequency domain: global changes using

the frequency domain representation (Fourier transform)• No standard for a well-enhanced image: depends on usage

and the person viewing the result• Assessment for machine vision is clearer: easier to

measure system performance

CSB I course, spring 2008 – p. 26

I n s t i t u t e o f S i g n a l P r o c e s s i n g

Spatial filtering

• Filter, window, mask• Linear filters:

• convolution, point spread function, impulse response• simply multiplication in frequency domain• advanced theory

• Smoothing:• noise suppression: linear smoothing (out of focus), local

median (preserves sharp edges)• Sharpening:

• high-pass filter

CSB I course, spring 2008 – p. 27

I n s t i t u t e o f S i g n a l P r o c e s s i n g

Enhancement in frequency domain

• Simple outline:• discrete fourier transform• multiply by the required transfer function• inverse transform

• Implementation often by spatial filters: easy implementation(convolution) and fast performance (small task)

• Frequency domain operations affect the frequency domainrepresentation directly (remove/amplify certain spatialfrequencies)

CSB I course, spring 2008 – p. 28

I n s t i t u t e o f S i g n a l P r o c e s s i n g

Restoration

• Attempt to reveal the original image from a degraded image• A mathematical model of the degratdation process is used:

attempt to develop inverse process• E.g. camera moved during exposure: impulse response as

the model, inverse filtering as the fix

CSB I course, spring 2008 – p. 29

I n s t i t u t e o f S i g n a l P r o c e s s i n g

Image coding

• Compression: reduce redundancy of the image data (moreefficient form)

• Encryption: transforming information to make it unreadableto anyone except those possessing special knowledge

• Error correction and detection• Watermarking: proof of origin• Steganography: messaging without trace (hidden

messages)

CSB I course, spring 2008 – p. 30

I n s t i t u t e o f S i g n a l P r o c e s s i n g

Segmentation

• Divide the image into reasonable parts, e.g. roads, cells,nuclei, cytoplasm, etc.

• Segmentation is based on two properties• Discontinuity: lines, edges, crossings (using matched

filters responsive to the specific features)• Similarity: thresholding, connected objects,

mathematical morphology, and object division,combination, growing, thinning etc.

CSB I course, spring 2008 – p. 31

I n s t i t u t e o f S i g n a l P r o c e s s i n g

Image recognition and interpretation

• Machines should possess human abilities: resolvingrelevant information, learn by examples and generalize,make conclusions based on partial information

• Machines are fast idiots, artificial intelligence is restricted toa limited context

• Image analysis:• Preprocessing: equalization, filtering, restoration,

enhancement• Human interpretation or transformation to suitable

representation (segmentation, object identification)• Recognition: pattern recognition, classification,

clustering, machine learning, etc.• Interpretation: restricted environments (expert systems

on specific areas)

CSB I course, spring 2008 – p. 32

I n s t i t u t e o f S i g n a l P r o c e s s i n g

Further reading:

• www.imageprocessingplace.com• Digital Image Processing by by Gonzalez and Woods (3rd

edition, Prentice-Hall, 2008)• Image processing courses at TUT (Digital Image

Processing I-III, both in English and Finnish)

CSB I course, spring 2008 – p. 33