Top Banner
Lecture 10 Lecture 10 Grey Level & Colour Grey Level & Colour Enhancement (2) Enhancement (2) TK3813 TK3813 Dr. Masri Ayob
54

Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

Dec 17, 2015

Download

Documents

Camron Palmer
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

Lecture 10Lecture 10Grey Level & Colour Grey Level & Colour Enhancement (2) Enhancement (2)

TK3813TK3813

Dr. Masri Ayob

Page 2: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

2

Image HistogramImage Histogram

The histogram of an image is a table containing (for every gray level K) the probability of level K actually occurring in the imageThe histogram could also be viewed as a frequency distribution of gray level within the image.

Calculation of an image histogram:

Create an array histogram with 2b elementsFor all grey levels, I, do

histogram[i]=0End for

For all pixel coordinates, x and y, doincrement histogram[f(x,y)] by 1

End for

Calculation of an image histogram:

Create an array histogram with 2b elementsFor all grey levels, I, do

histogram[i]=0End for

For all pixel coordinates, x and y, doincrement histogram[f(x,y)] by 1

End for

Page 3: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

3

Image Histogram ExampleImage Histogram Example

Page 4: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

4

Image HistogramsImage Histograms

0 32 63

Dark Image

0 32 63

Light Image

0 32 63

Low Contrast

The histogram on the left is representative of an “under-exposed” image. It has very few “bright” pixels and doesn’t make good use of the full dynamic range available.

The histogram on the left is representative of an “over-exposed” image. It has very few “dark” pixels and doesn’t make good use of the full dynamic range available.

The histogram on the left is representative of an “poor contrast” image. It has very few “dark” and very few “light” pixels. It doesn’t make good use of the full dynamic range available.

Contrast : Amount of difference between average gray level of an object and that of surroundings

Page 5: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

5

Image Histogram- Dark ImageImage Histogram- Dark Image

Page 6: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

6

Image HistogramImage Histogram

Added 150 to all pixels. If sum >255 at a pixel, gray level for that pixel is clipped to 255.

Page 7: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

7

Image HistogramsImage Histograms

The histogram on the left is representative of an image with good contrast. It makes good use of the full dynamic range available.

You can’t tell if an image is “good” just by looking at the histogram…but the histogram may give you a “tingly feeling” that something isn’t quite right.

Brightness span of an image’s gray scale

Page 8: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

8

Image HistogramImage Histogram

The histogram seems “uneven” but the image has good contrast. It just happens to be a naturally “bright” image.

Page 9: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

9

Image HistogramImage Histogram

The histogram seems “squeezed” and it does indicate (in this case) that the image has poor contrast.

Page 10: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

10

Low contrast & low dynamic rangeLow contrast & low dynamic range

Page 11: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

11

Higher contrast & dynamic rangeHigher contrast & dynamic range

Page 12: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

12

Test Your KnowladgeTest Your Knowladge

A: Both have the same histogram.

Q: The image on the right was obtained by swapping the top and bottom halves of the image on the left. What is the relationship of the histograms of the two images?

Page 13: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

13

Cumulative Distribution FunctionCumulative Distribution Function

The CDF of an image is a table containing (for every gray level K) the probability of a pixel of level K OR LESS actually occurring in the image

The CDF can be computed from the histogram as:

j

i

ij HC0

Page 14: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

14

Cumulative Distribution FunctionCumulative Distribution Function

The CDF of represents a monotonically increasing function.The derivative (slope) of the CDF is steep where there are lots of pixels and low where there are few pixels

0 32 63

Dark Image

Image histogram10 20 30 40 50 60

0.2

0.4

0.6

0.8

1

Image CDF

A function which is either entirely nonincreasing or nondecreasing. A function is monotonic if its first derivative (which need not be continuous) does not change sign.

Page 15: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

15

Cumulative Distribution FunctionCumulative Distribution Function

The CDF of an image having uniformly distributed pixel levels is a straight-line with slope 1 (using normalized gray levels). The derivative of the CDF is constant.

Image histogram

0 32 63

Low Contrast

Image CDF10 20 30 40 50 60

0.2

0.4

0.6

0.8

1

0 32 63

Good Contrast

Image histogram

10 20 30 40 50 60

0.2

0.4

0.6

0.8

1

Image CDF

Page 16: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

16

Histogram ProcessingHistogram Processing

Histogram of a digital image with gray levels in the range [0,L-1] is a discrete function

