100% tevredenheidsgarantie Direct beschikbaar na betaling Zowel online als in PDF Je zit nergens aan vast
logo-home
Introductie Medische Beeldbewerking Samenvatting H4-8 €3,49
In winkelwagen

Samenvatting

Introductie Medische Beeldbewerking Samenvatting H4-8

 209 keer bekeken  4 keer verkocht

Dit is een samenvatting voor het vak "Introductie Medische Beeldwerking" in de minor "Biomedische Beeldvorming" aan de VU. Een samenvatting van de hoofdstukken 4 t/m 8 van het boek Introduction to Digital Image Processing with MATLAB® (door McAndrew, A.). Hierin zijn ook de bijbehorende college's ...

[Meer zien]

Voorbeeld 3 van de 25  pagina's

  • Nee
  • H 4 t/m 8
  • 5 oktober 2018
  • 25
  • 2017/2018
  • Samenvatting
book image

Titel boek:

Auteur(s):

  • Uitgave:
  • ISBN:
  • Druk:
Alle documenten voor dit vak (1)
avatar-seller
sle8
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);

Voordelen van het kopen van samenvattingen bij Stuvia op een rij:

Verzekerd van kwaliteit door reviews

Verzekerd van kwaliteit door reviews

Stuvia-klanten hebben meer dan 700.000 samenvattingen beoordeeld. Zo weet je zeker dat je de beste documenten koopt!

Snel en makkelijk kopen

Snel en makkelijk kopen

Je betaalt supersnel en eenmalig met iDeal, creditcard of Stuvia-tegoed voor de samenvatting. Zonder lidmaatschap.

Focus op de essentie

Focus op de essentie

Samenvattingen worden geschreven voor en door anderen. Daarom zijn de samenvattingen altijd betrouwbaar en actueel. Zo kom je snel tot de kern!

Veelgestelde vragen

Wat krijg ik als ik dit document koop?

Je krijgt een PDF, die direct beschikbaar is na je aankoop. Het gekochte document is altijd, overal en oneindig toegankelijk via je profiel.

Tevredenheidsgarantie: hoe werkt dat?

Onze tevredenheidsgarantie zorgt ervoor dat je altijd een studiedocument vindt dat goed bij je past. Je vult een formulier in en onze klantenservice regelt de rest.

Van wie koop ik deze samenvatting?

Stuvia is een marktplaats, je koop dit document dus niet van ons, maar van verkoper sle8. Stuvia faciliteert de betaling aan de verkoper.

Zit ik meteen vast aan een abonnement?

Nee, je koopt alleen deze samenvatting voor €3,49. Je zit daarna nergens aan vast.

Is Stuvia te vertrouwen?

4,6 sterren op Google & Trustpilot (+1000 reviews)

Afgelopen 30 dagen zijn er 52510 samenvattingen verkocht

Opgericht in 2010, al 14 jaar dé plek om samenvattingen te kopen

Start met verkopen
€3,49  4x  verkocht
  • (0)
In winkelwagen
Toegevoegd