SlideShare a Scribd company logo
Image Processing
Ch2: Digital image
Fundamentals
Part 2
Prepared by: Tahani Khatib
Zooming (over sampling) images
Ch2, lesson2: Zooming and shrinking
Zoomed by
using
nearest
neighbor
Zoomed by
using
Bilinear
Zooming (over sampling) images
Ch2, lesson2: Zooming and shrinking
Zooming requires 2 steps:
􀂁 The creation of new pixel locations.
􀂁 The assignment of gray levels to these new
locations.
Two techniques for zooming:
1. Nearest neighbor interpolation
2. Bilinear interpolation
Nearest neighbor interpolation
Ch2, lesson2: Zooming and shrinking
Example:
Suppose A 2x2 pixels image will be enlarged 2 times by the nearest neighbor method:
1. Lay an imaginary 4*4 grid over the original image..
2. For any point in the overlay, look for the closest pixel in the original image, and assign its
gray level to the new pixel in the grid. (copy)
3. When all the new pixels are assigned values, expand the overlay grid to the original specified
size to obtain the zoomed image.
• Pixel replication (re sampling) is a special case that is applicable when the size of the image
needs to be increased an integer number of times (like 2 times not 1.5 for example).
+ ve : Nearest neighbor is fast
-ve: it produces a checkerboard effect
like this!
shrinking
 Similar to image zooming.
Shrinking an image an integer number of times
􀂁 Pixel replication is replaced by row&column
deletion.
Shrinking an image by a non-integer factor
􀂁 Expand the grid to fit over the original image.
􀂁 Do gray-level interpolation (nearest neighbor
or bilinear).
􀂁 Shrink the grid back to its original specified
size.
Ch2, lesson2: Zooming and shrinking
Neighbors of a pixel
Ch2, lesson3: Some basic Relationships between pixels
Adjacency
Ch2, lesson3: Some basic Relationships between pixels
V: set of gray level values (L), (V is a subset of L.)
3 types of adjacency
 4- adjacency: 2 pixels p and q with values from V are 4- adjacent if q is in the
set N4(p)
 8- adjacency: 2 pixels p and q with values from V are 8- adjacent if q is in the
set N8(p)
 m- adjacency: 2 pixels p and q with values from V are madjacent if
1. q is in N4(p), or
2. q is in ND(p) and the set N4(p) ∩ N4(q) has no pixels whose
values are from V
connectivity
 A digital path from pixel p with coordinates (x,y) to pixel q
with coordinates (s,t) is a sequence of distinct pixels with
coordinates (x0,y0), (x1,y1), …, (xn,yn), where (x0,y0)=
(x,y) and (xn,yn)=(s,t), and pixels (xi,yi) and (xi-1,yi-1) are
adjacent for 1 ≤ i ≤ n.
 S: a subset of pixels in an image.
 Two pixels p and q are said to be connected in S if there
exists a path between them consisting entirely of pixels in S.
 For any pixel p in S, the set of pixels that are connected to it
in S is called a connected component of S.
 If S has only one connected component, it is called a
connected set.
Ch2, lesson3: Some basic Relationships between pixels
Regions and boundaries
 R: a subset of pixels in an image.
 R is a region of the image if R is a
connected set.
 The boundary of a region R is the set of
pixels in the region that have one or more
neighbors that are not in R.
Ch2, lesson3: Some basic Relationships between pixels
Foreground and background
Suppose that the image contains K disjoint
regions Rk none of which touches the
image border .
Ru : the union of all regions .
(Ru)c : is the complement .
so Ru is called foreground , and (Ru)c : is
the background .
Distance measures
If we have 3 pixels: p,q,z:
p with (x,y)
q with (s,t)
z with (v,w)
Then:
D(p,q) = 0 iff p = q
D(p,q) = D(q,p)
D(p,z) ≤ D(p,q) + D(q,z)
 Euclidean distance between p and q: De(p,q) = [(x-s)2 + (y-t)2]1/2
 D4 distance: D4(p,q) = |x-s| + |y-t|
 D8 distance: D8(p,q) = max (|x-s| , |y-t|)
 D4 and D8 distances between p and q are independent of any paths
