44
1 Image Processing and Computer Vision Image Formation and Image Restoration

Image Processing and Computer Vision

  • Upload
    dani

  • View
    43

  • Download
    4

Embed Size (px)

DESCRIPTION

Image Processing and Computer Vision. Image Formation and Image Restoration. Score (คะแนน). Programming Assignment + Homework Midterm 15% Final 15% Examination (สอบ) Midterm 20% Final 25% Project - PowerPoint PPT Presentation

Citation preview

Page 1: Image Processing and Computer Vision

1

Image Processing and Computer Vision

Image Formation and Image Restoration

Page 2: Image Processing and Computer Vision

2

Score (คะแนน)

Programming Assignment + Homework Midterm 15% Final 15%

Examination (สอบ) Midterm 20% Final 25%

Project OCR 15%

เข้�าเรียน + จิ�ตพิ�สั�ย 10%

Page 3: Image Processing and Computer Vision

3

Topics

Binary Image Processing Edge Detection Automatic Threshold Hough Transform Generalized Hough Transform Texture segmentation Gradient Descent Method State space Gradient Descent

Page 4: Image Processing and Computer Vision

4

Topics

Gibbs sampler with simulated Annealing Stereo Matching, Stereo vision Optical Flow, Computing Optical Flow

Page 5: Image Processing and Computer Vision

5

ความแตกต�างข้อง Computer Graphic และ Image Processing

Image Processing

input output

ImageComputer Vision &Image Processing

Image

- การีหาข้นาดข้องภาพิ (Size)- การีหาข้อบข้องภาพิ (Edge Detection)- การีหารี�ปรี�างข้องภาพิ (Shape Detection)- การีก าจิ�ด Noise ข้องภาพิ (Noise Removing) - Etc.

Page 6: Image Processing and Computer Vision

6

ความแตกต�างข้อง Computer Graphic และ Image Processing

Computer Graphic

Scene Computer Graphic Image

- shape- material- light- color,shiny- tranparency- texture

input output

Page 7: Image Processing and Computer Vision

7

Binary Image Processing

Image Filtering and Edge Detection Image Restoration Region, Image Segmentation, texture Segmentation Blob coloring Contour Energy Minimization Stereo Matching, Object Recognition

Page 8: Image Processing and Computer Vision

8

Example

Noise Removal or Image Restoration

Gaussian Noise Restored image

Page 9: Image Processing and Computer Vision

9

Example

Noise Removal or Image Restoration

Salt and Pepper Noise Restored image

Page 10: Image Processing and Computer Vision

10

Example

Edge Detection

Original Image Robert’s Edge Detector Sobel Edge Detector

Page 11: Image Processing and Computer Vision

11

Example

Template Matching (Midterm Project) การอ�านตัวอกษรจากภาพที่��ได้�จากการสแกน และน�ามาเปร�ยบเที่�ยบกบตั�นแบบที่��ม�อย��แล�ว

Kedkarn ChaiyakhunComputer Engineering

Thai OCR

English OCR

Page 12: Image Processing and Computer Vision

12

Example

Stereo Vision (Final Project) การหาความล"กของวตัถุ&ในภาพ

Left eye Right eye

Page 13: Image Processing and Computer Vision

13

Example

Stereo Vision

Depth

Page 14: Image Processing and Computer Vision

14

Example

Stereo Vision

Left eye Right eye

Page 15: Image Processing and Computer Vision

15

Example

Stereo Vision

Depth

Page 16: Image Processing and Computer Vision

16

Edge Detection Image Processing (Pre-processing) Image Restoration Noise Removal

Low-Level Computer Vision

Page 17: Image Processing and Computer Vision

17

Mid-Level Computer Vision

Segmentation (การแบ�งแยก) Grouping แยกวตัถุ&ออกจาก Background Separate Image In the zone (การแบ�งโซนของพ*+นที่��) Finding Depth, Shape, Light, Material

Page 18: Image Processing and Computer Vision

18

High-Level Computer Vision

Pattern Recognition, Object Recognition Obstacle Avoidance (การหลบหล�กส,�งก�ด้ขวาง) Grasping (การจบส,�งของ, การคว�าส,�งของ ของ Robot) Etc.

Page 19: Image Processing and Computer Vision

19

RGB (Red Green BLUE) and CMY (Cyan Magenta Yellow)

RGB CMY19

เป-นการผสมส�สามส�ระหว�างส� Red,Green,Blue RGB เป-นการแยกส�อย�างชัด้เจน

Page 20: Image Processing and Computer Vision

20

Example RGB

Original Image R-Component

G-Component B-Component

Page 21: Image Processing and Computer Vision

21

Convert color to grayscale

I = (R+G+B) / 3 หร*อ I= 0.299 * R + 0.587 * G + 0.114 * B

++ / 3 =( ) ?

