DIGITAL IMAGE PROCESSING
(Course Code: CSE 4007)
Module-1:
Image Interpolation
Techniques
Interpolation
✔ What is image interpolation?
• a technique in digital image processing that involves transferring an image from one resolution to
another (image resize)
• Interpolation is the process of using known data to estimate values at unknown locations
✔ Why do we need image interpolation?
• We want BIG images
• We want GOOD images
Dr. Ashish Gupta
Sr. Assistant Professor, SENSE
Interpolation 2
INCREASING RESOLUTION
Dr. Ashish Gupta
Sr. Assistant Professor, SENSE
3
IMAGE INPAINTING
Dr. Ashish Gupta
Sr. Assistant Professor, SENSE
4
IMAGE WRAPPING
Dr. Ashish Gupta
Sr. Assistant Professor, SENSE
5
UPSAMPLING
Dr. Ashish Gupta
Sr. Assistant Professor, SENSE
6
UPSAMPLING
Dr. Ashish Gupta
Sr. Assistant Professor, SENSE
7
UPSAMPLING
Dr. Ashish Gupta
Sr. Assistant Professor, SENSE
8
1D- ZERO REPLICATION
Dr. Ashish Gupta
Sr. Assistant Professor, SENSE
9
1D- FIRST ORDER REPLICATION
Dr. Ashish Gupta
Sr. Assistant Professor, SENSE
10
1D- FIRST ORDER REPLICATION
Dr. Ashish Gupta
Sr. Assistant Professor, SENSE
11
LINEAR INTERPOLATION FORMULA
Dr. Ashish Gupta
Sr. Assistant Professor, SENSE
12
1D- THIRD-ORDER REPLICATION
Dr. Ashish Gupta
Sr. Assistant Professor, SENSE
13
GRAPHICAL REPRESENTATION OF INTERPOLATION TECHNIQUES
Dr. Ashish Gupta
Sr. Assistant Professor, SENSE
14
BASIC INTERPOLATION TECHNIQUES
⮚ Nearest neighbor Interpolation
⮚ Bilinear Interpolation
⮚ Bicubic Interpolation
Dr. Ashish Gupta
Sr. Assistant Professor, SENSE
15
Nearest Neighbor Interpolation
Dr. Ashish Gupta
Sr. Assistant Professor, SENSE
16
Nearest Neighbor Interpolation
⮚ Nearest Neighbor Interpolation is a simple and commonly used technique in image
processing.
⮚ It is used to resize or scale images, especially when increasing the size.
⮚ Nearest Neighbor Interpolation selects the pixel value from the original image that is
closest to the desired position in the resized image.
⮚ It avoids complex calculations and uses the existing pixel values directly.
Dr. Ashish Gupta
Sr. Assistant Professor, SENSE
17
Nearest Neighbor Interpolation
Steps:
⮚ Determine the desired size of the output image. (6,6)
⮚ Calculate the scaling factors for both width and height. (2,2)
⮚ For each pixel in the output image:
⮚ Find the corresponding position in the original image using the scaling factors. (1,2,3,4,5,6)/2 (0.5 1 1.5 2
2.5 3)
⮚ Round the position to the nearest integer coordinates. (1 1 2 2 3 3)
⮚ Assign the pixel value from the original image to the corresponding position in the output image.
⮚ Perform Pixel replication row wise and Column Wise
Dr. Ashish Gupta
Sr. Assistant Professor, SENSE
18
Nearest Neighbor Interpolation
⮚ Increase Size to 6*6
⮚Calculate for 8*8?
Dr. Ashish Gupta
Sr. Assistant Professor, SENSE
19
Bilinear Interpolation
⮚ Bilinear Interpolation is a widely used technique in image processing for resizing or
scaling images.
⮚ It offers a smoother and more visually pleasing result compared to Nearest Neighbor
Interpolation.
⮚ Bilinear Interpolation takes into account the neighboring pixels surrounding the desired
position in the resized image.
⮚ It calculates a weighted average of these neighboring pixels to determine the pixel value
at the desired position.
Dr. Ashish Gupta
Sr. Assistant Professor, SENSE
20
Bilinear Interpolation
Steps:
⮚ Determine the desired size of the output image. (4,4)
⮚ Calculate the scaling factors for both width and height. (2,2)
⮚ For each pixel in the output image:
⮚ Find the corresponding position in the original image using the scaling factors.
⮚ Identify the neighboring pixels surrounding the position.
⮚ Calculate the weighted average of these pixels based on their distance from the desired position.
⮚ Assign the resulting pixel value to the corresponding position in the output image.
⮚ Perform Pixel replication row wise and Column Wise
Dr. Ashish Gupta
Sr. Assistant Professor, SENSE
21
Bilinear Interpolation
⮚ 1 2
3 4
Dr. Ashish Gupta
Sr. Assistant Professor, SENSE
22
Nearest Neighbor vs Bilinear Interpolation
⮚
Dr. Ashish Gupta
Sr. Assistant Professor, SENSE
23
24