medical image processing & neural networks laboratory 1 medical image processing chapter 2...

38
Image Processing & Neural Networks Laboratory 1 Medical Image Processin Chapter 2 Digital Image Fundamentals 國國國國國國國國 國國國國國國國 國國國 (Chuan-Yu Chang ) 國國 Office: EB 212 TEL: 05-5342601 ext. 4337 E-mail: [email protected] Website: MIPL.yuntech.edu.tw

Upload: bertina-fowler

Post on 25-Dec-2015

223 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 1

Medical Image Processing

Chapter 2Digital Image Fundamentals

國立雲林科技大學 資訊工程研究所張傳育 (Chuan-Yu Chang ) 博士Office: EB 212TEL: 05-5342601 ext. 4337E-mail: [email protected]: MIPL.yuntech.edu.tw

Page 2: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 2

Structure of the Human Eye

角膜虹膜

視網膜

鞏膜脈絡膜

盲點 中央凹

玻璃體

水晶體

睫狀體睫狀肌

光受體有兩種:1. 錐狀體 (cones)600-700 萬 , 對色彩很靈敏,白晝視覺。2. 桿狀體 (rods)7500-1500 萬 , 對低亮度很靈敏,夜視視覺。

Page 3: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 3

Structure of the Human Eye (cont.) Distribution of rods and cones in the retina

Page 4: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 4

Image Formation in the Eye

Graphical representation of the eye looking at a palm tree

Page 5: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 5

Image Formation in the Eye (cont.) Brightness adaptation and Discrimination

Page 6: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 6

Image Formation in the Eye (cont.)

Page 7: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 7

Image Formation in the Eye (cont.) Typical Weber ratio as a function of intensity

Page 8: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 8

Image Formation in the Eye (cont.)

Page 9: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 9

Image Formation in the Eye (cont.)

Page 10: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 10

Optical illusion

Image Formation in the Eye (cont.)

Page 11: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 11

Light and the Electromagnetic Spectrum

Page 12: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 12

=c/v: wavelengthv: frequencyc: speed of light (2.998*108 m/s)

Light and the Electromagnetic Spectrum (cont.)

Page 13: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 13

Chapter 2: Digital Image FundamentalsChapter 2: Digital Image Fundamentals

Page 14: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 14

Chapter 2: Digital Image FundamentalsChapter 2: Digital Image Fundamentals

Page 15: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 15

Chapter 2: Digital Image FundamentalsChapter 2: Digital Image Fundamentals

Page 16: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 16

Chapter 2: Digital Image FundamentalsDigital Image Acquisition ProcessChapter 2: Digital Image FundamentalsDigital Image Acquisition Process

Page 17: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 17

Chapter 2: Digital Image Fundamentals

Image Sampling and Quantization To create a digital image, we need to convert the

continuous sensed data into digital form. This involves two processes: Sampling

Digitizing the coordinate values Quantization

Digitizing the amplitude values

Page 18: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 18

Chapter 2: Digital Image FundamentalsImage Sampling and QuantizationChapter 2: Digital Image FundamentalsImage Sampling and Quantization

Page 19: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 19

Chapter 2: Digital Image FundamentalsChapter 2: Digital Image Fundamentals

Page 20: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 20

Chapter 2: Digital Image FundamentalsChapter 2: Digital Image Fundamentals

Representing Digital Images The result of sampling and quantization is a matrix of real

