Digital Image Processing. Lecture 1 Introduction & Fundamentals

Digital Image Processing Lecture 1 Introduction & Fundamentals Topics Image formation Point processing and equalization Image Enhancement, Noise re...
Author: Georgia Willis
2 downloads 3 Views 4MB Size
Digital Image Processing

Lecture 1 Introduction & Fundamentals

Topics Image formation Point processing and equalization Image Enhancement, Noise reduction The Fourier transform and Convolution Image sampling, warping, and stitching Spatial filtering Mathematical morphology

Recommended Textbook “Digital Image Processing” by R.C. Gonzalez and R.E. Woods, 3rd edition, Pearson Prentice Hall, 2008

Course Objectives Cover basic theory and algorithms widely used in image processing Develop hands-on experience in processing images Familiarize with OpenCV (Open Source Computer Vision) Library Develop critical thinking about the state of the art

Prerequisites Signals and systems Linear algebra – Matrices, Matrix Operations – Determinants, Systems of Linear Equations – Eigenvalues, Eigenvectors

Probability and Statistics – – – – –

Probability density function Probability distribution Mean, variance, co-variance, correlation Priors, Posteriors, Likelihoods Gaussian distribution

Good programming skills

Grading 4 Homeworks = 20% Project and Presentation =%15 – 19/04/2016 or 26/04/2016

Midterm Exam: %25 – 05/04/2016

Final Exam: %40 – 10/05/2016

Bonus: Participation in class Note: There may me some small changes

Introduction What is Digital Image Processing? – Digital Image: a two-dimensional function f(x,y) or matrix x and y are spatial coordinates, discrete and finite  The amplitude of f is called intensity or gray level at the point (x, y)  Image size = max(x) x max(y) -- e.g. 640x480  Pixel : the elements of a digital image  Pixel intensity value f(x,y) ∈ [0, 255] 

– Digital Image Processing: process digital images by means of computer, it covers low-, mid-, and high-level processes low-level: inputs and outputs are images  mid-level: outputs are attributes extracted from input images  high-level: an ensemble of recognition of individual objects 

Why digital image processing? Image is better than any other information form for human being to perceive. Humans are primarily visual creatures – above 90% of the information about the world A picture is better than a thousand words However, vision is not intuitive for machines – projection of 3D world to 2D images => loss of information – interpretation of dynamic scenes, such as a moving camera and moving objects

Image understanding, image analysis, and computer vision aim to imitate the process of human vision electronically

A Typical Digital Image Processing System

Image analysis / computer vision Extracting information from images Quantitative: – object shape, location and distance

Semantic – – – –

Character recognition Object recognition Scene understanding Human Activity recognition

Relationship with other Fields

Applications Medicine (radiological diagnoses, microscopy) Defense (radar, sonor, infrared, satellites, etc.) Robotics / machine vision (e.g., “intelligent” vehicles) Human / computer interfaces (face / fingerprint “recognition” for security, character recognition) Compression for storage, transmission from space probes, etc. Entertainment industry Manufacturing (e.g., part inspection) The course emphasis will be fundamental methods

Origins of Digital Image Processing • First digital picture produced from coded tape by a telegraph printer (1921) • Coding images in up to 15 grayscale levels! (1929)

Sent by submarine cable between London and New York, the transportation time was reduced to less than three hours from more than a week

Origins of Digital Image Processing • Using computers to improve images from JPL space probes (1964) • Images of the moon transmitted by Ranger 7 were processed to correct distortions

Sources for Images Electromagnetic (EM) energy spectrum Acoustic Ultrasonic Electronic Synthetic images produced by computer

Electromagnetic (EM) energy spectrum

Major uses Gamma-ray imaging: nuclear medicine and astronomical observations X-rays: medical diagnostics, industry, and astronomy, etc. Ultraviolet: lithography, industrial inspection, microscopy, lasers, biological imaging, and astronomical observations Visible and infrared bands: light microscopy, astronomy, remote sensing, industry, and law enforcement Microwave band: radar