h(rh(rkk) = n) = nkk

Where rk : the kth gray level

nk : the number of pixels in the image having gray level rk

h(rk) : histogram of a digital image with gray levels rk

Page 17: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

17

Histogram ProcessingHistogram Processing

Basic for numerous spatial domain processing techniquesUsed effectively for image enhancementInformation inherent in histograms also is useful in image compression and segmentation

Page 18: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

18

Normalized HistogramNormalized Histogram

The probability of occurrence of gray level in an image is approximated by

The discrete version of transformation

k

j

j

k

jjrkk

, ..., L-, where kn

n

)r(p)r(Ts

0

0

110

110 , ..., L-, where k n

n)r(p k

kr

Page 19: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

19

Histogram EqualizationHistogram Equalization

Thus, an output image is obtained by mapping each pixel with level rrkk in the input image into a corresponding pixel with level sskk in the output image

In discrete space, it cannot be proved in general that this discrete transformation will produce the discrete equivalent of a uniform probability density function, which would be a uniform histogram

Page 20: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

20

Histogram EqualizationHistogram Equalization

As the low-contrast image’s histogram is narrow and centered toward the middle of the gray scale, if we distribute the histogram to a wider range the quality of the image will be improved.We can do it by adjusting the probability density function of the original histogram of the image so that the probability spread equally

Page 21: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

21

Histogram EqualizationHistogram Equalization

Used to automatically distribute pixel values evenly throughout the imageeach gray level should appear with identical probability in the imageOften enhances an image, but not always

Page 22: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

22

Histogram EqualizationHistogram Equalization

Page 23: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

23

Histogram EqualizationHistogram Equalization

E.g., consider equalizing the following 4-bit image using the above formula:

Page 24: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

24

Histogram EqualizationHistogram Equalization

Before

After

Page 25: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

25

Before After

Resulting image has increased dynamic range. Resulting histogram almost, Resulting image has increased dynamic range. Resulting histogram almost, but not completely, flat. Appears jagged and some gray levels unoccupied but not completely, flat. Appears jagged and some gray levels unoccupied since finite number of gray levels are available.since finite number of gray levels are available.

Page 26: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

26

Histogram Equalization ExampleHistogram Equalization Example

Source: Institue of Biotechnology, University of Helsinki, Mouse embryo 13 d pc, tissue section from molar tooth

Page 27: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

27

ExampleExample

before after Histogram equalization

Page 28: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

28

ExampleExample

2 3 3 2

4 2 4 3

3 2 3 5

2 4 2 4

4x4 image

Gray scale = [0,9]histogram

0 1

1

2

2

3

3

4

4

5

5

6

6

7 8 9

No. of pixels

Gray level

Page 29: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

29

Gray Level(j)

0 1 2 3 4 5 6 7 8 9

No. of pixels

0 0 6 5 4 1 0 0 0 0

0 0 6 11 15 16 16 16 16 16

0 06

/16

11 /16

15 /16

16 /16

16 /16

16 /16

16 /16

16 /16

s x 9 0 03.33

6.16

8.48

9 9 9 9 9

k

jjn

0

k

j

j

n

ns

0

Page 30: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

30

ExampleExample

3 6 6 3

8 3 8 6

6 3 6 9

3 8 3 8

Output image

Gray scale = [0,9]

Histogram equalization

0 1

1

2

2

3

3

4

4

5

5

6

6

7 8 9

No. of pixels

Gray level

2 3 3 2

4 2 4 3

3 2 3 5

2 4 2 4

Input image

Page 31: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

31

NoteNote

It is clearly seen that Histogram equalization distributes the gray level to reach the maximum gray level (white) because the cumulative distribution function equals 1 when 0 r L-1If the cumulative numbers of gray levels are slightly different, they will be mapped to little different or same gray levels as we may have to approximate the processed gray level of the output image to integer number Thus the discrete transformation function can’t guarantee the one to one mapping relationship

Page 32: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

32

NoteNote

Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level content of an entire image.Sometimes, we may need to enhance details over small areas in an image, which is called a local enhancement.

Page 33: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

33

Local EnhancementLocal Enhancement

define a square or rectangular neighbourhood and move the center of this area from pixel to pixel.at each location, the histogram of the points in the neighborhood is computed and histogram equalization transformation function is obtained.another approach used to reduce computation is to utilize nonoverlapping regions, but it usually produces an undesirable checkerboard effect.

a) Original image (slightly blurred to reduce noise)

