digital image processing in life sciences march 14 th, 2012 lecture number 1: digital image...

50
Digital Image Processing in Life Sciences March 14 th , 2012 Lecture number 1: Digital Image Fundamentals

Upload: maximillian-hancock

Post on 12-Jan-2016

227 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

Digital Image Processing in Life Sciences

March 14th, 2012

Lecture number 1: Digital Image Fundamentals

Page 2: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

What Is Digital Image Processing?

(The Origins of Digital Image Processing)

Fundamental Steps in Digital Image Processing

Image Sampling and Quantization

Spatial and Gray-Level Resolution

Some Basic Relationships Between Pixels

Zooming and Shrinking Digital Images

Lookup tables

Color spaces

Lecture’s outline

Page 3: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

Terms to be conveyed:

Pixel

Gray level

Bit depth

Dynamic range

Connectivity types/neighborhood

Interpolation types

Look-up tables

Page 4: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

Book: Digital Image Processing, Rafael C. Gonzales and Richard E.Woods

Web resources: www.microscopy.fsu.edu (very thorough and informative)

www.cambridgeincolour.com (beautiful examples, excellent tutorials)

Page 5: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

Next topics:

2. Image enhancement in the spatial domain

3. Segmentation

4. Image enhancement in the frequency domain

5. Multi dimensional image processing

6-7. Guest lectures-TBD

Page 6: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

What Is A Digital Image?

Image= “a two-dimensional function, f(x,y), where x and y are spatial coordinates, and the amplitude of f at any pair of coordinates (x, y) is called the intensity (gray level of the image) at that point. When x, y, and the amplitude values of f are all finite, discrete quantities, we call the image a digital image.” (Gonzalez and Woods).

Page 7: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

These sets of numbers can be depicted in terms of frequencies

http://cvcl.mit.edu/hybrid_gallery/gallery.html

Page 8: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

We can define three types of computerized processes:

Low-, mid-, and high-level.

Low: image preprocessing, noise reduction, enhance contrast etc.

Mid: segmentation, sorting and classification.

High: assembly of all components into a meaningful coherent form

Digital Image Processing-Points to consider:

Why process?

Are both the input and output of a process images?

Where does image processing stop and image analysis start?

Are the processing results intended for human perception or for machine perception? Character recognition and fingerprint comparisons vs intelligence photos…

Page 9: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

Digital image origins-The digital image dates back to… the 1920’s and the Bartlane cable picture transmission system between NY and London. The image took 3 hours to transmit, instead of more than one week.They started with 5 tone levels and increased to 15 levels by 1929.

Taken from Gonzalez and Woods

Page 10: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

What Is Digital Image Processing?

(The Origins of Digital Image Processing)

Fundamental Steps in Digital Image Processing

Image Sampling and Quantization

Spatial and Gray-Level Resolution

Some Basic Relationships Between Pixels

Zooming and Shrinking Digital Images

Lookup tables

Color spaces

Lecture’s outline

Page 11: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

Essential steps when processing digital images:

Acquisition

Enhancement

Restoration

Color image restoration

Wavelets

Morphological processing

Segmentation

Representation

Recognition

Outputs are digital images

Outputs are attributes of the image

Page 12: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

Image acquisition

Acquire or receive an image for further processing.This step has a major impact over the entire procedure of processing and analysis.

Image Enhancement

Improving quality subjectively (e.g. by change of contrast)

Image Restoration

Improving quality objectively (e.g. by removing psf)

Page 13: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

microscopy.fsu.edu

Page 14: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

microscopy.fsu.edu

Page 15: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

microscopy.fsu.edu

Page 16: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

Morphological processing

Extracting components for the purpose of representing shapes

Segmentation

Deconstructing the image into its constituent objects. A crucial step for successful recognition of the image contents.

Page 17: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals
Page 18: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

Morphological processing

Extracting components for the purpose of representing shapes

Segmentation

Deconstructing the image into its constituent objects. A crucial step for successful recognition of the image contents.

Representation

Feature selection-classification/grouping of objects

Page 19: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

What Is Digital Image Processing?

(The Origins of Digital Image Processing)

Fundamental Steps in Digital Image Processing

Image Sampling and Quantization

Spatial and Gray-Level Resolution