numbers.

)1,1(...)1,1()0,1(

::::

)1,1(...)1,1()0,1(

)1,0(...)1,0()0,0(

),(

NMfMfMf

Nfff

Nfff

yxf

1,11,10,1

1,11,10,1

1,01,00,0

...

:...::

...

...

NMMM

N

N

aaa

aaa

aaa

A

Page 21: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 21

Chapter 2: Digital Image FundamentalsChapter 2: Digital Image Fundamentals

Page 22: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 22

Chapter 2: Digital Image Fundamentals Spatial Resolution

The smallest discernible detail in an image. Line pair Size: 1024*1024

Page 23: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 23

Chapter 2: Digital Image FundamentalsChapter 2: Digital Image Fundamentals

Page 24: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 24

Chapter 2: Digital Image FundamentalsChapter 2: Digital Image Fundamentals

Gray-Level Resolution The smallest discernible

change in gray level. The # of gray levels is

usually an integer power of 2.

Page 25: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 25

Chapter 2: Digital Image FundamentalsChapter 2: Digital Image Fundamentals

False contouring

Page 26: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 26

Chapter 2: Digital Image Fundamentals Isopreference curves (Huang, 1965)

Quantify experimentally the effects on image quality produced by varying N and k simultaneously.

Points lying on an isopreference curves correspond to images of equal subjective quality

Isopreference curves tend to become more vertical as the detail in the image increase. For image with a large amount of detail only a few gray levels may

be needed.

Page 27: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 27

Chapter 2: Digital Image Fundamentals Aliasing and Moire Patterns

Functions whose area under the curve is finite can be represented in terms of sine and cosines of various frequencies.

Suppose that this highest frequency is finite and that the function is of unlimited duration.

The Shannon sampling theorem tells us, if the function is sampled at a rate equal to or greater than twice its highest frequency, it is possible to recover completely the original function from its samples.

If the function is undersampled, then a phenomenon called aliasing corrupted the sampled image.

Page 28: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 28

Chapter 2: Digital Image Fundamentals In practice, it is impossible to satisfy the sampling theorem.

We can only work with sampled data that are finite in duration.

Multiplying the unlimited function by a “gating function” that is valued 1 for some interval and 0 elsewhere.

The gating function itself has frequency components that extend to infinity.

The principal approach for reducing the aliasing effects on an image is to reduce its high-frequency components by blurring the image prior to sampling.

Page 29: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 29

Chapter 2: Digital Image Fundamentals

Zooming Zooming may be views as oversampling. Zooming requires two steps:

Step 1: the creation of new pixel location. Step 2: the assignment of gray level to those new locations.

Nearest neighbor interpolation Look for the closest pixel in the original image and assign its

gray level to the new pixel in the grid. Pixel replication

To double the size of an image, we can duplicate each column/ row

Biliner interpolation Using the four nearest neighbors of a point.

Page 30: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 30

Zooming (cont.) Example 2.4

Using nearest neighbor gray-level / bilinear interpolation

Page 31: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 31

Chapter 2: Digital Image Fundamentals

Shrinking Shrinking may be views as undersampling.

Row-column deletion To shrink an image by one-half, we delete every other

row and column.

Page 32: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 32

Some basic relationships between pixels Neighbors of a pixel

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

diagonal-neighbors of p: ND(p) (x+1, y+1), (x+1, y-1), (x-1, y+1), (x-1, y-1)

8-neighbors of p: N8(p) (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)

p

p

p

Some basic relationships between pixels

Page 33: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 33

Some basic relationships between pixels (cont.)

If two pixels are connected, it must be determined If they are neighbors and If their gray levels satisfy a specified criterion of

similarity.

Page 34: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 34

Adjacency: two pixels p and q with value from V are 4-adjacency: if q is in the set N4(p).

8-adjacency : if q is in the set N8(p). m-adjacency: if

(i) q is in N4(p) or (ii) q is in ND(p) and the set N4(p)∩ N4(q) has no pixels whose values are from V. To eliminate the ambiguities arise when 8-adjacency is used.

Some basic relationships between pixels (cont.)

Page 35: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 35

Digital path (or curve) Path is a sequence of distinct pixels with coordinates

(x0, y0), (x1, y1),…,(xn, yn) n is the length of the path If (x0, y0)=(xn, yn), the path is closed path.

Connectivity Connected component

Regions If R is a connected set.

Boundary (border, contour) The boundary of a region R is the set of pixels in the region that have

one or more neighbors that are not in R. The boundary of a finite region forms a closed path

Edge The edges are formed from pixels with derivative values that exceed

a preset threshold.

Some basic relationships between pixels (cont.)

Page 36: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 36

Distance measure Pixels:

p=(x,y), q=(s,t), z=(v, w) Euclidean distance between p and q is defined as

D4 distance (city-block distance) between p and q is defined as

22),( tysxqpDe

tysxqpD ),(421012

212

212

22

Some basic relationships between pixels (cont.)

Page 37: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 37

D8 distance (chessboard distance) between p and q is defined as

Example: D8 distance<=2

tysxqpD ,max),(8

2 2 2 2 22 1 1 1 22 1 0 1 22 1 1 1 22 2 2 2 2

Some basic relationships between pixels (cont.)

Page 38: Medical Image Processing & Neural Networks Laboratory 1 Medical Image Processing Chapter 2 Digital Image Fundamentals 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu

Medical Image Processing & Neural Networks Laboratory 38

Dm distance between p and q is defined as the shortest m-path between the points. Assume that p, p2, and p4 are 1.

p3 p4

p1 p2

p

0 p4

0 p2

p

0 p4

1 p2

p

1 p4

0 p2

p

1 p4

1 p2

pm-path=2

m-path=3

m-path=3

m-path=4

Some basic relationships between pixels (cont.)