10 views

Uploaded by Hải Trần

Xử lý ảnh số

- should we fear artificial intelligence
- compvis1
- Project Report
- Nr-421301--Artificial Intelligence and Expert Systems
- Accenture - Artificial Intelligence - Healthcare's New Nervous System [8]
- Computer Models of Creativity
- BIM AND ARTIFICIAL INTELLIGENCE IN THE DESIGN AND CONSTRUCTION OF EARTHQAKE RESISTANT BUILDINGS
- Digital Marketing 2017 Trends and Essentials
- 1(1)
- AI Slide
- Spatial domain image fusion using adaptive cross filtering
- Code for Fingure Print in Matlab
- Artificial Intellegence
- Gartner Data Analytics Australia Augmented Analytics 2018
- 274-B317
- Beyond intelligence
- symposium
- Artificial Intelligence to Amplify Customer Satisfaction
- 147592170200100102
- An Automated Approach for the Detection & Analysis of Brain Tumor using Detailed MRI through MATLAB

You are on page 1of 99

Dr. Le Dung

Dung.le@hust.edu.vn

0904982398

Chng III:

PHN ON NH

(Image Segmentation)

Ni dung

TCH BIN NH (EDGE DETECTION)

TCH KHUNG XNG NH (SKELETON EXTRACTION)

TCH VNG NH (REGION SEGMENTATION)

Grayscale image

Edges

Types of Edge

s u r f a c e

d e p t h

s u r f a c e

il l u m in a t io n

Luminance profile of an edge

S t e p

R o o f

HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY

L in e

SCHOOL OF ELECTRONICS AND TELECOMMUNICATION

Color typically isnt need when looking for edges

Less Computation in gray scale, no R,B,G

K thut tm bin nh

Luminance profile I(x,y)

First derivative

Second derivative

Gradient

Gradient direction:

The edge strength is given by the gradient magnitude

10

Edge Magnitude ?

Edge Orientation ?

High Detection Rate and Good Localization ?

11

Gradient with noise

HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY

12

Images can have noise in them

Heat waves

Dust

Smoke

Acquisition Noise

nh c nhiu

nh tch bin

13

Noise reduction

Gaussian Mask Gaussian Filter

14

Noise reduction

Gaussian Filter Smoothing (Gaussian blur)

Original

HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY

Smoothed

SCHOOL OF ELECTRONICS AND TELECOMMUNICATION

15

Smooth first, then Gradient

16

- Achieved by obtaining the magnitude for each pixel

from the outConvX[][] and the outConvY[][]

- Iterate through each pixel i and j

- Magnitude[i][j] =

17

18

19

Grad x

Grad y

20

21

22

23

24

25

26

27

Developed by John Canny in 1986

28

2. Finding the intensity gradient of the image (Sobel X & Y)

3. Non-maximum suppression (loi b im khng cc i)

4. Tracing edges through the image and hysteresis threshold

(ngng tri tr - n hi)

HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY

29

30

31

Non-maximum suppression

Non-maximum suppression is an edge thinning technique :

Select the single maximum point (peak) along the gradient direction.

32

Peaks

The matrix is represented with values

of the pictures Magnitude[][]

Since current pixels Magnitude[i][j] > relevant

pixels Magnitude[i][j]

12 34 23 Gradient

direction

peak[i][j] = true

85 90 30

23

78

90

pixels Magnitude[i][j]

Gradient

12 34 23

direction

85 90 99

peak[i][j] = false

23

HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY

78

90

33

Non-maximum suppression

Tin trnh thc hin loi b cc im khng cc i :

34

Non-maximum suppression

V d:

35

Non-maximum suppression

Kt qu v d ng bin c lm mnh

36

Strong

High threshold

Weak

Connectivity

Weak

Low threshold

37

Final[] is another Boolean matrix that represents peak

values that are accepted by the double threshold

High Threshold ( strong edges)

Values is selected by the programmer

If the Magnitude[] > High Threshold and peak[] == true then

that pixel is a peak in Final[] (certain edges)

Value is selected by the programmer

If High Threshold > Magnitude[] > Low Threshold

and peak[] == true

a strong edge pixel.

38

For i = 0 to Row length

For j = 0 to column length

if(peak[i][j] == true && magnitude[i][j] > High)

peak[i][j] = false

final[i][j] = true

else if(peak[i][j] == true && magnitude[i][j] < Low)

peak[i][j] == false

final[i][j] == false

39

High threshold: 80

Peak Table

Magnitude Table

7

Final Table

77 43 32 21 21

45 81 1

91 1

34 43 65 67 34 2

1

91 1

1

91 1

92 1

83 82 82 3

1

2

Table

