14
Shuozhong Wang, SCIE, Shanghai University Shuozhong Wang, SCIE, Shanghai University Digital Image Processing Kenneth R. Castleman 2008/2/26 Presentation by S. Wang Kenneth R. Kenneth R. Castleman Castleman 2008/2/26 Presentation by S. Wang Presentation by S. Wang 1 Shuozhong Wang, SCIE, Shanghai University Shuozhong Wang, SCIE, Shanghai University Original image Original image 2 Shuozhong Wang, SCIE, Shanghai University Shuozhong Wang, SCIE, Shanghai University Rotated Rotated 3 Shuozhong Wang, SCIE, Shanghai University Shuozhong Wang, SCIE, Shanghai University Enhanced Enhanced

Original image Digital Image Processing Part1-1.pdf · – Hardware for adequate sampling, quantization, and processing – High-quality equipment for low noise image acquisition

Embed Size (px)

Citation preview

Page 1: Original image Digital Image Processing Part1-1.pdf · – Hardware for adequate sampling, quantization, and processing – High-quality equipment for low noise image acquisition

Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Digital Image Processing

Kenneth R. Castleman

2008/2/26

Presentation by S. Wang

Kenneth R. Kenneth R. CastlemanCastleman

2008/2/26

Presentation by S. WangPresentation by S. Wang

1Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Original imageOriginal image

2Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

RotatedRotated

3Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

EnhancedEnhanced

Page 2: Original image Digital Image Processing Part1-1.pdf · – Hardware for adequate sampling, quantization, and processing – High-quality equipment for low noise image acquisition

4Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

SharpenedSharpened

5Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Zoomed: before processingZoomed: before processing

6Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Zoomed: after processingZoomed: after processing

7Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

OriginalOriginal

Page 3: Original image Digital Image Processing Part1-1.pdf · – Hardware for adequate sampling, quantization, and processing – High-quality equipment for low noise image acquisition

8Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

EnhancedEnhanced

9Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Detailed comparisonDetailed comparison

10Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Correction of Geometric DistortionCorrection of Geometric Distortion

Original

Barrel distortion corrected

Final11

Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Noisy ImageNoisy Image

Page 4: Original image Digital Image Processing Part1-1.pdf · – Hardware for adequate sampling, quantization, and processing – High-quality equipment for low noise image acquisition

12Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

FilteredFiltered

13Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Image Image inpaintinginpainting

14Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

BibliographyBibliography

K. R. Castleman, Digital Image Processing, Prentice Hall, 1998

Gonzalez and Woods, Digital Image Processing, 2nd Edition, Prentice Hall, 2002(电子工业出版社, 2003)

Gonzalez, Woods, and Eddins, Digital Image Processing Using MATLAB, Prentice Hall, 2004(电子

工业出版社, 2005)

阮秋琦,数字图像处理学,电子工业出版社,北京,2001

Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Part One Part One -- 11

Fundamentals:Images and Digital ProcessingDigitizing and DisplayTerminology

Fundamentals:Fundamentals:Images and Digital ProcessingImages and Digital ProcessingDigitizing and DisplayDigitizing and DisplayTerminologyTerminology

Page 5: Original image Digital Image Processing Part1-1.pdf · – Hardware for adequate sampling, quantization, and processing – High-quality equipment for low noise image acquisition

Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Chapter IChapter I

Images and Digital ProcessingImages and Digital Images and Digital ProcessingProcessing

17Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Introduction (1)Introduction (1)

What is digital image processing?– Manipulation of images by computer.

Factors that stimulate development of the subject:– Computer: growing performance and declining cost.– Increasing availability of digitizing and display equipment.

• Digital camera, scanner, video acquisition device, …• CRT, LED, printer, …

– Growing application fields.• Industry: machine vision, automatic control, monitoring, …• Space -- remote sensing: forestry, environment, resources, …• Medical applications• Military uses: reconnaissance, missile guide, sonar imaging , …• Document images, OA, …

18Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Introduction (2)Introduction (2)

Basic elements of digital image processing– Input– Storage– Processor– Output

摄像机

扫描仪 其他输出设备Computer

打印输出

19Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Terminology (1)Terminology (1)

ImageImage and picturepicture is used interchangeably in this course.

DigitalDigital: related to calculation by numerical methods or by discrete units.

Digital imageDigital image: : a 2D rectangular array of quantized sample values. Only digital images can be processed by computer.– Sampled in equally spaced rectangular grid pattern (raster), and

– Quantized in equal intervals of amplitude.

Digital image processingDigital image processing: the act of subjecting a digital image that is a numerical representation of an object to a series of operations in order to obtain a desired result.

Page 6: Original image Digital Image Processing Part1-1.pdf · – Hardware for adequate sampling, quantization, and processing – High-quality equipment for low noise image acquisition

20Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Terminology (2)Terminology (2)

Generalized imagesGeneralized images:– Non-optical images– Higher dimensional images (including multi-spectral images)– Images produced with non-standard sampling– Images produced with non-standard quantization

Image processingImage processing and image analysisimage analysis:– Image processing takes an image to produce a modified image

for better viewing or some other purposes.– Image analysis takes an image into something other than an

image such as number of object types, size of an object, etc.

Computer graphicsComputer graphics: concerned with generation of images with computer.Computer visionComputer vision: concerned with interpretation of scenes.

21Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Terminology (3)Terminology (3)

DigitizingDigitizing: the process of converting an image from its original form into digital form.

DisplayDisplay: reverse operation of digitizing, which generates a visible image from a digital image. – Image reconstruction on a screen (volatile)

– Hardcopy (permanent display)

– Image recording

ScanningScanning: sequentially addressing small spots in an image (pixels).

PixelPixel: picture cell, picture element.

22Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Terminology (4)Terminology (4)

SamplingSampling: measuring the gray level (color) of an image at each pixel location.QuantizationQuantization: Representation of a measured value by an integer (A-D conversion).

sampling quantization23

Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Terminology (5)Terminology (5)

Global operationGlobal operation: applied equally throughout the image.

Point operationPoint operation: value of output pixel depends only on the corresponding pixel in the input image.

ContrastContrast: magnitude of gray-level difference in an image.

NoiseNoise: additive (or multiplicative) contamination.

GrayGray--scale resolutionscale resolution: number of gray levels per measure of pixel brightness.

Sampling densitySampling density: number of samples per unit length.

Pixel spacingPixel spacing: reciprocal of sampling density.

MagnificationMagnification: size relation between input and output.

Page 7: Original image Digital Image Processing Part1-1.pdf · – Hardware for adequate sampling, quantization, and processing – High-quality equipment for low noise image acquisition

24Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Continuous and Discrete ApproachesContinuous and Discrete Approaches

Use discrete techniques to process images of a

continuous word.

The image becomes discrete so that we can use the

digital computer as a tool to implement our algorithms:– The native state of the image is continuous.

– The processed results will be interpreted in analog form.

Do not ignore the origin of image in continuous domain.

Conclusion:

– Digital image processing ≠ Processing digital images

– Rather, it means digital processing of images.

25Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

The Unified ApproachThe Unified Approach

Three essential steps in image digitization:– Characterize the possible effects of digitization.

– Seek means to convert an image into digital and back into analog

without significantly damaging the contents of interest.

– Predict sampling effects, and take measures to eliminate them or

bring them under control.

If these are followed, the digital image we process is

equivalent to the continuous original it represents.

We are free to choose between continuous and discrete

analysis as it is convenient. They produce the same result.

26Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Practical ConsiderationsPractical Considerations

Knowledge required: math, optics, computer technology.

Also required: intuition and common sense.

A general-purpose image processing system requires:

– Hardware for adequate sampling, quantization, and processing

– High-quality equipment for low noise image acquisition

