360 likes | 494 Views
3-D Computer Vision CSc 83020. Binary Images Horn (Robot Vision): pages 46-64. Binary Images. Binary Image b(x,y): Obtained from Gray-Level (or other image) g(x,y) By Thresholding. Characteristic Function: 1 g(x,y) < T b(x,y)= 0 g(x,y) >= T Geometrical Properties
E N D
3-D Computer VisionCSc 83020 Binary Images Horn (Robot Vision): pages 46-64. 3-D Computer Vision CSc 83020 – Ioannis Stamos
Binary Images • Binary Image b(x,y): Obtained from Gray-Level (or other image) g(x,y) • By Thresholding. • Characteristic Function: • 1 g(x,y) < T • b(x,y)= • 0 g(x,y) >= T • Geometrical Properties • Discrete Binary Images • Multiple objects • Sequential and Iterative Processing. 3-D Computer Vision CSc 83020 – Ioannis Stamos
Selecting the Threshold (T) g(x,y) h(i) BIMODAL HISTOGRAM T i (intensity) b(x,y) 3-D Computer Vision CSc 83020 – Ioannis Stamos
Histogram Thresholding T 3-D Computer Vision CSc 83020 – Ioannis Stamos
Geometric Properties b(x,y) Assume: 1) b(x,y) is continuous 2) Only one object y x 3-D Computer Vision CSc 83020 – Ioannis Stamos
Geometric Properties b(x,y) Assume: 1) b(x,y) is continuous 2) Only one object y x Area: (Zeroth Moment) 3-D Computer Vision CSc 83020 – Ioannis Stamos
Geometric Properties b(x,y) Assume: 1) b(x,y) is continuous 2) Only one object y x Area: (Zeroth Moment) Position: “Center” (x,y) of Area (First Moment) 3-D Computer Vision CSc 83020 – Ioannis Stamos
Orientation Difficult to define! We use axis of least second moment y axis (x,y) r ρ x θ 3-D Computer Vision CSc 83020 – Ioannis Stamos
Orientation Difficult to define! We use axis of least second moment For mass distribution: Axis of minimum Inertia. y axis (x,y) r ρ x θ Minimize: 3-D Computer Vision CSc 83020 – Ioannis Stamos
Orientation Difficult to define! We use axis of least second moment For mass distribution: Axis of minimum Inertia. y axis (x,y) r ρ x θ Minimize: Equation of Axis: y=mx+b ??? 0<= m <= infinity We use: (ρ, θ) finite. Find (ρ, θ) that minimize E for a given b(x,y)
We can show that: So: 3-D Computer Vision CSc 83020 – Ioannis Stamos
We can show that: So: Using dE/dρ=0 we get: 3-D Computer Vision CSc 83020 – Ioannis Stamos
We can show that: So: Using dE/dρ=0 we get: Note: Axis passes through center (x,y)!! So, change coordinates: x’=x-x, y’=y-y 3-D Computer Vision CSc 83020 – Ioannis Stamos
We can show that: So: Using dE/dρ=0 we get: Note: Axis passes through center (x,y)!! So, change coordinates: x’=x-x, y’=y-y We get: Second Moments w.r.t. (x, y) 3-D Computer Vision CSc 83020 – Ioannis Stamos
We can show that: So: Using dE/dρ=0 we get: Note: Axis passes through center (x,y)!! So, change coordinates: x’=x-x, y’=y-y We get: Second Moments w.r.t. (x, y) Mistake in your handout. 3-D Computer Vision CSc 83020 – Ioannis Stamos
Using dE/dθ=0, we get: tan(2θ)=b/(a-c) b 2θ a-c 3-D Computer Vision CSc 83020 – Ioannis Stamos
Using dE/dθ=0, we get: tan(2θ)=b/(a-c) So: b 2θ a-c 3-D Computer Vision CSc 83020 – Ioannis Stamos
Using dE/dθ=0, we get: tan(2θ)=b/(a-c) So: Solutions with positive sign may be used to find θ that minimizes E (why??). Emin/Emax -> (ROUDNESS of the OBJECT). b 2θ a-c 3-D Computer Vision CSc 83020 – Ioannis Stamos
Discrete Binary Images bij: value at pixel in row i & column j. j (y) m O i (x) n 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3-D Computer Vision CSc 83020 – Ioannis Stamos
Discrete Binary Images bij: value at pixel in row i & column j. Assume pixel area is 1. Area: Position (Center of Area): j (y) m O i (x) n 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3-D Computer Vision CSc 83020 – Ioannis Stamos
Discrete Binary Images bij: value at pixel in row i & column j. Assume pixel area is 1. Area: Position (Center of Area): j (y) m O i (x) n 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Second Moments. 3-D Computer Vision CSc 83020 – Ioannis Stamos
Discrete Binary Images (cont) Note: a’,b’,c’ are second moments w.r.t ORIGIN a,b,c (w.r.t “center”) can be found from (a’,b’,c’,x,y,A). Note: UPDATE (a’,b’,c’,x,y,A) during RASTER SCAN. 3-D Computer Vision CSc 83020 – Ioannis Stamos
Multiple Objects Need to SEGMENT image into separate COMPONENTS (regions). Connected Component: Maximal Set of Connected Points: B A Points A and B are connected: Path exists between A and B along which b(x,y) is constant. 3-D Computer Vision CSc 83020 – Ioannis Stamos
Connected Components 4-way connected 8-way connected Label all pixels that are connected 3-D Computer Vision CSc 83020 – Ioannis Stamos
Region Growing Algorithm(Connected Component Labeling) • Start with “seed” point where bij=1. • Assign LABEL to seed point. • Assign SAME LABEL to its NEIGHBORS (b=1). • Assign SAME LABEL to NEIGHBORS of NEIGHBORS. Terminates when a component is completely labeled. Then pick another UNLABELED seed point. 3-D Computer Vision CSc 83020 – Ioannis Stamos
What do we mean by NEIGHBORS? Connectedness 8-Connectedness (8-c) Neither is perfect! 4-Connectedness (4-c) 3-D Computer Vision CSc 83020 – Ioannis Stamos
What do we mean by NEIGHBORS? Jordan’s Curve Theorem: Closed curve -> 2 connected regions B1 O1 B1 0 1 0 1 0 1 O2 B2 O3 0 1 (4-c) Hole without closed curve! 0 B1 O4 B1 3-D Computer Vision CSc 83020 – Ioannis Stamos
What do we mean by NEIGHBORS? Jordan’s Curve Theorem: Closed curve -> 2 connected regions B1 O1 B1 B O B 0 1 0 1 0 1 O2 B2 O3 O B O (8-c) Connected background with closed ring! 0 (4-c) Hole without closed curve! 1 0 B1 O4 B1 B O B
Solution: Introduce Assymetry Use: or (a) (b) Using (a) Two separate line segments. B O1 B 0 1 0 1 0 1 O2 B O1 0 1 0 B O2 B Hexagonal Tesselation Above assymetry makes SQUARE grid like HEXAGONAL grid. 3-D Computer Vision CSc 83020 – Ioannis Stamos
Sequential Labeling Algorithm Raster Scan D B C Note: B,C,D are already labeled A 3-D Computer Vision CSc 83020 – Ioannis Stamos
Sequential Labeling Algorithm Raster Scan D B C Note: B,C,D are already labeled A Label(A) = background a. X X X 0 Label(A) = label(D) b. D X X 1 3-D Computer Vision CSc 83020 – Ioannis Stamos
Sequential Labeling Algorithm Raster Scan D B C Note: B,C,D are already labeled A Label(A) = label(C) c. 0 0 C 1 Label(A) = label(B) d. 0 B 0 1 If Label(B) = label(C ), then Label(A)=Label(B)= Label(C) d. 0 B C 1 3-D Computer Vision CSc 83020 – Ioannis Stamos
Sequential Labeling Algorithm Raster Scan D B C Note: B,C,D are already labeled A Label(A) = background a. X X X 0 Label(A) = label(D) b. D X X 1 Label(A) = label(C) c. 0 0 C 1 Label(A) = label(B) d. 0 B 0 1 If Label(B) = label(C ), then Label(A)=Label(B)= Label(C) d. 0 B C 1 3-D Computer Vision CSc 83020 – Ioannis Stamos
Sequential Labeling (Cont.) What if B & C are labeled but label(B) label(C) ? 3-D Computer Vision CSc 83020 – Ioannis Stamos
Sequential Labeling (Cont.) What if B & C are labeled but label(B) label(C) ? 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 1 1 1 1 1 1 1 1 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ? 3-D Computer Vision CSc 83020 – Ioannis Stamos
Sequential Labeling (Cont.) Solution: Let: Label(A)=Label(B) =2 & create an EQUIVALENCE TABLE. Resolve Equivalences in SECOND PASS. 2 1 7 3,6,4 … 3-D Computer Vision CSc 83020 – Ioannis Stamos