อ. สนั่น ศรีสุข computer graphics and multimedia (eecp0462) อ....

22
อ.ออออ Computer Graphics and Multimedia (EECP0462) อ.อออออ ออออออ Bachelor of Engineering (MUT) Master of Engineering (MUT) http://www.mut.ac.th/~sa nun

Upload: austyn-eells

Post on 31-Mar-2015

219 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: อ. สนั่น ศรีสุข Computer Graphics and Multimedia (EECP0462) อ. สนั่น ศรีสุข Bachelor of Engineering (MUT) Master of Engineering (MUT)

อ. สนั่��นั่ศรี�สข

Computer Graphics and Multimedia (EECP0462)อ.สนั่��นั่ ศรี�สข

Bachelor of Engineering (MUT)

Master of Engineering (MUT)

http://www.mut.ac.th/~sanun

Page 2: อ. สนั่น ศรีสุข Computer Graphics and Multimedia (EECP0462) อ. สนั่น ศรีสุข Bachelor of Engineering (MUT) Master of Engineering (MUT)

อ. สนั่��นั่ศรี�สข

Computer Graphics & Image Processing

Reference Books:

1. Donald Hearn. and M. Pauline Baker., “Computer Graphics C Version 2nd Edition.”

2. Gerhard X. Ritter. and Joseph N. Wilson., “Computer Vision Algorithms in Image Algebra.”

3. G. X. Ritter., “Image Algebra.” available via anonymous ftp from ftp://ftp.cis.ufl.edu/pub/src/ia/documents

4. J. R. Parker., “Algorithms for Image Processing and Computer Vision.”

Page 3: อ. สนั่น ศรีสุข Computer Graphics and Multimedia (EECP0462) อ. สนั่น ศรีสุข Bachelor of Engineering (MUT) Master of Engineering (MUT)

อ. สนั่��นั่ศรี�สข

Score

Midterm 30 %

Final 50 %

Homework 5 %

Project 15 %

Total 100 %

Page 4: อ. สนั่น ศรีสุข Computer Graphics and Multimedia (EECP0462) อ. สนั่น ศรีสุข Bachelor of Engineering (MUT) Master of Engineering (MUT)

อ. สนั่��นั่ศรี�สข

Course Descriptions Part I (Computer Graphics)

• Week1: Mathematics for Computer Graphics and Image Processing

• Week2: Line Drawing Algorithms

• Week3: Circle and Ellipse Generating Algorithms

• Week4: Basic Transformations

• Week5: Clipping Operations

• Week6: Filling Algorithms

• Week7: Three-Dimensional Concepts and Transformations

Page 5: อ. สนั่น ศรีสุข Computer Graphics and Multimedia (EECP0462) อ. สนั่น ศรีสุข Bachelor of Engineering (MUT) Master of Engineering (MUT)

อ. สนั่��นั่ศรี�สข

Course Descriptions Part II (Image Processing)

• Week8: Gray-Level Segmentaion

• Week9: Thinning and Skeletonizing

• Week10: Edge-Detection Techniques

• Week11: Image Matching (Hausdorff Distance)

• Week12: Basic Neural Network I

• Week13: Basic Neural Network II

• Week14: Basic Neural Network III

Page 6: อ. สนั่น ศรีสุข Computer Graphics and Multimedia (EECP0462) อ. สนั่น ศรีสุข Bachelor of Engineering (MUT) Master of Engineering (MUT)

อ. สนั่��นั่ศรี�สข

Two-Dimensional Cartesian Reference

Frames

xx i

y i

yxx i

y i

y

Coordinate origin at the lower left screen corner

Coordinate origin at the upper left screen corner

Page 7: อ. สนั่น ศรีสุข Computer Graphics and Multimedia (EECP0462) อ. สนั่น ศรีสุข Bachelor of Engineering (MUT) Master of Engineering (MUT)

อ. สนั่��นั่ศรี�สข

Polar coordinate reference

r

θ

xx i

y i

y

r

θ

P

Relationship between polar and Cartesian coordinates

Page 8: อ. สนั่น ศรีสุข Computer Graphics and Multimedia (EECP0462) อ. สนั่น ศรีสุข Bachelor of Engineering (MUT) Master of Engineering (MUT)

อ. สนั่��นั่ศรี�สข

Polar coordinates in the xy plane

θx

yr

P

cosrx

Polar to Cartesian coordinates

sinry

Cartesian to Polar coordinates 22 yxr

x

y1tan

Page 9: อ. สนั่น ศรีสุข Computer Graphics and Multimedia (EECP0462) อ. สนั่น ศรีสุข Bachelor of Engineering (MUT) Master of Engineering (MUT)