– High-quality display device

– Good software tools for data storage, access, and manipulation

– Versatile and re-usable codes and libraries

– Expandability of the program libraries

Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Chapter 2Chapter 2

Digitizing ImagesDigitizing ImagesDigitizing Images

Page 8: Original image Digital Image Processing Part1-1.pdf · – Hardware for adequate sampling, quantization, and processing – High-quality equipment for low noise image acquisition

28Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Image DigitizersImage Digitizers

Equipment for digitizing images turns a computer into an image-processing workstation.– Inexpensive image digitizers make image processing popular.

Topics about image digitizers:– Elements of an image digitizer

• Sampling aperture, to be able to access pixels

• Scanning mechanism, to address pixels

• Light sensor, to measure pixel brightness

• Quantizer, to accomplish A-to-D conversion

• Output storage medium, to store the processed results

– Related physical phenomena (optoelectric effects, deflection, etc.)

– Implementations (CCD, LED, etc.)

29Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Characteristics of an Image DigitizerCharacteristics of an Image Digitizer

Pixel size and spacing

Image size

Local property measured: transmittance, optical density

of the film, light intensity, etc.

Linearity: determines the accuracy of measurement

Dynamic range of the gray scale

Noise

30Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Types of Image DigitizersTypes of Image Digitizers

Scanners

Digital cameras

Plug-in cards for image/video grabbing

Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Chapter 3Chapter 3

Digital Image DisplayDigital Image DisplayDigital Image Display

Page 9: Original image Digital Image Processing Part1-1.pdf · – Hardware for adequate sampling, quantization, and processing – High-quality equipment for low noise image acquisition

32Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

IntroductionIntroduction

Basic requirement: the display should not cause degradation to an accurately digitized and properly processed digital image.Gray level resolution:– Human eye can resolve 40 gray levels.– Due to edge enhancement capability of the retina, gray-level

transition must be smaller than 1/40 of the full perceivable range.

Display types:– Volatile ⎯ screen– Permanent ⎯ hardcopy

Two options for displayed brightness:– Match the image pixel values– Match the human visual system (HVS)

33Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Display Characteristics (1)Display Characteristics (1)

Displayed image size:

– Physical size of the displayed image (screen size)

– Size of the largest digital image that the display system can

handle (number of lines, and number of dots per line)

Photometric resolution: accuracy with which the system

can produce the correct brightness at each pixel position.

– Displayed gray level number ≤ gray level number accepted by

device

– Gray level resolution is limited by the RMS noise level.

34Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Display Characteristics (2)Display Characteristics (2)

Gray scale linearity

– Human eye is insensitive to slight non-linearity provided that no

definite shoulder or toe exists in the input-to-output gray level

transfer curve.

Display calibration

– Important for properly presenting images to the viewer.

– Manual adjustment of the transfer curve may give satisfactory

effects in certain cases, but not always.

– Software control is desirable to produce consistent viewing effects,

both for volatile display and for hardcopy prints.35

Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

LowLow--Frequency Response (1)Frequency Response (1)

Consider the ability of a display system to produce large areas of constant gray level ⎯ the flat field performance.

The requirement: pixels fit together nicely.

Problem: in many display systems such as CRT, pixels are circular spots on a rectangular grid.

-20 -15 -10 -5 0 5 10 15 200

0.2

0.4

0.6

0.8

1

p(r)

D(r)

Page 10: Original image Digital Image Processing Part1-1.pdf · – Hardware for adequate sampling, quantization, and processing – High-quality equipment for low noise image acquisition

36Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

LowLow--Frequency Response (2)Frequency Response (2)

Assume Gaussian spots:

where R is the radius at which the intensity drops to 1/2.

Flatness of intensity depends on spacing between spots.

When d = 2R, fluctuation in combined intensity is 12.5%.

No choice of d makes the field absolutely flat.

The best field flatness falls in 1.55R ≤ d ≤ 1.65R. (p.43)

