Image Chapter2 Part1
Image Chapter2 Part1
Chapter 2
Digital Image Fundamentals
Part 1
1. Theoretical
Brightness Adaptation
The ability of the eye to discriminate between changes in light intensity at any
specific adaptation level.
The eye's ability to discriminate between different intensity levels
For example, when you enter a dark theater on a bright day, it takes an appreciable
interval of time before you can see well enough to find an empty seat.
1
White is the color which contains all the wavelengths of visible light without
absorption, has maximum brightness.
Black is the darkest color, the result of the absence of or complete absorption of light.
Green objects reflect light with wavelengths primarily in the 500 to 570 nm range
(green color range) while absorbing most of the energy at other wavelength
f(x,y) =i(x,y)r(x,y)
2
Changing the spatial resolution of a digital image, by zooming or shrinking. Simply,
zooming and shrinking are the operations of oversampling (increase resolution) and
undersampling (decrease resolution) a digital image, respectively.
Interpolation
Process of using known data to estimate unknown values
Interpolation (sometimes called resampling)
an imaging method to increase (or decrease) the number of pixels in a digital
image.
The assignment of gray levels to the new pixel locations is an operation of great
challenge. It can be performed using three approaches:
V(x,y)= ax+by+cxy+d
The sixteen coefficients are determined by using the sixteen nearest neighbors.
In MATLAB, this can be performed using the imresize function. This function
accepts a factor greater than 1.0 for zooming and smaller than 1.0 for shrinking. Also,
it accepts the required method of interpolation, either nearest neighbor or bilinear.
Cubic interpolation is the default method.
2. Practical
% Resizing the Reduced Images to the Original Size (256 X 256) and
Comapre
% them:
I16=imresize(I16,16,'bilinear');
I32=imresize(I32,8,'bilinear');
I64=imresize(I64,4,'bilinear');
I128=imresize(I128,2,'bilinear');
close
figure
subplot(121),imshow(I),title('I')
subplot(122),imshow(I128),title('I128')
pause,close
figure
subplot(221),imshow(I),title('I')
subplot(222),imshow(I64),title('I64')
subplot(223),imshow(I32),title('I32')
subplot(224),imshow(I16),title('I16')
pause,close
Output:
4
Example2: Reducing the Number of Gray Levels of an Image
% A 64 gray-level image:
[I64,map64]=gray2ind(I,64);
% A 32 gray-level image:
[I32,map32]=gray2ind(I,32);
% A 16 gray-level image:
[I16,map16]=gray2ind(I,16);
% A 8 gray-level image:
[I8,map8]=gray2ind(I,8);
% A 2 gray-level image:
[I2,map2]=gray2ind(I,2);
5
figure(1)
subplot(321),subimage(I),title('I'),axis off
subplot(322),subimage(I64,map64),title('I64'),axis off
subplot(323),subimage(I32,map32),title('I32'),axis off
subplot(324),subimage(I16,map16),title('I16'),axis off
subplot(325),subimage(I8,map8),title('I8'),axis off
subplot(326),subimage(I2,map2),title('I2'),axis off
3. Homework:
1. Write a MATLAB code like example1 to reduce the size of image using nearest Interpolation.
Which is better in quality of image, nearest or bilinear interpolation?
2. Write a MATLAB code that reads a gray scale image and generates the vertically flipped image
of original image. (Typically like the following result)