that might exist between the points.
 For m-adjacency, Dm distance between two points is defined as the
shortest m-path between the points.
Ch2, lesson3: Some basic Relationships between pixels
Distance measures
Example
q
p
1 2 3
1
2
3
Compute the distance between the two pixels
using the three distances :
q:(1,1)
P: (2,2)
Euclidian distance : ((1-2)2+(1-2)2)1/2 = sqrt(2).
D4(City Block distance): |1-2| +|1-2| =2
D8(chessboard distance ) : max(|1-2|,|1-2|)= 1
(because it is one of the 8-neighbors )
Distance measures
Example :
Use the city block distance to prove 4-
neighbors ?
Pixel A : | 2-2| + |1-2| = 1
Pixel B: | 3-2|+|2-2|= 1
Pixel C: |2-2|+|2-3| =1
Pixel D: |1-2| + |2-2| = 1
Now as a homework try the chessboard
distance to proof the 8- neighbors!!!!
d
c
p
a
b
1 2 3
1
2
3

More Related Content

PPT
DIP7_Relationships_between_pixels.ppt
PPTX
Image Acquisition and Representation
PPT
3.ppt
PPT
03 digital image fundamentals DIP
PPTX
Basic Relationships between Pixels- Digital Image Processing
PPTX
Pixelrelationships
PPTX
digital image processing pixel relationships.pptx
PPTX
pixelrelationships in image processing enhancement
DIP7_Relationships_between_pixels.ppt
Image Acquisition and Representation
3.ppt
03 digital image fundamentals DIP
Basic Relationships between Pixels- Digital Image Processing
Pixelrelationships
digital image processing pixel relationships.pptx
pixelrelationships in image processing enhancement

Similar to Image_Processing-ch2surface r_part_2.ppt (20)

PPTX
pixels arranged in a 2D grid, where each pixel carries intensity or color inf...
PPTX
Digital-Image-processing-fundamenntal.pptx
PPTX
Digital Image Processing
PDF
Ip unit 1
PDF
Digital image processing fundamental explanation
PPT
pixelrelationships-m-1.pptx.ppt
PDF
2. IP Fundamentals.pdf
PDF
Basic Relationship between pixels and adjacency
PPT
Digital Image Fundamentals 1.ppt
PPT
chap2.ppt
PPT
chap2.ppt is the presentation of image of eye.
PPT
Chapter 2 Image Processing: Pixel Relation
PDF
chapter_4_1ST_PART_BASIC_RELATION_OF_PIXELSchapter_2_dip_5th_sem.pdf
PPT
2 digital image fundamentals
PDF
bstract Point processing uses only the information in individual pixels to pr...
PPT
Lecture 07.ppt that is minimun hiiiga maruuua
PPT
Image processing 1-lectures
PPT
Lecture4.ppt
PPT
Image segmentation
pixels arranged in a 2D grid, where each pixel carries intensity or color inf...
Digital-Image-processing-fundamenntal.pptx
Digital Image Processing
Ip unit 1
Digital image processing fundamental explanation
pixelrelationships-m-1.pptx.ppt
2. IP Fundamentals.pdf
Basic Relationship between pixels and adjacency
Digital Image Fundamentals 1.ppt
chap2.ppt
chap2.ppt is the presentation of image of eye.
Chapter 2 Image Processing: Pixel Relation
chapter_4_1ST_PART_BASIC_RELATION_OF_PIXELSchapter_2_dip_5th_sem.pdf
2 digital image fundamentals
bstract Point processing uses only the information in individual pixels to pr...
Lecture 07.ppt that is minimun hiiiga maruuua
Image processing 1-lectures
Lecture4.ppt
Image segmentation
Ad

More from Praveen Kumar (20)

