fundamentals of digital image processingenyhchan/dip-f.pdf · coded into an image processing system...

13
CYH-ImgF 1 Fundamentals of Digital Image Processing Y H Chan CYH-ImgF 2 Applications of image processing What's an image? A simple image model Fundamental steps in image processing Elements of digital image processing systems Color processing CYH-ImgF 3 Applications of image processing Interest in digital image processing methods stems from 2 principal application areas: – improvement of pictorial information for human interpretation, and – processing of scene data for autonomous machine perception. CYH-ImgF 4 In the 2 nd application area, interest focuses on procedures for extracting from an image information in a form suitable for computer processing. Examples include automatic character recognition, industrial machine vision for product assembly and inspection, military recognizance, automatic processing of fingerprints etc.

Upload: others

Post on 06-Jul-2020

15 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Fundamentals of Digital Image Processingenyhchan/DIP-F.pdf · coded into an image processing system in the form of a knowledge database. CYH-ImgF 18 Examples of the fundamental steps

CYH-ImgF 1

Fundamentals of Digital Image Processing

Y H Chan

CYH-ImgF 2

• Applications of image processing• What's an image? • A simple image model• Fundamental steps in image processing• Elements of digital image processing

systems• Color processing

CYH-ImgF 3

Applications of image processing

• Interest in digital image processing methods stems from 2 principal application areas: – improvement of pictorial information for

human interpretation, and – processing of scene data for autonomous

machine perception.

CYH-ImgF 4

• In the 2nd application area, interest focuses on procedures for extracting from an image information in a form suitable for computer processing.

• Examples include – automatic character recognition, – industrial machine vision for product assembly and

inspection, – military recognizance, – automatic processing of fingerprints etc.

Page 2: Fundamentals of Digital Image Processingenyhchan/DIP-F.pdf · coded into an image processing system in the form of a knowledge database. CYH-ImgF 18 Examples of the fundamental steps

CYH-ImgF 5

What's an image?

• An image refers to a 2D light intensity function f(x,y), where – (x,y) denote spatial coordinates and – f(x,y) is a value proportional to the brightness

or gray levels of the image at that point.

CYH-ImgF 6

• A digital image is an image f(x,y) that has been discretized both in spatial coordinates and brightness.

• The elements of such a digital array are called image elements or pixels.

CYH-ImgF 7

A simple image model

• To be suitable for computer processing, an image f(x,y) must be digitalized both spatially and in amplitude.

• Digitization of the spatial coordinates (x,y) is called image sampling.

• Amplitude digitization is called gray-level quantization.

CYH-ImgF 8

23 65 32 67 …7 87 42 …

14 87 12 …

… 3 43… 26 76

Intensity plane

Grey-level image

53 15 82 67 …4 23 92 …

84 27 12 …

… 3 43… 26 76

23 65 32 67 …7 87 42 …

14 87 12 …

… 3 43… 26 76

43 65 32 67 …17 37 32 …24 57 18 …

… 3 43… 26 76

R planeG plane

B plane

Color image

Page 3: Fundamentals of Digital Image Processingenyhchan/DIP-F.pdf · coded into an image processing system in the form of a knowledge database. CYH-ImgF 18 Examples of the fundamental steps

CYH-ImgF 9

• The storage and processing requirementsincrease rapidly with the spatial resolution and the number of gray levels.

• Example: A 256 gray-level image of size 256x256 occupies 64K bytes of memory.

• Images of very low spatial resolution produce a checkerboard effect.

CYH-ImgF 10

CYH-ImgF 11

• The use of insufficient number of gray levels in smooth areas of a digital image results in false contouring.

No. of gray levels

The difference is so large that it becomes visible. CYH-ImgF 12

Page 4: Fundamentals of Digital Image Processingenyhchan/DIP-F.pdf · coded into an image processing system in the form of a knowledge database. CYH-ImgF 18 Examples of the fundamental steps

CYH-ImgF 13

Fundamental steps in IP

• Image acquisition:to acquire a digital image

• Image preprocessing: to improve the image in ways that increase the chances for success of the other processes.

• Image segmentation:to partitions an input image into its constituent parts or objects.

CYH-ImgF 14

• Image representation: to convert the input data to a form suitable for computer processing.

• Image description: to extract features that result in some quantitative information of interest or features that are basic for differentiating one class of objects from another.

CYH-ImgF 15

• Image recognition: to assign a label to an object based on the information provided by its descriptors.

• Image interpretation: to assign meaning to an ensemble of recognized objects.

CYH-ImgF 16

Preprocessing

Imageacquisition

Segmentation Representationand description

Knowledge base

Recognitionand

interpretion

ResultProblemdomain

Fig 1. Fundamental steps in digital image processing

Page 5: Fundamentals of Digital Image Processingenyhchan/DIP-F.pdf · coded into an image processing system in the form of a knowledge database. CYH-ImgF 18 Examples of the fundamental steps

CYH-ImgF 17

• Knowledge about a problem domain is coded into an image processing system in the form of a knowledge database.

CYH-ImgF 18

Examples of the fundamental steps of DIP

CYH-ImgF 19 CYH-ImgF 20

Elements of digital image processing systems

• The basic operations performed in a digital image processing systems include (1) acquisition, (2) storage, (3) processing, (4) communication and (5) display.

Page 6: Fundamentals of Digital Image Processingenyhchan/DIP-F.pdf · coded into an image processing system in the form of a knowledge database. CYH-ImgF 18 Examples of the fundamental steps

CYH-ImgF 21

Image acquisitionequipments

VideoScannerCamera

Display UnitTV monitorsPrintersSlideprojectors

StorageOptical disksTapeVideotapeMag disks

Processing UnitComputerWorkstation

Communicationchannel

Fig 2. Basic fundamental elements of an image processing systemCYH-ImgF 22

Color processing

• Basics of color• Color models in images • Color models in video

CYH-ImgF 23

Basics of color(a) Light and spectra• Color is the perceptual result of light in the

visible region of the spectrum, having in the region of 400nm to 700nm, incident upon the retina.

• Visible Light is a form of electromagnetic energy consisting of a spectrum of frequencies having wavelengths range from about 400nm for violet light to about 700nm for red light.

• Most light we see is a combination of many wavelengths.

CYH-ImgF 24

Page 7: Fundamentals of Digital Image Processingenyhchan/DIP-F.pdf · coded into an image processing system in the form of a knowledge database. CYH-ImgF 18 Examples of the fundamental steps

CYH-ImgF 25

(b) Primaries• Any color can be matched by proper

proportions of three component colors called primaries.

• The most common primaries are red, blue and green.

CYH-ImgF 26

CYH-ImgF 27 CYH-ImgF 28

(c) HSI color space• HSI stands for Hue, Saturation and

Intensity.• It decouples the intensity component from

the color-carrying information (hue and saturation) in a color.

Page 8: Fundamentals of Digital Image Processingenyhchan/DIP-F.pdf · coded into an image processing system in the form of a knowledge database. CYH-ImgF 18 Examples of the fundamental steps

CYH-ImgF 29

• The following terms are used to define color light:– Brightness or Luminance: This is the amount

of light received by the eye regardless of color.

– Hue: This is the predominant spectral color in the light.

– Saturation: This indicates the spectral purityof the color in the light.

CYH-ImgF 30

Top view of a

Cut a horizontal cross section

HS

CYH-ImgF 31

Two cross-sections• Intersection of the plane with the faces of the cube have either a triangular or hexagonal shape.

• Any one of the shapes can be warped into a circle by a geometric transformation.

CYH-ImgF 32

Page 9: Fundamentals of Digital Image Processingenyhchan/DIP-F.pdf · coded into an image processing system in the form of a knowledge database. CYH-ImgF 18 Examples of the fundamental steps

CYH-ImgF 33

• RGB-to-HIS transformation

[ ][ ]

−−+−

−+−= −

2/1221

1

))(()(

)()(cos

BGBRGR

BRGRθ

)(31 BGRI ++=

[ ]),,min(31 BGRBGR

S++

−=

>−≤

=GBifGBif

Hθπ

θ2

where

CYH-ImgF 34

• In 1931, the CIE adopted a set of nonphysical primaries, X, Y and Z.

CYH-ImgF 35 CYH-ImgF 36

Page 10: Fundamentals of Digital Image Processingenyhchan/DIP-F.pdf · coded into an image processing system in the form of a knowledge database. CYH-ImgF 18 Examples of the fundamental steps

CYH-ImgF 37

Typical color gamut of color monitors (triangle) and color printing devices (irregular region)

CYH-ImgF 38

CYH-ImgF 39

• The chromaticity coordinates are obtained from x=X/D, y=Y/D, z=Z/D, where D=X+Y+Z.

• The edges represent the "pure" colors.• When added, any two colors produce a

point on the line between them.

CYH-ImgF 40

Color models in images:

• A color image is a 2D array of (R,G,B) integer triplets.

• CRT displays have 3 phosphors (RGB) which produce a combination of wavelengths when excited with electrons.

Page 11: Fundamentals of Digital Image Processingenyhchan/DIP-F.pdf · coded into an image processing system in the form of a knowledge database. CYH-ImgF 18 Examples of the fundamental steps

CYH-ImgF 41

23 65 32 67 …7 87 42 …

14 87 12 …

… 3 43… 26 76

Intensity plane

Grey-level image

53 15 82 67 …4 23 92 …

84 27 12 …

… 3 43… 26 76

23 65 32 67 …7 87 42 …

14 87 12 …

… 3 43… 26 76

43 65 32 67 …17 37 32 …24 57 18 …

… 3 43… 26 76

R planeG plane

B plane

Color image

CYH-ImgF 42

CYH-ImgF 43 CYH-ImgF 44

• CMY model, which uses Cyan, Magenta and Yellow primaries, is mostly used in printing devices where the color pigments on the paper absorb certain colors.

−−−

=

BGR

YMC

111

Page 12: Fundamentals of Digital Image Processingenyhchan/DIP-F.pdf · coded into an image processing system in the form of a knowledge database. CYH-ImgF 18 Examples of the fundamental steps

CYH-ImgF 45

• Sometimes, an alternative CMYK model (K stands for black) is used in color printing to produce a darker black than simply mixing CMY.

where K=min{C,M,Y}

−−−

=

KYKMKC

YMC

'''

CYH-ImgF 46

CYH-ImgF 47

Color models in video

• YIQ and YUV are the 2 commonly used color models in video.

CYH-ImgF 48

Page 13: Fundamentals of Digital Image Processingenyhchan/DIP-F.pdf · coded into an image processing system in the form of a knowledge database. CYH-ImgF 18 Examples of the fundamental steps

CYH-ImgF 49 CYH-ImgF 50

CYH-ImgF 51 CYH-ImgF 52

• Numerical example of 4:1:1

51 415250

56 96 20 60 0 32 36 32

84 52 12 6036 96 40 60

46 243947

4:1:1 format

51 51 51 5141 41 41 4152 52 52 5250 50 50 50

46 46 46 4624 24 24 2439 39 39 3947 47 47 47

56 96 20 600 32 36 32

84 52 12 6036 96 40 60

Restored when used

40 64 32 68 16 72 32 4424 56 48 8032 24 80 64

Y plane

I plane

Q plane

Original

24 60 32 68 10 30 32 2420 40 16 8080 20 20 68

56 96 20 60 0 32 36 32

84 52 12 6036 96 40 60