Some Basic Relationships Between Pixels

Zooming and Shrinking Digital Images

Lookup tables

Color spaces

Lecture’s outline

Page 20: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

Keep in mind:

The sensor we used to create the image has a continuous output.

But, the transition from a continuum to a digital image requires two processes: sampling and quantization.

Sampling is the process of digitizing the spatial coordinates.

Quantization is the process of digitizing the amplitude values at those spatial coordinates.

The arrangement of the sensor used to create the image determines the sampling method and its output.

Different limits determine the performance of the optical sensors and of the mechanical sensors.

Sampling and quantization

Page 21: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals
Page 22: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

Sampling and quantization result in arrays of discrete quantities.

By convention, the coordinate (x,y)=(0,0) is located at the upper leftmost corner of the image.

picture elements=image elements=pels=pixels

(Gonzales and Woods)

Sampling results in typical image sizes that can vary from 128 x 128 to 4096 x 4096 or any combination thereof.

Page 23: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

An Image Formation Model

Let l(x0, y0) be the gray level (gl) value at (x0, y0) : l=f (x0, y0)

l is bounded by Lmin and Lmax and the boundary [Lmin, Lmax] is the gray scale.

This interval is usually shifted to [0, L-1] where 0 represents black gl values, and L-1 represents white gl values.

Page 24: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

Quantization results in discrete values of gray levels, typically an integer power of 2: L=2k . If k=8, the result is 256 gray levels, from 0 to 255.

Dynamic range- the portion of the gray levels in the image out of the entire gray scale of the image.

Think about high vs low dynamic range images: how does the dynamic range affect the contrast of the image? Next lecture…

Page 25: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

Gray level (bit-depth)

Res

olut

ion

How many bits are required to save a digital image?

b=M x N x k (or M2k for images of equal dimensions).

Size (kb)

  8 (256) 12 (4096) 16 (65536)128 16.384 24.576 32.768256 65.536 98.304 131.072512 262.144 393.216 524.2881024 1048.576 1572.864 2097.1522048 4194.304 6291.456 8388.608

Page 26: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

8bit images- values are integers, unsigned

16bit images- values are integers, some softwares allow signed.

32bit images-floating-point, signed.

Page 27: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

What Is Digital Image Processing?

(The Origins of Digital Image Processing)

Fundamental Steps in Digital Image Processing

Image Sampling and Quantization

Spatial and Gray-Level Resolution

Some Basic Relationships Between Pixels

Zooming and Shrinking Digital Images

Lookup tables

Color spaces

Lecture’s outline

Page 28: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

Spatial and gray-level resolution

Spatial resolution is rather intuitive, and is determined by the quality and “density” of the sampling.

Sampling theories (eg Nyquist-Shannon) state that sampling should be performed at a rate that is at least twice the size of the smallest object/highest frequency.Based on this, over-sampling and under-sampling (=spatial aliasing) can occur.

Gray level resolution is a term used to describe the binning of the signal rather than the actual difference we managed to obtain when we quantized the signal. 8-bit and 16-bit images are the most common ones, but 10- and 12-bit images can also be found.

Page 29: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

128 x 128

256 x 256

512 x 512

64 x 64

Changing the resolution of the image without changing bit-depth

checker board patterns

Page 30: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals
Page 31: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

2bit

3bit

4bit

8bit

1bit

Changing the bit-depth of the image without changing resolution

False contouring

Page 32: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals
Page 33: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

What Is Digital Image Processing?

(The Origins of Digital Image Processing)

Fundamental Steps in Digital Image Processing

Image Sampling and Quantization

Spatial and Gray-Level Resolution

Some Basic Relationships Between Pixels

Zooming and Shrinking Digital Images

Lookup tables

Color spaces

Lecture’s outline

Page 34: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

(x+1, y), (x-1, y), (x, y+1), (x, y-1)= 4 neighbors of p, or N4(p)

(x+1, y+1), (x+1, y-1), (x-1, y+1), (x-1, y-1)= the four diagonal neighbors, or Nd(p).

N4(p) together with Nd(p) are N8(p).

Consider the case of image borders.

Neighbors of a pixel

(x,y) (x+1, y)(x-1, y)

(x, y+1)

(x, y-1)

(x+1, y+1)

(x+1, y-1)