อ. สนั่��นั่ศรี�สข

Points and Vectors• Vector V in the xy plane of a Cartesian

reference

Vector V is:

xx 2

y 2

y

|v |P2

x 1

y 1 P1

12 PPV ),( 1212 yyxx

),( yx VVVector magnitude using the Pythagorean theorem is:

22yx VVV

x

y

V

V1tan

Page 10: อ. สนั่น ศรีสุข Computer Graphics and Multimedia (EECP0462) อ. สนั่น ศรีสุข Bachelor of Engineering (MUT) Master of Engineering (MUT)

อ. สนั่��นั่ศรี�สข

Elements of Point set TopologyThe concept of set is basic to all of mathematics and

mathematical applications. We think of a set as something made up by all the object that satisfy some given condition, such as the set of integers, the set of pages in book.

The objects making up the set are called the elements, or member, of the set and may themselves be sets.

A set X is comprised of elements, for example, the equation.

X = {1, 2, 3, 4}means that a set X made up of the four elements 1, 2, 3

and 4. A set may be not by any particular order, Thus X might

be.X = {1, 4, 2, 0}

Page 11: อ. สนั่น ศรีสุข Computer Graphics and Multimedia (EECP0462) อ. สนั่น ศรีสุข Bachelor of Engineering (MUT) Master of Engineering (MUT)

อ. สนั่��นั่ศรี�สข

The elements of a set X may have duplicates. For example.

X = {1, 2, 3, 3, 4, 5, 4, 1}={1, 2, 3, 4, 5}. Each elements must distinct each other.

If a set is a large finite set or an infinite set, we can describe it by listing a property necessary for membership. For example, the equation.

Y = {y | y is a positive, even integer}reads “Y equals the set of all y such that y is a

positive, even integer,” that is, Y consists of the integers 2, 4, 6, and so on.

If X is a finite set, we let|X| = number of elements in X

If x is in the set X, we write reads “x is an element of X,” and if x is not in X, we write reads “x is not an element of X.”

XxXx

Page 12: อ. สนั่น ศรีสุข Computer Graphics and Multimedia (EECP0462) อ. สนั่น ศรีสุข Bachelor of Engineering (MUT) Master of Engineering (MUT)

อ. สนั่��นั่ศรี�สข

For example, if X={x | x is a positive integer}, Y={-1, -3, -5}. if x=2, then

, but . The set with no element is called the empty set and is denoted by .

Thus The sets X and Y are equal and we write X=Y if X and Y

have the same elements. To put it another way, X=Y if whenever , then and whenever , then . In image algebra we write

reads “for all x such that x is an element of X if and only if x is an element of Y.” , read “X is a subset of Y,” signifies that each element of X is an element of Y, that is, We call X a proper subset of Y whenever and . The set whose elements are all the subsets of a given set X is called the power set of X and is denoted by .

Xx

Y x

{}.

Xx YxYxXx

.| YxXxx

YX

.| YxXxx

YX YX X2

Page 13: อ. สนั่น ศรีสุข Computer Graphics and Multimedia (EECP0462) อ. สนั่น ศรีสุข Bachelor of Engineering (MUT) Master of Engineering (MUT)

อ. สนั่��นั่ศรี�สข

The following statements are evident:.set every for XXX

. then , and if ZXZYYX

. and both ifonly and if XYYXYX

.set every for XX

.2 and 2 XX X

.2}{ and ,2 XX xXxYXY

Page 14: อ. สนั่น ศรีสุข Computer Graphics and Multimedia (EECP0462) อ. สนั่น ศรีสุข Bachelor of Engineering (MUT) Master of Engineering (MUT)

อ. สนั่��นั่ศรี�สข

The algebra of SetsWhen defining operations on and between

sets it is customary to view the sets under consideration as subsets of some larger set U, called a universal set or the universe of discourse.

Example: Consider the equation.

If R is the universal set, then X={-1, 3/2}.Let X and Y be given sets. The union of X

and Y, written , is defined as the set whose elements are either in X or in Y (or in both X and Y). Thus,

0)1)(32)(1( 2 xxx

YX

}.or |{ YzXzzYX

Page 15: อ. สนั่น ศรีสุข Computer Graphics and Multimedia (EECP0462) อ. สนั่น ศรีสุข Bachelor of Engineering (MUT) Master of Engineering (MUT)

อ. สนั่��นั่ศรี�สข

The intersection of X and Y, written is defined as the set of all elements that belong to both X and Y. Thus,

For example, X={0, 1, 2, 3}, Y={-2, -1, 0, 1, 2}.

Two sets X and Y are called disjoint if they have no elements in common, that is, if obviously,

If then the complement of X (with respect to U) is denoted by and is defined as The difference of two sets is denoted by X\Y. and defined as

,YX

}. and |{ YzXzzYX

}.3,2,1,0,1,2{ YX

}.2,1,0{YX

.YX disjoint. are and ZZ

,UX X

}.,|{ XxUxxX UYX ,

}.|{\ that Note }.|{\ XxUxXUXYxXxYX

Page 16: อ. สนั่น ศรีสุข Computer Graphics and Multimedia (EECP0462) อ. สนั่น ศรีสุข Bachelor of Engineering (MUT) Master of Engineering (MUT)

อ. สนั่��นั่ศรี�สข

Some of the more important laws governing operations with sets. Here X, Y, and Z are subsets of some given universal set U.

Because of associativity, we can designate Similarly, a union (or intersection) of four

sets, say

by associativity, the distribution of parentheses is irrelevant, and by commutativity , the order of terms plays no role. By induction, the same remarks apply to the union (or intersection) of any finite number of sets.

.by simply )( ZYXZYX

because, as written becan ),()( ZYXWYZXW

. ison intersecti theand , written is ,,..., sets, ofunion Then

111 i

ii

n

in XXXXn

Page 17: อ. สนั่น ศรีสุข Computer Graphics and Multimedia (EECP0462) อ. สนั่น ศรีสุข Bachelor of Engineering (MUT) Master of Engineering (MUT)

อ. สนั่��นั่ศรี�สข

The statements

and

are all equivalent.

:bygiven is and ,,between relation The

,)( YXI

,)( YXXII

,)( YXYIII

,)( XYIV

.)( YXV

Page 18: อ. สนั่น ศรีสุข Computer Graphics and Multimedia (EECP0462) อ. สนั่น ศรีสุข Bachelor of Engineering (MUT) Master of Engineering (MUT)

อ. สนั่��นั่ศรี�สข

Identity Laws

Idempotent Laws

Complement Laws

Associative Laws

(Laws of Operations with Sets)

UUX XUX

XX X

XXX XXX

XX )( UU ,

UXX XX

)()( ZYXZYX )()( ZYXZYX

Page 19: อ. สนั่น ศรีสุข Computer Graphics and Multimedia (EECP0462) อ. สนั่น ศรีสุข Bachelor of Engineering (MUT) Master of Engineering (MUT)

อ. สนั่��นั่ศรี�สข

Commutative Laws

Distributive Laws

Demorgan’s Laws

(Laws of Operations with Sets)

XYYX XYYX

)()()( ZXYXZYX )()()( ZXYXZYX

YXYX )( YXYX )(

Page 20: อ. สนั่น ศรีสุข Computer Graphics and Multimedia (EECP0462) อ. สนั่น ศรีสุข Bachelor of Engineering (MUT) Master of Engineering (MUT)

อ. สนั่��นั่ศรี�สข

Distance Function (or Distance Measures)In many applications, it is necessary to find

the distance between two pixels or two components of an image. Unfortunately, there is no unique method of defining distance in digital images. One can define distance in many different ways. For all pixels p, q, and r, any distance metric must satisfy all of the following three properties:

Let,

}.,{},,{},,{ 332211 yxryxqyxp

,0),( and 0),( .)( qpqpdqpdI

),,(),( .)( qpdpqdII

).,(),(),( .)( rqdqpdrpdIII

Page 21: อ. สนั่น ศรีสุข Computer Graphics and Multimedia (EECP0462) อ. สนั่น ศรีสุข Bachelor of Engineering (MUT) Master of Engineering (MUT)

อ. สนั่��นั่ศรี�สข

Several distance functions have been used in digital geometry. Some of the more common distance functions are:

Euclidean

City-block

Chessboard

2

12

122

122

122

12 )()()()(),( yyxxyyxxqpdEuclidean

1212),( yyxxqpdcity

),max(),( 1212 yyxxqpdchess

Page 22: อ. สนั่น ศรีสุข Computer Graphics and Multimedia (EECP0462) อ. สนั่น ศรีสุข Bachelor of Engineering (MUT) Master of Engineering (MUT)

อ. สนั่��นั่ศรี�สข

Euclidean distance City-block distance

Chessboard distance

3

85258

52125

3210123

52125

85258

3

3

323

32123

3210123

32123

323

3

3333333

3222223

3211123

3210123

3211123

3222223

3333333