22 )/(2ln)/( 2)( RrRrerp −− ==

37Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

High Frequency ResponseHigh Frequency Response

Consider ability of a display system to produce fine details.

Use test patterns to find the best pixel spacing that gives good contrast for fine detail.

Contrast becomes poor when pixel spacing is less than 2R.

Compromise is needed for both high and low Compromise is needed for both high and low frequencies.frequencies.

38Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Sampling for Display Purposes (1)Sampling for Display Purposes (1)

Display is a process of image reconstruction from digital to analog.

The ideal reconstruction (interpolation) function is sinc, not Gaussian.

-30 -20 -10 0 10 20 30-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

39Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Sampling for Display Purposes (2)Sampling for Display Purposes (2)

Reconstruction with Gaussian spots inevitably causes

distortion even the Nyquist theorem is satisfied. (Fig.3-11)

Solutions:

– Over-sampling: more data are required in processing and display.

– Re-sampling at display: insert additional data between samples

prior to display (Fig.3-12). Burden is placed only to the display.

Noise considerations

– Amplitude noise (pepper & salt): affects flat areas.

– Spot position noise: combined with inter-spot effects, may affect

display.

Page 11: Original image Digital Image Processing Part1-1.pdf · – Hardware for adequate sampling, quantization, and processing – High-quality equipment for low noise image acquisition

Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Chapter 4Chapter 4

Image Processing SoftwareImage Processing Image Processing SoftwareSoftware

41Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Commercial Image Processing ToolsCommercial Image Processing Tools

Commercial software tools have powerful functions and friendly user-interface for image processing.Skills in using these tools require knowledge of image processing and practical experiences. Examples:– Adobe Photoshop: the most popular software for digital

photograph processing and artistic manipulations– ACD System

• ACDSee: for viewing digital images• ACD Photo Editor

– Microsoft Photo Editor– And many more …

42Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Special Purpose Image ProcessorsSpecial Purpose Image Processors

These are developed for specific applications, generally having basic processing capabilities and special functions.Examples– Remote sensing image processing system– Document image processing system– Watermarking system for copyright protection

43Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Development PlatformsDevelopment Platforms

MATLAB– Powerful tool for numerical computation, simulation, visualization,

prototyping, etc.

– Useful in research and development in image processing

Visual C++– Frequently used in developing image processing applications and

commercial products

– Important in transfer research findings into real applications

Hardware implementation of processing algorithms– DSP, ASIC, etc.

– For real time environments

– Combined into other applications and devices

Page 12: Original image Digital Image Processing Part1-1.pdf · – Hardware for adequate sampling, quantization, and processing – High-quality equipment for low noise image acquisition

44Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Digital Processing of ImagesDigital Processing of Images

Continuous Scene

Analog Observation

Digital Processing by

Computer

45Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Human eye resolutionHuman eye resolution

46Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Shoulder and ToeShoulder and Toe

Shoulder Toe

47Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

DeDe--nosingnosing

Before processing After processing

Noise elimination algorithm allows decreasingdecreasing noise impact while retaining retaining the sharpness of small details.

Page 13: Original image Digital Image Processing Part1-1.pdf · – Hardware for adequate sampling, quantization, and processing – High-quality equipment for low noise image acquisition

48Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Industrial ApplicationsIndustrial Applications

Detection/recognition of different types of road surface damage

49Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Remote SensingRemote Sensing

50Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Medical ImagesMedical Images

51Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Document Images: ArchivesDocument Images: Archives

Page 14: Original image Digital Image Processing Part1-1.pdf · – Hardware for adequate sampling, quantization, and processing – High-quality equipment for low noise image acquisition

52Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Military ApplicationsMilitary Applications

53Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Display Size and Spatial ResolutionDisplay Size and Spatial Resolution

54Shuozhong Wang, SCIE, Shanghai UniversityShuozhong Wang, SCIE, Shanghai University

Photometric ResolutionPhotometric Resolution