Reduksi Noise-jilid-6 - Repository UNIKOM

  Pertemuan-8

REDUKSI NOISE

  John Adler KK-Komputasi dan Kecerdasan Buatan Teknik Komputer Universitas Komputer Indonesia-UNIKOM Face morphing

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, and scaling the image to a reasonable size.

  

Noise reduction

Features finding:

  

4 major feature points, namely the two

eyes, and the two endpoints of the mouth. Within the scope of this project, we developed an eye-finding algorithm

that successfully detects eyes at 84%

rate.

  

Median filtering

Mask = Median value of the appropriate 9 pixels

Median filtering images

  Digital chest radiograph with After application of 3x1 medial Reduksi Noise

  Shot & Salt Pepper Noise

  Filter Median

  Filter Min & Max Min

  Filter Max & Min Max

DITHERING

  John Adler KK-Komputasi dan Kecerdasan Buatan Teknik Komputer Universitas Komputer Indonesia-UNIKOM Dithering Methods

  • There are three dithering methods that are commonly

    used in image processing programs:
    • noise
    • pattern
    • error diffusion dithering
    Dithering Methods - Noise 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

Figure 3.4 Noise

  (i.e., random)

Figure 3.3 Thresholding

  dithering Dithering Methods - Pattern Pattern dithering (also called ordered dithering or the

  • Bayer method) (a)
  • 2 Uses a regular pattern of dots to simulate c

    • – An m × m array of values between 1 and m 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

  • – 2

  Each pixel value p is scaled to a value p′ between

  0 and m Dithering Methods - Pattern 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
  • – black; otherwise, it is white
Dithering Methods - Pattern 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

Figure 3.5 Pattern dithering Dithering Methods – Error Diffusion (1) 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
  • – is the color in the reduced palette closest to the pixel’s new value
Dithering Methods – Error Diffusion (2) Error diffusion dithering (also called the Floyd–

  • Steinberg algorithm)

  The results of error diffusion dithering method are shown in

  • – Figure 3.6

Figure 3.6 Error diffusion dithering Dithering

  • Compensates for lack of color resolution

  • Eye does spatial averaging
  • Black/white dithering to achieve gray scale
    • – Each pixel is black or white
    • – From far away, color determined by fraction of white
    • – For 3x3 block, 10 levels of gray scale
    Dithering

    Dithering takes advantage of the human eye's tendency to "mix"

    two colors in close proximity to one another.

Dithering

  

Dithering takes advantage of the human eye's tendency to "mix"

two colors in close proximity to one another. with dithering original 24 no dithering 8 8 Colors = 2 Colors = 2

  Colors = 2 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

  7/16 3/16 5/16 1/16

  

Floyd-Steinberg Error Diffusion

Floyd-Steinberg Error Diffusion

  Enhances edges Retains high frequency Some checkerboarding

  

From

  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
    • – Generally looks good

SPATIAL FILTERING

  John Adler KK-Komputasi dan Kecerdasan Buatan Teknik Komputer Universitas Komputer Indonesia-UNIKOM Convolution – Gaussian Blur (1) 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

Figure 3.25 Convolution for

  Averaging pixels in a 3 × 3 neighborhood Convolution – Gaussian Blur (2)

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

Figure 3.26 Convolution

  mask for Gaussian blur Reduction

Image with noise Median filter (5x5)

  Reduction Original image Image with noise Median filter (5x5)

Some common types are:

  • Neighborhood-averaging filters
  • Median filters
  • Mode 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

weights are equal then this is a mean filter.

"linear"

  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 sorting of the values. However, this method is generally very good at preserving edges.

  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

example, each class could be some type of

terrain, crop type, water, etc..

  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 Semester 2011, Vanderbilt University School of Engineering