Chapter 1 Introduction 1 1 Motivation 1 2

  • Slides: 52
Download presentation
Chapter 1 - Introduction 1. 1. Motivation 1. 2. Why is Computer Vision Difficult?

Chapter 1 - Introduction 1. 1. Motivation 1. 2. Why is Computer Vision Difficult? 1. 3. Image Representation and Image Analysis 1. 4. Summary 0

1. 1. Motivation An image is worth thousands of words Two principal roles of

1. 1. Motivation An image is worth thousands of words Two principal roles of images: 1. Communication 2. Scene understanding Objectives of image processing: 1. Human perception 2. Machine interpretation 1

Human Perception Before After 2

Human Perception Before After 2

Before After 3

Before After 3

Before After 4

Before After 4

Before 5

Before 5

After 6

After 6

For you, . . . not much can be done! 7

For you, . . . not much can be done! 7

Machine Interpretation • Optical Character Recognition (OCR) 0 1 Z A 8

Machine Interpretation • Optical Character Recognition (OCR) 0 1 Z A 8

9

9

10

10

 • Form Analysis • Documentation • License Number Identification Input image Location Recognition

• Form Analysis • Documentation • License Number Identification Input image Location Recognition GG 4025 11

 • Model-based Object Recognition 12

• Model-based Object Recognition 12

Object Models 13

Object Models 13

Model Matching 14

Model Matching 14

 • Image Understanding (i) people, (ii) How Whatmany are their adults, and children

• Image Understanding (i) people, (ii) How Whatmany are their adults, and children spatial (v) What (iii) (iv) Where Who are they? doing? are there in the relationships? picture? 15

Machine interpretation of images requires diverse methods of Mathematical Engineering Biological Psycho-physiological Intelligent Scientific

Machine interpretation of images requires diverse methods of Mathematical Engineering Biological Psycho-physiological Intelligent Scientific disciplines 16

Image Analysis Low-level processing: e. g. , noise removal, deblurring, and contrast enhancement IP

Image Analysis Low-level processing: e. g. , noise removal, deblurring, and contrast enhancement IP Mid-level processing: e. g. , edge, region, corner, and texture detections ===== High-level processing: CV e. g. , object, function, relationship, event, and activity recognitions 17

1. 2. Why is Computer Vision Difficult? (1) Loss of information in 3 D

1. 2. Why is Computer Vision Difficult? (1) Loss of information in 3 D 2 D 18

(2) Local window vs. global view 19

(2) Local window vs. global view 19

(3) Sequential vs. parallel processing 20

(3) Sequential vs. parallel processing 20

Sequential processing (4) Too much data (5) Noise 21

Sequential processing (4) Too much data (5) Noise 21

1. 3. Image Representation Scene G(x, y, z): a 3 -D continuous function Image

1. 3. Image Representation Scene G(x, y, z): a 3 -D continuous function Image F(x, y): a 2 -D continuous function Discrete image D(r, c): a 2 -D discrete function Digital image I(r, c): an array of discrete values Origin M M × N : Image size ○ N 22

Dynamic range (or color depth) : number of bits for a single pixel (a)

Dynamic range (or color depth) : number of bits for a single pixel (a) 1 - bit: black and white (binary image) (b) 8 - bit: gray-scale (gray scale image) (c) 24 - bit: true color (color image) 23

 • Physically, An image file is a binary file, which can be dump.

• Physically, An image file is a binary file, which can be dump. 24

 • Types of file formats: BMP : Microsoft Bitmap formal JPEG : Joint

• Types of file formats: BMP : Microsoft Bitmap formal JPEG : Joint Photographics Experts Group PNG : Portable Network Graphics TIFF : Tagged Image File Format GIF : Graphics Interchange Format HDF : Hierarchical Data Format PCX : PC Paintbrush XWD : X Window Dump ICO : ICOns CUR : CURsor 25

An image file contains (a) Header: Characteristics of image Image size Color map Compression

An image file contains (a) Header: Characteristics of image Image size Color map Compression method (b) Image data: Pixel values, Index values 26

