Image Processing
Download
Report
Transcript Image Processing
Image Processing
A brief introduction
(by Edgar Alejandro Guerrero Arroyo)
What is an image?
We can think in an image as a two
dimensional array of pixels.
What is Image Processing?
Image processing is any form of signal
processing for which the input is an
image.
So...is the image a signal?
Yes it is!!
A image can be tought as a two
dimensional signal.
Brief Motivation
Quantization: It’s a signal process of
approximating a continuous range of
values by a relatively small discrete set
of integer values.
Brief Motivation
Image Editing: Alterating the image.
Brief Motivation
High dynamic range image: changing
the range of luminances.
Why in Parallel?
It is expensive in time.
Suppose a pix max of 1024x1024 8-bit
pixels.
In order to operate every pixel we need
to do
operations!
We can remember the example of
project 1 of class.
Low Level Image Processing
It is natural to think about doing the
operations in a image in a pixel level.
There are several low level operations that can
be applied in images.
Such operations can be divided depending of
in what is the output based.
A single pixel: point processing
A goup of pixels: local operations
All the pixels in the image: global operations
Low Level Image Operations
Thresholding
The idea is to define a threshold value.
Later on, all the pixels with values above
the predetermined threshold value are
kept.
The rest of the pixels are reduce to 0.
Low Level Image Operations
Contrast Stretching
The range of the gray-level values is
extended.
Therefore the details are more visible.
Original range
Contrast range
Low Level Image Operations
Histograms
It’s a function that shows the # of pixels
of an image at each gray level.
It is useful to find the variations of gray
levels in an image.
Low Level Image Operations
Smooothing
It suppresses large fluctuations in intensity
over the image area.
It could be achieved by reducing the high
frequency contend.
It reduces the noise in the image but blurs it.
A simple technique is to take the mean of a
group of pixels as the new value of the central
pixel (project 1).
Low Level Image Operations
Computing the Mean
Low Level Image Operations
Sharpening
It accentuates the transitions enhancing
the detail.
One approach is to reduce the low
frequence content
Another one is to accentuate changes
through differentiation.
Low Level Image Operations
Sharpening
Low Level Image Operations
Noise Reduction
It suppresses a noise signal present in
the image.
The noise signal itself may be a random
signal completely uncorrelated with the
image signal.
One way to reduce this last is
capturating the image several times and
taking the averange of each pixel.
Low Level Image Operations
Noise Reduction
Luminance fluctuations along thin blue and red
strips of pixels in the top and the bottom
images respectively.
Low Level Image Operations
Noise Reduction
Edge Detection
The idea of identify objects from other is
clearly quite important.
What is an edge?
It’s a significant change in the gray level
intensity.
Edge Detection
Gradient and Magnitude
Let f(x) be a one-dimentional gray level
function.
f '(x) measures the gradient of the
transition.
f ''(x) helps to identify the exact position
of transition.
Edge Detection
Gradient and Magnitude
Edge Detection
But an image is a two dimensional
discretized gray level function f(x,y).
The norm of the gradient can be
aproximated to reduce computations.
Edge Detection
Edge Detection Using Masks
The idea is to use the partial derivates of
the function, (discrete).
In this way we can know the difference
between neighbouring pixel gray levels
in a row and in a column.
Edge Detection
Example
(Done in class)
Edge Detection
Prewitt Operator
As always, using more points we get
better results. (Example)
Edge Detection
Sobel Operator
Both edge detection and Smoothing.
Edge Detection
Sobel Operator
Edge Detection
Sobel Operator
Edge Detection
Laplace Operator
If the first derivate is good, the second is
better.
After it, it’s good to apply an edge detection
operator, (threshold is prefered), to get either
black or white pixels.
Edge Detection
Laplace Operator
The Hough Transform
It ‘s useful to find the parameters of equations
of lines that most likely fit the sets of pixels in
an image.
The proporse of use this is because is cheaper
than using a edge detector in simple lines,
(straight lines, circles, etc).
The Hough Transform
Example (Done in class)
Consider the problem of find the line that
contains 3 given points.
For each data point, a number of lines are
plotted going through it, all at different angles.
For each solid line a line is plotted which is
perpendicular to it and which intersects the
origin.
The length and angle of each dashed line is
measured.
This is repeated for each data point.
The Hough Transform
Example cont
(Done in class)
The Hough Transform
Example cont. (Done in class)
Fourier Series
Joseph Fourier, (1768-1830), found that
every function can be expressed as an
infinite sum of Sines and Cosines.
Fourier Transformation
The Fourier transform is an application
that sends a complex function f into an
“scary” function g as follow:
Brief explanation. (Done in class)
Discrete Fourier Transform
The sequence of N complex numbers X0, ...,
XN−1 is transformed into the sequence of N
complex numbers X0, ..., XN−1 by the DFT
according to the formula:
where
is a primitive N'th root of unity.
Calculate sequentialy this serie will cost N xN
products and N sums => O(N^2)
Discrete Fourier Transform
The Fourier Transform is used if we want
to access the geometric characteristics
of a spatial domain image.
In the image we can calculate a two
dimensional Fourier Transformation (!!!).
But instead, we can calculate the Fourier
transformation of rows and columns
separately (clever).
Discrete Fourier Transform
The kth element of the DFT is given by:
Then, the vector result can be seen as the dot product of a
matrix and a vector.
Discrete Fourier Transform
Therefore, since the DFT can be
computed as a matrix product, we can
apply a numerical algorithm to achieve
this, (maybe with our project 3).
Fast Fourier Transform
This method allows us to find the DFT in O(NLogN), in sequential
time, instead of (N^2).
Fast Fourier Transform
Binary Algorithm
Fast Fourier Transform
Binary Algorithm Analisis
Computation: Given P processors and N
points, at each steap each processor will
calculate N/P points, (1 sum and 1 product).
That’s it O(NLogN).
Communication: if P = N, then communication
occurs at each step, one data. That’s it O(N).
If P < N, then communication occurs only the
first Log P steaps. That’s it O(LogP).
Fast Fourier Transform
The image before and after Fourier Transformation. We take the
logarithm after FT, otherwise we will only see a point.
Bibliography
Wikipedia.com
Parallel Programing, Wilkinson & Allen.
Internet