Basic Concepts in Digital Image Processingcse.sc.edu/~tongy/csce763/lectures/lect3.pdf · Basic...
Transcript of Basic Concepts in Digital Image Processingcse.sc.edu/~tongy/csce763/lectures/lect3.pdf · Basic...
Basic Concepts in Digital Image Processing
Announcement
Homework #1 was posted in dropbox and on class website.
Due time: Wednesday, Jan 31 , before class starts.
Today’s Agenda
• Basic Relationships between Pixels
Basic Set and Logical Operations
Set Operations Based on Coordinates
A region in an image is represented by a set of coordinates within the region
Some Basic Relationships between Pixels
Neighbors of a pixel (x-1,y)
(x,y-1) (x,y) (x,y+1)
(x+1,y)
(x-1,y-1) (x-1,y+1)
(x,y)
(x-1,y+1) (x+1,y+1)
(x-1,y-1) (x-1,y)
(x-1,y+1)
(x,y-1)
(x,y) (x,y+1)
(x-1,y+1) (x+1,y) (x+1,y+1)
Adjacency
Adjacency is the relationship between two pixels p and q
V is a set of intensity values used to define adjacency
• Binary image: V={1} or V={0}
• Gray level image:
Three types of adjacency: 4-adjacency 8-adjacency m-adjacency
and
p
Intensity constraints
X
Connectivity
• Path from p to q: a sequence of distinct and adjacent pixels with coordinates
Starting point p ending point q
• Closed path: if the starting point is the same as the ending point • p and q are connected: if there is a path from p to q in S • Connected component: all the pixels in S connected to p • Connected set: S has only one connected component
adjacent
Are they connected sets?
Regions
• R is a region if R is a connected set
• Ri and Rj are adjacent if is a connected set
Boundaries
• Inner boundary (boundary) -- the set of pixels each of which has at least one background neighbor
• Outer boundary – the boundary pixels in the background
Distance Measures
For pixels p, q, and z, with coordinates (x,y), (s,t) and (v,w), D is a distance function or metric if
),(),(),()(),,(),()(
0),(0),()(
zqDqpDzpDcandpqDqpDb
qpiffqpDqpDa
+≤=
==≥
Distance Measures
Euclidean distance
City-block (D4) distance
Chessboard (D8) distance (Chebyshev distance)
22 )()(),( tysxqpDe −+−=||||),(4 tysxqpD −+−=
|)||,max(|),(8 tysxqpD −−=
Distance: Sample Problem
D4 distance
D8 distance
Euclidean distance
p
q
Distance vs length of a path?
6
5
𝟏 + 𝟓𝟐
Mathematic Tools
Array versus Matrix operations
Array Multiplications
Matrix Multiplications
𝒂𝟏𝟏 𝒂𝟏𝟐𝒂𝟐𝟏 𝒂𝟐𝟐 ∙ 𝒃𝟏𝟏 𝒃𝟏𝟐
𝒃𝟐𝟏 𝒃𝟐𝟐= 𝒂𝟏𝟏𝒃𝟏𝟏 𝒂𝟏𝟐𝒃𝟏𝟐
𝒂𝟐𝟏𝒃𝟐𝟏 𝒂𝟐𝟐𝒃𝟐𝟐
𝒂𝟏𝟏 𝒂𝟏𝟐𝒂𝟐𝟏 𝒂𝟐𝟐 × 𝒃𝟏𝟏 𝒃𝟏𝟐
𝒃𝟐𝟏 𝒃𝟐𝟐= 𝒂𝟏𝟏𝒃𝟏𝟏 + 𝒂𝟏𝟐𝒃𝟐𝟏 𝒂𝟏𝟏𝒃𝟏𝟐 + 𝒂𝟏𝟐𝒃𝟐𝟐
𝒂𝟐𝟏𝒃𝟏𝟏 + 𝒂𝟐𝟐𝒃𝟐𝟏 𝒂𝟐𝟏𝒃𝟏𝟐 + 𝒂𝟐𝟐𝒃𝟐𝟐
Mathematic Tools
Linear/nonlinear operations
Arithmetic Operations – single pixel operations • Image averaging, image subtraction, image multiplication
Set and logic operations
Spatial operations • Single pixel operations and neighborhood operations
Image transformation
Probabilistic methods
Linearity:
Image Averaging – Noise Reduction
Assumption: the noise is uncorrelated in image and has zero mean
Image Subtraction – Enhance Difference
Image Subtraction
The images used in averaging & subtraction must be registered!
Image Multiplication (Division)
g(x,y)=f(x,y)/h(x,y)
g(x,y)=f(x,y)h(x,y)
Notes on Arithmetic Operations
)]max(/[)min(
mms
m
ffKffff
=−=
Output images should be normalized to the range of [0,255]
The images used in averaging & subtraction must be registered!
Set Operations Based on Intensities
Complement – negative image
Thresholding 𝑨 ∪ 𝑩 = 𝒙,𝒚, max 𝒛𝒂, 𝒛𝒃 𝒙,𝒚, 𝒛𝒂 ∈ 𝑨, 𝒙,𝒚, 𝒛𝒃 ∈ 𝑩
𝑨𝒄 = 𝒙,𝒚,𝑲− 𝒛 𝒙,𝒚, 𝒛 ∈ 𝑨
Logic Operations for Binary Image
Foreground/background • Binary image: 0/1 • Fuzzy set: [0,1]