Digital Image Processing
Preliminary Lect
1
Intro & Affiliations
Muhammad Usman Akram, PhD Computer Engineering
Area of research: Analysis of medical images/signals using Image/signal
processing and Machine Learning Techniques
Email: [email protected]
Contact: 0333691391
www.biomisa.org/usman
www.biomisa.org
www.risetech.pk
www.albasr.com
www.ekko.pk
2
Text Book & References:
• Rafael C. Gonzalez and Richard E.
Woods, Digital Image Processing,
4rd Edition, 2018 (available from
local market)
• Rafael C. Gonzalez and Richard E.
Woods, Digital Image Processing using
MATLAB, 3rd Edition, 2020 (available
from local market) (available from local
market)
• Class slides & selected research
papers to be shared by the instructor
Course Information
• Course Material
– Lectures slides, assignments (computer/written),
solutions to problems, projects, and announcements
will be uploaded on course web page, Google Drive
and LMS.
http://biomisa.org/usman/digital-image-processing-sp-21.html
Grading Policy
Course Assessment
Exam: 2 Sessional and 1 Final
Home work: 3 graded Assignments, 02-04 home tasks (non graded)
Lab reports: 12-13 reports, 01 open Lab, 01 Lab Final
Design reports: 1 Design report and 2 presentations based on Semester Project (First 3 Min Brief,
Second 10 Min complete project presentation)
Quizzes: 6-8 Quizzes
Theory (67%) Lab (33%)
Lab Work/Tasks 30%
2 One Hour Tests 30%
(Every week)
(OHTs):
Open Lab 10%
Grading: Quizzes: 10% Lab Final 10%
Assignments 10% Home Tasks 05%
Final Project 25%
Final Exam 50%
Image Processing 20%
Challenge’21
Course Contents
• Introduction to Image processing (Chapter – 1, 2)
• Image processing Fundamentals (Chapter-2)
• Image Enhancement (Spatial & Frequency Domain) (Chapter – 3, 4)
• Morphological operations (Chapter – 9)
• Segmentation (Chapter – 10, Online material, David Forsyth)
• Texture analysis (Chapter – 11, Online material, David Forsyth )
• Image Pyramids & Wavelets (Chapter – 07, Online material, David Forsyth )
• Image representation and description (Chapter – 11)
• Introduction to Machine Learning and Convolutional Neural Networks (Chapter – 12
& Stanford course on CNN)
Contents Breakdown
1. Introduction to image processing and it fundamentals 6 hrs
a. Basics of image processing
b. Image resolution
c. Connected component analysis
2. Image enhancement in spatial domain 5 hrs
a. Intensity transformations
b. Histogram and its analysis
c. Convolution and spatial filtering
3. Edge Detection and analysis 2 hrs
a. Edge segmentation (magnitude and Phase Analysis)
b. Hough Transform
4. Segmentation using thresholding and clustering 2 hrs
a. Global, local and adaptive thresholding
b. K-means clustering
c. Region growing and splitting based segmentation
5. Color image processing 1.5 hrs
a. Formation of color image
b. Different color models
c. Analysis of colored images
6. Morphological operations for binary and gray images 2 hrs
a. Introduction to morphological operations
b. Morphological operation for binary images
c. Gray level morphological operations
Contents Breakdown
7. Image enhancement in frequency domain 3 hrs
a. Basic concepts related to Fourier transform
b. Sampling in frequency domain and introduction to DFT
c. Filtering in frequency
8. Texture Analysis 2 hrs
a. Statistical descriptors
b. GLCM analysis
c. Spectral descriptors
9. Convolution Neural Networks 6 hrs
a.Basic concepts of CNNS
b.Calculating parameters and layer size for CNN architectures
c.Segmentation and Object detection
10. Descriptors 2 hrs
a. Local Binary Pattern
b. Histogram of oriented gradients
1. Lab Experiments
Lab Breakdown
Lab 01 Installation & Introduction to Python and OpenCV
Lab 02 Basic Image Processing (Group formation for semester project and Image Processing Challenge)
Lab 03 Connected Component Analysis (Assignment-1: Using Connect Component for Image Analysis )
Lab 04 Transformation Operations (Project Assignment)
Lab 05 Histogram Equalization and other transformations (Brief on Image Processing Challenge)
Lab 06 Spatial Filtering (3 Minute presentation on project Idea)
Edge Detection and Segmentation (Assignment-2 Use of filtering, edge detection and segmentation for
Lab 07
image analysis)
Lab 08 Open Lab
Lab 09 Morphological Operations (Seminar on using GitHub)
Lab 10 Color Processing
Lab 11 Frequency Analysis
Lab 12 Texture Based Descriptors (Assignment-3: Use of Color, frequency and textures for feature extraction)
Lab 13 Introduction to Machine Learning and Convolutional Neural Network
Lab 14 Image Classification using CNN with Tensorflow
Lab 15 Image Segmentation and Object detection (Submission of Image processing Challenge’21 data on GitHub and
winners announcement)
Lab 16 Lab Final (Project Presentation and submission after Exam)
Lab Rubrics
Unsatisfactory (0-3 marks) Satisfactory (4-6 marks) Good (7-8 marks) Excellent (9-10 marks)
Specifications Completed less than 70% of the Completed between 70-80% Completed between 80- Completed between 90-100% of
Weight = 35% requirements. of the requirements. 90% of the requirements. the requirements.
Coding No name, date, or Includes name, date, and Includes name, date, and Includes name, date, and
Standards/ assignment/task title included assignment/task title. assignment/task title. assignment/task title.
Time Efficiency Poor use of white space White space makes program Good use of white space. Excellent use of white space.
Weight = 20% (indentation, blank lines). fairly easy to read. Organized work. Creatively organized work.
Disorganized and messy Organized work. Good use of variables (no Excellent use of variables (no
Poor use of variables (many Good use of variables (few global variables, global variables, unambiguous
global variables, ambiguous global variables, unambiguous naming) naming).
naming). unambiguous naming). Delivered on time, and in Delivered on time, and in
Not delivered on time or not in Delivered on time, and in correct format (disk, email, correct format (disk, email, etc.)
correct format (disk, email, etc.) correct format (disk, email, etc.)
etc.)
Documentation No documentation included. Basic documentation has Clearly documented Clearly and effectively
Weight = 15% been completed including including descriptions of documented including
descriptions of all variables. all variables. descriptions of all variables.
Purpose is noted for each Specific purpose is noted Specific purpose is noted for
function. for each function and each function, control structure,
control structure. input requirements, and output
results.
Runtime/Outp Does not execute due to errors. Executes without errors. Executes without errors. Executes without errors
ut User prompts are misleading or User prompts contain little User prompts are excellent user prompts, good
Weight = 15% non-existent. information, poor design. understandable, minimum use of symbols, spacing in
No testing has been completed. Some testing has been use of symbols or spacing output.
completed. in output. Thorough and organized testing
Thorough testing has been has been completed and output
completed from test cases is included.
Efficiency A difficult and inefficient A logical solution that is Solution is efficient and Solution is efficient, easy to
Weight = 15% solution. easy to follow but it is not easy to follow (i.e. no understand, and maintain.
the most efficient. confusing tricks).
Trait
Project Rubrics
Unsatisfactory Satisfactory Good Exceptional
(0-3) (4-6) (7-8) (9-10)
Understanding of Problem 25%
Problem There is no knowledge of The depth of the problem is very The depth of problem is The depth of the problem
Understanding the problem depth. weak. understood to a sufficient is exceptionally
Weight = 15% level. understood.
Review No effort made to cover Related work covered is very Related work of the Related work of the
Weight = 10% related work of the sketchy. problem is covered problem is covered to an
selected problem. sufficiently except for the excellent extent.
latest developments.
Presentation and Demonstration Skills 25%
Demonstration The demonstration is poor The demonstration is Good skills while Excellent command of
Weight = 25% with no organization and unorganized and cross demonstrating project and project is shown with
fails at the cross questioning session is sketchy. fairing fairly good in cross exceptional question
questioning session. questioning answer session.
Coding and Documentation 50%
Specifications The program is producing The program produces correct The program works and The program works and
Weight = 30% incorrect results. results but does not display produces the correct meets all of the
them correctly. results and displays them specifications.
correctly. It also meets
most of the other
specifications.
Readability The code is poorly The code is readable only by The code is fairly easy to The code is exceptionally
Weight = 10% organized and very difficult someone who knows what it is read. well organized and very
to read. supposed to be doing. easy to follow.
Report The documentation is The documentation is simply The documentation The documentation is well
(Documentation) simply comments comments embedded in the consists of embedded written and clearly explains
Weight = 10% embedded in the code and code with some simple header comment and some simple what the code is
does not help the reader comments separating routines. header documentation accomplishing and how.
understand the code. that is somewhat useful in
understanding the code.
Course Learning Outcome
Learning
Course Learning Outcome (CLOs) PLOs Level Assessments
Understanding the fundamentals and basic concepts Q1, Q2, A1,
CLO 1 of image processing related to image enhancement, PLO 1 C2 OHT-1, Final
filtering and segmentation etc 1-question
Performing different mathematical transformations, Q3, Q4, A2,
histogram based operations and filtering concepts OHT2, Final 1-
CLO 2 PLO 2 C3
for solving image enhancement and feature question
extraction problems
Combining the concepts of image processing with Q6, A3, Final
machine learning to analyze and design decision 1-question
CLO 3 PLO 3 C4, C6
support systems for image processing based
applications
Learning the use of Python and OpenCV to Labs, Open
CLO 4 implement basic image processing algorithms and to PLO 5 P4 Labs, Project,
solve real life and open ended problems Presentation
CODE OF ETHICS
• All students must come to class on time (Attendance
will be taken in first 5 to 10 mins)
• Students should remain attentive during class and
avoid use of Mobile phone, Laptops or any gadgets
• Obedience to all laws, discipline code, rules and
community norms
• Respect peers, faculty and staff through actions and
speech
• Bring writing material and books
• Class participation is encouraged
•
Policies
No extensions in assignment deadlines.
• Quizzes will be unannounced.
• Final Exam will be OPEN book
• No Attendance and marking of lab tasks if late more than 15 min
• Never cheat.
– “Better fail NOW or else will fail somewhere LATER in life”
• Plagiarism will also have strict penalties.
Adapted from What is Plagiarism PowerPoint
Courtesy Dr. Khawar http://mciu.org/~spjvweb/plagiarism.ppt
in g
ss Ima
c e g
ro eA
nal
e P y s is
ag
Im
i t i on
c ogn
Re ion
at t ern V is
P e
Com hin
pute ac
r Vis M
ion
Image Processing & Machine Vision
From Image Processing to Machine Vision:
low, mid and high-level processes
Low Level Process
Input: Image
Output: Image
Examples: Noise
removal, image
sharpening
Image Processing
16
Example: Low Level Processing
17
Image Processing & Machine Vision
From Image Processing to Machine Vision:
low, mid and high-level processes
Low Level Process Mid Level Process
Input: Image Input: Image
Output: Image Output: Attributes
Examples: Noise Examples: Object
removal, image recognition,
sharpening segmentation
Image Processing
18
Example: Mid Level Processing
Segmentation of image into regions
19
Image Processing & Machine Vision
Fr om Image Pr oces sin gt o Mach in eVisi on :
l o w, mi d an d h i gh -l evel p ro cess es
Low Level Process Mid Level Process High Level Process
Input: Image Input: Image Input: Attributes/Image
Output: Image Output: Attributes Output: Understanding
Examples: Noise Examples: Object Examples: Scene
removal, image recognition, understanding,
sharpening segmentation autonomous navigation
Image Processing Machine Vision
20
Example: High Level Processing
Object Classification
21
Image Processing & Machine Vision
Fr om Image Pr ocess in gt o Mach ine Visi on :
l o w, mi d an d h i gh -l evel p ro cess es
InInthis
thiscourse
course
Some
Someofofthis
thisas
aswell
well
Low Level Process Mid Level Process High Level Process
Input: Image Input: Image Input: Attributes/Image
Output: Image Output: Attributes Output: Understanding
Examples: Noise Examples: Object Examples: Scene
removal, image recognition, understanding,
sharpening segmentation autonomous navigation
Image Processing Machine Vision
22
Why Image Processing?
• Images and video are everywhere!
Personal photo albums Movies, news, sports
Surveillance and security Medical and scientific images
Slide credit; L. Lazebnik
Summary of Applications
Problem Domain Application Input Pattern Output Class
Document Image Optical Character Document Image Characters/words
Analysis Recognition
Document Classification Internet search Text Document Semantic categories
Document Classification Junk mail filtering Email Junk/Non-Junk
Multimedia retrieval Internet search Video clip Video genres
Speech Recognition Telephone directory Speech waveform Spoken words
assistance
Natural Language Information extraction Sentence Parts of Speech
Processing
Biometric Recognition Personal identification Face, finger print, Iris Authorized users for
access control
Medical Computer aided Microscopic Image Healthy/cancerous cell
diagnosis
Military Automatic target Infrared image Target type
recognition
Industrial automation Fruit sorting Images taken on Grade of quality
conveyor belt
Bioinformatics Sequence analysis DNA sequence Known types of genes
24
Image Sources
• Electromagnetic (EM) band imaging
– Gamma ray band images
– X-ray band images
– Ultra violet band images
– Visual light and infra-red images
– Images based on micro waves or radio waves
• Non-EM band imaging
– Acoustic and ultrasonic images
– Electron microscopy
– Computer generated images (synthetic)
Light & EM Spectrum
• EM Waves
– A stream of mass less particles each travelling in a
wave like pattern, moving at the speed of light and
contains a certain bundle of energy
– The electromagnetic spectrum is split up in to bands
according to the energy per photon
Highest
HighestEnergy
Energy Lowest
LowestEnergy
Energy
Visible light is just a particular part of the electromagnetic spectrum that can be
sensed by the human eye
Light & EM Spectrum
Examples: Imaging in EM bands
Spectral Band Example
Gamma-Rays Nuclear Medicine (Radioactive isotope
injected in the patient)
X-Rays Medical Diagnostic
Ultraviolet Fluorescence microscopy
Visible & Infrared Remote sensing, industrial inspection,
…
Microwave Radar
Radio Medicine – MRI
Examples: Imaging other Modalities
• Sound
– Geological Applications – Oil and Gas Exploration
– Medicine – Ultrasound Imaging
• Synthetic Images
– Computer generated
A synthetic image
Key Stages in DIP
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Representation
Acquisition & Description
Object
Problem Domain Recognition
Colour Image Image
Processing Compression
Key Stages in DIP
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Representation
Acquisition & Description
Object
Problem Domain Recognition
Colour Image Image
Processing Compression
Key Stages in DIP
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Representation
Acquisition & Description
Object
Problem Domain Recognition
Colour Image Image
Processing Compression
Key Stages in DIP
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Representation
Acquisition & Description
Object
Problem Domain Recognition
Colour Image Image
Processing Compression
Key Stages in DIP
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Representation
Acquisition & Description
Object
Problem Domain Recognition
Colour Image Image
Processing Compression
Key Stages in DIP
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Representation
Acquisition & Description
Object
Problem Domain Recognition
Colour Image Image
Processing Compression
Key Stages in DIP
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Representation
Acquisition & Description
Object
Problem Domain Recognition
Colour Image Image
Processing Compression
Key Stages in DIP
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Representation
Acquisition & Description
Object
Problem Domain Recognition
Colour Image Image
Processing Compression
Key Stages in DIP
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Representation
Acquisition & Description
Object
Problem Domain Recognition
Colour Image Image
Processing Compression
Key Stages in DIP
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Representation
Acquisition & Description
Object
Problem Domain Recognition
Colour Image Image
Processing Compression
Readings from Book (3 Edn.)
rd
• Chapter - 1
Acknowledgements
Statistical Pattern Recognition: A Review – A.K Jain et al., PAMI (22) 2000
Material in these slides has been taken from, the following resources
Pattern Recognition and Analysis Course – A.K. Jain, MSU
Pattern Classification” by Duda et al., John Wiley & Sons.
Digital Image Processing”, Rafael C. Gonzalez & Richard E. Woods, Addison-Wesley, 2008
Machine Vision: Automated Visual Inspection and Robot Vision”, David Vernon, Prentice Hall,
1991
www.eu.aibo.com/
Advances in Human Computer Interaction, Shane Pinder, InTech, Austria, October 2008
42