Lecture 2 - Binary Images Flashcards
In a pixel how many grey levels are there?
Each pixel represented by one byte
* 256 discrete intensity values can be encoded
* 0 indicates perfect black
* 255 indicates perfect white
* Each value represents a shade of gray, called a grey-level
What is Binarization?
Reduce number of grey levels to two (foreground and background)
Objects segmented from background
Textual images or document images
Much `information’ can be lost by binarization
Binary images are often simpler to process than grayscale images
These arguments need to be traded of before choosing between binary and gray scale image processing approaches
What are Binary Images usually the result of?
Binary images are usually the result of a thresholding process.
Possible principles for thresholding
* Manual (interactive / trial and error)
* x fraction for black and white and use histogram
* distribution-based (typically: two peaks in histogram; find valleybetween two hills)
REFER TO SLIDES FOR EQUATION
Why is Thresholding difficult?
As you have to consider the value when there are other factors such as illumnation and reflection that can affect it.
What is Otsu Thresholding?
The aim is to find a threshold that minimizes the intra-class variance (i.e. minimum variation in the foreground + minimum variation in the background)
How: Using an Exhaustive search
Within-class variance = foreground variance + background variance
Minimizing the within-class variance is the same as maximizing the between-class variance
REFER TO SLIDES FOR EQUATION
What is Local Thresholding?
Niblack’s method: At each pixel position determine:
* mean 𝜇 in a region of e.g. 15 x 15 pixels
* standard deviation 𝜎 in the same region
* set local threshold to 𝑡 = 𝜇 − 0.2std (standard deviation symbol)
REFER TO SLIDES FOR EQUATIONS
What is the difference between Local and Global Thresholding methods?
Global Thresholding methods are:
* Fast
* Give good results when illumination over a page is uniform
* Fail when there are local changes in illumination
Local Thresholding methods are:
* Slow
* Adapt to local changes in illumination
* Perform well for both uniform and non-uniform illumination
What is Connected Component Analysis?
Scan the image row by row
When a foreground pixel is encountered, assign it a label:
* If the left neighbour pixel belongs to the background, a new label is assigned to the current foreground pixel
* If the left neighbour pixel belongs to the foreground, its label is copied to the current pixel
If the upper neighbour pixel belongs to the foreground, merge the label of the current pixel and that of the upper neighbour
REFER TO SLIDES FOR EXAMPLES
What are the features of Connected Components?
Shape features
* Area
* Bounding box
* Boundary length
* Compactness
Features may or may not have invariance properties
* Translation invariance
* Rotation invariance
* Scale invariance
Features of Connected Components – Area
Count number of pixels
For an arbitrarily fine resolution, the area is translation and rotation invariant.
Discretization effects may cause considerable variations.
Features of Connected Components – Bounding Box
The area around a box, the width and length of the image. Typically easy to compute.
Features of Connected Components – Boundary Length
The boundary length (perimeter) is defined as the number of pixels which
constitute the boundary of a shape.
Features of Connected Components – Compactness
compactness = area / boundary length^2
What is Morphological Image Processing?
View binary images as 2-dimensional sets
Basic set-theory concepts you are familiar with: element, subset, union, intersection, disjoint sets, complement, difference
Morphological Image Processing – Additional Basic Concepts
Reflection and Translation - REFER TO SLIDES FOR EQUATIONS
Morphological Image Processing – Dilation
REFER TO SLIDES FOR EQUATIONS
Morphological Image Processing – Erosion
REFER TO SLIDES FOR EQUATIONS
Morphological Image Processing – Opening
REFER TO SLIDES FOR EQUATIONS
Smoothens outlines
Breaks narrow bridges, removes protrusions
Morphological Image Processing – Closing
REFER TO SLIDES FOR EQUATIONS
Smoothens outlines
Fuses narrow breaks, eliminates holes, fills gaps in contour
Morphological Image Processing – Boundary Extraction
REFER TO SLIDES FOR EQUATIONS
Boundary extraction using morphological operators
What is the Distance Transform?
Finding the thickness of objects
What is the Two-Pass Algorithm - In realtion to Distance Transform
Two-Pass Algorithm: The distance transform can be computed by performing a series of local operations while scanning the image twice.
- For any p let B(p) (before) be the set of pixels (4- or 8-) adjacent to p that precede p when scanning in standard order:
- If p has coordinates (x, y), B contains (x, y – 1) and (x – 1, y), and if we use 8- adjacency it also contains (x – 1, y – 1) and (x + 1, y – 1).
- Let A(p) (`after’) be the remaining (4- or 8-) neighbours of p.
REFER TO SLIDES FOR EQUATIONS
What is Greyscale Image Analysis?
Generally, we can get more information from a grayscale image
The bulk of computer vision techniques process grayscale images
Recall that a grayscale image is a matrix of integers in the range (0-255)
What is Images as Surfaces?
REFER TO SLIDES FOR EXAMPLES
What is the concept of terrain
Uphill / downhill
Contour lines
Steepness of slope
Peaks / valleys (local extrema)
===
In Mathematical Notions
Tangent plane
Normal vector
Curvature
Gradient vectors (vectors of partial derivatives) will help compute all these
REFER TO SLIDES - 1D and 2D gradients
What are 1D and 2D Gradients?
REFER TO SLIDES