Example: BMP header 27

Example: BMP header 27

Example: 28

Example: 28

C/C++ Program http: //www. cs. ucsd. edu/classes/sp 03/cse 190 -b/hw 1/ Read header information

C/C++ Program http: //www. cs. ucsd. edu/classes/sp 03/cse 190 -b/hw 1/ Read header information 29

Read image data 30

Read image data 30

 • GIF header 31

• GIF header 31

Example: 32

Example: 32

 • TIFF header 33

• TIFF header 33

Summary • Two major roles of images played: (i) Communication, (ii) scene understanding •

Summary • Two major roles of images played: (i) Communication, (ii) scene understanding • Two main objectives of IP: (i) Human perception, (ii) machine interpretation • Three levels of IP: Low-, mid-, and high- levels • Difficulties of computer vision: (1) Loss of information in 3 D 2 D (2) Noise (3) Too much data (4) Local window vs. global view (5) Sequential vs. parallel processing 34

Summary • Two main objectives of IP: Human perception, Machine interpretation • Machine interpretation

Summary • Two main objectives of IP: Human perception, Machine interpretation • Machine interpretation 35

 • Three levels of IP: Low-, mid-, and high- levels • Difficulties of

• Three levels of IP: Low-, mid-, and high- levels • Difficulties of computer vision: (1) Loss of information in 3 D 2 D (2) Noise (3) Too much data (4) Local window vs. global view (5) Sequential vs. parallel processing • Dynamic range (or color depth) : # bits per pixel 36

Open. CV && Matlab 37

Open. CV && Matlab 37

Opencv 安裝 • 通常使用Visual studio C++ 搭配open. CV • 也可以使用Dev C++搭配 (http: //yester-place. blogspot.

Opencv 安裝 • 通常使用Visual studio C++ 搭配open. CV • 也可以使用Dev C++搭配 (http: //yester-place. blogspot. tw/2008/06/ dev-copencv. html) 38

Visual C++ 2010 Express • Visual express 下載 http: //www. visualstudio. com/downloads/downloadvisual-studio-vs 39

Visual C++ 2010 Express • Visual express 下載 http: //www. visualstudio. com/downloads/downloadvisual-studio-vs 39

Open. CV 安裝 • http: //opencv. org/downloads. html 40

Open. CV 安裝 • http: //opencv. org/downloads. html 40

設定Visual C++ 42

設定Visual C++ 42

 • 對專案點右鍵>屬性 • VC++目錄> Include目錄加上 – C: Open. CV 246buildincludeopencv • 程式庫目錄加上 –

• 對專案點右鍵>屬性 • VC++目錄> Include目錄加上 – C: Open. CV 246buildincludeopencv • 程式庫目錄加上 – C: Open. CV 246buildx 86vc 10lib 43

 • 連結器>輸入>其他相依性> – – – opencv_core 246 d. lib opencv_calib 3 d 246

• 連結器>輸入>其他相依性> – – – opencv_core 246 d. lib opencv_calib 3 d 246 d. lib opencv_contrib 246 d. lib opencv_features 2 d 246 d. lib opencv_highgui 246 d. lib opencv_imgproc 246 d. lib opencv_ml 246 d. lib opencv_objdetect 246 d. lib opencv_videostab 246 d. lib opencv_nonfree 246 d. lib opencv_flann 246 d. lib 44

Open. CV函式 • 讀取圖片 – Imread() – cv. Load. Image() • 輸出圖片 – Imwrite()

Open. CV函式 • 讀取圖片 – Imread() – cv. Load. Image() • 輸出圖片 – Imwrite() – cv. Save. Image() • 讀取影片 – Video. Capture • 改變圖片大小 – cv. Resize() • 其餘的可以上Open. CV官網查詢 – http: //docs. opencv. org/modules/refman. html 47

Matlab 軟體安裝 師大校園軟體服務(http: //www. itc. ntnu. edu. tw/sw/index. html) 48

Matlab 軟體安裝 師大校園軟體服務(http: //www. itc. ntnu. edu. tw/sw/index. html) 48