1. Trang chủ
  2. » Giáo án - Bài giảng

Image processing using matlab

67 426 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 67
Dung lượng 4,16 MB

Nội dung

Published by John Wiley & Sons, Inc., Hoboken, New Jersey, 4th ed 2007 4 Digital Signal and Image Processing Using MATLAB, Gerard Blanchet Maurice Charbit, Printed and bound in Great Br

Trang 1

IMAGE PROCESSING

Using

MATLAB

Trang 2

Tại sao lại dùng matlab?

Matlab (MATrix LABoratory)

Ảnh trong matlab được xử lý như là ma

trận

Mỗi pixel là một phần tử của ma trận

Tất cả các toán tử trong matlab đều tác

độ ng lên ma trận và có thể được dùng

để tác động lên ảnh: +, -, *, /, ^, sqrt,

sin, cos, etc.

Trang 3

Tài Liệu

1) Digital image processing using Matlab, Rafael C Gonzalez,

Richard E Woods, Steven L Eddins, Printed in India, (2005)

2) Graphics and GUIs with MATLAB by Patrick Marchand and O

Thomas Holland, 3rd ed (2003)

3) Digital image processing, Pratt, William K Published by John Wiley & Sons,

Inc., Hoboken, New Jersey, 4th ed (2007)

4) Digital Signal and Image Processing Using MATLAB, Gerard Blanchet

Maurice Charbit, Printed and bound in Great Britain by Antony Rowe Ltd, Chippenham, Wiltshire, (2006)

5) Image processing and analysis, Chan T and Shen J Printed in United states

of America, (2005)

6) Biosignal and Biomedical Image processing (Matlab-Based application),

John L Semmlow, Printed in United states of America, (2004)

7) Image processing and jump regression analysis, Peihua Qiu, Printed in

United states of America (2005)

8) Image Analysis of Food Microstructure, John C Russ, Printed in the United

States of America, (2005)

Trang 5

XỬ LÝ ẢNH IMAGE PROCESSING

Trang 6

recognition, segmentation

High Level Process Input: Attributes Output: Understanding Examples: Scene

understanding, autonomous navigation

In this course we will

stop here Low Level Process Mid Level Process High Level Process

Trang 7

CÁC L Ĩ NH V Ự LIÊN QUAN

Trang 8

ng dụng của Computer Vision & Image processing

Trang 9

APPLICATION OF IMAGE PROCESSING

Trang 10

APPLICATION OF IMAGE PROCESSING

Trang 13

APPLICATION OF IMAGE PROCESSING

Trang 15

Computer Vision System

Kiểm tra sản phẩm

Trang 16

APPLICATION OF IMAGE PROCESSING

Trang 25

Traffic Monitoring

ng dụng trong giao thông

Trang 26

APPLICATION OF IMAGE PROCESSING

Trang 29

ng dụng trong công nghiệp

Trang 30

Face Detection

ng dụng trong an ninh quốc phòng

Trang 31

Image Types in MATHLAB

 Indexed images

 Intensity (or grayscale) images

 RGB (or truecolor) images:

 Black and White Images

Trang 32

