Chapter3 CV
Chapter3 CV
Chapter3 CV
Note:
Brightness refers to the over all lightness or darkness of
the image.
Increasing the brightness make every pixel in the frame
gets lighter.
Contrast is the difference in brightness b/n objects in the image.
Increasing the contrast makes light areas lighter & dark
area in the frame becomes much darker.
Image Enhancement
1. Image Negatives
B. Mapping:
➢ S = 1 – r , where r is the input gray level
value, and S = is the output gray level value.
Con’t…
C. Denormalization:
➢Multiply pixel value with the highest gray level
value.
Con’t…
Zooming
There are three methods of zooming that
we are going to see:
1. Pixel replication or (Nearest neighbor interpolation)
2. Zero order hold method
3. Zooming K times
Zooming…pixel replication
Pixel replication:
It is also known as Nearest neighbor interpolation.
we just replicate the neighboring pixels or the
gray level values.
zooming is nothing but increase amount of sample
or pixels.
In this method we create new pixels from the
already given pixels.
Each pixel is replicated in this method n times row
wise and column wise and you got a zoomed image.
Con’t…
E.g. if you have an image of 3 rows and 3
columns and you want to zoom it twice or
2 times using pixel replication, here how it
can be done.
Con’t…
ROW WISE ZOOMING:
➢When we zoom it row wise , we will just
simple copy the rows pixels to its adjacent
new cell.
Con’t…
COLUMN SIZE ZOOMING:
simply copy the column pixel to its adjacent
new column or simply below it.
Con’t…
(Original image rows * zooming factor, Original Image
cols * zooming factor)
ADVANTAGE
One of the advantage of this zooming technique is , it is
very simple.
You just have to copy the pixels and nothing else.
DISADVANTAGE
This technique is that image got zoomed but the output is very blurry.
And as the zooming factor increased , the image got more
and more blurred.
That would eventually result in fully blurred image
zooming... Zero order hold method
Zero order hold method:
Zero order hold method is another method of
zooming.
It is also known as zoom twice.
We pick two adjacent elements from the rows
respectively and then we add them and divide the
result by two, and place their result in between
those two elements.
We first do this row wise and then we do this
column wise.
Con’t…
Con’t…
First we zoom it row wise and column wise.
ROW WISE ZOOMING
Con’t…
Column wise zooming
Con’t…
The new image is formed(2*no of rows)-1 *(2*no
of column)-1
ADVANTAGES
This method does not produce a blurry image,
unlike the other methods
We can always double the image resolution
without any special effort.
It is easy to implement with zero computation
overhead.
Con’t…
Disadvantage
This method can only run on the power of two.
Because of the power two, it doesn't allow us to
zoom images by custom resolution.
zooming... K-Times zooming
K-Times zooming:
K times is the third zooming method we
are going to discuss.
It is one of the most perfect zooming
algorithm discussed so far
It caters the challenges of both twice
zooming and pixel replication.
K in this zooming algorithm stands for
zooming factor.
Con’t…
WORKING:
1. take two adjacent pixels.
2. Then you have to subtract the smaller from the greater one. the
result is called op
3. Divide this op /output with the zooming factor (K).
4. Now you have to add the result (OP) to the smaller value and put
the result in between those two values.
Add the value OP again to the value you just put and place it
again next to the previous putted value.
You have to do it till you place k-1 values in it.
Repeat the same step for all the rows and the columns , and you
get a zoomed images.
Con’t…
Con’t…
ROW WISE ZOOMING
Take the first two adjacent pixels. Which are 15
and 30.
Subtract 15 from 30. 30-15 = 15.
Divide 15 by k. 15/k = 15/3 = 5. We call it OP.
(where op is just a name)
Add OP to lower number. 15 + OP = 15 + 5 = 20.
Add OP to 20 again. 20 + OP = 20 + 5 = 25.
We do that 2 times because we have to insert k-1
values.
Con’t…
Con’t…
COLUMN WISE ZOOMING:
The same procedure has to be performed column wise.
The procedure include taking the two adjacent
pixel values, and then Subtracting the smaller
from the bigger one
Then after that, you have to divide it by k.
Store the result as OP.
Add OP to smaller one, and then again add OP to
the value that comes in first addition of OP.
Insert the new values.
Con’t…
Con’t…
ADVANTAGES
The one of the clear advantage that k time
zooming algorithm has that it is able to compute
zoom of any factor which was the power of pixel
replication algorithm.
It gives improved result (less blurry) which was
the power of zero order hold method.
It comprises the power of the two algorithms.
DISADVANTAGE
The algorithm is it has to be sort in the end,
which is an additional step.
Thus, it increases the cost of computation.
Intensity Transformation Functions
Con’t…
For instance, the following two images show
an image before and after an intensity
transformation.
Originally, the camera man's jacket looked
black, but with an intensity transformation,
the difference between the black intensity
values, which were too close before, was
increased so that the buttons and pockets
became viewable.
Con’t…
Generally, making changes in the intensity is done
through Intensity Transformation
Functions.
Con’t…
1. photographic negative (linear or identity)
2. gamma transformation (power low)
3. logarithmic transformations (log)
The Photographic Negative is probably the easiest of
the intensity transformations to describe.
• Assume that we are working with grayscale double
arrays where black is 0 and white is 1.
• The idea is that 0's become 1's, 1's become 0's,
and any gradients in between are also reversed.
• In intensity, this means that the true black becomes
true white and vise versa.
Con’t…
Without background
S= L-1=7; 2<=r<=4
0 ; otherwise
Co’t…
r= 1,5,6,7 S= 0
r= 2,3,4 S= 7
The graph will be drawn and the digital
image output will be generated.
Intensity level slicing with background
r=2,3,4 S= 7;
r=1 S=1;
r=5 S=5;
r=6 S=6;
r=7 S=7;
Its graph can be drawn and out put image can be generated
Bit plane
Digital image
Convert into binary
MSB, CENTER, LSB
Contrast stretching
Assignment:(5%)
use the following digital image
nk, no of pixel
gray no PDF=nk CDF= sk*7 histog
level of /sum SK ram sum=6+14+5=25.
pixe level cdf=cumulative
l
probability function is
0 0 0 0 0 0
for first pixel is 0
1 0 0 0 0 0
2 0 0 0 0 0
then add output of
3 6 6/25=0.2 0.24 1.68 2
CDF to pdf.
4 sk*7, the highest gray
4 14 14/25=0. 0.8 5.6 6 level in 8 bit.
56
histogram level= take
5 5 5/25=0.2 1 7 7
approxmation of
6 0 0 1 7 7
number to plot
7 0 0 1 7 7
Con’t…
4 4 4 4 4 6 6 6 6 6
3 4 5 4 3 2 6 7 6 2
3 5 5 5 3 2 7 7 7 2
3 4 5 4 3 2 6 7 6 2
4 4 4 4 4 6 6 6 6 6