b) global histogram equalization (enhance noise & slightly increase contrast but the construction is not changed)

c) local histogram equalization using 7x7 neighborhood (reveals the small squares inside larger ones of the original image.

(a) (b) (c)

Page 34: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

34

Explain the result in c)Explain the result in c)

Basically, the original image consists of many small squares inside the larger dark ones.However, the small squares were too close in gray level to the larger ones, and their sizes were too small to influence global histogram equalization significantly.So, when we use the local enhancement technique, it reveals the small areas.Note also the finer noise texture is resulted by the local processing using relatively small neighborhoods.

Page 35: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

35

ImplementationImplementation

Take a look at the built-in BuffereImageOp interface

Method Summary

 BufferedImage createCompatibleDestImage(BufferedImage src, ColorModel destCM)           Creates a zeroed destination image with the correct size and number of bands.

 BufferedImage filter(BufferedImage src, BufferedImage dest)           Performs a single-input/single-output operation on a BufferedImage.

 Rectangle2D getBounds2D(BufferedImage src)           Returns the bounding box of the filtered destination image.

 Point2D getPoint2D(Point2D srcPt, Point2D dstPt)           Returns the location of the corresponding destination point given a point in the source image.

 RenderingHints getRenderingHints()           Returns the rendering hints for this operation.

Page 36: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

36

ImplementationImplementationpublic class StandardGreyOp implements BufferedImageOp {

public BufferedImage filter(BufferedImage src, BufferedImage dest) {

checkImage(src);

if (dest == null)

dest = createCompatibleDestImage(src, null);

WritableRaster raster = dest.getRaster();

src.copyData(raster);

return dest;

}

public BufferedImage createCompatibleDestImage(BufferedImage src,

ColorModel destModel) {

if (destModel == null)

destModel = src.getColorModel();

int width = src.getWidth();

int height = src.getHeight();

BufferedImage image = new BufferedImage(destModel,

destModel.createCompatibleWritableRaster(width, height),

destModel.isAlphaPremultiplied(), null);

return image;

}

// other methods here ///

}

public class StandardGreyOp implements BufferedImageOp {

public BufferedImage filter(BufferedImage src, BufferedImage dest) {

checkImage(src);

if (dest == null)

dest = createCompatibleDestImage(src, null);

WritableRaster raster = dest.getRaster();

src.copyData(raster);

return dest;

}

public BufferedImage createCompatibleDestImage(BufferedImage src,

ColorModel destModel) {

if (destModel == null)

destModel = src.getColorModel();

int width = src.getWidth();

int height = src.getHeight();

BufferedImage image = new BufferedImage(destModel,

destModel.createCompatibleWritableRaster(width, height),

destModel.isAlphaPremultiplied(), null);

return image;

}

// other methods here ///

}

Page 37: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

37

ImplementationImplementation

public class StandardGreyOp implements BufferedImageOp {

// other methods here

public Rectangle2D getBounds2D(BufferedImage src) { return src.getRaster().getBounds(); } public Point2D getPoint2D(Point2D srcPoint, Point2D destPoint) { if (destPoint == null) destPoint = new Point2D.Float(); destPoint.setLocation(srcPoint.getX(), srcPoint.getY()); return destPoint; } public RenderingHints getRenderingHints() { return null; } public void checkImage(BufferedImage src) { if (src.getType() != BufferedImage.TYPE_BYTE_GRAY) throw new ImagingOpException("operation requires an 8-bit grey image"); }}

public class StandardGreyOp implements BufferedImageOp {

// other methods here

public Rectangle2D getBounds2D(BufferedImage src) { return src.getRaster().getBounds(); } public Point2D getPoint2D(Point2D srcPoint, Point2D destPoint) { if (destPoint == null) destPoint = new Point2D.Float(); destPoint.setLocation(srcPoint.getX(), srcPoint.getY()); return destPoint; } public RenderingHints getRenderingHints() { return null; } public void checkImage(BufferedImage src) { if (src.getType() != BufferedImage.TYPE_BYTE_GRAY) throw new ImagingOpException("operation requires an 8-bit grey image"); }}

Page 38: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

38

ImplementationImplementation