Radio band: medicine (such as MRI) and astronomy

Light and EM Spectrum

c  

E  h , h : Planck's constant.

Light and EM Spectrum 

The colors that humans perceive in an object are determined by the nature of the light reflected from the object. e.g. green objects reflect light with wavelengths primarily in the 500 to 570 nm range while absorbing most of the energy at other wavelength



Monochromatic light: void of color Intensity is the only attribute, from black to white Monochromatic images are referred to as gray-scale images



Chromatic light bands: 0.43 to 0.79 um    

The quality of a chromatic light source: Radiance: total amount of energy Luminance (lm): the amount of energy an observer perceives from a light source Brightness: a subjective descriptor of light perception that is impossible to measure. It embodies the achromatic notion of intensity and one of the key factors in describing color sensation.

Examples: Gama-Ray Imaging

Examples: X-Ray Imaging

Examples: Ultraviolet Imaging

Examples: Light Microscopy Imaging

Examples: Visual and Infrared Imaging

Examples: Visual and Infrared Imaging

Examples: Infrared Satellite Imaging

Examples: Automated Visual Inspection

Examples: Automated Visual Inspection

Results of automated reading of the plate content by the system The area in which the imaging system detected the plate

Example of Radar Image

Examples: MRI (Radio Band)

Examples: Ultrasound Imaging

Some Applications -- Remote Sensing

Some Applications -- Transmitting Images

Some Applications -- Storing Images

Some Applications -- Image Forensics

Fundamental Steps in DIP Extracting image components

Improving the appearance

Result is more suitable than the original

Partition an image into its constituent parts or objects

Represent image for computer processing

Image Acquisition l

Image properties depend on: – – – – – –

Image acquisition parameters Camera distance, viewpoint, motion Camera intrinsic parameters (e.g., lens aberration) Number of cameras Illumination Visual properties of the 3D world captured

Image Acquisition Process

A Simple Image Formation Model f (x, y) = i(x, y)ir(x, y) f (x, y) : intensity at the point (x, y) i(x, y) : illumination at the point (x, y) (the amount of source illumination incident on the scene) r(x, y) : reflectance/transmissivity at the point (x, y) (the amount of illumination reflected/transmitted by the object) where 0 < i(x, y) < ¥ and 0 < r(x, y) < 1

Some Typical Ranges of illumination Illumination Lumen — A unit of light flow or luminous flux Lumen per square meter (lm/m2) — The metric unit of measure for illuminance of a surface – On a clear day, the sun may produce in excess of 90,000 lm/m2 of illumination on the surface of the Earth – On a cloudy day, the sun may produce less than 10,000 lm/m2 of illumination on the surface of the Earth

– On a clear evening, the moon yields about 0.1 lm/m2 of illumination – The typical illumination level in a commercial office is about 1000 lm/m2

Some Typical Ranges of Reflectance Reflectance – 0.01 for black velvet

– 0.65 for stainless steel – 0.80 for flat-white wall paint – 0.90 for silver-plated metal – 0.93 for snow

Image Sampling and Quantization

Digitizing the coordinate values Digitizing the amplitude values

Image Sampling and Quantization

Sampling and Quantization

real image

sampled

quantized

sampled & quantized

Sampling and Quantization column index

row index

pixel grid

real image

sampled

quantized

sampled & quantized

Sampling and Quantization Sampling

Take the average within each square.

I C  ,  

I S ( r, c )

continuous image

sampled image

Sampling and Quantization

Sampling

Take the average within each square.

I C  ,  

I S ( r, c )

continuous image

sampled image

Sampling and Quantization Sampling

Take the average within each square.

I C  ,  

I S ( r, c )

continuous image

sampled image

Sampling and Quantization

Sampling

Take the average within each square.

I C  ,  

I S ( r, c )

continuous image

sampled image

Sampling and Quantization

discrete color output

Digital Image Formation: Quantization

continuous colors mapped to a finite, discrete set of colors.

continuous color input

Representing Digital Images

