Top Banner
Digital Image Processing Hongjun Xu August 1, 2007
46
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Digital Image Processing

Digital Image Processing

Hongjun Xu

August 1, 2007

Page 2: Digital Image Processing

Lecture 1

Introduction and Digital Image Fundamentals

Page 3: Digital Image Processing

• What is an Image?

Picture, photograph

Visual data

Usually two or three dimensional

What is a digital image?

An image which is “discretized,”, i.e., defined on a discrete grid

Two-dimensional collection of light values (or gray values)

Page 4: Digital Image Processing

What is digital image processing?

Digital image processing is the study of representation and manipulation of pictorial information by a computer.

Improve pictorial information for better clarity (human interpretation)

Examples:

1 Enhancing the edges of an image to make it appear sharper

2 Remove “noise” from an image

3 Remove motion blur from an image

Page 5: Digital Image Processing

What is image interpretation?

Assign meaning to an ensemble of recognized objects

Automatic machine processing of scene data (interpretation by a machine/non-human, storage, transmission)

Examples:

1 Obtain the edges of an image

2 Remove detail from an image

Page 6: Digital Image Processing

Important steps in a typical image processing system

Step 1: Image acquisition

Step 2: Discretization / digitalization; Quantization ; Compression

Step 3: Image enhancement and restoration

Step 4: Image segmentation

Step 5: Feature selection

Capturing visual data by an image sensor

Convert data into discrete form; compress for efficient storage/transmission

Improving image quality (low contrast, blur noise)

Partition image into objects or constituent parts

Extracting pertinent features from an image that are important for differentiating one class of objects from another

Page 7: Digital Image Processing

Step 6: Image representation

Step 7: Image interpretation

Assigning labels to an object based on information provided by descriptors

Assigning meaning to an ensemble of recognized objects

Page 8: Digital Image Processing

Image analysis:

Step 4: Image segmentation

Step 5: Feature selection

Step 6: Image representation

Image understanding:

Step 6: Image representation

Step 7: Image interpretation

Image processing:

Step 2: Compression

Step 3: Image enhancement and restoration

Step 4: Image segmentation

Imaging: Step 1: Image acquisition and

Step 2: digitalization; Quantization ; Compression

Page 9: Digital Image Processing

Image processing and analysis transformations

Level 0: Image representation

Level 1: Image to image transformations

Level 2: Image to parameter transformation

Level 3: Image to decision transformation

Acquisition; sampling; quantization; compression

Enhancement; restoration; segmentation

Feature selection

Recognition and interpretation

Page 10: Digital Image Processing

Image Acquisition and Sampling

Sampling refers to the process of digitizing a continuous function

For Example: 1

sin( ) sin(3 )3

y x x

Page 11: Digital Image Processing

Sampling an image requires that we consider the Nyquist criterion, when we consider an image as a continuous function of two variables, we wish to sample it to produce a digital image.

Using light

Light is the predominant energy source for image because it is the energy source which human beings can observe directly.

Many digital images are captured using visible light as the energy source.

For example, photographs are pictorial record of visible scene.

Page 12: Digital Image Processing

Light spectrum

Page 13: Digital Image Processing

Types of sensors:

Optical (camera)

Infrared (senses heat changes)

X-ray (CT Scan)

Magnetic (MRI)

Ultrasound (acoustic energy)

Electron Microscopy (Electron beam)

Computer generated images (fractals, animation)

Page 14: Digital Image Processing

Create an image

To create a digital image, we need to convert the continuously sensed data into digital form.

This involves:

Sampling:

Quantization (bits/pixel)

Digitizing the coordinate values (resolution)

Depends on density of sensor in an array

Limited by optical resolution

Digitizing the amplitude values

Pixel: short for picture element

Page 15: Digital Image Processing

Image Representation

Page 16: Digital Image Processing
Page 17: Digital Image Processing
Page 18: Digital Image Processing

Spatial Resolution

Sampling determines resolution

Resolution is the smallest discernible detail in an imageCommon unit – 480 x 640 pixels

Need to know size of image also

Page 19: Digital Image Processing

Quantization

• 1 bit /pixel

• B bits/pixel

Gray: generally integer values, ranging from 0 to some maximum value

–2 possible values–2 gray levels -> 0 or 1 (binary image)

–2B gray levels–1 byte = 8 bits –> 256 levels

Page 20: Digital Image Processing

Coordinate Convention

Page 21: Digital Image Processing

Digital Image Representation

)1,1(...)1,1()0,1(

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

)1,1(......)0,1(

)1,0(...)1,0()0,0(

),(

MNfNfNf

Mff

Mfff

yxf

Digital Image Image Elements(Pixels)

Page 22: Digital Image Processing

Pixel Notation

Page 23: Digital Image Processing

Reading ImagesMATLAB syntax: imread(‘filename’)Format name Description Recognized Extensions

TIFF Tagged Image File Format .tif, .tiff

JPEG Joint photographic experts group .jpg, .jpeg

GIF Graphics Interchange format .gif

BMP Windows Bitmap .bmp

PNG Portable Network Graphics .png

XWD X Window Dump .xwd

Note: GIF is supported by imread, but not by imwrite.

Page 24: Digital Image Processing

Applications• BIOLOGICAL: automated systems for analysis of samples.

•DEFENSE/INTELLIGENCE: enhancement and interpretation of images to find and track targets.

•DOCUMENT PROCESSING: scanning, archiving, transmission.

•FACTORY AUTOMATION: visual inspection of products.

•LAW ENFORCEMENT/FORENSICS: fingerprint analysis.

•MATERIALS TESTING: detection and quantification of cracks, impurities, etc.

•MEDICAL: disease detection and monitoring, therapy/surgery planning

•...

Page 25: Digital Image Processing

Image processing with MATLAB

What is the Image Processing Toolbox?

• The Image Processing Toolbox is a collection of functions that extend the capability of the MATLAB ® numeric computing environment. The toolbox supports a wide range of image processing operations, including:– Geometric operations

– Neighborhood and block operations

– Linear filtering and filter design

– Transforms

– Image analysis and enhancement

– Binary image operations

– Region of interest operations (RIO)

>> help images

Page 26: Digital Image Processing
Page 27: Digital Image Processing
Page 28: Digital Image Processing
Page 29: Digital Image Processing
Page 30: Digital Image Processing
Page 31: Digital Image Processing
Page 32: Digital Image Processing
Page 33: Digital Image Processing
Page 34: Digital Image Processing
Page 35: Digital Image Processing

Data Classes

Double -double precision, range: [-10^308, +10^308]

Uint8 -unsigned 8-bit integer, range:[0,255]

Unit16 -unsigned 16-bit integer, range:[0, 65535]

Unit32 -unsigned 32-bit integer, range:[0, 2^32-1]

Int8 -signed 8-bit integer, range:[-128,127]

Int16 -signed 16-bit integer, range:[-32768,+32767]

Int32

Single -single precision, range:[-10^38,+10^38]

Char -characters

Logical -values are 0 or 1

Page 36: Digital Image Processing

Converting between Image Classes

Name Convert input to

Im2uint uint8

Im2uint16 uint16

Im2double double

Im2bw logical

Mat2gray double (in range [0,1])

Page 37: Digital Image Processing

Image types in MATLAB

1. White and black images

2. Grey scale images

3. Colored image

They are also called binary images, containing 1 for white and 0 for black.

They are also called Intensity Images, containing numbers in the range of 0 to 255 or 0 to 1.

They may be represented as RGB Image or Indexed Image.

Page 38: Digital Image Processing

Indexed images: m-by-3 color map

Most colour images only have a small subset of the more than sixteen million possible colours. So the image has an associated colour map. Each pixel has a value which does not give its colour, but an index to the colour in the map.

RGB images: m-by-n-by-3

If each of these components has a range 0-255, this gives a total 255^3=16777216 different possible colours in the image

Page 39: Digital Image Processing

Gray-level values can be stored as one of several data types:

All MATLAB operations work on images of type double

>>x=double(x);

DOUBLE Convert to double precision.

Only some MATLAB operations work on intensity or binary images of type uint8

–uint8: 8-bit unsigned integer; range is 0 (black) - 255 (white)

–double: double-precision floating-point number; range is 0.0 - 1.0

–uint16

Page 40: Digital Image Processing

Binary images

MATLAB code

Page 41: Digital Image Processing

Intensity Images

Page 42: Digital Image Processing

RGB images

Page 43: Digital Image Processing

Indexed Images

MATLAB stores the RGB values of an indexed image as values of type double, with values between 0 and 1.

Page 44: Digital Image Processing

Image display

• image - create and display image object

• imagesc - scale and display as image

• imshow - display image

• colorbar - display colorbar

• getimage- get image data from axes

• truesize - adjust display size of image

• zoom - zoom in and zoom out of 2D plot

• Imread - read image

Page 45: Digital Image Processing

Writing Images

imwrite -write images

Basic syntax: imwrite (f,’filename’)

Page 46: Digital Image Processing

Image conversion

• gray2ind - intensity image to index image

• im2bw - image to binary

• im2double - image to double precision

• im2uint8 - image to 8-bit unsigned integers

• im2uint16 - image to 16-bit unsigned integers

• ind2gray - indexed image to intensity image

• mat2gray - matrix to intensity image

• rgb2gray - RGB image to grayscale

• rgb2ind - RGB image to indexed image