Indexed Images

 An indexed image consists of a data matrix, X ((of type

uint8, uint16, or double), and a colormap matrix, map

 Youcan read X and map by

 The pixels in the image are represented by integers,

which are pointers (indices) to color values stored in the colormap

 For example pixel X= 5 points to

 [0.29 0.0627 0.0627]

Trang 34

Intensity Images

 An intensity image is a data matrix, I, whose values represent intensities within some range.

 MATLAB stores an intensity image as a single matrix of class double, uint8, or uint16, with each element of the matrix corresponding to one image pixel.

Trang 36

8-Bit and 16-Bit RGB Images

 The color components of an 8-bit RGB image are integers in the range [0, 255] rather than floating-point values in the range [0, 1].

 A pixel whose color components are (255,255,255) displays as white.

 To obtain red, blue and green

components of a pixel (10,5) of the

image I

Trang 38

nh màu

Một ảnh màu được mô tả bởi 3 ma trận

31.087

.065.0

75.082.056.0

02.038.048.0

73.093.037

0 0.19 0.84 0.71

92.056.016.0

Trang 39

G N

G

M G G

G

M G G

G

G

f f

f

f f

f

f f

f f

, ,

2 ,

1

2 , 2

, 2 2

, 1

1 , 1

, 2 1

, 1

B N

B

M B B

B

M B B

B B

f f

f

f f

f

f f

f f

, ,

2 ,

1

2 , 2

, 2 2

, 1

1 , 1

, 2 1

, 1

R N

R

M R R

R

M R R

R

R

f f

f

f f

f

f f

f f

, ,

2 ,

1

2 , 2

, 2 2

, 1

1 , 1

, 2 1

, 1

N

M M

f f

f

f f

f

f f

f

, ,

2 ,

1

2 , 2

, 2 2

, 1

1 , 1

, 2 1

, 1

Trang 40

BLUE

GREEN

Qu á trình tác động nên các phần tử của ma trận ảnh để làm nổi bật các đặc trưng mong muốn gọi là xử lý ảnh

Các màu cơ bản

và quá trình xử lý ảnh

Trang 42

Example RGB

Trang 44

Ả nh các đường biên ngăn cách các vùng màu khác nhau của màng

mỏng Au

Trang 45

ng dụng trong khoa học vật liệu

Cấu trúc bề mặt của màng mỏng

vàng trên đế silic sau khi ủ Ảnh khi tách các vùng giàu Au ra từ ảnh ở bên trái

Trang 46

Tách các vùng giàu Au ra từ ảnh màng mỏng vàng trên đế Si (xem hình 2)

Hình 6: Phần bề mặt màu đỏ được tách riêng ra và có diện

tích S=6.92% diện tích toàn bề mặt

Trang 47

Basics about image processing in matlab

In this section we present:

Basics of working with images in Matlab

We will see how to read, display, write and convert images

We will also talk about the way images are represented in Matlab and how to convert between the different types.

Trang 48

One pixel

1 2 3

Trang 49

intensity

RGB binary

Trang 52

Grand total is 400 elements using 400

bytes f is an array of class uint8, and

size 20x20 That means 20 rows and 20 columns We can see some of this information with the following commands

Trang 54

Basics about image processing in matlab

Trang 55

Basics about image processing in matlab

The syntax imshow(f, [low high]) displays

all pixels with values less than or equal to

low as black, all pixels with values greater

or equal to high as white.

figure, imshow(f) figure, imshow(f, [100, 150]) figure, imshow(f, [100, 200])

Trang 56

Basics about image processing in matlab

We can also display portions of an image by specifying the range

>> figure, imshow(f(10:100, 10:200), [50, 210])

Trang 57

Basics about image processing in matlab

Another matlab tool available to display images and do simple image manipulations

is imtool.

Trang 58

Basics about image processing in matlab

Images can be written to disk using the function

imwrite Its format is

Trang 59

Image types, data classes and image classes

There are different image types and image classes available in MATLAB The two primary image types you will be working with are as follows:

1/ Intensity images

uint16 [0, 65535] (CCD cameras on microscopes)

uint8[0, 255] (From your standard digital camera)

double [-10308, 10308]

2/ Binary images (black and white)

logical, 0 or 1

Trang 60

Image types, data classes and image classes

Raw images typically come in the form of an unsigned

integer (uint16 denotes 16-bit unsigned integer, and uint8

denotes 8-bit unsigned integer) However floating-point operations (mathematical operations that involve a decimal

point, such as log(a)) can only be done with arrays of class

Trang 61

Many MATLAB image processing operations operate under the assumption that the image is scaled to the range [0,1] For instance, when

imshow displays an double image, it displays an

intensity of 0 as black and 1 as white You can

automatically create a scaled double image using

Trang 62

Matlab converts f to class double, and then sets to

0 the values below T and to 1 the values above T The result is of class logical See the following

Trang 63

Basic Segmentation using Thresholding

Many biological images comprise of light objects over a constant dark background, in such a way that object and background pixels have gray levels grouped into two dominant modes One obvious way

to extract the objects from the background is to select a threshold T that separates these modes:

where g(x,y) is the thresholded binary image of f(x,y) We can

implement the thresholding operation in MATLAB by the

following function:

>> g = im2bw(f, T)

Trang 64

Image histograms and threshold

Image histograms provide a means to visualize the distribution of grayscale intensity values in the entire image They are useful for estimating background values, determining thresholds, and for visualizing the effect of contrast djustments on the image (next section) The matlabfunction to visualize image histograms is imhist

>> f = imread('rice.png');

>> imhist(f) >> imhist(f, 30)

Trang 65

Image histograms and threshold

Trang 66

Image histograms and threshold

imb = im2bw(im,level+0.1); imb = im2bw(im,level-0.1);

How to solve?

Trang 67

Image histograms and threshold

Using the binary image, we can then calculate region properties of objects in the image, such as area, diameter, etc… An object in a binary image is a set of white pixels (ones) that are connected to each other

We can enumerate all the objects in the figure using the bwlabel command:

Ngày đăng: 28/04/2014, 10:34

HÌNH ẢNH LIÊN QUAN

Hình 6: Ph ầ n b ề m ặ t màu đỏ đượ c tách riêng ra và có di ệ n - Image processing using  matlab
Hình 6 Ph ầ n b ề m ặ t màu đỏ đượ c tách riêng ra và có di ệ n (Trang 46)

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

w