Page 22: Image Processing and Computer Vision

22

Image Formation (Gray Scale)

Intensity Image (ความเข�มของส�) ม�ค�าตั+งแตั� 0…255 (ในระด้บ Gray Scale) 0 – Black 100 – Gray 255 - White

200 220 190 100 225 180

90 245 180 150 180 255

244 230 0 20 130 140

230 122 34 90 112 67

… .... … … … …

Page 23: Image Processing and Computer Vision

23

Pixel-Pixel เป-นหน�วยที่��เล0กที่��ส&ด้ของภาพที่��แสด้งบนหน�าจอคอมพ,วเตัอร1- Neighbors of Pixel ในแตั�ละ pixel น+นบางคร+งเราจ�าเป-นที่��จะตั�องที่�าการประมวลผลที่�� pixel ป2จจ&บนร�วมกบ pixel ข�างเค�ยง (Neighbors)

Page 24: Image Processing and Computer Vision

24

Pixel Coordinate(column x, row y)

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

0123456789101112131415

Zoom 1600%

Pixel ที่�� column =7,row = 4 ม�ค�าเป-นส�เหล*องหร*อ x=7, y=4

Page 25: Image Processing and Computer Vision

25

4-neighbors of Pixel

(x,y) is a red circle(x,y-1) is top one(x-1,y) is left one(x+1,y) is right one(x,y+1) is bottom one

(x-1)

(y-1)

(y+1)

(x+1)(x)

(y)

Page 26: Image Processing and Computer Vision

26

Diagonal neighbor of Pixel

(x,y) is a red circle(x-1,y-1) is top-left one(x+1,y-1) is top-right one(x-1,y+1) is bottom-left one(x+1,y+1) is bottom-right one

(x-1)

(y-1)

(y+1)

(x+1)(x)

(y)

Page 27: Image Processing and Computer Vision

27

8-neighbors of Pixel

(x,y) is a red circle(x-1,y-1), (x,y-1),(x+1,y-1), (x-1,y), (x,y), (x+1,y),(x-1,y+1),(x,y+1), (x+1,y+1)

(x-1)

(y-1)

(y+1)

(x+1)(x)

(y)

Page 28: Image Processing and Computer Vision

28

Noise in Sensor (camera, scanner) ความผิ�ดเพิ"ยนต�าง ๆ ที่%ที่ าให�ภาพิไม�มค(ณภาพิ การ Scan กระด้าษส�ขาวด้�วย

เคร*�อง scanner ภาพที่��ได้�อาจจะไม�ได้�ค�าเป-น 200 ที่+งหมด้ก0ได้�

Page 29: Image Processing and Computer Vision

29

Gaussian Additive Noise

Page 30: Image Processing and Computer Vision

30

Salt and Pepper Noise

Salt = Noise ที่��ที่�าให�ภาพม� intensity ส�ขาวซ"�งที่�าให�แตักตั�างจาก pixel ข�างเค�ยงPepper = Noise ที่��ที่�าให�ภาพม� intensity ส�ด้�าซ"�งที่�าให�แตักตั�างจาก pixel ข�างเค�ยง

Page 31: Image Processing and Computer Vision

31

การีก าจิ�ด Noise

Gaussian Noise Use Gaussian Filter หร*อ Average Filter

Salt/Pepper Noise Use Median Filter

Page 32: Image Processing and Computer Vision

32

Filter ค*ออะไรี