PPT
Unit - Imechancialmetal cutting process.ppt
PPTX
metal cuttingmechancial metalcutting.pptx
PPTX
IoT_Embedded_Systems_Trainingiotppt.pptx
PPTX
IoT_and_Embedded_Systems_Presentation.pptx
PPT
8437546mechanicalmachining process23.ppt
PPT
5960060mechan icalpptmetalcutiingprocess.ppt
PPT
PPT2_Metal formingMECHANICALENGINEEIRNG .ppt
PPT
PPT1_Metal formngMECHANICAKENGINEEING.ppt
PPTX
PDP PresentationMECHANCALSYMERGYMECH.pptx
PPTX
Teaching planMECHANUCALENGINEERING_Final.pptx
PPT
fdocuments.in_introduction-to-weldingppt-56c13478bad3b.ppt
PPT
fdocuments.in_welding-introduction (1).ppt
PPTX
UNIT2 PPT4 Machine tool using single poit tools (1).pptx
PPTX
UNIT-2 PPT1 Machine tool using single point tools (2).pptx
PPTX
Columnsmechanicalcolummsppt23459874.pptx
PPTX
3unit-200715014624mechanical ppt234.pptx
PPT
UNIT 3 sheet metal formingmechanical.ppt
PPT
UNIT 5 Additive Manufacturing manufactuing.ppt
PPT
UNIT1-Castingprocessmechanical engineering.ppt
PPTX
chap 4 Die set and press workmechancasndk.pptx
Unit - Imechancialmetal cutting process.ppt
metal cuttingmechancial metalcutting.pptx
IoT_Embedded_Systems_Trainingiotppt.pptx
IoT_and_Embedded_Systems_Presentation.pptx
8437546mechanicalmachining process23.ppt
5960060mechan icalpptmetalcutiingprocess.ppt
PPT2_Metal formingMECHANICALENGINEEIRNG .ppt
PPT1_Metal formngMECHANICAKENGINEEING.ppt
PDP PresentationMECHANCALSYMERGYMECH.pptx
Teaching planMECHANUCALENGINEERING_Final.pptx
fdocuments.in_introduction-to-weldingppt-56c13478bad3b.ppt
fdocuments.in_welding-introduction (1).ppt
UNIT2 PPT4 Machine tool using single poit tools (1).pptx
UNIT-2 PPT1 Machine tool using single point tools (2).pptx
Columnsmechanicalcolummsppt23459874.pptx
3unit-200715014624mechanical ppt234.pptx
UNIT 3 sheet metal formingmechanical.ppt
UNIT 5 Additive Manufacturing manufactuing.ppt
UNIT1-Castingprocessmechanical engineering.ppt
chap 4 Die set and press workmechancasndk.pptx
Ad

Recently uploaded (20)

PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
Sustainable Sites - Green Building Construction
PPTX
Geodesy 1.pptx...............................................
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
web development for engineering and engineering
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
Construction Project Organization Group 2.pptx
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
Lecture Notes Electrical Wiring System Components
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
Internet of Things (IOT) - A guide to understanding
Sustainable Sites - Green Building Construction
Geodesy 1.pptx...............................................
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
web development for engineering and engineering
OOP with Java - Java Introduction (Basics)
Foundation to blockchain - A guide to Blockchain Tech
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Construction Project Organization Group 2.pptx
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Lecture Notes Electrical Wiring System Components
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Embodied AI: Ushering in the Next Era of Intelligent Systems
Automation-in-Manufacturing-Chapter-Introduction.pdf