True Peak

True Final

False Peak

False Final

40

MoreToDo = On

While(MoreToDo == On)

{ MoreToDo = Off

For i = 0 to Row length

For j = 0 to column length

if(Final[i][j] == true)

For p = -1 to 1

For q = -1 to 1

if(peak[i+p][j+q] == true)

{ Final[i+p][j+q] == true

peak[i+p][j+q] = false

MoreToDo = On

}

}

HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY

41

General Peaks Table

with High and Low:

Final Table:

Table

Low Peak

High Peak

True Final

False Peak

False Final

42

Output

For i = 0 to Row length

For j = 0 to column length

if(Final[i][j] == true)

print white pixel

else

print black pixel

43

l nh s

44

SKELETON OF IMAGE

l nh s

45

Skeleton

Thut ton bin i nh khong cch (Distance Transform)

Lc tch xng nh trn nh Distance transformation image

l nh s

46

DISTANCE TRANSFORM

l nh s

47

l nh s

48

l nh s

49

+ Bt u n mn t im c khong cch bng 2, sau lp li vi khong cch

tng dn ln (3,4,5 n khong cch ln nht)

+ im ang xt s khng b n mn trong cc trng hp sau:

4 ln cn trc tip u l im nn (background) v c t nht 1 ln

cn khc l im nh foreground.

Trong 4 ln cn trc tip th c 3 im l im nn (1 im cn li l

foreground).

Trong 4 ln cn trc tip th c 2 im l im nn th

3 trng hp sau l khng n mn:

?

u l im foreground)

HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY

l nh s

50

V d 1: Cho nh Distance transform image sau

l nh s

51

V d 1: n mn im nh c khong cch bng 2

l nh s

52

V d 1: n mn im nh c khong cch bng 4

l nh s

53

V d 1: n mn im nh c khong cch bng 5

l nh s

54

V d 1: n mn im nh c khong cch bng 6

l nh s

55

V d 1: n mn im nh c khong cch bng 7 Kt thc

l nh s

56

l nh s

57

TCH VNG NH

Dng Histogram

Dng Connected Component Labeling Algorithm

l nh s

58

l nh s

59

Histogram

Cutting direction

d12

2

1

Horizontal

Cutting line

Code Area

Border

9 8 7 6

5 4 3 2 1

Histogram

12 pixels

(pixels)

Vertical

direction

Selected area

Threshold 10 pixels

pixels

20

Position of numbers

V1

V2

V3

V4

V5

Border

l nh s

60

Tch cc vng nh khng lin kt

3

3

7

7

7

7

B T i PD NM GA T L AL

B tp r

n ht h u TOt N

l nh s

61

1

Cc im cha

dn nhn c gi

tr bng 1

(im nn gi tr

bng 0)

1

1

1

1

nh cn phn

vng bng

thut ton

CCL

10

Kmax

.....

HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY

l nh s

62

Bt u t im

[0,0] i t tri

sang phi, trn

xung di.

im cha c

dn nhn s

c nh nhn

mi k.

2 im ln cn

phi v di

cha c dn

nhn cng c

nh nhn k lun

1

1

nh cn phn

vng bng

thut ton

CCL

1

1

1

1

1

1

(dng 4-connectivity)

1

10

Kmax

.....

HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY

l nh s

63

Nhn k s

c tng

dn ln

3

1

1

1

nh cn phn

vng bng

thut ton

CCL

1

1

10

Kmax

.....

HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY

l nh s

64

im c

nh nhn k ri

s c dng

nh tip cc

im ln cn phi

v di cha dn

nhn

3

4

nh cn phn

vng bng

thut ton

CCL

Vy khi im ln

cn phi cng

dn nhn ri th

sao?.

1

1

1

10

Kmax

.....

HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY

l nh s

65

Khi im ln cn

phi dn nhn

So snh

dng nh nh

hn

nh cho im

ln cn di.

1

1

nh cn phn

vng bng

thut ton

CCL

ng thi ghi

nhn 1 s kt

hp nhn trong

mng theo di

10

Kmax

.....

HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY

l nh s

66

Tng th nh

nhn cc im

nh v cc v tr

kt hp nhn

trong lt nh

nhn ln u.

nh cn phn

vng bng

thut ton

CCL

10

Kmax

.....

HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY

l nh s

67

nh li nhn cho

cc im nh c

nhn kt hp da

vo mng theo

di s kt hp

nhn.

nh cn phn

vng bng

thut ton

CCL

10

Kmax

.....

HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY

l nh s

68

Va nh nhn

theo thut ton

CCL va m s

im nh cng

nhn.

3

4

4

5

Ghi li trn

mng theo di

nhn.

3

6

3

8

Nhn

.....

m s im

.....

10

Kmax

l nh s

69

Vng nh va

nh nhn va

nh s lng

im nh (Label

&Weight)

1

1

1

1

Trn mng

theo di nhn s

cng gp s im

nh cc nhn b

kt hp

ng dng ?

1

1

Nhn

.....

m s im

6+5+

2

6+2

.....

10

Kmax

l nh s

70

l nh s

71

l nh s

72

l nh s

73

Morphological Operators

(Cc ton t hnh thi)

Cc ton t Morphological thng nhn mt nh nh

phn (binary image) hay nh a mc xm (greyscale

image) v mt phn t cu trc SE (structuring element)

(mt ma trn, kernel) nh l d liu u vo, sau kt

hp chng bng cch s dng tp php ton nh giao,

hp, bao gm, b (intersection, union, inclusion,

complement) cho ra mt nh kt qu c cng kch thc.

Morphological operations the shape of the object

l nh s

74

X

Morphological Operator: Structuring Elements

SE = kernel

o r ig in

l nh s

75

hits the image

Structure

Element

SE fits the image

SE hits (intersects)

the image

l nh s

76

https://www.cs.auckland.ac.nz/courses/compsci773s1c/lectures/ImageProcessing-html/topic4.htm

l nh s

77

A is a set in Z2 ,

a=(a1,a2) an element of A, aA If not, then aA

: null (empty) set

A subset of B: AB

Union of A and B: C=AB

Intersection of A and B: D=AB

Disjoint sets: AB=

Complement of A: Ac = {x|xA}

Difference of A and B:

A-B = {x|xA, x B} = ABc

l nh s

78

l nh s

79

Reflection of B: denoted by BR and X(x1,x2) is reference point.

BR = {x|x=-b, for bB}

Translation of B by X(x1,x2), denoted by (B)x :

(B)x = {c| c=b+x, for bB}

l nh s

80

A B = {x | (B)x A}

The erosion of A by B is the set of all points x such that B,

translated by x, is contained (fits) in A (B usually is the

structure element)

The basic effect of the Erosion operator on a binary

image is to erode away the boundaries of regions of

foreground pixels.

Thus areas of foreground pixels shrink in size, and

holes within those areas become larger.

l nh s

81

The eroded image

(A B)

(A)

SE fits

on the image A

will be eroded

The pixel is eroded

SE = B

3x3

HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY

l nh s

82

The eroded image

?

SE

l nh s

83

SE

Original image

original image

l nh s

84

Application Example (1)

Boundary Extraction: The boundary of a set A, can be obtained

by first eroding A by B and then performing the set difference

between A and its erosion.

( A) A A B

l nh s

85

Application Example (2)

l nh s

86

A B = {x | (BR)x A }

1.

2.

the reference point and then shifting this reflection by x.

The dilation of A by B then is the set of all x

displacements such that BR and A overlap by at least

one nonzero pixel (hit).

l nh s

87

The original image

(A)

(AB)

SE = B =BR

HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY

l nh s

88

The original image

?

SE

=B

= BR

l nh s

89

The dilated image ?

The original image

SE

SER

l nh s

90

Application Example (1)

Hole Filling

1. Forming an array X0 of 0s (the same size as the array

containing A), except the locations in X0 corresponding to the

given point in each hole, which we set to 1.

2. Xk = (Xk-1 + B) Ac

k=1,2,3,

l nh s

91

Application Example (1)

Hole Filling

l nh s

92

Application Example (2)

l nh s

93

Morphological Operator:

Duality (Erosion & Dilation)

Erosion and dilation are duals of each other with respect to set

complementation and reflection

A B

A B

A B

A B

and

l nh s

94

Morphological Operator:

Duality (Erosion & Dilation)

Erosion and dilation are duals of each other with respect to set

complementation and reflection

A B

z | B Z A

z | B Z A

c

z | B Z Ac

Ac B

l nh s

95

The opening of set A by structuring element B,

denoted A B, is defined as

A B A B B

The closing of set A by structuring element B,

denoted A B, is defined as

A B A B B

l nh s

96

Properties of Opening

(b) if C is a subset of D, then C B is a subset of D B

(c) ( A B) B A B

Properties of Closing

(b) If C is a subset of D, then C B is a subset of D B

(c) ( A B) B A B

HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY

l nh s

97

l nh s

98

l nh s

99