public abstract class GreyMapOp extends StandardGrayOp { protected byte[] table = new byte[256]; // lookup table public abstract void computeMapping(int low, int high);

public int getTableEntry(int i) { if (table[i] < 0) return 256 + (int) table[i]; else return (int) table[i]; }

protected void setTableEntry(int i, int value) { if (value < 0) table[i] = (byte) 0; else if (value > 255) table[i] = (byte) 255; else table[i] = (byte) value; }

public void computeMapping() { computeMapping(0, 255); } public BufferedImage filter(BufferedImage src, BufferedImage dest) { checkImage(src); if (dest == null) dest = createCompatibleDestImage(src, null); LookupOp operation = new LookupOp(new ByteLookupTable(0, table), null); operation.filter(src, dest); return dest; }}

public abstract class GreyMapOp extends StandardGrayOp { protected byte[] table = new byte[256]; // lookup table public abstract void computeMapping(int low, int high);

public int getTableEntry(int i) { if (table[i] < 0) return 256 + (int) table[i]; else return (int) table[i]; }

protected void setTableEntry(int i, int value) { if (value < 0) table[i] = (byte) 0; else if (value > 255) table[i] = (byte) 255; else table[i] = (byte) value; }

public void computeMapping() { computeMapping(0, 255); } public BufferedImage filter(BufferedImage src, BufferedImage dest) { checkImage(src); if (dest == null) dest = createCompatibleDestImage(src, null); LookupOp operation = new LookupOp(new ByteLookupTable(0, table), null); operation.filter(src, dest); return dest; }}

Page 39: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

39

ImplementationImplementation

public class SquareRootOp extends GreyMapOp {

public SquareRootOp() { computeMapping(); }

public SquareRootOp(int low, int high) { computeMapping(low, high); }

public void computeMapping(int low, int high) {

if (low < 0 || high > 255 || low >= high)

throw new java.awt.image.ImagingOpException("invalid mapping limits");

double a = Math.sqrt(low);

double b = Math.sqrt(high);

double scaling = 255.0 / (b - a);

for (int i = 0; i < 256; ++i) {

int value = (int) Math.round(scaling*(Math.sqrt(i) - a));

setTableEntry(i, value);

}

}

}

public class SquareRootOp extends GreyMapOp {

public SquareRootOp() { computeMapping(); }

public SquareRootOp(int low, int high) { computeMapping(low, high); }

public void computeMapping(int low, int high) {

if (low < 0 || high > 255 || low >= high)

throw new java.awt.image.ImagingOpException("invalid mapping limits");

double a = Math.sqrt(low);

double b = Math.sqrt(high);

double scaling = 255.0 / (b - a);

for (int i = 0; i < 256; ++i) {

int value = (int) Math.round(scaling*(Math.sqrt(i) - a));

setTableEntry(i, value);

}

}

}

Page 40: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

40

ImplementationImplementation

public class EqualiseOp extends GreyMapOp {

public EqualiseOp(Histogram hist) throws HistogramException {

float scale = 255.0f / hist.getNumSamples();

for (int i = 0; i < 256; ++i)

table[i] = (byte) Math.round(scale*hist.getCumulativeFrequency(i));

}

public void computeMapping(int low, int high) {

// Does nothing - limits are meaningless in histogram equalisation

}

}

public class EqualiseOp extends GreyMapOp {

public EqualiseOp(Histogram hist) throws HistogramException {

float scale = 255.0f / hist.getNumSamples();

for (int i = 0; i < 256; ++i)

table[i] = (byte) Math.round(scale*hist.getCumulativeFrequency(i));

}

public void computeMapping(int low, int high) {

// Does nothing - limits are meaningless in histogram equalisation

}

}

Page 41: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

41

