计算机视觉课件4
——if color is gray, go to step b). d) Stop if all nodes are either black or white.
4) Region Adjacency Graph: —— Emphasize the adjacency of regions —— node: region —— link: common boundary between regions.
— same as binary image representation
— often be used as a mask over intensity image to select the region for proper processing.
2) Pyramids representation
E (T ) P 2 E 1 (T ) P 1 E 2 (T )
T should be chosen such that
E(T)min
From
E(T) 0, T
Get
P 1p1(T)P 2p2(T)
Applying Gaussian distributions, get:
A2T B TC0
Where:
Course 4 Regions
Course 4. Regions
Def. of Region: A set of connected image pixels,
with similar properties. • similar gray level • similar color • similar texture so on ……
they are similar. —— For the region that are similar, merge them and
modify the adjacency graph. d) Repeat step c) until no region are merged. Criteria for merge:
Where P(.) is homogeneity predicate measurement.
1) Thresholding:
2) (1) P-Tile Thresholing
3) If a pre-knowledge of object size S is given, the
4) area percentage of the object in image A can be got
(3) Adaptive Thresholding
The basic concept is to choose threshold T locally to against uneven distribution of image intensity (caused by uneven illumination in scene). • Partition an image into several regions . • In each region, choose threshold T at major valley of it histograph, and perform threholding in each region.
s— common edge length
T — threshold, e.g. T=0.75
How to measure the weakness of an edge?
I —preset value
i.e., the gradient of image intensity.
3) Region Spliting:
5) Picture Tree: —— Emphasize region inclusion within another region. —— Recursively split an image into regions, and the process stops when no region can be further splitted (homogeneity predicate)
1. Region Representation
1) Array representation:
Given a region R in image S,
Its array representation A is:
A a[i,j]
[i,j]S, a[i,j] 1 0 io[fi,tj]hR e rw
b) Make an adjacency graph for the image .
c) For each region in the image, do the following steps: —— Consider it adjacent regions, and check whether
A12 22
B2(112 222)
C1222
2212
21222
ln(2P1) 1P2
One can solve for T
In the case 12 22 2
We can get
T12 2 lnP(2) 2 12 P1
In most application, we just simply threshold an image at intensity T where histograph has a valley, which can approximate optimal thresholding.
not want.
• Merge operation combines regions that are considered similar.
Algorithm:
a) Form initial regions in the image using thresholding, followed by clustering labeling (find connected components).
Region may be separated adjacent overlapped included
Important principle of region process: ——homogeneity predicate (value similarity) ——special proximity
—— if some property of a region is not constant, the
region should be split —— difficulties:
how to measure “properties” how to find splitting boundary? Algorithm (split and merge): a) Set the whole image as a region R
2. Region Segmentation Suppose an image A is well segmented into n regions Ri, i=1,2,…,n, there must be:
n
Ri A
i 1
P ( R i ) True P ( R i R j ) False
S
1
2
3
4
1
2
3
4
Color of node:
wh.ia tellpixealrse"0" intheregi colo brla. cakllpixealrse"1" intheregi
gr.ayhavbeot"h0" and"1" pixels
Algorithm:
a) Set an image as a region, and represents it as a node in quad tree (0-level)
Pyramid representation of a NxN image (N=2k) contains k layers of reduced image. Each pixel in an upper layer image corresponds to 4 pixels in the lower layer image, i.e.,
Dark region: Bright region:
p1(Z)
1
(Zμ1)2
e 2σ12
2πσ1
p2(Z)
1
e(Z2σμ222)2
2πσ2
1 2
we set partition threshold at T, error probability of object being segmented as background:
5)
by T
P=S/A.
Thus, wTe
P
set the value
p()d
of
threshold
at
0
6) such that
p( )
L
0 p( ) 1
(2) Optimal thresholding:
Suppose an image contain only two principal brightness regions and both obey Gaussian distribution in intensity.
N N N N N N 1 1 22 44
Pixels value of upper layer image can be obtained by ——averaging the corresponding pixels of lower layer image, or ——subsampling (e.g. choose upper-left pixel value)