- should we fear artificial intelligenceUploaded byapi-316142758
- compvis1Uploaded byrashed44
- Project ReportUploaded byAbhishek Gupta
- Nr-421301--Artificial Intelligence and Expert SystemsUploaded bySrinivasa Rao G
- Accenture - Artificial Intelligence - Healthcare's New Nervous System [8]Uploaded byRobert Kover
- Computer Models of CreativityUploaded bySteve Raderman
- BIM AND ARTIFICIAL INTELLIGENCE IN THE DESIGN AND CONSTRUCTION OF EARTHQAKE RESISTANT BUILDINGSUploaded byXimena
- Digital Marketing 2017 Trends and EssentialsUploaded byIyut Syfa Fauziah
- 1(1)Uploaded byMark Caezar Co
- AI SlideUploaded byFadzlunesa Binti Isa
- Spatial domain image fusion using adaptive cross filteringUploaded byAnonymous vQrJlEN
- Code for Fingure Print in MatlabUploaded byspatade7
- Artificial IntellegenceUploaded bykaushik_1991
- Gartner Data Analytics Australia Augmented Analytics 2018Uploaded byAjaya Kumar
- 274-B317Uploaded byWaseem Khan
- Beyond intelligenceUploaded byamilcarsoares
- symposiumUploaded byapi-395561819
- Artificial Intelligence to Amplify Customer SatisfactionUploaded byPayment Asia
- 147592170200100102Uploaded byCESAR
- An Automated Approach for the Detection & Analysis of Brain Tumor using Detailed MRI through MATLABUploaded byIRJET Journal
- iep1Uploaded byapi-340505430
- Unintended BehaviorsUploaded byCharbel Avognon
- 98ICS.pdfUploaded byfelipeo83
- Identification of Image Spam by Using Low Level & Metadata FeaturesUploaded byAIRCC - IJNSA
- CEAT Case AnalysisUploaded byPoonam Sanas
- PatternUploaded byAbhinav Hans
- Active Contour Without EdgesUploaded bylizhi0007
- Hype of AI FirstUploaded byGanesh Shevade
- Artificial Immune System Based Cognitive Agent ArchitectUploaded byTahir Alyas
- 2006 Ai SyllabusUploaded byKatie Blessedandhighlyfavoured Donaldson

- Creating Testbench Using Modelsim-AlteraUploaded byMuhammad Reyhan Fahlevi
- AssertionUploaded byHải Trần
- NNLT ReportUploaded byHải Trần
- Node Redminecraft September2015 150903090552 Lva1 App6892Uploaded byHải Trần
- Line Coding CMIUploaded byHải Trần
- Zedboard Audio DocUploaded byHải Trần
- Codec de AudioUploaded byAndres Suarez
- lab5_VerilogUploaded byHải Trần
- lab2_VerilogUploaded byHải Trần
- lab1_VerilogUploaded byTruong Quang Thong
- NativeLink SimulationUploaded byHải Trần

- Street Fighter- Anniversary Collection - Capcom Co., Ltd.Uploaded bywillboy447
- ReportUploaded byakgoldy123
- greenhouse gas emissionsUploaded byapi-250463908
- Heidelberg_GTO52.pdfUploaded byworldnetlink
- Arc FlashUploaded byHugo Dennis Mattos Espinoza
- 1412eich.pdfUploaded byMohd Mustafa
- SIEMENSUploaded byCarlos Oliveros
- Sanction Seminar ListUploaded byRahul Mathur
- Heavy Wall ReactorsUploaded bygpskumar22
- sudirexUploaded bymrinalkantibhaduri
- lesson plan template2015Uploaded byapi-316666723
- S04420000220104003S0442 Session 3 Heavy Equipment for Earthwork ConstructionUploaded byshaburo
- Major Factors Affecting Cable AmpacityUploaded byfvicunae
- Financing of Solar RooftopUploaded byAltaf Siddiqui
- Industrial Building SystemUploaded byAin Zulkefli
- U2L Solution Rollout 26 April 2016Uploaded byNak Sandy
- Lesson 9 - Layout and FlowUploaded byDerrick Maatla Moadi
- Sequence Impedance of ALTERNATORUploaded bykumarchaturvedula
- FastMIG - Service ManualUploaded byMetCES
- Compute Gazette Issue 72 1989 JunUploaded byCubemanPDX
- PSL08AUploaded bytomcan
- 8365813182Uploaded bysatishhh1987
- Comparison of Pha MethodsUploaded byfakhri ghrairi
- Preetha Main Project ProposalUploaded byUsha Baburaj
- Voltage Regulation With STATCOMs Modeling, Control and ResultsUploaded byapi-27465568
- Ecommerce Click to Call Click to Chat Slides 2009Uploaded byj2ch5en
- SteeringUploaded byDemetria Thomas
- Email EtiquettesUploaded byspandey1982
- When File System is Full SapUploaded bymkumarshahi
- CoveragePkg DocUploaded byImran Imran