Representing Digital Images The representation of an M×N numerical array as f (0,1) ... f (0, N  1)   f (0, 0)  f (1, 0)  f (1,1) ... f (1, N  1)  f ( x, y )     ... ... ... ...    f ( M  1, 0) f ( M  1,1) ... f ( M  1, N  1)  The representation of an M×N numerical array as  a0,0  a 1,0  A  ...   aM 1,0

a0,1 a1,1 ... aM 1,1

... a0, N 1  ... a1, N 1  ... ...   ... aM 1, N 1 

Representing Digital Images Discrete intensity interval [0, L-1], L=2k The number b of bits required to store a M × N digitized image b=M×N×k

Spatial and Intensity Resolution Spatial resolution – A measure of the smallest discernible detail in an image

– stated with line pairs per unit distance, dots (pixels) per unit distance, dots per inch (dpi)

Intensity resolution – The smallest discernible change in intensity level – stated with 8 bits, 12 bits, 16 bits, etc.

Spatial Resolution 1250dpi

300dpi

150dpi

72dpi

Spatial resolution – A measure of the smallest discernible detail in an image – stated with line pairs per unit distance, dots (pixels) per unit distance, dots per inch (dpi) – Dots (pixels) per inch – DPI – Examples: 

Newspapers 75dpi

Magazines Glossy

133dpi

brochures 175dpi

Intensity Resolution Intensity resolution – The smallest discernible change in intensity level – stated with 8 bits, 12 bits, 16 bits, etc.

Saturation

Image Processing Toolas and Softwates Matlab OpenCV ImageJ

Matlab Image Processing Toolbox Matlab is optimised for operating on matrices. Images are matrices! It provides a comprehensive set of reference-standard algorithms, functions, and apps for image processing, analysis, visualization, and algorithm development. You can perform image analysis, image segmentation, image enhancement, noise reduction, geometric transformations, and image registration. Many toolbox functions support multicore processors, GPUs, and C-code generation.

OpenCV OpenCV means Intel® Open Source Computer Vision Library. It is a collection of C functions and a few C++ classes that implement some popular Image Processing and Computer Vision algorithms. It has C++, C, Python and Java interfaces and supports Windows, Linux, Mac OS, iOS and Android. FREE for commercial and non-commercial uses Written in optimized C/C++, the library can take advantage of multi-core processing Available on Sourceforge – http://opencv.org/

– http://sourceforge.net/projects/opencvlibrary/

ImageJ ImageJ: Open source Java Image processing software Developed by Wayne Rasband at Nat. Inst for Health (NIH) – Many image processing algorithms already implemented – New image processing algorithms can also be implemented easily – Nice click‐and‐drag interface

Key Features – Interactive tools for image processing of images – Supports many image file formats (JPEG, PNG, GIF, TIFF,BMP, DICOM, FITS)

– Plug‐in mechanism for implementing new functionality, extending ImageJ –

Macro language + interpreter: Easy to implement large blocks from small pieces without knowing Java

ImageJ uses Java’s windowing system (AWT) for display – Programmer writes plugins to extend ImageJ

Image Processing Toolboxes In C/C++ – IPL ... : http://www.cs.nott.ac.uk/~jzg/nottsvision/old/index.html – OpenCV: http://sourceforge.net/projects/opencvlibrary – ImageMagick: http://www.imagemagick.org/ – Insight Toolkit ITK (medical image) : http://www.itk.org/ – mathtools.net: http://www.mathtools.net/C_C__/Image_Processing/

In Java – Java Media APIs: JAI, JMF, Java image I/O ...: http://java.sun.com/javase/technologies/desktop/media/

– http://www.mathtools.net/Java/Image_Processing/index.html

Python – Python Imaging Library (PIL) http://www.pythonware.com/products/pil/ numpy,

– SciKit,

scipy

Image Processing Software Bitmap editing: Adobe Photoshop, Macromedia Fireworks Vector graphics editing: Adobe Illustrator, Corel Draw Consumer photo tools: Picassa, ACDSee, Windows Paint, XV, Photoshop Elements