(x-1, y+1)

(x-1, y-1)

Page 35: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

Adjacency/Connectivity, Regions, and Boundaries

Pixels are said to be connected if they are neighbors and if their gray levels satisfy a specified criterion of similarity.

Consider this example of binary pixels

V- the set of gray levels used to define adjacency. In this binary example, V={0} to define adjacency of pixels with the value 0. In non-binary images, the values of V can have a wider range.

Page 36: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

The region R of an image- a subset of pixels which is a connected set, meaning that there exists a path that connects the adjacent pixels.

The boundary (=border=contour) of R is the set of pixels in R that have one or more neighbors that are not in R.

What happens when R is the entire image?

Do not confuse boundary with edge. The edge is formed by discontinuity of gray levels at a certain point.

In binary images, edges and boundaries correspond.

Page 37: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

Distances between pixels

Between (x,y) and (s,t):

Eucladian distance: given by Pythagoras

D4 distance (=city-block distance): D4(p, q) = |x – s| + |y – t|.

3,3

3,2

3,1

4,22,2

2,31,3 4,3 5,3

4,43,42,4

3,5

0

1

1

1

1

2 2

2

2

2

2

2

2

Diamond pattern

Pixel coordinates:

Page 38: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

D8(p, q) =max( |x – s| , |y – t|) results in a square pattern around the center pixel.

0

1

1

1

1

1 1

2

2

1

2

1

2

2 2

2

2

22

22

2

2

22

Page 39: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

What Is Digital Image Processing?

(The Origins of Digital Image Processing)

Fundamental Steps in Digital Image Processing

Image Sampling and Quantization

Spatial and Gray-Level Resolution

Some Basic Relationships Between Pixels

Zooming and Shrinking Digital Images

Lookup tables

Color spaces

Lecture’s outline

Page 40: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

Zooming and shrinking digital images

Zoom: 1. Create new pixel locations 2. Assign gray level values to the locations

Page 41: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

For increasing the size of an image an integer number of times, the method of “pixel replication” is used.

For example, when changing a 512 x 512 image to 1024 x 1024, every column and every row in the original image is duplicated.

At high magnification factors, checkerboard patterns appear.

Nearest neighbor interpolationBilinear interpolation (2 x 2)Bicubic interpolation (4 x 4)

Examples of non-adaptive interpolation

Page 42: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

Pixel replication

Bilinear

Bicubic

Scaling up using different methods

Page 43: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals
Page 44: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

What Is Digital Image Processing?

(The Origins of Digital Image Processing)

Fundamental Steps in Digital Image Processing

Image Sampling and Quantization

Spatial and Gray-Level Resolution

Some Basic Relationships Between Pixels

Zooming and Shrinking Digital Images

Lookup tables

Color spaces

Lecture’s outline

Page 45: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

Look up tables:

Save computational time (LUTs can be found early in history…)

Require a mapping or transformation function- an equation that converts the brightness value of the input pixel to another value in the output pixel

Do not alter pixel values

Image transformations that involve look-up tables can be implemented by either one of two mechanisms: at the input so that the original image data are transformed, or at the output so that a transformed image is displayed but the original image remains unmodified.

www.microscopy.fsu.edu

Page 46: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals
Page 47: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

What Is Digital Image Processing?

(The Origins of Digital Image Processing)

Fundamental Steps in Digital Image Processing

Image Sampling and Quantization

Spatial and Gray-Level Resolution

Some Basic Relationships Between Pixels

Zooming and Shrinking Digital Images

Lookup tables

Color spaces

Lecture’s outline

Page 48: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

There are ways to describe color images other than the RGB space

Color space=color gamut

RGB= 3 X 8-bit channels= 24bit= true color

The histograms of RGB images can be viewed either as separate channels or as the weighted average of the channels.

Some representations of color images calculate a weighted average of green, red and blue.

Page 49: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

Hue-Saturation-Intensity (more intuitive, as we perceive the world):

Hue= color spectrum, Saturation= color purity, Intensity= brightness

More: Hue-Saturation-Lightness; Hue-Saturation-Brightness

Page 50: Digital Image Processing in Life Sciences March 14 th, 2012 Lecture number 1: Digital Image Fundamentals

End of Lecture 1

Thank you!