0% found this document useful (0 votes)
21 views24 pages

Geometry

The document discusses various methods of image interpolation including nearest neighbor, linear, and bilinear interpolation. It explains how these techniques can be used to change the size or orientation of an image through scaling and rotation. Examples are provided to demonstrate nearest neighbor, bilinear, and bicubic interpolation on a sample image.

Uploaded by

Nisa Zaira
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views24 pages

Geometry

The document discusses various methods of image interpolation including nearest neighbor, linear, and bilinear interpolation. It explains how these techniques can be used to change the size or orientation of an image through scaling and rotation. Examples are provided to demonstrate nearest neighbor, bilinear, and bicubic interpolation on a sample image.

Uploaded by

Nisa Zaira
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 24

Image Geometry

Image Geometry
• Change the shape, size , or orientation of
an image, for printing/viewing purposes.

• Affine transformation
– Lines are transformed to lines


Data Interpolation
• Suppose we have a collection of four values that
we wish to enlarge to eight.
• Spatial transformation

x 1 2 3 4

x' 1 2 3 4 5 6 7 8

• Interpolation:
Interpolation estimate f(x') from f(x)
Data Interpolation
• In digital (discrete), none of the new points coincide
exactly with an original point except for the first and
last.

• We have to estimate function values f(x') based on the


known values of nearby f(x).

• Such estimation of function values based on


surrounding values is called interpolation.
interpolation
Nearest-neighbor Interpolation
• Estimate from the closest point
Linear Interpolation
• Join original values by straight lines and
interpolate values at those lines
Linear Interpolation

F  f ( x1 ) f ( x2 )  f ( x1 )

 1

F  f ( x2 )  (1   ) f ( x1 )
Data Interpolation - Example

f ( x1 )  2, f ( x2 )  3, f ( x3 )1.5, f ( x4 )  2.5

f ( x4 ' )  2
7 f ( x3 )  75 f ( x2 )  2.5714

f ( x7 ' )  4
7 f ( x4 )  73 f ( x3 )  2.0714
Image Interpolation
Open circle=original
Bilinear Interpolation

f ( x, y ' )  f ( x, y  1)  (1   ) f ( x, y )
f ( x  1, y ' )  f ( x  1, y  1)  (1   ) f ( x  1, y )

f ( x' , y ' )  f ( x  1, y ' )  (1   ) f ( x, y ' )

f ( x' , y ' )  f ( x  1, y  1)   (1   ) f ( x  1, y )


 (1   ) f ( x, y  1)  (1   )(1   ) f ( x, y )
rescale Function
from skimage import data, color, io
from skimage.transform import rescale

image = color.rgb2gray(data.camera())
head=image[140:190,255:325]
head4n=rescale(head,2,order=0)
headbilinear=rescale(head,2,order=1)

io.imshow(head4n)
NN
bilinear
General Interpolation
f ( x' )  R ( ) f ( x1 )  R (1   ) f ( x2 )
General Interpolation
Nearest  neighbor Interpolation :
0 , if u  0.5

R0  1 , if  0.5  u  0.5
0 , if u  0.5

Linear Interpolation :
1  u , if u0
R1  
1  u , if u0
Cubic Interpolation
1.5 | u |3 2.5 | u |2 1, if | u | 1
R3 (u )  
 0.5 | u |3 2.5 | u |2 4 | u | 2, if 1 | u | 2
f ( x' )  R3 (1   ) f ( x1 )  R3 ( ) f ( x2 )  R3 (1   ) f ( x3 )  R4 (2   ) f ( x4 )
Cubic Interpolation
Cubic Interpolation
headbicubic=rescale(head,4,order=3)
Scaling Smaller
• Scaling smaller is called image minimization.
minimization
• Subsampling : making image smaller by deleting
pixels (nearest neighbor approach)
• Subsampling does not give good result
• To solve the problem
– Apply a lowpass filter (averaging) before subsampling
– Apply data interpolation (e.g. bicubic)

smallerimage=rescale(image,0.25,order=0)
Rotation
 x '  cos   sin    x 
 y '  sin  cos    y 
     
 x   cos  sin    x ' 
 y     sin  cos    y '
     
Image Rotation
• Filled circles indicate the original position, and the open
circles point their positions after rotation.
• Must ensure that even after rotation, the points remain in a
grid.
Rotation
• The gray value at (x", y") can be found by interpolation,
using surrounding gray values.
• This value is then the gray value for the pixel at (x', y') in the
rotated image.
rotate Function

• Example:
from skimage import data, color, io
from skimage.transform import rescale ,rotate

image = color.rgb2gray(data.camera())
head4n=rotate(image,60,order=0)

io.imshow(head4n)
Rotation Examples

Ch6-p.139

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy