Image Processing Lecture - Q
Image Processing Lecture - Q
and MATLAB
What is image processing?
Image sharpening
Image deblurring
❑ Obtaining the edges of an image(edge detection).
The effective resolution of this new image is only 128×128. We can do all
this in one line:
X2=imresize(imresize(x,1/2),2);
By changing the parameters of imresize, we can change the effective
resolution of the image to smaller amounts:
Arithmetic operations
Ex:
adding or subtracting 128 from each pixel in the image.
when we add 128, all grey values of 127 or greater will be mapped to
255. And when we subtract 128, all grey values of 128 or less will be
mapped to 0.
Adding and subtracting a constant
>> b=imread(’blocks.tif’);
>> b1=uint8(double(b)+128);
>> b1=imadd(b,128);
>> b2=imsubtract(b,128);
>> imshow(b1),figure,imshow(b2)
Arithmetic operations on an image: adding or subtracting a
constant
Using multiplication and division
Histogram is a graph indicating the number of times each grey level occurs in
the image, it consists of the histogram of image grey levels.
The image pout.tif and its histogram
where i is the original grey level and j its result after the transformation
Histogram equalization
Let :
L is the different grey levels 0,1,2,….. L -1, and the gray level is i
ni times in the image.( )عدد مرات تكرارالون
n the total number of pixels in the image
>> p=imread(’pout.tif’);
>> ph=histeq(p);
>> imshow(ph),figure,imhist(ph),axis tight
The histogram after equalization
The index image
and its histogram
The image
equalized and its
histogram
Thresholding
Single thresholding
• A greyscale image is turned into a binary (black and white) image by first
choosing a grey level T in the original image, and then turning every pixel
black or white according to whether its grey value is greater than or less than T