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

Digital ImageProcessing 5

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

Digital ImageProcessing 5

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

Image Processing

For Computer Science students

University of Diyala
Computer Science Department
Image Processing
3rd Class
Lecturer: Dr. Jumana Waleed Salih

Image Processing

‫معالجة صور‬
5 th lecture

1
Introduction to Image Enhancement

What is the image enhancement?


Modify the intensities of pixels in an image so that it can be more suitable for a
specific application. Different enhancement process suits different applications. An
enhancement method is good for an application but maybe bad for another application.

Two categories of methods for enhancement process


One is based on the spatial domain of the image. Another is based on the frequency
domain of the image.
 Spatial domain: process pixels in the image plane directly.
 Frequency domain: modify the Fourier transform of an image.

For the enhancement in the spatial domain, we use the transform function:
g(x,y) = T [f(x,y)]
f(x,y) --- input image,
g(x,y) --- output image,
T --- a transform
The object transformed may be a sub-image with 2x2, 3x3 or 1x1. For simplicity, 1x1,
so we have s = T (r)
r --- gray-level value for an inputting pixel
s --- gray-level value for an outputting pixel
Grey-level value transform graph
We use a graph to denote the transform function s = T (r).

2
Some Simple Enhancement Methods

1- Image negatives

Example:
>> f=imread('E:\rose.jpg');
>> size (f)
ans =
252 237
>> imshow(f);
>> c=imcomplement(f);
>> figure; imshow(c);
>> imwrite ( c, 'E:\rosecomplement.jpg');

3
2- Contrast stretching
For a low-contrast image, we feel it uncomfortable and sometimes cannot see any
details clearly.

3- Compression of dynamic range


When the dynamic range of the gray-level in an image far exceeds the capability
of the display device, it needs to be compressed to display it better. A good transform
function is as follow;

Histogram Processing
What is the histogram of an image?
The distribution of the pixel gray level is very important for an image display. For a
limited gray-level domain [0, L-1] we hope there is a uniform distribution of the pixel
gray level instead of non-uniform distribution. Based on the distribution of the pixel
gray level we define the image histogram.
For a digital image with gray levels in the range [0, L-1], we define a discrete
function:

Where:
nk is the number of the pixels with the gray level rk
n is the total number of pixels in the image.
We call p(rk) the histogram of a digital image.
Four special histograms are as follows.

4
Histogram equalization
Sometimes we need to convert a low-contrast image into a high-contrast image for
displaying it better. We can do it by extending its histogram.

5
Example:
>> f=imread('E:\rose.jpg');
>> imshow(h);
>> figure; imhist(f);
>> h=histeq(f, 256);
>> figure; imhist(h);
>> figure; imshow(h);

Image Subtraction

The result is that the different parts between two images are kept but the same parts
between them are removed (become dark). A typical application is the medical X-ray
image test for a specific body area of the patient.
>> sub=f-g;
>> imshow(sub);
6

You might also like