CSSE463: Image Recognition Day 9 Lab 3 (edges) due Weds Test 1 Monday. Mostly written problems too long for in-class quizzes Will include a take-home part (1-2 questions) that I’ll distribute later this week Today: region properties Questions?
Representing a Region Review: Connected components labels groups of connected pixels. 4-connectivity vs. 8-connectivity matters Could you write a recursive algorithm for connected components?
Region properties Includes location, size, shape, and orientation Focus on binary images
Region Properties Area and Centroid ∑ = 1 A Area: sum of pixels in region ∈ ( , ) r c R ( , ) r c Centroid: (avg row, avg column) = 1 1 ∑ ∑ = = c c r r A A ∈ ∈ ( , ) ( , ) r c R r c R Recall that find returns row and column coordinates if you ask it to do so: [r,c] = find(mask == 1) Q1
Bounding box Can be used to describe a region’s location For region to right, (r min , r max , c min , c max ) Extent = (area of region)/ = (1,4,4,7) (area of bounding box) What types of shapes have maximal/minimal extent? Matlab returns (x min , y min , width, height)
Perimeter Perimeter (assume no holes) The set of interior border pixels = ∈ − ≠ φ ( ) {( , ) | ( , ) } P R r c R N r c R 8 4 Interpretation, please? In Matlab P 8 (region) is called bwperim(region, 4) because the border pixels are connected with the background using a 4-neighborhood. The output is a mask The definition for P 4 is dual to P 8 .
Perimeter length Assume we have an algorithm to list the perimeter pixels in a chain of neighboring pixels… Matlab’s bwtraceboundary 1. On the test, you’ll study the “inner boundary tracing” algorithm 1. (from text) Extremely efficient representation for large regions 1. …to find perimeter length, denoted PL or |P|: Each pair of horizontal/vert. neighbors contributes 1 Each pair of diagonal neighbors contributes sqrt(2) Which is typically shorter, |P 8 | or |P 4 | ? Q2,3
Circularity measures Circles (theoretically) 2 | | P = C have minimum ratio, C 1 1 A Why? µ = R , where C 2 σ R 1 N ∑ Having a small standard µ = − ( , ) ( , ) r c r c R i i N = i 1 deviation gives a larger 1 2 [ ] 2 N 1 ∑ σ = − − µ ( , ) ( , ) r c r c circularity. R i i R N = 1 i = # of pixels on perimeter Sample radial N ⋅ = Euclidean length of vector representations of images µ = mean distance of boundary pixel from center R What’s a circle’s C 2 ? µ = standard deviation of distances from center R Q2,4
Recommend
More recommend