Image_Processing-ch2surface r_part_2.ppt

  • 1. Image Processing Ch2: Digital image Fundamentals Part 2 Prepared by: Tahani Khatib
  • 2. Zooming (over sampling) images Ch2, lesson2: Zooming and shrinking Zoomed by using nearest neighbor Zoomed by using Bilinear
  • 3. Zooming (over sampling) images Ch2, lesson2: Zooming and shrinking Zooming requires 2 steps: 􀂁 The creation of new pixel locations. 􀂁 The assignment of gray levels to these new locations. Two techniques for zooming: 1. Nearest neighbor interpolation 2. Bilinear interpolation
  • 4. Nearest neighbor interpolation Ch2, lesson2: Zooming and shrinking Example: Suppose A 2x2 pixels image will be enlarged 2 times by the nearest neighbor method: 1. Lay an imaginary 4*4 grid over the original image.. 2. For any point in the overlay, look for the closest pixel in the original image, and assign its gray level to the new pixel in the grid. (copy) 3. When all the new pixels are assigned values, expand the overlay grid to the original specified size to obtain the zoomed image. • Pixel replication (re sampling) is a special case that is applicable when the size of the image needs to be increased an integer number of times (like 2 times not 1.5 for example). + ve : Nearest neighbor is fast -ve: it produces a checkerboard effect like this!
  • 5. shrinking  Similar to image zooming. Shrinking an image an integer number of times 􀂁 Pixel replication is replaced by row&column deletion. Shrinking an image by a non-integer factor 􀂁 Expand the grid to fit over the original image. 􀂁 Do gray-level interpolation (nearest neighbor or bilinear). 􀂁 Shrink the grid back to its original specified size. Ch2, lesson2: Zooming and shrinking
  • 6. Neighbors of a pixel Ch2, lesson3: Some basic Relationships between pixels
  • 7. Adjacency Ch2, lesson3: Some basic Relationships between pixels V: set of gray level values (L), (V is a subset of L.) 3 types of adjacency  4- adjacency: 2 pixels p and q with values from V are 4- adjacent if q is in the set N4(p)  8- adjacency: 2 pixels p and q with values from V are 8- adjacent if q is in the set N8(p)  m- adjacency: 2 pixels p and q with values from V are madjacent if 1. q is in N4(p), or 2. q is in ND(p) and the set N4(p) ∩ N4(q) has no pixels whose values are from V
  • 8. connectivity  A digital path from pixel p with coordinates (x,y) to pixel q with coordinates (s,t) is a sequence of distinct pixels with coordinates (x0,y0), (x1,y1), …, (xn,yn), where (x0,y0)= (x,y) and (xn,yn)=(s,t), and pixels (xi,yi) and (xi-1,yi-1) are adjacent for 1 ≤ i ≤ n.  S: a subset of pixels in an image.  Two pixels p and q are said to be connected in S if there exists a path between them consisting entirely of pixels in S.  For any pixel p in S, the set of pixels that are connected to it in S is called a connected component of S.  If S has only one connected component, it is called a connected set. Ch2, lesson3: Some basic Relationships between pixels
  • 9. Regions and boundaries  R: a subset of pixels in an image.  R is a region of the image if R is a connected set.  The boundary of a region R is the set of pixels in the region that have one or more neighbors that are not in R. Ch2, lesson3: Some basic Relationships between pixels
  • 10. Foreground and background Suppose that the image contains K disjoint regions Rk none of which touches the image border . Ru : the union of all regions . (Ru)c : is the complement . so Ru is called foreground , and (Ru)c : is the background .
  • 11. Distance measures If we have 3 pixels: p,q,z: p with (x,y) q with (s,t) z with (v,w) Then: D(p,q) = 0 iff p = q D(p,q) = D(q,p) D(p,z) ≤ D(p,q) + D(q,z)  Euclidean distance between p and q: De(p,q) = [(x-s)2 + (y-t)2]1/2  D4 distance: D4(p,q) = |x-s| + |y-t|  D8 distance: D8(p,q) = max (|x-s| , |y-t|)  D4 and D8 distances between p and q are independent of any paths that might exist between the points.  For m-adjacency, Dm distance between two points is defined as the shortest m-path between the points. Ch2, lesson3: Some basic Relationships between pixels
  • 13. Example q p 1 2 3 1 2 3 Compute the distance between the two pixels using the three distances : q:(1,1) P: (2,2) Euclidian distance : ((1-2)2+(1-2)2)1/2 = sqrt(2). D4(City Block distance): |1-2| +|1-2| =2 D8(chessboard distance ) : max(|1-2|,|1-2|)= 1 (because it is one of the 8-neighbors )
  • 14. Distance measures Example : Use the city block distance to prove 4- neighbors ? Pixel A : | 2-2| + |1-2| = 1 Pixel B: | 3-2|+|2-2|= 1 Pixel C: |2-2|+|2-3| =1 Pixel D: |1-2| + |2-2| = 1 Now as a homework try the chessboard distance to proof the 8- neighbors!!!! d c p a b 1 2 3 1 2 3