ImplementationImplementationpublic final class Histogram implements Cloneable { public Histogram(); public Histogram(Reader reader); public Histogram(BufferedImage image) throws HistogramException; public void computeHistogram(BufferedImage image) throws HistogramException; private void accumulateFrequencies(BufferedImage image) throws HistogramException {

if (image.getType() == BufferedImage.TYPE_BYTE_BINARY || image.getType() == BufferedImage.TYPE_USHORT_GRAY) throw new HistogramException("invalid image type");

Raster raster = image.getRaster();if (image.getType() == BufferedImage.TYPE_BYTE_GRAY) { for (int y = 0; y < image.getHeight(); ++y)

for (int x = 0; x < image.getWidth(); ++x) ++freq[0][raster.getSample(x, y, 0)];

} else { int[] value = new int[3]; for (int y = 0; y < image.getHeight(); ++y)

for (int x = 0; x < image.getWidth(); ++x) { raster.getPixel(x, y, value); ++freq[0][value[0]]; ++freq[1][value[1]]; ++freq[2][value[2]];}

}}

public final class Histogram implements Cloneable { public Histogram(); public Histogram(Reader reader); public Histogram(BufferedImage image) throws HistogramException; public void computeHistogram(BufferedImage image) throws HistogramException; private void accumulateFrequencies(BufferedImage image) throws HistogramException {

if (image.getType() == BufferedImage.TYPE_BYTE_BINARY || image.getType() == BufferedImage.TYPE_USHORT_GRAY) throw new HistogramException("invalid image type");

Raster raster = image.getRaster();if (image.getType() == BufferedImage.TYPE_BYTE_GRAY) { for (int y = 0; y < image.getHeight(); ++y)

for (int x = 0; x < image.getWidth(); ++x) ++freq[0][raster.getSample(x, y, 0)];

} else { int[] value = new int[3]; for (int y = 0; y < image.getHeight(); ++y)

for (int x = 0; x < image.getWidth(); ++x) { raster.getPixel(x, y, value); ++freq[0][value[0]]; ++freq[1][value[1]]; ++freq[2][value[2]];}

}}

Page 42: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

42

PsuedoColoringPsuedoColoring

Artifical coloring (PsuedoColoring) can often enhance the presentation of image information

Replaces the gray-scale levels by an arbitrarily selected palette or color bar

Page 43: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

43

PsuedoColoringPsuedoColoring

50 100 150 200 250

0.2

0.4

0.6

0.8

1Pseudo Color Table

50 100 150 200 250

0.2

0.4

0.6

0.8

1Pseudo Color Table

50 100 150 200 250

0.2

0.4

0.6

0.8

1Pseudo Color Table

50 100 150 200 250

0.2

0.4

0.6

0.8

1Pseudo Color Table

Color Tables are arbitrarily selected Palettes of colors. There are ways to automatically compute interesting palettes. Tables below were generated using offset sinusoidal waves in each of the RGB bands

Page 44: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

44

PsuedoColoringPsuedoColoring

The color tables below were generated by using offset sinusoids into each of the RGB bands.

50 100 150 200 250

0.2

0.4

0.6

0.8

1Pseudo Color Table

50 100 150 200 250

0.2

0.4

0.6

0.8

1Pseudo Color Table

50 100 150 200 250

0.2

0.4

0.6

0.8

1Pseudo Color Table

50 100 150 200 250

0.2

0.4

0.6

0.8

1Pseudo Color Table

Page 45: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

45

Psuedo Coloring ExamplePsuedo Coloring Example

Weather satellite image. Note the way the colorized image brings out certain details that are difficult to distinguish in the original.

Page 46: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

46

Psuedo Coloring ExamplePsuedo Coloring Example

Source: Institue of Biotechnology, University of Helsinki, Mouse embryo 13 d pc, tissue section from molar tooth

The above tissue sample is colorized using two different color tables. Take your pick!

Page 47: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

47

Image AveragingImage Averaging

consider a noisy image g(x,y) formed by the addition of noise (x,y) to an original image f(x,y)

g(x,y) = f(x,y) + (x,y)

Page 48: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

48

Image AveragingImage Averaging

if noise has zero mean and be uncorrelated then it can be shown that if

),( yxg = image formed by averaging K different noisy images

K

ii yxg

Kyxg

1

),(1

),(

Page 49: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

49

Image AveragingImage Averaging

Note: the images gi(x,y) (noisy images) must be registered (aligned) in order to avoid the introduction of blurring and other artifacts in the output image.

Page 50: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

50

ExampleExample

a) original imageb) image corrupted by additive Gaussian noise with zero mean and a standard deviation of 64 gray levels.c). -f). results of averaging K = 8, 16, 64 and 128 noisy images

a b

c d

e f

Page 51: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

51

Image SubtractionImage Subtraction

g(x,y) = f(x,y) – h(x,y)g(x,y) = f(x,y) – h(x,y)

Enhancement of the differences between images.

Page 52: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

52

Image SubstractionImage Substraction

Page 53: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

53

Image SubstractionImage Substraction

Page 54: Lecture 10 Grey Level & Colour Enhancement (2) TK3813 Dr. Masri Ayob.

54