Filter ค*อการีน าเอาหน�ากากข้นาดเล+ก (mask) ไปแปะใน input image ที่%ต�องการีปรีะมวลผิลและหน�ากาก(mask) จิะที่ าการีเล*%อนไปย�งที่(ก ๆ pixel ข้อง input image จิากซ้�ายไปข้วา และจิากบนลงล�าง จินกรีะที่�%งถึ.ง pixel สั(ดที่�ายข้อง input image (ข้นาดข้อง Filter น�"นน�ยมใช้�3X3 หรี*อ 2X2)

Page 33: Image Processing and Computer Vision

33

The Convolution ProcessThe Convolution Process

z1 z2 z3

z4 z5 z6

z9z8z7

I1 I2 I3 I4 I5 I6

I12

I18

I11I10I9I7

I13

I19

I17I14 I15 I16

I20 I21 I22 I23 I24

I25 I26 I27 I28 I29 I30

I31 I32 I33 I34 I35 I36

XX

XX = I= I11zz11+I+I22zz22+I+I33zz33+I+I77zz44+I+I88zz55+I+I99zz66+I+I1313zz77+I+I1414zz88+I+I1515zz99

ค�า Z ซ้.%งเป0นค�าข้อง Filter หรี*อ หน�ากาก จิะเปล%ยนค�าไปตามช้น�ดต�าง ๆ ข้อง Filter

Page 34: Image Processing and Computer Vision

34

The Convolution ProcessThe Convolution Process

z1 z2 z3

z4 z5 z6

z9z8z7

I1 I2 I3 I4 I5 I6

I12

I18

I11I10I8I7

I13

I19

I17I14 I15 I16

I20 I21 I22 I23 I24

I25 I26 I27 I28 I29 I30

I31 I32 I33 I34 I35 I36

XX

XX = I= I22zz11+I+I33zz22+I+I44zz33+I+I88zz44+I+I99zz55+I+I1010zz66+I+I1414zz77+I+I1515zz88+I+I1616zz99

Page 35: Image Processing and Computer Vision

35

The Convolution ProcessThe Convolution Process

z1 z2 z3

z4 z5 z6

z9z8z7

I1 I2 I3 I4 I5 I6

I12

I18

I11XI8I7

I13

I19

I17I14 I15 I16

I20 I21 I22 I23 I24

I25 I26 I27 I28 I29 I30

I31 I32 I33 I34 I35 I36

II99

XX = I= I33zz11+I+I44zz22+I+I55zz33+I+I99zz44+I+I1010zz55+I+I1111zz66+I+I1515zz77+I+I1616zz88+I+I1717zz9 9

Page 36: Image Processing and Computer Vision

36

The Convolution ProcessThe Convolution Process

z1 z2 z3

z4 z5 z6

z9z8z7

I1 I2 I3 I4 I5 I6

I12

I18

XXXI7

I13

I19

XX X XX X X X I24

I25 X X X X I30

I31 I32 I33 I34 I35 I36

XX

ค�าข้อง X ที่%ได�ค*อค�าข้อง pixel intensity ค�าใหม�ที่%จิะได�มาจิากการีปรีะมวลผิลด�วย Filter หรี*อ หน�ากาก

Pixel ที่%เป0นข้อบข้องรี�ปภาพิสัามารีถึน ามาแสัดงผิลได�เลยเน*%องจิากไม�ได�ผิ�านการี process จิาก filter ซ้.%งการีไม�ผิ�าน Filter น�"นไม�มผิลใด ๆ ในการีแสัดงผิลบนหน�าจิอคอมพิ�วเตอรี1เพิรีาะ ความละเอยดข้นาด 1 pixel เป0นสั�วนที่%เล+กน�อยมาก

Page 37: Image Processing and Computer Vision

37

Filter Example (การีใช้� Filter ในการีเบลอภาพิ)

Blurring (การีเบลอภาพิ)

หรี*อAverage Filter

Page 38: Image Processing and Computer Vision

38

Mean Filter (Average Filter)

Mean Filter ใชั�ส�าหรบ เบลอภาพ หลกการง�าย ๆ ของ Mean Filter ก0ค*อ จบ pixel ที่��อย��ใกล�เค�ยงกนน�ามาบวกกน และ ที่�าการหารด้�วยจ�านวนชั�องของ Filter น+น

Page 39: Image Processing and Computer Vision

39

Median Filter

Median Filter ใชั�จด้การกบ Salt/Pepper Noise

Page 40: Image Processing and Computer Vision

40

Median Filter

ไม�ใช้�การี Convolution ที่�าการเร�ยงล�าด้บค�า และเล*อกค�าที่��อย��ตัรงกลาง ตัวอย�าง

Page 41: Image Processing and Computer Vision

41

Median Filter

Page 42: Image Processing and Computer Vision

42

Median Filter3 * 3 Median Filter

Page 43: Image Processing and Computer Vision

43

Assignment 1 ให�นกศึ"กษาเข�ยนโปรแกรมโด้ยใชั�ภาษาอะไรก0ได้� เชั�น C, C#, VB, Java

อ*�น ๆ (ยกเว�น Matlab) เพ*�อที่�าการอ�านภาพ Gray Scale ซ"�งม� Salt & Pepper Noise และ Guassian Noise เข�ามา และที่�าการ ก�าจด้ Noise โด้ยการใชั� Filter 2 แบบ ค*อ1. Median Filter ใชั�ส�าหรบก�าจด้ Salt & Pepper Noise2. Average Filter (mean filter) ใชั�ส�าหรบก�าจด้ Guassian Noise

CPE3 ปกต�ก าหนดสั�ง อ�งคารีที่% 9 พิฤศจิ�กายน 2553 สั�งพิรี�อมการีรี�นผิลล�พิธ์1และอธ์�บายโปรีแกรีม

CPE3/4 ปกต�ก าหนดสั�ง ศ(กรี1ที่% 12 พิฤศจิ�กายน 2553 สั�งพิรี�อมการีรี�นผิลล�พิธ์1และ

อธ์�บายโปรีแกรีม

Page 44: Image Processing and Computer Vision

44

www.rmuti.ac.th/user/kedkarn

Email : [email protected]

0868129127