- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
to bottom) to find the first pixels sS as a starting pixel.
b) Set c=s, and b=left neighbor of c, bS .
c) From pixel b, in clockwise order check the 8-neighbors
in binary form, e.g. edge, contour, … —— human can understand binary line drawings.
1. Neighbors/path/connectivity (1) Neighbors of a pixel
a. 4-neighbors: the upper, lower, left and right neighbor pixels of a pixel.
where
a(xijx)2B[i,j];
ij
b2 (xijx)y (ijy)B [i,j];
ij
c (yijy)2B[i,j];
ij
Note: x 2 may minimize or maximize 2 .
The has two values; the corresponding lines are
Course 3 Binary Image
Course 3 Binary Image
Binary Images have only two gray levels: “1” and “0”, i.e., black / white.
—— save memory —— fast processing —— many features of an intensity image appear
—— Run-length code is a compact way to represent a binary image. —— Run-length encoding is a row-based operation.
Method 1: only encode “1” pixels. Using start position and length of runs of “1” to represent the runs. Method 2: encode “1” runs and “0” runs alternatively. Using only one number to indicate the length of the run. If an image row starts with a “0” run, put a “0” as the header of the code of the row, otherwise the header will not appear.
(5) Clustering
Clustering, or component labeling, is a common operation in computer vision to find connected components. Each connected component may represent an object or a part of an object.
(8)
So: 2 (x ic j o y is s j i n )2 B [ i,j]
ij
Set
2 ,0 and
2 0
We get: xco sysin
where x, y is the center of the component, and
1tan1( b )
2 ac
b. 8-neighbors: the 4-neighbors pixels plus the diagonal neighbors.
[i-1,j]
[i-1,j-1] [i-1,j] [i-1,j+1]
[i,j-1] [i,j] [i,j+1]
[i,j-1]
[i,j]
[i,j+1]
[i+1,j]
[i+1,j-1] [i-1,j] [i+1,j+1]
2. Geometric attributes of a binary image/component:
(1) size (area):
AB[i,j] for all B[.,.] = 1 pixels.
ij
(2) position: the position of a binary image component is defined by its mass center.
Background: the set of all connected components
oSf that have points on the border of the image.
Hole: the connected component inS
not have border points.
2 rij2B[i,j]min ij
(5) wherrie, j is the distance from pixel [ i, j ]to the line.
(6) Let the line in polar coordinates be:
xc os ys in
(7)
Thenr : x co y s si n
Horizontal projection:
H[i]B[i, j]
j
Vertical projection:
V[j]B[i, j]
j
For a well alined text binary image, the projection has comb shape, image can be easily partitioned.
of c, n1,n2, ,n8; find the first n i such that ni S . d) Set cni,bni1
e) Repeat step c) and d) until c=s.
(4) Projections
Projecting a binary image onto a line (usually horizontally or vertically) may provide partition information of the image. It is often used in OCR for character separation.
Let image f [i, j] has gray level ranged in [0,L] , T be
threshold, 0<T<L
Then,
fT[i, j]10,,
if f[i,j]T otherwise
If you are interested in image information of certain range of gray level, you can choose double thresholds
c is 4 . If c = 4 , S is a circular region.
When c is larger, S is elongated
when c, S is a line segment.
3. Binary Processing:
(1) Thresholding:
Thresholding converts an intensity image into a binary image, partitioning the original image to regions.
(2) Interior SS (pixels in S but not in S)
Surrounds: if any 4-path from any point of S to image border must intersect region T, we say region T surrounds region S.
——4 path if 4-neighbor is used
——8 path if 8-neighbor is used
(3) Connectivity:
A pixel pis said to be connected to q if there is a path from p to q consisting of pixels of S .
0T 1T 2L
Then,
fT[i,j] 1 0,, if
T1f[i,j]T2 otherwise
Original image (L=64)
Image by threshold T=48
double threshold T1 = 2, T2 = 48
(2) Run-length encode:
(7) Perimeter
Def.1: The total length of lines that separate pixels
of S from S .
Def.2: The number of boundary pixels.
(8) Compactness
P2
c
A
Where P— perimeter, A— area. The smallest value of
called maximum axis and minimum axis of the image component.
Maximum axis
Minimum axis
(4) Foreground / Background :
Foreground: the set f all “1” pixels in an image.