Shingo Kagami .ac.jp

Intelligent Control Systems

Image Processing (1)

-- Basic Concepts and Introduction of OpenCV --

Shingo Kagami

Graduate School of Information Sciences, Tohoku University

swk(at)ic.is.tohoku.ac.jp



Basic Motivation

e.g. Vision-based Control of Robots

? image acquisition (not covered this year) ? image processing ? robot control (have been covered by Prof. Hashimoto's part)

Shingo Kagami (Tohoku Univ.) Intelligent Control Systems 2020 (1)

3

Schedule

We focus on theories and implementations of basic visual tracking methods, which give foundations of image processing for visual servoing

July 10: Intro: Image Processing Programming July 17: Image Processing Basics (Filtering, Colors) (July 24: Holiday) July 31: Object Tracking (1) August 7: Object Tracking (2)

August 31: Final Report due

Shingo Kagami (Tohoku Univ.) Intelligent Control Systems 2020 (1)

4

Digital Images

Analog distribution of light intensity

2-D discretization (into pixels) quantization of intensity (ADC)

A digital image: 2-D array of pixel values

Shingo Kagami (Tohoku Univ.) Intelligent Control Systems 2020 (1)

6

Pixel Value

(analog) light intensity; illuminance; voltage (digital) pixel value; intensity value; gray level; grayscale value

255

...

128

quantized into [0, 255] integer: 8-bit grayscale image

...

cf. binary image (= 1-bit grayscale) 0

Shingo Kagami (Tohoku Univ.) Intelligent Control Systems 2020 (1)

7

Expression of a Digital Image

M ? N pixels digital image:

{ Fx,y }, x = 0, 1, , M-1, y = 0, 1, , N-1 Pixel value at (x, y): Fx,y

F0,0 F1,0 F2,0

FM-1,0

x axis

F0,1 F1,1 F2,1

FM-1,1

y axis

F0,N-1F1,N-1F2,N-1

FM-1,N-1

Shingo Kagami (Tohoku Univ.) Intelligent Control Systems 2020 (1)

8

Example in C

#define M 640 #define N 480 unsigned char image[M * N];

8-bit

image[M * y + x] = 30; // F(x, y) := 30

M N

? 2-D array is not convenient in C (e.g. not flexible in sizes) ? 1-D array is often preferred

Shingo Kagami (Tohoku Univ.) Intelligent Control Systems 2020 (1)

9

A Simple Example Code in C

binarization (or thresholding)

#define M 640 #define N 480 #define THRESHOLD 128 unsigned char image[M * N]; int i, j;

for (j = 0; j < N; j++) { for (i = 0; i < M; i++) { if (image[M * j + i] >= THRESHOLD) { image[M * j + i] = 255; } else { image[M * j + i] = 0; } }

}

Shingo Kagami (Tohoku Univ.) Intelligent Control Systems 2020 (1)

10

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download