REDUKSI NOISE
KK-Komputasi dan Kecerdasan Buatan
Teknik Komputer
Universitas Komputer Indonesia-UNIKOM
John Adler
5/11/19 1
Procedures adopted
Pre-processing:
When getting an image containing human faces,
it is always better to do some pre-processing such
like removing the noisy backgrounds,
clipping to get a proper facial image,
Features finding:
4 major feature points, namely the two
eyes, and the two endpoints of the
Median filtering
Mask
= Median value of
the appropriate 9 pixels
in the original image
Median filtering images
Digital chest
radiograph with
Reduksi Noise
Filter Median
Filter Max & Min Max
DITHERING
KK-Komputasi dan Kecerdasan Buatan
Teknik Komputer
Universitas Komputer Indonesia-UNIKOM
17
Dithering Methods
Dithering
•
There are three dithering methods that are commonly
used in image processing programs:
– noise – pattern
Dithering Methods - Noise
Dithering
•
Noise dithering
(also called
random dithering
)
– Eliminates the patchiness and high black/white contrast by
adding high frequency noise—speckles of black and white that, when combined by the eye, look like shades of gray
– Figure 3.3, shows thesholding which results in large patches of
black and white
19
Dithering Methods - Pattern
Dithering
•
Pattern dithering
(also called
ordered dithering
or the
Bayer method
) (a)
– Uses a regular pattern of dots to simulate colors
– An m × m array of values between 1 and m2 is applied to each m × m block of pixels in the image file called a mask
– The numbers in the mask will determine the appearance of the
pattern in the dithered image file, e.g., 1 7 4
5 8 3 6 2 9
–
Each pixel value
p
is scaled to a value
p′
between
Dithering Methods - Pattern
Dithering
•
Pattern dithering
(also called
ordered dithering
or the
Bayer method
) (b)
– In this case, we can divide all the pixels by 25.6 and drop the
remainder
– Assuming that the values initially are between 0 and 255, this
will result in normalized values between 0 and 9
– Then the normalized pixel value is compared to the value in the
corresponding position in the mask
– If p′ is less than that value, the pixel is given the value 0, or
21
Dithering Methods - Pattern
Dithering
•
Pattern dithering
(also called
ordered dithering
or the
Bayer method
) (c)
– Pattern dithering is easy and fast, but it can result in a
crosshatched effect, see Figure 3.5
Dithering Methods – Error Diffusion (1)
Dithering
•
Error diffusion dithering
(also called the
Floyd–
Steinberg algorithm
)
– Is a method that disperses the error, or difference between a
pixel’s original value and the color (or grayscale) value available
– For each pixel, the difference between the original color and
the color available is calculated
– Then this error is divided up and distributed to neighboring
pixels that have not yet been visited
– After all pixels have been visited, the color used for each pixel
23
Dithering Methods – Error Diffusion (2)
Dithering
•
Error diffusion dithering
(also called the
Floyd–
Steinberg algorithm
)
– The results of error diffusion dithering method are shown in
Figure 3.6
Dithering
•
Compensates for lack of color resolution
•
Eye does spatial averaging
•
Black/white dithering to achieve gray scale
– Each pixel is black or white
Dithering
Dithering
Dithering takes advantage of the human eye's tendency to "mix"
two colors in close proximity to one another.
original
no dithering
with dithering
Ordered Dithering
•
How do we select a good set of patterns?
•
Regular patterns create some artifacts
•
Example of good 3x3 dithering matrix
6 8 4 1 0 3 5 2 7
Floyd-Steinberg Error Diffusion
• Diffuse the quantization error of a pixel to its neighboring pixels • Scan in raster order
• At each pixel, draw least error output value
• Add the error fractions into adjacent, unwritten pixels
• If a number of pixels have been rounded downwards, it becomes
more likely that the next pixel is rounded upwards
Floyd-Steinberg Error Diffusion
Enhances edges
Color Dithering
•
Example: 8 bit framebuffer
– Set color map by dividing 8 bits into 3,3,2 for RGB – Blue is deemphasized because we see it less well
•
Dither RGB separately
– Works well with Floyd-Steinberg
SPATIAL
FILTERING
KK-Komputasi dan Kecerdasan Buatan
Teknik Komputer
Universitas Komputer Indonesia-UNIKOM
33
Convolution – Gaussian Blur (1)
Spatial Filtering
•
The mask shown in Figure 3.25 takes an average of the
pixels in a 3 × 3 neighborhood
•
An alternative for smoothing is to use a
Gaussian blur
,
where the coefficients in the convolution mask get smaller as
you move away from the center of the mask
Convolution – Gaussian Blur (2)
Spatial Filtering
•
It is called a Gaussian blur because the mask values both
the horizontal and vertical directions vary in the shape of a
Gaussian bell curve (see Figure 3.26)
•
These values result in a weighted average of neighboring
pixels
Example: Noise
Reduction
Some common types are:
•
Neighborhood-averaging filters
•
Median filters
Neighborhood-averaging filters
These replace the value of each pixel, by a
weighted-average of the pixels in some
neighborhood around it, i.e. a weighted sum
of the weights are non-negative. If all the
Median filters
This replaces each pixel value by the median
of its neighbors, i.e. the value such that 50%
of the values in the neighborhood are above,
and 50% are below. This can be difficult and
costly to implement due to the need for
Mode filters
Each pixel value is replaced by its most
common neighbor. This is a particularly useful
filter for
classification
procedures where each
pixel corresponds to an object which must be
placed into a class; in remote sensing, for
Referensi
•
Erkki Rämö, Digital Media, “Image
Processing”, Principal Lecturer, Metropolia
University of Applied Sciences.
•
Richard Alan Peters II,
EECE/CS 253 Image
Processing, Lecture Note : Reduction of
Uncorrelated Noise,
Department of Electrical
Engineering and Computer Science, Fall
TERIMA KASIH