Week 1 - Image Processing Flashcards
What are the four ways we can represent an image
Image Function
Landscape
Array of pixels
Image histogram
What is a grayscale image function
I : R^2 - > R
(x,y) -> I(x,y)
Gives the Intensity at position I(x,y)
A digital image is a discrete (sampled) version of this function
What is an image landscape
Imagine throwing a piece of cloth over a scene
creates a smooth and continuous landscape
What is an image histogram
Count the amount of pixels at each grey level
What is Spatial Resolution
The number of pixels that determines the resolution
(want more detail -> need more pixels)
eg Pixels per inch
-Allows for smaller scale structured images (to be seen in detail)
-constantly increases in digital cameras
What is grey level resolution
Number of different shades of grey that can be represented in an image
Higher resolution - > captures fine changes in brightness
What is important about having an array of pixels representation
We get the spatial relationship
What is Image arithmetic
Considering images as functions
g(x,y) = f(x,y) + 20
brightens by 20
g(x,y) = f(-x,y)
image is inverted along the y axis
What is image addition and what does it do visually
Takes the average over images in a sequence
(adding the two corresponding pixels)
Reduces noise
What is image subtraction and what does it do visually
Takes the difference of two images
Can capture a movement between two static background (the leftover is the moving object in the image)
Captures, shadows, reflections
What is Noise
A stochastic (random) process
All images contain noise
Do identical images have the same noise
No
How do we model noise
As small fluctuations
Noise is normally distributed
Some small fluctuations may actually be small changes in an image and not noise
What is the signal-to-noise ratio
SNR = max signal / σ
σ has subscript noise
Larger σ creates a smaller ratio and a more noisy image
How do we reduce noise by temporal averaging
We can average noise over N images
σ(subscript N) = σ / √N
Take N consecutive samples of the same image
the noise reduces
How do we reduce noise by spatial averaging
(When we do not have the choice of sampling an image n times)
Pass a 3x3 mask over an image, replacing the central pixel with the average of neighbours
“local averaging”
What is the issue with reducing noise by spatial averaging
Lose resolution - like blurring 5x5
particularly along edges
What is sub-sampling
Throw away every other row and columns in the image to create a 1/2 size image
Creates a very scruffy output
How can we improve sub-sampling
Local average first (which removes small scale detail and noise) then subsample
Means we are not keeping noise
What are the 3 ways we can define noise using its neighbours
Noisy dark areas
-just a messy area of dark pixels
Just noise
-white pixels with one dark pixels (one noise pixel)
Vertical edge
-noise is aligned vertically
What is neighbourhood processing and the 2 main methods
Modifying the pixel values of an image based on the values of neighboring pixels in a window
1) Rank filtering
2) Convolution
What is Rank filtering
Takes values in the filter window and orders them darkest to lightest
There are different ways to rank: minimum (erosion), maximum (dilation), median filtering
Replace the middle pixel with whichever chosen method (minimum/median/maximum)
Move to the next window and repeat
What is the effect of median filtering
Removes both dark and light noise spots
It is not the same as taking the mean
Mean -> creates shades of grey
Median - > produces only either white or black, keeps sharp edges
Works very well for salt and pepper noise
What is Convolution
Very often used in pre-processing
Want to maintain the spatial patterns
Uses a weighted filter window
Eg 1 2 1
applied to input image: 0.5 1 1
only changing the middle value to the average of all
The middle value = 0.9
NOTE divide by 4 (total of filter weight) not by pixel number
What is a kernel
filter/mask/convolution mask/ window
What is asterisk notation for convolution
I~ = g * I
or
I~ = I * g
g = kernel weights
I = input image
I~ = output image
Why does convolution create a cropped output image
We cannot begin in the corner pixel as it does not have a full set of 3x3 neighbors
What are 3 padding methods
Zero: set all pixels outside image to 0
constant (border colour): set all pixels outside source image to specific value
mirror: reflect pixels across the image edge
What is linear filtering
output is a linear combination of the input pixel values within a local neighborhood
What is a smoothing kernel
9x9 mask filled with 1s
(constant mask)
___|-|___
What is a gaussian kernel
Smoothing using a normal distribution
Any kernel representing a single bump distribution will blur the image
1 2 1
2 4 2
1 2 1
How does changing sigma affect the gaussian filter
small σ = sharper, more weight to central pixels, less blur
large σ = weight spread, more blurred
What is segmentation
The division into background pixels and object pixels
grayscale image -> binary label image
Only applicable in simple, high contrasting images
What is thresholding
b(x,y) = (g(x,y) < T)
If we want the dark pixels (objects of interest)
b(x,y) is a binary image
We can use two thresholds if we want two different gray levels
What is a bimodal image histogram
A histogram that shows two distinct levels
background/foreground
What is the intermodal minimum
Where we place the threshold
marks in between background and foreground pixel values
Histogram as a derivative of area
H(D) = dA(D) /dD
where D = grey level
Because the area under the histogram curve represents the total intensity
What is Adaptive Thresholding
When we encounter shaded backgrounds and a single threshold wont work
Smooths first to get estimate of varying background
Subtract smoothed image from the original
Then threshold
What is over/under segmentation
Thresholding too high(over) or low(under) causing a poor quality output image
How do we carry out automated thresholding selection
There are many algorithms that do this
What does having longer words at each pixel allow
Each pixel can display a greater range of grey values
(bits per pixel)
what is a word
basic unit of data that can process a single operation
size of word = __bits
commonly 1 byte = 8 bits
What do lighter pixels in grayscale images represent
objects (why dilation = choosing maximum Intensity pixel)
Is convolution linear filtering
Yes
Is median filtering linear filtering
No