Share
Embed
Annual Pro sale · Save $30
Have presentations of your own?
Share with private links, password protection, and more control over your work.
Transcript
129 slides
-
Digital Image Processing Introduction (Week 1) NHSM - 4th year
- Fall 2026 - Prof. Mohammed Hachama [email protected] hachama.github.io/home -
Information about the course • Image processing courses • Introduction
to image processing (S7 - UEF721): Image = matrix • Computer vision (S8 - UEF823): More applications • Image processing (S9 - UEF911): Image = function (more elaborated mathematics) NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 2/23 -
Information about the course • Image processing courses • Introduction
to image processing (S7 - UEF721): Image = matrix • Computer vision (S8 - UEF823): More applications • Image processing (S9 - UEF911): Image = function (more elaborated mathematics) • UEF721 Course • 1 Lecture: slides, no written notes (see references if need be!) • 1 Tutorial/Practical session • 6 Chapters: 1 assignment + 1 problems set NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 2/23 -
Information about the course • Image processing courses • Introduction
to image processing (S7 - UEF721): Image = matrix • Computer vision (S8 - UEF823): More applications • Image processing (S9 - UEF911): Image = function (more elaborated mathematics) • UEF721 Course • 1 Lecture: slides, no written notes (see references if need be!) • 1 Tutorial/Practical session • 6 Chapters: 1 assignment + 1 problems set • Evaluation • Grade = Final Exam (/20) + Midterm (/20) + Bonus (/2) • After two absences: -1 point for each additional absence • Exams (Final and Midterm, 2 hours each): Theoretical (/10) + Practical (/10) NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 2/23 -
Information about the course • Syllabus: 15 weeks • Introduction
(1 week) • Spatial Processing (3 weeks) • Frequency-domain processing (3 weeks) • Mid-Term • Image Compression (2 week) • Image Segmentation (3 weeks) • Image Restoration (2 weeks) • Links • Google classroom • Professor: hachama.github.io/home/ NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 2/23 -
Information about the course • Prerequisites • Linear algebra •
Differential calculus • Probability and statistics • Fourier transform • Basics of optimization • Python programming NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 2/23 -
Information about the course • Books NHSM - 4th year:
Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 2/23 -
Information about the course • Similar courses • CS 131
Computer Vision: Foundations and Applications (Stanford University) • Introduction to Computer Vision, CS5670, Spring 2023, Cornell Tech, www.cs.cornell.edu/courses/cs5670/2024sp/ • 16-385 Computer Vision, Spring 2020, Carnegie Mellon, www.cs.cmu.edu/∼16385/ • YouTube lectures • Intro to Digital Image Processing, Rich Radke NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 2/23 -
Outline Introduction Image characteristics Digitization Geometric Transformations NHSM - 4th
year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 3/23 -
Introduction NHSM - 4th year: Digital Image Processing - Introduction
(Week 1) - M. Hachama ([email protected]) 4/23 -
Why automatic image processing? NHSM - 4th year: Digital Image
Processing - Introduction (Week 1) - M. Hachama ([email protected]) 5/23 -
Why automatic image processing? NHSM - 4th year: Digital Image
Processing - Introduction (Week 1) - M. Hachama ([email protected]) 5/23 -
Why automatic image processing? NHSM - 4th year: Digital Image
Processing - Introduction (Week 1) - M. Hachama ([email protected]) 5/23 -
Why automatic image processing? NHSM - 4th year: Digital Image
Processing - Introduction (Week 1) - M. Hachama ([email protected]) 5/23 -
Why automatic image processing? Importance of using automatic image processing!
NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 5/23 -
What is an image? Image = representation of a scene
• Scene: Set of objects that are in the field of vision • Light source: Sun, ambient lighting, spotlights, ... NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 6/23 -
What is an image? Image = matrix of intensities NHSM
- 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 6/23 -
What is an image? Image = matrix of intensities •
Image = numbers! • Red, Green, Blue (RGB), K = 3 • RGB: Usual color-space for acquisition and display • Color-spaces for different purposes: HSV (Hue, Saturation, Value), YUV, YCbCr. NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 6/23 -
What is an image? Image = matrix of intensities •
Discretization NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 6/23 -
What is an image? Image = matrix of intensities •
Quantization NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 6/23 -
What is an image? Intensities = information • Thermal Imaging:
temperature degrees NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 6/23 -
What is an image? Intensities = information • Magnetic resonance
imaging (MRI) NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 6/23 -
What is an image? Intensities = information • X-ray scans
NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 6/23 -
What is an image? Intensities = information • Radar Imaging
NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 6/23 -
What is an image? Image = A mathematical object •
Matrix/Tensor • Function I : E −→ F • Distribution • Random field • Surface/sub-manifold • ... NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 6/23 -
Image processing (1) What is image processing? • Transformation of
a digital image into another image or extracting features, primitives, or information. NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 7/23 -
Image processing (1) What is image processing? NHSM - 4th
year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 7/23 -
Image processing (1) What is image processing? NHSM - 4th
year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 7/23 -
Image processing (1) What is image processing? NHSM - 4th
year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 7/23 -
Image processing (2) Fundamental problems • Restoration NHSM - 4th
year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 8/23 -
Image processing (2) Fundamental problems • Restoration NHSM - 4th
year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 8/23 -
Image processing (2) Fundamental problems • Restoration NHSM - 4th
year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 8/23 -
Image processing (2) Fundamental problems • Deconvolution NHSM - 4th
year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 8/23 -
Image processing (2) Fundamental problems • Contours Detection NHSM -
4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 8/23 -
Image processing (2) Fundamental problems • Segmentation NHSM - 4th
year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 8/23 -
Image processing (2) Fundamental problems • Matching NHSM - 4th
year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 8/23 -
Image processing (2) Fundamental problems • Inpainting NHSM - 4th
year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 8/23 -
Image processing (2) Fundamental problems • Rigid Registration NHSM -
4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 8/23 -
Image processing (2) Fundamental problems • Non-Rigid Registration NHSM -
4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 8/23 -
Image processing (2) Fundamental problems • Non-Rigid Registration NHSM -
4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 8/23 -
Image processing (2) Fundamental problems • Non-Rigid Registration NHSM -
4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 8/23 -
Image processing (2) Fundamental problems • Non-Rigid Registration NHSM -
4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 8/23 -
Image processing (2) Fundamental problems • Image decomposition NHSM -
4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 8/23 -
Image processing (2) Fundamental problems • Image fusion NHSM -
4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 8/23 -
Image processing (3) Applications • Pattern recognition NHSM - 4th
year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 9/23 -
Image processing (3) Applications • Optical character recognition (OCR) NHSM
- 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 9/23 -
Image processing (3) Applications • Optical character recognition (OCR) NHSM
- 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 9/23 -
Image processing (3) Applications • Scene recognition NHSM - 4th
year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 9/23 -
Image processing (3) Applications • Inspection in manufacturing NHSM -
4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 9/23 -
Image processing (3) Applications • Compression NHSM - 4th year:
Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 9/23 -
Image processing (3) Applications • Medical imaging NHSM - 4th
year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 9/23 -
Image processing (3) Applications • Geographic Information Systems NHSM -
4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 9/23 -
Image processing (3) Applications • Geographic Information Systems NHSM -
4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 9/23 -
Image processing (3) Applications • Special effects NHSM - 4th
year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 9/23 -
Image processing (3) Applications • Biometric identification NHSM - 4th
year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 9/23 -
Image processing (3) Applications • Self-driving cars NHSM - 4th
year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 9/23 -
Image processing (3) Applications • Augmented Reality NHSM - 4th
year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 9/23 -
Image processing (3) Applications • Virtual Reality NHSM - 4th
year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 9/23 -
Image characteristics NHSM - 4th year: Digital Image Processing -
Introduction (Week 1) - M. Hachama ([email protected]) 10/23 -
Image = matrix • Image = Matrix (I : {1,
.., N} × {1, ..., M} −→ [0, 1]) • Pixel = indices + intensity NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 11/23 -
Image = matrix • Image = Matrix (I : {1,
.., N} × {1, ..., M} −→ [0, 1]) • Pixel = indices + intensity • Frame = Origin + Axes NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 11/23 -
Image = matrix • Image = Matrix (I : {1,
.., N} × {1, ..., M} −→ [0, 1]) • Pixel = indices + intensity • Frame = Origin + Axes • Pixel neighborhood system: 4-neighbors (2 horizontals + 2 verticals) NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 11/23 -
Image = matrix Pixel neighbors • 4-neighbors (2 horizontals +
2 verticals) (x + 1, y ), (x − 1, y ), (x , y + 1), (x , y − 1) • 4 diagonal (x + 1, y + 1), (x + 1, y − 1), (x − 1, y + 1), (x − 1, y − 1) • 8-Neighbors • Some pixels can call outside the image! NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 11/23 -
Image = matrix Distances between pixels • Given two pixels
p(x , y ) and q(s, t) • Manhattan distance: D1 (p, q) = |x − s|+|y − t| ? ? ? ? ? NHSM - 4th year: Digital Image Processing ? ? ? ? ? ? ? 0 ? ? ? ? ? ? ? - Introduction (Week 1) - ? ? ? ? ? M. Hachama ([email protected]) 11/23 -
Image = matrix Distances between pixels • Given two pixels
p(x , y ) and q(s, t) • Euclidean Distance: D2 (p, q) = [(x − s)2 + (y − t)2 ]1/2 ? ? ? ? ? NHSM - 4th year: Digital Image Processing ? ? ? ? ? ? ? 0 ? ? ? ? ? ? ? - Introduction (Week 1) - ? ? ? ? ? M. Hachama ([email protected]) 11/23 -
Image = matrix Distances between pixels • Given two pixels
p(x , y ) and q(s, t) • chessboard distance: D3 (p, q) = maximum(|x − s|, |y − t|) ? ? ? ? ? NHSM - 4th year: Digital Image Processing ? ? ? ? ? ? ? 0 ? ? ? ? ? ? ? - Introduction (Week 1) - ? ? ? ? ? M. Hachama ([email protected]) 11/23 -
Image = matrix Image = Vector representation NHSM - 4th
year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 11/23 -
Image = matrix Image = Vector representation Linear algebra tools:
linear operator, matrix decomposition, norms, optimization, ... NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 11/23 -
Types of regions NHSM - 4th year: Digital Image Processing
- Introduction (Week 1) - M. Hachama ([email protected]) 12/23 -
Characteristics For an image I: • Dynamic: max I −
min I • Luminance: Lum = Mean (I) • Contrast: 2 j=1 (I(i, j) − Lum) PN PM C1 = i=1 NHSM - 4th year: Digital Image Processing N.M - Introduction (Week 1) - , C2 = max I − min I max I + min I M. Hachama ([email protected]) 13/23 -
Format and storage • A bit (Binary-Digit) = ”The basic
element with which the computer works. Its value is 1 or 0. • 8 bits = 28 = 256 possible values (16 bits = 65.536). • 1 Byte = 1 octet = 8 bits. • Binary Image 512 × 512: 512 × 512 × 1 = 262144 bits = 32768 bytes. • 512 × 512 8-bit gray-level image: 512 × 512 × 1 = 262144 bytes. • 512 × 512 color image, with a byte used to store each color: 512 × 512 × 3 = 786432 bytes. • 2 hours color video: 1000x 1000x 24x 30x 60x 120 = 5184 × 109 bits = 648Go! NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 14/23 -
Format and storage • A bit (Binary-Digit) = ”The basic
element with which the computer works. Its value is 1 or 0. • 8 bits = 28 = 256 possible values (16 bits = 65.536). • 1 Byte = 1 octet = 8 bits. • Binary Image 512 × 512: 512 × 512 × 1 = 262144 bits = 32768 bytes. • 512 × 512 8-bit gray-level image: 512 × 512 × 1 = 262144 bytes. • 512 × 512 color image, with a byte used to store each color: 512 × 512 × 3 = 786432 bytes. • 2 hours color video: 1000x 1000x 24x 30x 60x 120 = 5184 × 109 bits = 648Go! We definitely need compression! NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 14/23 -
Format and storage • TIFF(.tif, .tiff): Tagged Image File Format,
no compression, high quality, large size. Good for printing. • JPEG (.jpg, .jpeg): Joint Photographic Experts Group, Lossy compression, reduced size. Good for digital cameras, web use. • GIF: Graphics Interchange Format, used for web graphics, can be animated, limited to 256 colors, allow for transparency, small size. • PNG: Portable Network Graphics , lossless, support 16 million colors. • EPS (.eps) Encapsulated PostScript, vector file type, can be opened in applications such as Adobe Illustrator or CorelDRAW. • RAW Image Files (.raw, .cr2, .nef, .orf, .sr2, dicom, ...): created by a camera or scanner, hold a lot of information (intensities + metadata), need to be processed in an editor. NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 14/23 -
Digitization NHSM - 4th year: Digital Image Processing - Introduction
(Week 1) - M. Hachama ([email protected]) 15/23 -
Digitization Sampling + quantification NHSM - 4th year: Digital Image
Processing - Introduction (Week 1) - M. Hachama ([email protected]) 16/23 -
Quantification (1) Tonal resolution: 1,2, ..., 8 bits NHSM -
4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 17/23 -
Quantification (1) Tonal resolution NHSM - 4th year: Digital Image
Processing - Introduction (Week 1) - M. Hachama ([email protected]) 17/23 -
Quantification (1) Application 1: Compression by reducing the tonal resolution
% Loading OpenCV library import cv2 as cv % Quantification ratio Q = 32 % Lecture of the input image im1 = cv.imread(’data/lake.jpg’,0) % Compression im2=(im1.astype(np.float32)/Q).astype(np.uint8) NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 17/23 -
Quantification (1) Application 1: Compression by reducing the tonal resolution
Original image/1 NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 17/23 -
Quantification (1) Application 1: Compression by reducing the tonal resolution
Image size/2 NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 17/23 -
Quantification (1) Application 1: Compression by reducing the tonal resolution
Image size/4 NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 17/23 -
Quantification (1) Application 1: Compression by reducing the tonal resolution
Image size/8 NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 17/23 -
Quantification (1) Application 1: Compression//False contours Image size/16 NHSM -
4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 17/23 -
Quantification (1) Application 1: Compression//Dithering: adding noise Image size/16 NHSM
- 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 17/23 -
Quantification (2) Application 2: Steganography Decimal/binary Representation 241 = (?
) × 20 + (? ) × 21 + (? ) × 22 + (? ) × 23 + (? ) × 24 + (? ) × 25 + (? ) × 26 + (? ) × 27 241 1 120 0 NHSM - 4th year: Digital Image Processing 60 0 30 0 15 1 - Introduction (Week 1) - 7 1 3 1 1 1 0 − M. Hachama ([email protected]) 18/23 -
Quantification (2) Application 2: Steganography Bitplanes: Original / Bit 1
NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 18/23 -
Quantification (2) Application 2: Steganography Bitplanes: Original / Bit 2
NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 18/23 -
Quantification (2) Application 2: Steganography Bitplanes: Original / Bit 3
NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 18/23 -
Quantification (2) Application 2: Steganography Bitplanes: Original / Bit 4
NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 18/23 -
Quantification (2) Application 2: Steganography Bitplanes: Original / Bit 5
NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 18/23 -
Quantification (2) Application 2: Steganography Bitplanes: Original / Bit 6
NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 18/23 -
Quantification (2) Application 2: Steganography Bitplanes: Original / Bit 7
NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 18/23 -
Quantification (2) Application 2: Steganography Bitplanes: Original / Bit 8
NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 18/23 -
Quantification (2) Application 2: Steganography (Secret message) NHSM - 4th
year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 18/23 -
Quantification (2) Application 2: Steganography (modification od bit 7) NHSM
- 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 18/23 -
Quantification (2) Application 2: Steganography (modification of bits 7, 6
and 5) NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 18/23 -
Sampling Spatial resolution: number of pixels NHSM - 4th year:
Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 19/23 -
Sampling Spatial resolution: number of pixels • dpi: dots per
inch (1 inch = 2.54 cm), ppp : points par pouce • Number of ”physical” pixels in an inch of a printed document. • ppc: points per centimeter ; ppm : points per millimeter • ppi (pixels per inch): # of ”squared” pixels in an inch of a screen. NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 19/23 -
Sampling Spatial resolution: number of pixels • Example 1. You
want to print a 13 × 10 cm photo. Your printer asks you to provide images with a resolution of at least 300 dpi. • minimal width: 13 × 300/2.54 = 1535 pixels • minimal height: 10 × 300/2.54 = 1181 pixels. NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 19/23 -
Sampling Spatial resolution: number of pixels • Example 2. A
screen set at 75 ppi displays a photo with dimensions of 15 × 12 cm. What is the size of the image in pixels? • 75ppi= 75/2.54 pixels/cm • Width of the image: 15 × 75/2.54 = 443 px • Height of the image: 12 × 75/2.54 = 354 px NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 19/23 -
Sampling Aliasing = Distortion in the signal due to a
low sampling frequency NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 19/23 -
Sampling Aliasing = Distortion in the signal due to a
low sampling frequency NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 19/23 -
Sampling Aliasing = Distortion in the signal due to a
low sampling frequency NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 19/23 -
Sampling Aliasing = Distortion in the signal due to a
low sampling frequency • The bands change direction and thickness. NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 19/23 -
Sampling Aliasing = Distortion in the signal due to a
low sampling frequency • The bands change direction and thickness. NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 19/23 -
Geometric Transformations NHSM - 4th year: Digital Image Processing -
Introduction (Week 1) - M. Hachama ([email protected]) 20/23 -
Transformations Geometric Transformations NHSM - 4th year: Digital Image Processing
- Introduction (Week 1) - M. Hachama ([email protected]) 21/23 -
Transformations Geometric Transformations • Direct Transformation: (i ′ , j
′ ) = T (i, j) NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 21/23 -
Transformations Geometric Transformations • Direct Transformation: (i ′ , j
′ ) = T (i, j) NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 21/23 -
Transformations Geometric Transformations • Direct Transformation: (i ′ , j
′ ) = T (i, j) NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 21/23 -
Transformations Geometric Transformations • Direct Transformation: (i ′ , j
′ ) = T (i, j) NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 21/23 -
Transformations Geometric Transformations • Direct Transformation: (i ′ , j
′ ) = T (i, j) NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 21/23 -
Transformations Geometric Transformations • Direct Transformation: (i ′ , j
′ ) = T (i, j) NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 21/23 -
Transformations Geometric Transformations • Direct Transformation: (i ′ , j
′ ) = T (i, j) • Points without images, Points outside the image NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 21/23 -
Transformations Geometric Transformations • Inverse Transformation: (i, j) = T
−1 (i ′ , j ′ ) • Interpolation: Nearest neighbor, Bi-linear, ... NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 21/23 -
Transformations Geometric Transformations • Translation: i′ j′ ! = 1
0 0 1 ! i j ! sin θ cos θ ! ti tj + ! • Rotation: x′ y′ ! = cos θ − sin θ x y ! + 0 0 ! • Coordinates relative to the center of the image • Exercise: Implement and run simulations. NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 21/23 -
Transformations Geometric Transformations • Rotation: Coordinates relative to the center
of the image NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 21/23 -
Transformations Geometric Transformations • Rotation: Interpolation by Nearest neighbor NHSM
- 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 21/23 -
Transformations Geometric Transformations • Rotation: Bi-linear Interpolation NHSM - 4th
year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 21/23 -
Transformations Geometric Transformations • Change of scale: i′ j′ !
= • Affine Deformation: ! i′ = j′ αi 0 0 αj ! a1 a3 a2 a4 ! i j ! ! + 0 0 i j ! ! + b1 b2 • Exercise: Implement and run simulations. NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 21/23 -
Image Interpolation Image Interpolation • Image interpolation is the process
of estimating pixel values at non-integer coordinates. • It is used in various applications such as resizing, rotating, and warping images. • Types of Image Interpolation • Replication • Nearest Neighbor Interpolation • Bilinear Interpolation • Bicubic Interpolation NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 22/23 -
Image Interpolation Pixel replication • Produces a “jagged” result since
each individual square pixel is made larger. NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 22/23 -
Image Interpolation Nearest Neighbor Interpolation • The simplest method where
the value of the nearest pixel is assigned to the interpolated pixel. • Formula: I(x ′ , y ′ ) = I(round(x ), round(y )) • I(x ′ , y ′ ) is the intensity value at the point (x ′ , y ′ ) in the output. • I(x , y ) is the intensity value at the point (x , y ) in the input image. • round(.) = round the coordinates to the nearest integer. NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 22/23 -
Image Interpolation Bilinear Interpolation • Uses a weighted average of
the closest 2 × 2 neighbors (four nearest pixels) to estimate the new pixel value. • Formula: I(x ′ , y ′ ) = 1 X 1 X I(x + i, y + j)(1 − |x ′ − (x + i)|)(1 − |y ′ − (y + j)|) i=0 j=0 The weights (1 − |x ′ − (x + i)|) and (1 − |y ′ − (y + j)|) are proportional to the distance of (x ′ , y ′ ) from the corresponding neighboring pixels. NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 22/23 -
Image Interpolation Bicubic Interpolation • Considers the closest 4 ×
4 neighbors (16 pixels) to estimate the new pixel value using cubic polynomials. • Formula: I(x ′ , y ′ ) = 2 2 X X I(x + i, y + j)W (i, x ′ )W (j, y ′ ) i=−1 j=−1 where W (k, t) is the cubic weight function. NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 22/23 -
Image Interpolation Comparison • Nearest neighbor is fast but may
produce blocky images. • Bilinear provides smoother images, but may blur details. • Bicubic gives better quality with more computational cost. NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 22/23 -
Image Interpolation What about image warping? NHSM - 4th year:
Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 22/23 -
Image Interpolation What about image warping? NHSM - 4th year:
Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 22/23 -
Assignment 1 Write a python code that depends on the
OpenCV library and that performs the following: 1. Read, display and save an image. 2. Manipulate pixels intensities and image channels. 3. Transform a matrix into a vector and vice-versa. 4. Compute and display some characteristics such as dynamic, luminance and contrast. 5. Perform compression by reducing the tonal resolution. 6. Perform different geometric transformations. 7. Perform a steganography. 8. Perform subsampling and upsampling. 9. Perfom image warping into a circle. NHSM - 4th year: Digital Image Processing - Introduction (Week 1) - M. Hachama ([email protected]) 23/23