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

Tài liệu xử lý ảnh Đại học Bách Khoa Hà Nội

51 19 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 51
Dung lượng 5,26 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Color ModelsThe RGB Color Model  When fed into an RGB monitor, these three images combine on the screen to produce a composite color image.. Color ModelsThe RGB Color Model  EXAMPLE

Trang 1

XỬ LÝ ẢNH TRONG CƠ ĐIỆN TỬ

Machine Vision

TRƯỜNG ĐẠI HỌC BÁCH KHOA HÀ NỘI

Giảng viên: TS Mạc Thị Thoa Đơn vị: Bộ môn Cơ điện tử, Viện Cơ khí

Trang 2

Chapter 4 Color Image Processing

1 Color Fundamentals

2 Color Models

3 Pseudocolor Image Processing

4 Basics of Full-Color Image Processing

5 Color Transformations

6 Color Image Smoothing and Sharpening

Trang 3

1 Color Fundamentals

Color spectrum

Color spectrum seen by passing white light through a prism(lăng kính)

Trang 6

1 Color Fundamentals

Wavelengths

Wavelengths comprising the visible range of the electromagnetic spectrum (quang phổ)

Trang 7

1 Color Fundamentals

The absorption of light by the red, green, and blue cones (tế bào hình nón) in the eye

Absorption of light by the red, green, and blue cones in the human eye as

a function of wavelength

Trang 8

1 Color Fundamentals

Primary and secondary colors of light and pigments (mảng màu).

Trang 10

1 Color Fundamentals

Hue (tông màu), Saturation (độ bão hòa màu), and Brightness (độ sáng)

 The characteristics generally used to distinguish one color from another are brightness, hue, and saturation.

 Brightness embodies the achromatic notion of intensity.

 Hue là màu sắc mà chúng ta nhìn thấy phụ thuộc vào bước sóng ánh sáng được phản xạ hoặc sản xuất ra Màu sắc được đo theo góc sắp xếp trên hình tròn và giúp chúng ta dễ cảm nhận sự thay đổi hơn so với hệ tọa độ RGB.

 Saturation Nó đơn giản chỉ là cách màu sắc được hiển thị dưới các điều kiện ánh sáng khác

nhau Saturation giúp miêu tả màu sắc đậm hay nhạt theo các cường độ ánh sáng mạnh – nhẹ

khác nhau.

 Hue and saturation taken together are called chromaticity  a color may be characterized by its

brightness and chromaticity

Trang 11

1 Color Fundamentals

Hue, Saturation, and Brightness

 The amounts of red, green, and blue needed to form any particular color are called the

tristimulus values, and are denoted, X, Y, and Z, respectively

 A color is then specified by its trichromatic coefficients,

Trang 12

1 Color Fundamentals

CIE chromaticity diagram

CIE chromaticity diagram, which shows color composition as a function of x (red) and y (green) For any value of x and y, the corresponding value

of z (blue) is obtained from Eq (7-4) by noting that

z = 1 – (x + y) The point marked green in Fig 7.5 , for example, has approximately 62% green and 25% red content It follows from Eq (7-4) that the composition of blue is approximately 13%

Trang 13

1 Color Fundamentals

Color gamut

Illustrative color gamut of color monitors (triangle) and color printing devices (shaded region)

Trang 14

2 Color Models

Color model

 The purpose of a color model (also called a color space or color system) is to facilitate the

specification of colors in some standard way.

 A color model is a specification of

(1) a coordinate system, and

(2) a subspace within that system, such that each color in the model is represented by a single

point contained in that subspace.

 RGB (red, green, blue) model: color monitors and a broad class of color video cameras

 HSI (hue, saturation, intensity) model : closely with the way humans describe and interpret color

Trang 15

2 Color Models

The RGB Color Model

Schematic of the RGB color cube Points along the main diagonal have gray values, from black

at the origin to white at point (1, 1, 1)

Trang 16

2 Color Models

The RGB Color Model

 When fed into an RGB monitor, these three images combine on the screen to produce a

composite color image.

 The number of bits used to represent each pixel in RGB space is called the pixel depth.

 Each RGB color pixel has a depth of 24 bits.

 The term full-color image is used often to denote a 24-bit RGB color image.

 The total number of possible colors in a 24-bit RGB image is (28)3= 16, 777, 216.

Trang 17

2 Color Models

The RGB Color Model

 EXAMPLE: Generating a cross-section of the RGB color cube and its thee hidden planes.

Fig 1 A 24-bit RGB color cube

(a) Generating the RGB image of the cross-sectional color plane (127, G, B) (b) The three hidden surface planes in the color cube of Fig 1

