Procesamiento Digital de Señales
Semana 3 – sesión 1
Acerca de una imágenes y técnicas de
procesamiento
Objetivos de la sesión
Objetivos de la sesión
Entender el proceso de digitalización de imagenes
Datos/Observaciones
What is anImage?
⚫ 2‐dimensional matrix of Intensity (gray or color) values
Image coordinates
Set of Intensity are
values integers
Laminas basado en los PPTs de Digital Image Processing (CS/ECE 545) @Prof Emmanuel Agu
What is anImage?
⚫ 2‐dimensional matrix of Intensity (gray or color) values
Image coordinates
Set of Intensity are
values integers
Example of Digital Images
a) Natural landscape
b) Synthetically generated scene
c) Poster graphic
d) Computer screenshot
e) Black and white illustration
f) Barcode
g) Fingerprint
h) X‐ray
i) Microscope slide
j) Satellite Image
k) Radar image
l) Astronomical object
Imaging System
Example: a camera Credits: Gonzales and Woods
Converts light to image
DigitalImage?
⚫Remember: digitization
causes a digital imageto
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
become an approximation of a realscene
1 pixel
Digital Image Digital Image
Real image Real image
(an approximation) (an approximation)
Digital Image
⚫ Common image formatsinclude:
⚫ 1 values per point/pixel (B&W or Grayscale)
⚫ 3 values per point/pixel (Red, Green, and Blue)
⚫ 4 values per point/pixel (Red, Green, Blue, + “Alpha” or Opacity)
Grayscale RGB RGBA
⚫ We will start with gray‐scale images, extend to color later
What is image Processing?
⚫ Algorithms that alter an input image to create new image
⚫ Input is image, output isimage
Image Processing
Algorithm
(e.g. Sobel Filter)
Original Image Processed Image
⚫ Improves an image for human interpretation in waysincluding:
⚫ Image display and printing
⚫ Image editting
⚫ Image enhancement
⚫ Image compression
Example Operation: Noise Removal
Think of noise as white specks on a picture (random or non-random)
Examples: Noise Removal
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Example: Contrast Adjustment
Example: Edge Detection
Example: Region Detection, Segmentation
Example: Image Compression
Example: ImageInpainting
Inpainting? Reconstruct corrupted/destroyed parts of an image
Examples: Artistic (Movie Special)Effects
Applications of ImageProcessing
⚫ dd
Applications of ImageProcessing
⚫ dd
Applications of Image Processing:Medicine
Original MRI Image of a Dog Heart Edge Detection Image
Applications of ImageProcessing
⚫ dd
Applications of Image Processing: Geographic Information Systems (GIS)
⚫ Terrain classification
⚫ Meteorology (weather)
Applications of Image Processing: Law Enforcement
⚫ Number plate recognition for speedcameras or
automated toll systems
⚫ Fingerprint recognition
Applications of Image Processing: HCI
⚫ Face recognition
⚫ Gesture recognition
Relationship with other Fields
Key Stages in Digital Image Processing
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Representation
Acquisition & Description
Object
Problem Domain
recognition
Colour Image Image
Processing Compression
Key Stages in Digital Image Processing: Image Aquisition
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Representation
Acquisition & Description
Example: Take a picture Object
Problem Domain
recognition
Colour Image Image
Processing Compression
Key Stages in Digital Image Processing: Image Enhancement
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Representation
Acquisition & Description
Example: Change contrast
Object
Problem Domain
recognition
Colour Image Image
Processing Compression
Key Stages in Digital ImageProcessing: Image Restoration
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Image Morphological
Restoration Processing
Example: Remove
Noise
Image
Segmentation
Enhancement
Image Representation
Acquisition & Description
Problem Domain Object
recognition
Colour Image Image
Processing Compression
Key Stages in Digital Image Processing: Morphological Processing
Extract
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Image Morphological attributes
Restoration Processing useful for
describing
image
Image
Segmentation
Enhancement
Image Representation
Acquisition & Description
Object
Problem Domain
recognition
Colour Image Image
Processing Compression
Key Stages in Digital ImageProcessing: Segmentation
Divide
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Image Morphological image into
Restoration Processing constituent
parts
Image
Segmentation
Enhancement
Image Representation
Acquisition & Description
Object
Problem Domain
recognition
Colour Image Image
Processing Compression
Key Stages in Digital ImageProcessing: Object Recognition
Image
regions
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Image Morphological transformed
Restoration Processing suitable for
computer
processing
Image
Segmentation
Enhancement
Image Representation
Acquisition & Description
Object
Problem Domain
recognition
Colour Image Image
Processing Compression
Key Stages in Digital ImageProcessing: Representation & Description
Finds &
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Image Morphological Labels
Restoration Processing objects in
scene (e.g.
motorbike)
Image
Segmentation
Enhancement
Image Representation
Acquisition & Description
Object
Problem Domain
recognition
Colour Image Image
Processing Compression
Key Stages in Digital ImageProcessing: Image Compression
Reduce
Image Morphological
image size
Restoration Processing (e.g. JPEG)
Image
Segmentation
Enhancement
Image Representation
Acquisition & Description
Object
Problem Domain
recognition
Colour Image Image
Processing Compression
Key Stages in Digital ImageProcessing: Colour Image Processing
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Representation
Acquisition & Description
Object
Problem Domain
recognition
Consider color
Colour Image Image
images (color
models, etc) Processing Compression
Mathematics for ImageProcessing
⚫ Calculus
⚫ Linear algebra
⚫ Probability and statistics
⚫ Differential Equations (PDEs andODEs)
⚫ Differential Geometry
⚫ Harmonic Analysis (Fourier, wavelet,etc)
About ThisCourse
⚫ Class is concerned with:
⚫ How to implement image processingalgorithms
⚫ Underlying mathematics
⚫ Underlying algorithms
⚫ This course is a lot of work. Requires:
⚫ Lots of programming in MATLAB
⚫ Lots of math, linear systems, fourieranalysis
Light And TheElectromagnetic Spectrum
⚫Light: just a particular part ofelectromagnetic
spectrum that can be sensed by the human eye
⚫The electromagnetic spectrum is split upaccording to
the wavelengths of different forms of energy
ReflectedLight
⚫The colours humans perceive are determinedby
nature of light reflected from an object
⚫For example, if whitelight
(contains all wavelengths)
is shone onto greenobject
it absorbs most wavelengths Colours
Absorbed
absorbed except green
wavelength (color)
Electromagnetic Spectrum andIP
⚫ Images can be made from any form of EM radiation
Images from Different EM Radiation
⚫ Radar imaging (radio waves)
⚫ Magnetic Resonance Imaging (MRI)(Radio waves)
⚫ Microwave imaging
⚫ Infrared imaging
⚫ Photographs
⚫ Ultraviolet imaging telescopes
⚫ X‐rays and Computedtomography
⚫ Positron emission tomography (gammarays)
⚫ Ultrasound (not EM waves)
Human Visual System: StructureOf The Human Eye
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
⚫The lens focuses light from objects onto the retina
⚫ Retina covered with light receptors
called cones (6‐7 million) and rods
(75‐150 million)
⚫ Cones concentrated around fovea.
Very sensitive to colour
⚫Rods more spreadout
• and sensitive to low illuminationlevels
Image Formation In TheEye
⚫Muscles in eye can change the shape of the lens
allowing us focus on near or far objects
⚫An image is focused onto retina exciting the rods and
cones and send signals to the brain
ImageFormation
⚫ The Pinhole Camera (abstraction)
⚫ First described by ancient Chinese and Greeks (300‐400AD)
Thin Lens
Brightness Adaptation & Discrimination
⚫The human visual system can perceiveapproximately
1010 different light intensity levels
⚫However, at anyone time we can only discriminate
between a much smaller number – brightness adaptation
⚫Similarly, perceived intensity of a region is related to the
light intensities of the regions surrounding it
Brightness Adaptation & Discrimination: Mach BandEffect
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Perceived intensity
overshoots or undershoots
at areas of intensity change
Brightness Adaptation & Discrimination
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
An example of simultaneous contrast
All inner squares have same intensity but appear darker as outer
square (surrounding area) gets lighter
Image Acquisition
⚫ Imagestypically generated byilluminating a scene
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
and absorbing energy reflected by scene objects
Image Sensing
⚫Incoming energy (e.g. light) lands on a sensor material
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
responsive to that type of energy, generating a voltage
⚫ Collections of sensors are arranged to capture images
Imaging Sensor
Line of Image Sensors
Array of Image Sensors
Spatial Sampling
⚫ Cannot record image values for all (x,y)
⚫ Sample/record image values at discrete(x,y)
⚫ Sensors arranged in grid to sample image
Image (Spatial) Sampling
⚫ A digital sensor
can only measure a limited number of
samples at a discrete set of energy levels
⚫ Sampling can be thought of as:
Continuous signal x comb function
Image Quantization
⚫ Quantization:process of converting continuous analog
signal into its digitalrepresentation
⚫ Discretize image I(u,v) values
⚫ Limit values image cantake
Image Sampling AndQuantization
⚫ Sampling
and quantization generates
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
approximation of a real worldscene
Image as DiscreteFunction
Image as aFunction
Representing Images
⚫ Image data structure is 2D array of pixel values
⚫ Pixel values are gray levels in range 0‐255 or RGB colors
⚫ Array values can be any data type (bit, byte, int, float,
double, etc.)
Spatial Resolution
⚫The spatial resolution of an image isdetermined by
how fine/coarse sampling wascarried out
⚫ Spatial resolution: smallest discernable imagedetail
⚫ Vision specialists
talk about image resolution
⚫ Graphic designers
talk about dots per
inch (DPI)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Spatial Resolution
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Spatial Resolution: Stretched Images
Intensity LevelResolution
⚫Intensitylevel resolution: number of intensitylevels
used to represent theimage
⚫ The more intensity levels used, the finer the level of detail
discernable in an image
⚫ Intensity level resolution usually given in terms of number
of bits used to store each intensity level
Number of
Number of Bits Examples
Intensit
y
Levels
1 2 0, 1
2 4 00, 01, 10, 11
4 16 0000, 0101, 1111
8 256 00110011, 01010101
16 65,536 1010101010101010
Intensity LevelResolution
256 grey levels (8 bits per pixel) 128 grey levels (7 bpp) 64 grey levels (6 bpp) 32 grey levels (5 bpp)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
16 grey levels (4 bpp) 8 grey levels (3 bpp) 4 grey levels (2 bpp) 2 grey levels (1 bpp)
Saturation & Noise
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Saturation: highest intensity
value above which color is
washed out
Noise: grainy texture pattern
Resolution: How Much IsEnough?
⚫The big question with resolution is always how much
is enough?
⚫ Depends on what is in the image (details) and what
you would like to do with it (applications)
⚫ Key questions:
⚫ Does image look aesthetically pleasing?
⚫ Can you see what you need to see in image?
Resolution: How Much IsEnough?
⚫Example: Picture on right okay for counting number
of cars, but not for reading the number plate
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Low Detail
Intensity LevelResolution
Medium Detail
High Detail
Image FileFormats
⚫ Hundreds of image file formats.Examples
⚫ Tagged Image File Format (TIFF)
⚫ Graphics Interchange Format (GIF)
⚫ Portable Network Graphics(PNG)
⚫ JPEG, BMP, Portable Bitmap Format (PBM),etc
⚫ Image pixel values canbe
⚫ Grayscale: 0 – 255 range
⚫ Binary: 0 or 1
⚫ Color: RGB colors in 0‐255 range (or other color model)
⚫ Application specific (e.g. floating point values inastronomy)
How many Bits Per ImageElement?
Introduction to ImageJ
⚫ ImageJ: Open source Java Image processingsoftware
⚫ Developed by Wayne Rasband at Nat. Inst for Health (NIH)
⚫ Manyimage processing algorithms already implemented
⚫ New image processing algorithms can also be implemented easily
⚫ Nice click‐and‐drag interface
Wayne Rasband (right)
ImageJ: KeyFeatures
⚫ 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 SoftwareArchitecture
⚫ ImageJ uses Java’s windowing system (AWT) for display
⚫ Programmer writes plugins toextend ImageJ
⚫ Already implemented plugins available throughImageJ’s
plugins menu
First ImageJ Example: Invert Image
⚫ Task: Invert 8‐bit grayscale (M x N) image
⚫ Basically, replace each image pixel with its complement
⚫ We shall call plugInMy_Inverter
⚫ Name of Java Class:My_Inverter
⚫ Name of source file:My_Inverter.java
⚫ “_” underscore makes ImageJ recognize source file as plugin
⚫ After compilation, automatically inserted intoImageJ menu
Ejercicios
Ejercicios, invertir imágenes en Matlab y comparar con ImageJ
Cierre
-….
References
⚫ Wilhelm Burger and MarkJ.Burge, Digital Image
Processing, Springer, 2008
⚫ University of Utah, CS 4640: Image Processing Basics,
Spring 2012
⚫ Gonzales and Woods, Digital Image Processing (3rd
edition), Prentice Hall
⚫ Digital Image Processing slides by Brian Mac Namee