Lecture 2 - Binary Images Flashcards
(36 cards)
How are images represented and how many grey levels are there?
An image is represented as a matrix of pixel values. In grayscale images:
* Each matrix entry corresponds to the intensity level (also called a grey level).
* The intensity levels range from 0 to 255:
○ 0 represents perfect black.
○ 255 represents perfect white.
○ Values in between represent varying shades of Gray.
Each pixel in this matrix typically uses 8 bits (1 byte) to store its value.
What is the understanding of Pixel Location and Image Resolution
Each pixel has a specific location defined by its row (i) and column (j) coordinates: (i, j).
* The image size is defined by the number of rows and columns, e.g., 512 × 512.
* The image (spatial) resolution of the image refers to how detailed the image is, influenced by how many pixels are used to represent it.
○ A higher resolution image (more pixels) captures more detail and a lower resolution image appears blocky or pixelated.
What is the understanding of Memory Requirements and Bit Representation
- A grayscale pixel typically uses 8 bits to represent 256 intensity levels (0 to 255).
- For a 512 × 512 grayscale image:
○ Total pixels = 512 × 512 = 262,144
○ Memory required = 262,144 pixels × 8 bits = 2,097,152 bits = 256 KB
Compression techniques reduce the memory without degrading visual quality
What is the Effect of Reducing Image Size (Down sampling)
- Down sampling decreases the resolution by reducing the number of pixels.
- Visual effects of down sampling:
○ Pixelization: image becomes visibly blocky.
○ Loss of detail: fine textures are lost.
○ May involve reduction of grey levels too.
This impacts the ability to interpret or analyse image features.
What is a Profile in Image Analysis?
A profile refers to the variation in pixel intensity values along a specific path or line in the image—commonly a row or column.
* It is useful to visualize how intensities change across a section of the image, for example when analysing edges or features.
What is a histogram and how do you calculate it?
Histogram and How to Calculate It
* A histogram is a graphical representation of pixel intensity distribution.
* X-axis: grey level values (0 to 255).
* Y-axis: frequency of occurrence for each grey level.
* Used to identify modes, valleys, and set thresholds.
Computed by counting how many pixels have each grey level.
What is Binarization?
- Binarization is the process of converting a grayscale image into a BW image.
- Achieved by applying a threshold.
- Note: binarization simplifies processing but may cause information loss.
What is the Formula for Binarization
Uses a piecewise function where
g(x,y) = 1 if f(x,y) > T(x,y,p(x,y)) or 0 otherwise
How does T in binarization change the thresholding?
If T is constant -> global thresholding
If T depends on local property p(x,y) -> local thresholding
What are some applications of Binarization?
- Applications:
○ Cleaning scanned documents for OCR.
○ License plate recognition
○ Fingerprint and palm print analysis
○ Signature recognition
○ Edge detection
What is the difference between Black & White (BW) vs Grayscale Images
- BW image: has only two values, 0 (black) and 1 (white), or 0 and 255.
- Grayscale image: contains 256 levels of intensity.
- BW images are typically the result of thresholding a grayscale image.
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.
How to convert greyscale to BW using thresholding
Converting Grayscale to BW using Thresholding
* Thresholding methods:
○ Global thresholding: same threshold value for all pixels.
○ Local thresholding: threshold depends on local neighbourhood (e.g., local mean and standard deviation).
* Thresholding transforms the image by assigning:
○ 0 to pixels < threshold
○ 255 to pixels ≥ threshold
What is Global Threshold?
Global thresholding: same threshold value for all pixels.
* Global Thresholding:
○ Efficient and fast.
○ Suitable for uniformly illuminated images.
○ May fail in varying lighting conditions.
What is Local Threshold?
Local thresholding: threshold depends on local neighbourhood (e.g., local mean and standard deviation).
* Local Thresholding:
○ Slower.
○ Adapts to local brightness variations.
○ Works better for complex illumination.
What is an Image Window (Sliding Window)?
- A window is a small rectangular region (e.g., 15 × 15 pixels) centered on a pixel.
- Used in local thresholding to calculate local statistics (mean, std dev).
- It moves pixel-by-pixel across the image.
What is Otsu Thresholding?
A global thresholding method.
Objective: select a threshold that minimizes intra-class variance( i.e. minimum variation in the foreground + minimum variation in the background)
Alternatively: maximize inter-class variance.
What are the steps for Otsu Thresholding?
Compute the histogram and proabilities of the intensity level
Initialise the class probabilities and class means
Step through all possible thresholds t = 1 to 255
- As you do this compute probabilities and class mean
Compute FORMULA: σ_b²(t) = w₁(t) * w₂(t) * (μ₁(t) − μ₂(t))²
Select Threshold that maximises σ_b²
What is Niblacks Method?
A local Thresholding method
For each pixel t=μ−kσ
Where 𝜇 μ and 𝜎 σ are the local mean and standard deviation in the window, and 𝑘 = 0.2
What is Sauvolas Method?
A variant of Niblacks: t = μ(1 + k(σ/r − 1))
What is Connected Component Analysis?
- Scan the image pixel by pixel.
- If the pixel is part of the object (black/foreground):
- Check its neighbors (either 4-connected or 8-connected).
- If neighbors are already labeled, assign the same label.
- If not, assign a new label.
- After the first pass, a second pass may be required to merge equivalent labels.
REFER TO SLIDES FOR EXAMPLES ON HOW IT WORKS
What is Connnected Component Analysis with 4 or 8 neighbours
- 4-connected: Only connected to adjacent pixels in the left, right, top, bottom directions.
- 8-connected: Is connected to all surrounding pixels (also includes diagonals).
REFER TO SLIDES FOR EXAMPLE
What are the features of Connected Components?
Shape features
* Area
* Bounding box
* Boundary length
* Compactness
Features of Connected Components – Area
Count number of pixels
For an arbitrarily fine resolution, the area is translation and rotation invariant.