Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Summary

Introduction Medical Image Processing Summary H4-8

Rating
-
Sold
4
Pages
25
Uploaded on
05-10-2018
Written in
2017/2018

This is a summary for the course "Introduction Medical Imaging" in the minor "Biomedical Imaging" at the VU. A summary of chapters 4 to 8 of the book Introduction to Digital Image Processing with MATLAB® (by McAndrew, A.). The relevant lectures of the course are also included in the text.

Show more Read less
Institution
Course

Content preview

Chapter 4 Point Processing

4.1 Introduction
Any image-processing operation transforms the gray values of the pixels. Image-processing
operations can be divided into three classes based on the information required to perform the
transformation. From the most complex to the simplest, they are as follows:
1. Transforms. A transform represents the
pixel values in some other equivalent form.
Transforms allow for some very efficient
and powerful algorithms.
2. Neighborhood processing. To change the
gray level of a given pixel we only need to
know the value of the gray levels in a small
neighborhood of pixels around the given
pixel.
3. Point operations. A pixel’s gray value is
changed without any knowledge of its
surroundings.
Although point operations are the simplest, they contain some of the most powerful and
widely used image processing operations. They are especially useful in image pre-processing,
where an image is required to be modified before the main job is attempted.

4.2 Arithmetic Operations
Arithmetic operations act by applying a simple function 𝑦 = 𝑓(𝑥) to each gray value in the
image. Thus 𝑓(𝑥) is a function which maps the range 0 … 255 onto itself. Simple functions
include adding or subtracting a constant value to each pixel or multiplying each pixel by a
constant.

In each case we may have to fiddle the output slightly in order to ensure that the results are
integers in the 0 … 255 range. We can do this by first rounding the result to obtain an integer,
and then clipping the values by setting:
255 𝑖𝑓 𝑦 > 255,
𝑦←{
0 𝑖𝑓 𝑦 < 0.

Figure 2.2 shows the result of adding or
substracting 128 from each pixel in the
image. When we add 128, all gray values
of 127 or greater will be mapped to 255.
When we substract 128, all gray values of
127 or less will be mapped to 0. Adding a
constant will lighten an image and
substracting a constant will darken it.

Arithmetic operations can’t be performed
on unit8 data type, because this type is only used for data storage. So, first we need to turn the
matrix of type unit8 into a matrix of type double. We can transform the matrix in and out of
double or use the imadd or imsubtract function to add or subtract a value.

,b1 = uint8(double(b)+128);
b1 = imadd(b,128);

We can also perform lightening or darkening of an image by multiplication. To implement
these functions we use the immultiply or imdivide function.
If we compare darkening by subtraction and multiplication we see a lot of information has
been lost by the subtraction process. This is because with subtraction all pixels with gray
values 128 or less have become zero. A similar loss of information also occurs with addition.

Complement
The complement of a grayscale image is its photographic negative.
If an image matrix m is of type double and thus its gray values are in the range 0.0 to 1.0, we
can obtain its negative with the command: 1-m.
If the image is binary, we can use: ~m.
If the image is of type uint8, the best approach is the imcomplement function:
bc = imcomplement(b);.

Special effects can be obtained by complementing only part of the image. For example, by
taking the complement of pixels of gray value 128 or less and leaving the other pixels
untouched. The effect of these functions is called solarization.

4.3 Histograms
Given a grayscale image, its histogram consists of its gray levels; that is, it is a graph
indicating the number of times each gray level occurs in the image.
• In a dark image, the gray levels are clustered at the lower end.
• In a uniformly bright image, the gray levels are clustered at the upper end.
• In a well-contrasted image, the gray levels are well spread out over much of the range.

We can view the histogram of an image in MATLAB by using the imhist function,
p = imread(‘pout.tif’);
imshow(p), figure, imhist(p), axis tight
where the axis tight command ensures the axes are scaled so that all the histogram bars fit
entirely within the figure.

Given a poorly contrasted image, we would like to enhance its contrast by spreading out its
histogram. There are two ways of doing this: histogram stretching or histogram equalization.

4.3.1 Histogram Stretching (Contrast Stretching)
We can stretch out gray levels in the center of the range by applying a piecewise linear
function. An example is given in Figure 2.9 which has the effect of stretching the gray levels
5-9 to gray levels 2-14, according to equation,
14 − 2
𝑗= (𝑖 − 5) + 2
9−5
where i is the original gray level and j is its result after the transformation. Or basically:
𝑏𝑖+1 − 𝑏𝑖
𝑦= (𝑥 − 𝑎𝑖 ) + 𝑏𝑖
𝑎𝑖+1 − 𝑎𝑖
where a indicates the range of gray levels that need to be stretched to a range of gray levels b.

, Gray levels outside this range are either left alone (as in this case) or transformed according to
the linear functions at the ends. This yields an image with greater contrast than the original.




Use of imadjust
To perform histogram stretching in MATLAB, the imadjust
function may be used. In its simplest incarnation, the
command imadjust(im,[a,b],[c,d])stretches the image
according to the function shown in Figure 2.10. Because
imadjust is designed to work equally well on images of type
double, uint8, or uint16, the values a, b, c and d must be
between 0 and 1. The function automatically converts the
image (if needed) to be of type double.

Note that imadjust does not work quite in the same way as shown in Figure 2.10. Pixel values
less than a are all converted to c, and pixel values greater than b are all converted to d. If
either [a,b]or[c,d] are chosen to be [0,1], the abbreviation[]may be used. Thus, for
example, the command imadjust(im,[],[])does nothing, and the command
imadjust(im,[],[1,0])inverts the gray values of the image to produce a result similar to
a photographic negative.

The imadjust function has one other optional parameter: the gamma value, which describes
the shape of the function between coordinates (𝑎, 𝑐) and (𝑏, 𝑑). Use of the gamma value alone
can be enough to substantially change the appearance of the image. If gamma is equal to 1,
which is the default, then a linear mapping is used. However, values less than 1 produce a
function that is concave downward, and values greater than 1 produce a figure that is concave
upward. The imadjust stretching function can be viewed with the plot function.

A piecewise linear-stretching function
We can easily write our own function to perform piecewise linear stretching. To do this, we
make use of the find function to find the pixel values in the image between ai and ai+1.
Because the line between the coordinates (𝑎𝑖 , 𝑏𝑖 ) and (𝑎𝑖+1 , 𝑏𝑖+1 ) has the equation,
𝑏 −𝑏
𝑦 = 𝑎𝑖+1 −𝑎𝑖 (𝑥 − 𝑎𝑖 ) + 𝑏𝑖 ,
𝑖+1 𝑖
the heart of our function will be the lines:
pix = find(im >= a(i) & im < a(i+1));
out(pix) = (im(pix)-a(i))*(b(i+1)-b(i))/(a(i+1)-a(i)+b(i);

Connected book

Written for

Institution
Study
Course

Document information

Summarized whole book?
No
Which chapters are summarized?
H 4 t/m 8
Uploaded on
October 5, 2018
Number of pages
25
Written in
2017/2018
Type
SUMMARY

Subjects

$4.77
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
sle8 Vrije Universiteit Amsterdam
Follow You need to be logged in order to follow users or courses
Sold
99
Member since
7 year
Number of followers
73
Documents
35
Last sold
4 months ago

3.9

20 reviews

5
6
4
8
3
4
2
2
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions