0% found this document useful (0 votes)
68 views

Lesson 3 PERSPECTIVE TRANSFORMATION

The document discusses perspective transformation and the different frames of reference used to transform 3D scenes and objects into 2D images. It explains that perspective transformation deals with converting a 3D world image into a 2D one using similar principles as human vision and cameras. It describes the five main frames of reference used - object, world, camera, image, and pixel - and how transformations occur between these frames to map 3D points onto a 2D image plane. Mathematical representations of these transformations are also provided.

Uploaded by

PETER
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views

Lesson 3 PERSPECTIVE TRANSFORMATION

The document discusses perspective transformation and the different frames of reference used to transform 3D scenes and objects into 2D images. It explains that perspective transformation deals with converting a 3D world image into a 2D one using similar principles as human vision and cameras. It describes the five main frames of reference used - object, world, camera, image, and pixel - and how transformations occur between these frames to map 3D points onto a 2D image plane. Mathematical representations of these transformations are also provided.

Uploaded by

PETER
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 81

PERSPECTIVE TRANSFORMATION

• When human eyes see near things they look


bigger compared to those far away.
• This is called perspective in a general way.
• Transformation is the transfer of an object
from one state to another.
• Perspective transformation deals with the
conversion of 3D world image into 2D image.
• The same principle on which human vision
and camera works.
11/30/2019 Lesson 2 1
Frame of reference Concept
• Frame of reference is basically a set of values
in relation to which we measure something.

11/30/2019 Lesson 2 2
5 frames of reference
• In order to analyze a 3D world/image/scene,
5 different frame of references are required.
– Object
– World
– Camera
– Image
– Pixel

11/30/2019 Lesson 2 3
• Object coordinate frame
– Object coordinate frame is used for modeling
objects.
– For example, checking if a particular object is in a
proper place with respect to the other object.
– It is a 3D coordinate system.

• World coordinate frame


– World coordinate frame is used for co-relating
objects in a 3D world.
– It is a 3D coordinate system.

11/30/2019 Lesson 2 4
• Camera coordinate frame
– Camera co-ordinate frame is used to relate objects
with respect to the camera.
– It is a 3D coordinate system.
• Image coordinate frame
– It is not a 3D coordinate system, rather it is a 2D
system.
– It is used to describe how 3D points are mapped
in a 2D image plane.
• Pixel coordinate frame
– It is also a 2D coordinate system.
– Each pixel has a value of pixel co ordinates.

11/30/2019 Lesson 2 5
Transformation between these 5 frames

• That's how a 3D scene is transformed into 2D,


with image of pixels.
11/30/2019 Lesson 2 6
Transformation rep’d mathematically

• Where
– Y = 3D object
– y = 2D Image
– f = focal length of the camera
– Z = distance between object and the camera

11/30/2019 Lesson 2 7
• There are two different angles formed in this
transform which are represented by Q. They are:
1) ) Where minus denotes that image is inverted

2)
• Comparing these two equations we get
• From this equation, we can see that when the
rays of light reflect back after striking the object,
passed in the camera, an inverted image is
formed.
11/30/2019 Lesson 2 8
Calculating the size of image formed
• Suppose an image has been taken of a person 5m
tall, and standing at a distance of 50m from the
camera, and we have to tell the size of the image
of the person, with a camera of focal length 50mm.
• The focal length is in millimeter, so convert
everything in millimeter.
– Y = 5000 mm.
– f = 50 mm. = -5 mm.
– Z = 50000 mm.
• Minus sign indicates that the image is inverted.

11/30/2019 Lesson 2 9
CONCEPT OF BITS PER PIXEL
• Bpp or bits per pixel denotes the number of
bits per pixel. The number of different colors
in an image depends on the depth of color or
bits per pixel.
• Number of different colors
Bits per pixel Number of colors
1 bpp 2 colors
2 bpp 4 colors
3 bpp 8 colors
4 bpp 16 colors
5 bpp 32 colors
6 bpp
11/30/2019 64 colors Lesson 2 10
• Shades

• Color images are usually of the 24 bpp format,


or 16 bpp.
• Color values
• Black color:
– Remember, 0 pixel value always denotes black
color. But there is no fixed value that denotes
white color.
• White color:
– The value that denotes white color can be
calculated as :

11/30/2019 Lesson 2 11
• Gray color:
• Gray color is the midpoint of black and white.
• In case of 8bpp, the pixel value that denotes
gray color is 127 or 128bpp if you count from
1, not from 0.

11/30/2019 Lesson 2 12
Image storage requirements
• Image size
– The size of an image depends upon three things.
• Number of rows
• Number of columns
• Number of bits per pixel
• Size of an image = rows * cols * bpp

11/30/2019 Lesson 2 13
TYPES OF IMAGES
• The binary image
– The binary image as it name states, contain only two pixel
values.
– 0 and 1.
• 0 refers to black color and 1 refers to white color. It is
also known as Monochrome.
• Black and white image:
• The resulting image that is formed hence consist of
only black and white color and thus can also be
called as Black and White image.

11/30/2019 Lesson 2 14
– No gray level
– In Binary image that there is no gray level in it. Only
two colors that are black and white are found in it.
– Format: Binary images have a format of PBM
(Portable bitmap)
• 2, 3, 4,5, 6 bit color format
• The images with a color format of 2, 3, 4, 5 and 6
bit are not widely used today. They were used in
old times for old TV displays, or monitor displays.
• But each of these colors have more than two gray
levels, and hence has gray color unlike the binary
image.
• In a 2 bit 4, in a 3 bit 8, in a 4 bit 16, in a 5 bit 32,
in a 6 bit 64 different colors are present.

11/30/2019 Lesson 2 15
• 8 bit color format
– 8 bit color format is one of the most famous image
format.
– It has 256 different shades of colors in it. It is
commonly known as Grayscale image.
– The range of the colors in 8 bit vary from 0-255.
Where 0 stands for black, and 255 stands for white,
and 127 stands for gray color.
– This format was used initially by early models of the
operating systems - UNIX and the early color
Macintoshes.
• Format: The format of these images are PGM
(Portable Gray Map)

11/30/2019 Lesson 2 16
• 16 bit color format
– It is a color image format.
– It has 65,536 different colors in it.
– It is also known as High color format.
– It has been used by Microsoft in their
systems that support more than 8 bit color
format.

11/30/2019 Lesson 2 17
• The distribution of color in a color image is not
as simple as it was in grayscale image.
• A 16 bit format is actually divided into three
further formats which are Red, Green and
Blue. The famous RGB format.

11/30/2019 Lesson 2 18
• Distribution of 16 bit is done as: 5 bits for R, 6
bits for G, 5 bits for B.
• The additional bit is added to the green bit,
because green is the color which is most
soothing to eyes in all of these three colors.
• Another distribution of 16 bit format is:
• 4 bits for R, 4 bits for G, 4 bits for B, 4 bits for
alpha channel.
• Or 5 bits for R, 5 bits for G, 5 bits for B, 1 bits
for alpha channel.

11/30/2019 Lesson 2 19
• 24 bit color format
– 24 bit color format also known as true color format.
Like 16 bit color format, in a 24 bit color format, the
24 bits are distributed equally between three
different channels of Red, Green and Blue.
– 8 bits for R, 8 bits for G, 8 bits for B.

11/30/2019 Lesson 2 20
• Unlike a 8 bit gray scale image, which has one
matrix behind it, a 24 bit image has three
different matrices of R, G, B. RGB components
10 10 16 28
 9 656 7026
56  43
37  78
 32 99 54 70  67 
96 56
15  256013 902296
  67
• Format   21  54 47  42 
32 158587 853943  92
54  65 65 39 
– It is the most common used format. 32 65 87 99

– Its format is PPM- Portable pix Map which is


supported by Linux operating system.
– The famous windows has its own format which is
BMP Bitmap.

11/30/2019 Lesson 2 21
• COLOR CODES CONVERSION
• Different color codes
– Binary color format
– Black-0,0,0
– White-255,255,255
– Red-255,0,0
– Gray color-128,128,128
• The gray color is actually the midpoint.
• In an 8-bit format, the midpoint is 128 or 127.
• In this case we chose 128.

11/30/2019 Lesson 2 22
• CMYK color model:
– CMYK is another color model where c stands for
cyan, m stands for magenta, y stands for yellow,
and k for black.
– CMYK model is commonly used in color printers.
• Color: Cyan-0,255,255
– Cyan color is formed from the combination of
Green and blue.
– Magenta-255,0,255
– Magenta color is formed from the combination of
Red and Blue.

11/30/2019 Lesson 2 23
• Conversion from RGB to Hex code:
– To convert RGB to Hex:
• Take a color. E.g: White = 255,255,255.
• Take the first portion e.g 255.
• Divide it by 16.

• Take the two numbers below line, the factor, and the
remainder.
• In this case it is 15 which is FF.
• Repeat the step 2 for the next two portions.
• Combine all the hex code into one.
– Answer: #FFFFFF
11/30/2019 Lesson 2 24
• Conversion from Hex to RGB:
– Take a Hex number. E.g: #FFFFFF
– Break this number into 3 parts: FF FF FF
– Take the first part and separate its components: F F
– Convert each of the part separately into binary:
1111 1111
– Now combine the individual binaries into one:
11111111
– Convert this binary into decimal: 255
– Now repeat step 2, two more times.
– Answer: 255,255,255

11/30/2019 Lesson 2 25
• Common colors and their Hex code
Color Hex Code
Black #000000
White #FFFFFF
Gray #808080
Red #FF0000
Green #00FF00
Blue #0000FF
Cyan #00FFFF
Magenta #FF00FF
Yellow #FFFF00
11/30/2019 Lesson 2 26
• RGB TO GRAYSCALE CONVERSION
• Converting RGB color Image to Gray scale
image
• Two methods are:
– Average method
– Weighted method or luminosity method
• Average method
– Take the average of three colors.
– Grayscale = R+G+B/3

11/30/2019 Lesson 2 27
• Example

• A color image shown on the left converted into


grayscale using average method, the result appears as
the image on the right.
• Explanation
– There is one thing to be sure, that something happens to
the original works. It means that our average method
works. But the results were not as expected. We wanted to
convert the image into a grayscale, but this turned out to
be a rather black image.

11/30/2019 Lesson 2 28
• Problem
– This problem arise due to the fact, that we take
average of the three colors. Since the three
different colors have three different wavelength
and have their own contribution in the formation
of image, so we have to take average according to
their contribution.
– What was done was, 33% of Red, 33% of Green,
33% of Blue, each of the portion has same
contribution in the image. But in reality that's not
the case.
• The solution to this is luminosity/weighted
average method.

11/30/2019 Lesson 2 29
• Weighted method or luminosity method
– Since red color has more wavelength of all the
three colors, and green is the color that has not
only less wavelength than red color but also green
is the color that gives more soothing effect to the
eyes.
– Decrease the contribution of red, increase the
contribution of the green color, and put blue color
contribution in between these two.
• So the new equation that form is:
– New grayscale image = (0.3∗R+ 0.59∗G + 0.11∗B).
– Red contribute 30%, Green 59% and Blue 11%.
11/30/2019 Lesson 2 30
• Applying this equation to the image, we get
this

• Original Image Gray scale image


• Explanation
• The image has been properly converted to
grayscale using weighted method.
• Compared to average method, this image is
more brighter.
11/30/2019 Lesson 2 31
HISTOGRAMS
• A histogram is a graph that shows frequency
of occurring of data in the whole data set.
• A Histogram has two axis the x axis and the y
axis.
• The x axis contains event whose frequency
you have to count.
• The y axis contains frequency.
• The different heights of bar shows different
frequency of occurrence of data.

11/30/2019 Lesson 2 32
• Example

11/30/2019 Lesson 2 33
• Histogram of an image
• Histogram of an image, like other histograms
also shows frequency.
• An image histogram, shows frequency of
pixels intensity values.
• In an image histogram, the x axis shows the
gray level intensities and the y axis shows the
frequency of these intensities.

11/30/2019 Lesson 2 34
• Example

• The x axis of the histogram shows the range of pixel


values.
• Since its an 8 bpp image, that means it has 256 levels
of gray or shades of gray in it.
• That's why the range of x axis starts from 0 and end at
255 with a gap of 50.
• Whereas on the y axis, is the count of these
intensities.

11/30/2019 Lesson 2 35
• Applications of Histograms in Image
Processing
a)Analysis of the image. We can predict the
appearance of an image by just looking at its
histogram.
– Its like looking an x ray of a bone of a body.
b) Brightness purposes. The histograms has wide
application in image brightness. Not only in
brightness, but histograms are also used in
adjusting contrast of an image.
c) Equalizing an image.
d) Thresholding. This is mostly used in computer
vision.

11/30/2019 Lesson 2 36
BRIGHTNESS AND CONTRAST
• Brightness
– Brightness is a relative term. It depends on your
visual perception.
– The amount of energy output by a source of light
relative to the source we are comparing it to.
– In some cases we can easily say that the image is
bright, and in some cases, it's not easy to
perceive.

11/30/2019 Lesson 2 37
• Making an Image Brighter
– Brightness can be simply increased or decreased
by simple addition or subtraction, to the image
matrix.
– Consider this black image of 5 rows and 5 columns

• This image matrix is given below.


0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
11/30/2019 0 0 0 0 2
Lesson 0 38
• Add 50 to each of the matrix value of the
image 1 and see what the image has become.

• If the matrix of the image1 contains 100 at


each index

11/30/2019 Lesson 2 39
• Contrast
– Contrast is the difference between maximum and
minimum pixel intensity in an image.
– Consider the final image1 in brightness.

• The matrix of this image is:


100 100 100 100 100
100 100 100 100 100
100 100 100 100 100
100 100 100 100 100
100 100 100 100 100

11/30/2019 Lesson 2 40
• The maximum value in this matrix is 100.
• The minimum value in this matrix is 100.
• Contrast = maximum pixel intensity subtracted
by minimum pixel intensity
= 100 subtracted by 100 = 0
0 means that this image has 0 contrast.

11/30/2019 Lesson 2 41
IMAGE TRANSFORMATIONS
• Transformation is a function that maps one set
to another set after performing some
operations.
• Digital Image Processing system
– In digital image processing system the input is an
image and output is an image too.
– And the system perform some processing on the
input image and gives its output as a processed
image. It is shown below.

11/30/2019 Lesson 2 42
• The function applied inside this digital system
process an image and convert it into output
can be called as transformation function.

11/30/2019 Lesson 2 43
• Image transformation.
– Consider this equation Gx,y = T{ fx,y}
– In this equation, Fx,y = input image on which
transformation function has to be applied.
– Gx,y = the output image or processed image.
– T is the transformation function.
– This relation between input image and the
processed output image can also be represented
as.
– s = T r, where r is actually the pixel value or gray
level intensity of fx,y at any point.
– And s is the pixel value or gray level intensity of
gx,y at any point.

11/30/2019 Lesson 2 44
• Consider this transformation function.

• Let's take the point r to be 256, and the point p to be 127.


Consider this image to be a one bpp image.
• That means we have only two levels of intensities that are 0
and 1. So in this case the transformation shown by the graph
can be explained as.
– All the pixel intensity values that are below 127 point p are
0, means black.
– And all the pixel intensity values that are greater than 127,
are 1, that means white.
– But at the exact point of 127, there is a sudden change in
transmission, so we cannot tell that at that exact point, the
value would be 0 or 1.
11/30/2019 Lesson 2 45
• Mathematically this transformation function
can be denoted as:

• Consider another transformation like this

11/30/2019 Lesson 2 46
• In the graph, there is a straight transition line
between input image and output image.
• It shows that for each pixel or intensity value of input
image, there is a same intensity value of output
image.
• That means the output image is exact replica of the
input image.
• It can be mathematically represented as:
– gx,y = fx,y
• The input and output image in this case are as shown
below.

11/30/2019 Lesson 2 47
• HISTOGRAM SLIDING
– In histogram sliding, we just simply shift a
complete histogram rightwards or
leftwards.
– Due to shifting or sliding of histogram
towards right or left, a clear change can be
seen in the image.
– Histogram sliding can be used for
manipulating brightness.

11/30/2019 Lesson 2 48
• Increasing brightness using histogram sliding

• On the y axis of this histogram are the frequency


or count. And on the x axis, we have gray level
values.
• From the histogram, those gray level intensities
whose count is more then 700, lies in the first
half portion, towards blacker portion.
• Hence the image is a bit darker.

11/30/2019 Lesson 2 49
• To brighten the image, slide its histogram
towards right, or towards whiter portion.
• Add atleast a value of 50 to this image.
• It can be seen from the histogram, that the
image also has 0 pixel intensities, that are
pure black.
• Adding 50 to 0, shifts all the values that lies at
0 intensity to 50 intensity and all the rest of
the values are shifted accordingly.

11/30/2019 Lesson 2 50
• Comparing the images

• As can be seen from the new histogram all the


pixels values has been shifted towards right.
11/30/2019 Lesson 2 51
• Decreasing brightness using histogram sliding
– To decrease brightness of this new image to such an extent
that the old image look brighter, we got to subtract some
value from all the matrix of the new image.
– If 80 is subtracted, the new image becomes darker than
the original image.

11/30/2019 Lesson 2 52
HISTOGRAM STRETCHING
• This enables contrast enhancement.
• There are two methods of enhancing contrast.
– The first one is called Histogram stretching that
increase contrast.
– The second one is called Histogram equalization
that enhance contrast.

11/30/2019 Lesson 2 53
• Increasing the contrast of the image
• To stretch contrast use the following formula

• Need to find the minimum and maximum pixel


intensity and multiply by levels of gray.
• If the image is 8bpp, the levels of gray are 256.
• The minimum value is 0 and the maximum value is
255. Substituting in the formula

– where fx,y denotes the value of each pixel intensity


11/30/2019 Lesson 2 54
• Example
• The following image appear after applying histogram stretching.

• Note the shape and symmetry of histogram.


• The histogram is now stretched or expanded.
• Hence we can say that the contrast of the image is
increased.
• This method fails in some cases
11/30/2019 Lesson 2 55
• Failing of histogram stretching
• Failing cases include when pixel intensity of 0
and 255 are present in the image
• In that case, 0 and 255 intensities become the
minimum and maximum pixel intensity which
ruins the formula like this.
• Substitution leads to
• Thus

• That means the output image is equal to the


processed image.
• That means there is no effect of histogram
stretching on the image.
11/30/2019 Lesson 2 56
Probabilistic functions for contrast stretching
• PMF- probability mass function.
– As its name suggest, it gives the probability of
each number in the data set or you can say that it
basically gives the count or frequency of each
element.
– PMF is computed in two different ways.
• First from a matrix, as an image is nothing more than a
two dimensional matrix.
• Second, calculate PMF from the histogram.

11/30/2019 Lesson 2 57
• Consider this matrix
1 2 7 5 6
7 2 3 4 5
0 1 5 7 3
1 2 5 6 7
6 1 0 3 4
• Its PMF is 0 2 2/25
1 4 4/25
2 3 3/25
3 3 3/25
4 2 2/25
5 4 4/25
6 3 3/25
7 4 4/25
• Note that the sum of the count must be equal to total number
of values.

11/30/2019 Lesson 2 58
• Calculating PMF from histogram

• The above histogram shows frequency of gray


level values for an 8 bits per pixel image.
• To calculate its PMF, get the count of each bar
from vertical axis and then divide it by total
count.

11/30/2019 Lesson 2 59
• So the PMF of the histogram is this.

• Another important thing to note in the above


histogram is that it is not monotonically
increasing.
• To increase it monotonically, calculate its CDF

11/30/2019 Lesson 2 60
• CDF- cumulative distributive function.
– It is a function that calculates the cumulative sum of all the
values that are calculated by PMF.
– It basically sums the previous one.
– To compute CDF, simply keep the first value as it is, and then in
the 2nd value, add the first one and so on.
– For this PMF, its CDF is
– From the graph , the first value of PMF
remain as it is. The second value of PMF is
added to the first value and placed over 128.
The third value of PMF is added to the second
value of CDF, that gives 110/110 which is
equal to 1
-The function is growing monotonically which is necessary
condition for histogram equalization.
-PMF and CDF are used in histogram equalization
11/30/2019 Lesson 2 61
• Histogram equalization
– Histogram equalization is used for enhancing the
contrast of the images.
– In the histogram equalization, the first and the
second step are PMF and CDF.
– Since in histogram equalization, we have to equalize
all the pixel values of an image.
– PMF helps us calculating the probability of each pixel
value in an image.
– CDF gives us the cumulative sum of these values.
– CDF is multiplied by gray levels, to find the new pixel
intensities, which are mapped into old values, and
the histogram is equalized.
11/30/2019 Lesson 2 62
• HISTOGRAM EQUALIZATION
• Histogram equalization is used to enhance
contrast.
• It is not necessary that contrast will always be
increased in this.
• There may be some cases where histogram
equalization can be worse.
• In that cases the contrast is decreased.

11/30/2019 Lesson 2 63
• Example

• Compute PMF and CDF as discussed earlier

11/30/2019 Lesson 2 64
• Calculate CDF according to gray levels
• Lets for instance consider this, that the CDF
calculated in the second step looks like this.
Gray Level Value CDF
0 0.11
1 0.22
2 0.55
3 0.66
4 0.77
5 0.88
6 0.99
7 1
• Then in this step multiply the CDF value with
Graylevels (minus1).

11/30/2019 Lesson 2 65
• Considering we have an 3 bpp image. Then
number of levels we have are 8. And 1
subtracted from 8 is 7. So multiply CDF by 7. The
results after multiplying is as follows:
Gray Level Value CDF CDF * Levels−1

0 0.11 0
1 0.22 1
2 0.55 3
3 0.66 4
4 0.77 5
5 0.88 6
6 0.99 6
7 1 7

11/30/2019 Lesson 2 66
• Next is the last step, where we map the new
gray level values into number of pixels.
• Assuming the old gray levels values had these
number of pixels.
Gray Level Value Frequency
0 2
1 4
2 6
3 8
4 10
5 12
6 14
7 16

11/30/2019 Lesson 2 67
• Map the new values to them gives
Gray Level Value New Gray Level Value Frequency
0 0 2
1 1 4
2 3 6
3 4 8
4 5 10
5 6 12
6 6 14
7 7 16

• Map these new values onto the histogram,


and you are done.

11/30/2019 Lesson 2 68
• Histogram Equalization Image

• Cumulative Distributive function of this image

• Histogram Equalization

11/30/2019 Lesson 2 69
• Comparing both the histograms and images

• From the images, the new image contrast has been enhanced
and its histogram has also been equalized.
• There is also one important thing to be noted that during
histogram equalization the overall shape of the histogram
changes, where as in histogram stretching the overall shape of
histogram remains same. Lesson 2
11/30/2019 70
• GRAY LEVEL TRANSFORMATION
• Image enhancement
• Enhancing an image provides better contrast
and a more detailed image as compared to
non enhanced image.
• Image enhancement has very many
applications.
– It is used to enhance medical images, images
captured in remote sensing, images from satellite
e.t.c

11/30/2019 Lesson 2 71
• The transformation function has been given
below
• s=Tr
– where r is the pixels of the input image and s is
the pixels of the output image.
– T is a transformation function that maps each
value of r to each value of s.
– Image enhancement can be done through gray
level transformations.

11/30/2019 Lesson 2 72
• Gray level transformation
• There are three basic gray level transformation.
– Linear
– Logarithmic
– Power – law

11/30/2019 Lesson 2 73
• Linear transformation
• Linear transformation includes simple identity
and negative transformation.
• Identity transition is shown by a straight line.
In this transition, each value of the input
image is directly mapped to each other value
of output image.
• That results in the same
input image and output image.
• Hence is called identity
transformation.
11/30/2019 Lesson 2 74
• Negative transformation
• Negative transformation is an inverse of
identity transformation.
• In negative transformation, each value of the
input image is subtracted from the L-1 and
mapped onto the output image.
• The result is somewhat like this
• Input Image Output Image

11/30/2019 Lesson 2 75
• In this case the following transition has been done.
• s = L–1– r
• since the input image is an 8 bpp image, so the
number of levels in this image are 256. Putting 256 in
the equation, we get this
• s = 255 – r
• So each value is subtracted from 255.
• The lighter pixels become darker and the darker
picture becomes lighter.
• It results in an image which is negative (inverse).

11/30/2019 Lesson 2 76
• Logarithmic transformations
• Logarithmic transformation further contains two
type of transformation. Log transformation and
inverse log transformation.
• Log transformation
• The log transformations can be defined by this
formula - s = c logr+1.
• Where s and r are the pixel values of the output and
the input image and c is a constant.
• The value 1 is added to each of the pixel value of the
input image because if there is a pixel intensity of 0
in the image, then log 0 is equal to infinity.
• So 1 is added, to make the minimum value at least 1.
11/30/2019 Lesson 2 77
• During log transformation, the dark pixels in an image
are expanded as compared to the higher pixel values.
• The higher pixel values are kind of compressed in log
transformation. This result in image enhancement.
• The value of c in the log transform adjust the kind of
enhancement you are looking for.
• Input Image Log Transform Image

• The inverse log transform is opposite to log transform.


11/30/2019 Lesson 2 78
• Power – Law transformations
• Two types of power law transformations are nth
power and nth root transformation. These
transformations can be given by the expression:
• s=cr^γ
• The symbol γ is called gamma, hence this
transformation is also known as gamma
transformation.
• Variation in the value of γ varies the enhancement of
the images.
• Different display devices / monitors have their own
gamma correction, that’s why they display their
images at different intensity values.
11/30/2019 Lesson 2 79
• This type of transformation is used for
enhancing images for different type of display
devices. The gamma of different display devices
is different.
• For example Gamma of CRT lies in between of
1.8 to 2.5, that means the image displayed on
CRT is dark

11/30/2019 Lesson 2 80
• Correcting gamma.
• s=cr^γ
• s=cr^1/2.5
• The same image but with different gamma
values has been shown here.
• Gamma=10 Gamma=8 Gamma=6

11/30/2019 Lesson 2 81

You might also like