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
1
Image Processing and Computer Vision
Image Formation and Image Restoration
2
Score (คะแนน)
Programming Assignment + Homework Midterm 15% Final 15%
Examination (สอบ) Midterm 20% Final 25%
Project OCR 15%
เข้�าเรียน + จิ�ตพิ�สั�ย 10%
3
Topics
Binary Image Processing Edge Detection Automatic Threshold Hough Transform Generalized Hough Transform Texture segmentation Gradient Descent Method State space Gradient Descent
4
Topics
Gibbs sampler with simulated Annealing Stereo Matching, Stereo vision Optical Flow, Computing Optical Flow
5
ความแตกต�างข้อง Computer Graphic และ Image Processing
Image Processing
input output
ImageComputer Vision &Image Processing
Image
- การีหาข้นาดข้องภาพิ (Size)- การีหาข้อบข้องภาพิ (Edge Detection)- การีหารี�ปรี�างข้องภาพิ (Shape Detection)- การีก าจิ�ด Noise ข้องภาพิ (Noise Removing) - Etc.
6
ความแตกต�างข้อง Computer Graphic และ Image Processing
Computer Graphic
Scene Computer Graphic Image
- shape- material- light- color,shiny- tranparency- texture
input output
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
8
Example
Noise Removal or Image Restoration
Gaussian Noise Restored image
9
Example
Noise Removal or Image Restoration
Salt and Pepper Noise Restored image
10
Example
Edge Detection
Original Image Robert’s Edge Detector Sobel Edge Detector
11
Example
Template Matching (Midterm Project) การอ�านตัวอกษรจากภาพที่��ได้�จากการสแกน และน�ามาเปร�ยบเที่�ยบกบตั�นแบบที่��ม�อย��แล�ว
Kedkarn ChaiyakhunComputer Engineering
Thai OCR
English OCR
12
Example
Stereo Vision (Final Project) การหาความล"กของวตัถุ&ในภาพ
Left eye Right eye
13
Example
Stereo Vision
Depth
14
Example
Stereo Vision
Left eye Right eye
15
Example
Stereo Vision
Depth
16
Edge Detection Image Processing (Pre-processing) Image Restoration Noise Removal
Low-Level Computer Vision
17
Mid-Level Computer Vision
Segmentation (การแบ�งแยก) Grouping แยกวตัถุ&ออกจาก Background Separate Image In the zone (การแบ�งโซนของพ*+นที่��) Finding Depth, Shape, Light, Material
18
High-Level Computer Vision
Pattern Recognition, Object Recognition Obstacle Avoidance (การหลบหล�กส,�งก�ด้ขวาง) Grasping (การจบส,�งของ, การคว�าส,�งของ ของ Robot) Etc.
19
RGB (Red Green BLUE) and CMY (Cyan Magenta Yellow)
RGB CMY19
เป-นการผสมส�สามส�ระหว�างส� Red,Green,Blue RGB เป-นการแยกส�อย�างชัด้เจน
20
Example RGB
Original Image R-Component
G-Component B-Component
21
Convert color to grayscale
I = (R+G+B) / 3 หร*อ I= 0.299 * R + 0.587 * G + 0.114 * B
++ / 3 =( ) ?
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
… .... … … … …
23
Pixel-Pixel เป-นหน�วยที่��เล0กที่��ส&ด้ของภาพที่��แสด้งบนหน�าจอคอมพ,วเตัอร1- Neighbors of Pixel ในแตั�ละ pixel น+นบางคร+งเราจ�าเป-นที่��จะตั�องที่�าการประมวลผลที่�� pixel ป2จจ&บนร�วมกบ pixel ข�างเค�ยง (Neighbors)
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
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)
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)
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)
28
Noise in Sensor (camera, scanner) ความผิ�ดเพิ"ยนต�าง ๆ ที่%ที่ าให�ภาพิไม�มค(ณภาพิ การ Scan กระด้าษส�ขาวด้�วย
เคร*�อง scanner ภาพที่��ได้�อาจจะไม�ได้�ค�าเป-น 200 ที่+งหมด้ก0ได้�
29
Gaussian Additive Noise
30
Salt and Pepper Noise
Salt = Noise ที่��ที่�าให�ภาพม� intensity ส�ขาวซ"�งที่�าให�แตักตั�างจาก pixel ข�างเค�ยงPepper = Noise ที่��ที่�าให�ภาพม� intensity ส�ด้�าซ"�งที่�าให�แตักตั�างจาก pixel ข�างเค�ยง
31
การีก าจิ�ด Noise
Gaussian Noise Use Gaussian Filter หร*อ Average Filter
Salt/Pepper Noise Use Median Filter
32
Filter ค*ออะไรี
Filter ค*อการีน าเอาหน�ากากข้นาดเล+ก (mask) ไปแปะใน input image ที่%ต�องการีปรีะมวลผิลและหน�ากาก(mask) จิะที่ าการีเล*%อนไปย�งที่(ก ๆ pixel ข้อง input image จิากซ้�ายไปข้วา และจิากบนลงล�าง จินกรีะที่�%งถึ.ง pixel สั(ดที่�ายข้อง input image (ข้นาดข้อง Filter น�"นน�ยมใช้�3X3 หรี*อ 2X2)
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
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
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
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นสั�วนที่%เล+กน�อยมาก
37
Filter Example (การีใช้� Filter ในการีเบลอภาพิ)
Blurring (การีเบลอภาพิ)
หรี*อAverage Filter
38
Mean Filter (Average Filter)
Mean Filter ใชั�ส�าหรบ เบลอภาพ หลกการง�าย ๆ ของ Mean Filter ก0ค*อ จบ pixel ที่��อย��ใกล�เค�ยงกนน�ามาบวกกน และ ที่�าการหารด้�วยจ�านวนชั�องของ Filter น+น
39
Median Filter
Median Filter ใชั�จด้การกบ Salt/Pepper Noise
40
Median Filter
ไม�ใช้�การี Convolution ที่�าการเร�ยงล�าด้บค�า และเล*อกค�าที่��อย��ตัรงกลาง ตัวอย�าง
41
Median Filter
42
Median Filter3 * 3 Median Filter
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และ
อธ์�บายโปรีแกรีม