Trang 18

 CMY to CMYK:

 Let:

 If K = 1 then we have pure black, with no color contributions

2 Color Models

The CMY and CMYK Color Models

 cyan, magenta, and yellow are the secondary colors of light or, alternatively, they are the primary colors of pigments

where the assumption is that all RGB color values have been normalized to the range [0, 1]

Trang 19

2 Color Models

Hệ màu CMYK và RGB

RBG dùng cho thiết kế, hình ảnh/sản phẩm trên màn hình??? CMYK trong các thiết bị in ấn

Trang 20

2 Color Models

The CMY and CMYK Color Models

Trang 21

2 Color Models

HSI model: Hue được định nghĩa có giá trị 0-2π, mang thông tin về màu

sắc Saturation có giá trị 0-1, mang giá trị về độ thuần khiết về thành phần

Hue Intensity có giá trị 0-1 mang thông tin về độ sáng điểm ảnh Hệ thống

màu này thích hợp với một số thiết kế đồ họa vì nó cung cấp sự điều khiển

trực tiếp về ánh sáng và sắc độ

Trang 22

2 Color Models

The HSI Color Model

The Hue component describes the color itself in the form of an angle between [0,360] degrees 0 degree mean red, 120 means green 240 means blue 60 degrees is yellow, 300 degrees is magenta.

The Saturation component signals how much the color is polluted with white color The range of the S component is [0,1].

The Intensity range is between [0,1] and 0 means black, 1 means white.

As the above figure shows, hue is more meaningful when saturation approaches 1 and less meaningful when saturation approaches 0 or when intensity approaches 0 or 1 Intensity also limits the saturation values.

To formula that converts from RGB to HSI or back is more complicated than with other color models, therefore we will not elaborate on the

detailed specifics involved in this process.

Trang 23

2 Color Models

The HSI Color Model

Hue and saturation in the HSI color model

The dot is any color point The angle from the red axis gives the hue The length of the vector is the saturation The intensity of all

colors in any of these planes is given by the position of the plane on the vertical intensity axis

Trang 24

2 Color Models

The HSI Color Model

The HSI color model based on (a) triangular, and (b) circular color planes The triangles and

Trang 25

2 Color Models

The HSI Color Model

 Converting Colors from RGB to HSI

Trang 26

2 Color Models

The HSI Color Model

 Converting Colors from HSI to RGB

RG sector (00  H < 1200): GB sector (1200  H < 2400): RG sector (00  H < 1200):

Trang 27

2 Color Models

The HSI Color Model

 EXAMPLE: The HSI values corresponding to the image of the RGB color cube.

HSI components of the image in Fig 1 (p 14): (a) hue, (b) saturation, and (c) intensity images

Trang 28

2 Color Models

The HSI Color Model

 Manipulating HSI Component Images

Trang 29

3 Pseudocolor Image Processing (False color)

Xử lý ảnh Pseudocolor (False color) bao gồm việc gán màu cho các giá trị

xám dựa trên một tiêu chí xác định.

Trang 30

3 Pseudocolor Image Processing (False color)

Intensity Slicing and Color Coding

Graphical interpretation of the

Trang 31

3 Pseudocolor Image Processing (False color)

Intensity Slicing and Color Coding

An alternative representation of

Trang 32

3 Pseudocolor Image Processing

Intensity Slicing and Color Coding

 EXAMPLE: Intensity slicing and color coding.

(a) Grayscale image of the Picker Thyroid Phantom (tuyến giáp) (b) Result of intensity slicing using eight colors

Trang 33

3 Pseudocolor Image Processing

Intensity Slicing and Color Coding

 EXAMPLE: Intensity slicing and color coding.

(a) X-ray image of a weld (b) Result of color coding

Trang 34

3 Pseudocolor Image Processing

Intensity Slicing and Color Coding

 EXAMPLE: Use of color to highlight rainfall levels.

(a) Grayscale image in which intensity (in the horizontal band shown) corresponds to average monthly rainfall (b) Colors

assigned to intensity values (c) Color-coded image (d) Zoom of the South American region

Trang 35

3 Pseudocolor Image Processing

Intensity to Color Transformations

Functional block diagram for pseudocolor image processing Images fR, fG, and fBare fed into the corresponding red, green, and blue inputs of an RGB color monitor

Trang 36

3 Pseudocolor Image Processing

Intensity to Color Transformations

 EXAMPLE: Using pseudocolor to highlight explosives in X-ray images.

Figure 7.22(a) shows two monochrome images of luggage

obtained from an airport X-ray scanning system The image on the

left contains ordinary articles The image on the right contains the same articles, as well as a block of simulated plastic

explosives

The purpose of this example is to illustrate the use of intensity

to color transformations to facilitate detection of the explosives

Trang 37

3 Pseudocolor Image Processing

Intensity to Color Transformations

 EXAMPLE: Using pseudocolor to highlight explosives in X-ray images.

Fig.7.23 Transformation functions used to obtain the pseudocolor images in Fig 7.22

These sinusoidal functions contain regions of relatively

constant value around the peaks as well as regions that

change rapidly near the valleys Changing the phase and

frequency of each sinusoid can emphasize (in color) ranges

in the grayscale For instance, if all three transformations

have the same phase and frequency, the output will be a

grayscale image A small change in the phase between the

three transformations produces little change in pixels

whose intensities correspond to peaks in the sinusoids,

especially if the sinusoids have broad profiles (low

frequencies) Pixels with intensity values in the steep

section of the sinusoids are assigned a much stronger color

content as a result of significant differences between the

amplitudes of the three sinusoids caused by the phase

displacement between them

Trang 38

3 Pseudocolor Image Processing

Intensity to Color Transformations

Trang 39

3 Pseudocolor Image Processing

Intensity to Color Transformations

 EXAMPLE: Color coding of multispectral images.

(a)–(d) Red (R), green (G), blue (B), and infrared (IR) components of a LANDSAT

near-multispectral image of the Washington, D.C

area (e) RGB color composite image obtained using the IR, G, and B component images (f) RGB color composite image obtained using the

R, IR, and B component images

four satellite images of the Washington, D.C., area, including part of the Potomac River

Trang 40

3 Pseudocolor Image Processing

Intensity to Color Transformations

 EXAMPLE: Color coding of multispectral images.

Trang 41

4 Basics of Full-Color Image Processing

 Let c represent an arbitrary vector in RGB color space:

 In order for per-component-image and vector-based processing to be equivalent, two conditions

have to be satisfied:

(1) the process has to be applicable to both vectors and scalars;

(2) the operation on each component of a vector (i.e., each voxel) must be independent of the

other components

Trang 42

4 Basics of Full-Color Image Processing

Spatial neighborhoods for grayscale and RGB color images Observe in (b) that a single

Trang 43

5 Color Transformations

Formulation

 Color transformations for multispectral images

where n is the total number of component images, r i

are the intensity values of the input component images,

s i are the spatially corresponding intensities in the

output component images, and T i are a set of

transformation or color mapping functions that operate

on r i to produce s i For example, in the case of RGB

color images, are the intensities values at a point in the

input components images, and are the corresponding

transformed pixels in the output image In principle, we

can implement a different transformation for each input

component image

A full-color image and its various color-space components.

Trang 44

5 Color Transformations

Formulation

Adjusting the intensity of an image using color transformations (a) Original image (b) Result of decreasing

its intensity by 30% (i.e., letting k = 0.7) (c) The required RGB mapping function (d)–(e) The required

Trang 45

5 Color Transformations

Color Complements

Color complements on the color circle

EXAMPLE: Computing color image complements.

Color complement transformations (a) Original image (b) Complement transformation functions (c) Complement of (a) based on the RGB mapping functions (d) An approximation of

Trang 46

5 Color Transformations

Color Slicing

 Using a cube of width W

 Using a sphere of radius R0

Trang 47

5 Color Transformations

Color Slicing

 Using a cube of width W

 Using a sphere of radius R0

EXAMPLE: Color slicing

Color-slicing transformations that detect (a) reds within an RGB cube of width centered at (0.6863, 0.1608, 0.1922), and (b) reds within an RGB sphere of radius 0.1765

centered at the same point Pixels outside the cube and sphere were replaced by color (0.5, 0.5, 0.5).

Trang 48

5 Color Transformations

Histogram Processing of Color Images

 EXAMPLE: Histogram equalization in the HSI color space.

Histogram equalization (followed by saturation adjustment) in the HSI color space

Trang 49

6 Color Image Smoothing and Sharpening

Color Image Smoothing

 The average of the RGB component vectors in this neighborhood is

Trang 50

6 Color Image Smoothing and Sharpening

Color Image Smoothing

 EXAMPLE: Color image smoothing by neighborhood averaging.

HSI components of the RGB color image (a) Hue (b) Saturation (c) Intensity.

Trang 51

6 Color Image Smoothing and Sharpening

Color Image Sharpening

 EXAMPLE: Image sharpening using the Laplacian.

Image sharpening using the Laplacian (a) Result of processing each RGB channel (b) Result of processing the HSI intensity component and converting to RGB (c) Difference between the two results.

Ngày đăng: 14/12/2021, 00:04

TỪ KHÓA LIÊN QUAN

🧩 Sản phẩm bạn có thể quan tâm

w