Вы находитесь на странице: 1из 29

1

Contents:
Ch1. Introduction
1.What is an image?
1.1 Pixel
1.2 Gray scale
1.3 color scale
1.3.1 RGB
1.3.2 CMYK
2. Medical imaging

Ch2. Image processing


1. Segmentation (image processing)
2. Cluster analysis
2.1. K-Mean Clustering
2.2 K-means algorithm
2.3 Demonstration of the algorithm
2.4 Applications of the algorithm
3. Wavelet
4. Results Using MATLAB program on PET images
5. Conclusion
6. References

Ch1. Introduction
1. What is an image?
An image is an array, or a matrix, of square pixels
(picture elements) arranged in columns and rows.
[figure2]

1.1 Pixel
In digital imaging, a pixel (picture element) is the
smallest piece of information in an image. Pixels
are normally arranged in a regular 2-dimensional
grid, and are often represented using dots or
squares. Each pixel is a sample of an original
image, where more samples typically provide a
more accurate representation of the original. The
intensity of each pixel is variable; in color systems,
each pixel has typically three or four components
such as red, green, and blue.[figure1]

[figure1]:

show 6 x 4 (24 pixel elements)

The word pixel is based on the abbreviation "pix"


(for "pictures") and element; similar backformations include voxel, luxel, and texel.

1.2 Grayscale

Figure [2]: An image an array or a matrix of pixels arranged in


columns and rows.

In a (8-bit) greyscale image each picture element


has an assigned intensity that ranges from 0 to
255. A grey scale image is what people normally
call a black and white image, but the name
emphasizes that such an image will also include
many shades of grey.[figure3]

[figure3]: Each pixel has a value from 0 (black) to 255 (white). The
possible range of the pixel values depend on the colour depth of the
image, here 8 bit = 256 tones or greyscales.

A normal grey-scale image has 8 bit color


depth = 256 grey-scales. A true color
image has 24 bit color depth = 8 x 8 x 8 bits
= 256 x 256 x 256 colors = ~16 million
colors.[figure4]

[figure4]: A true-color image assembled from three grey-scale


images colored red, green and blue. Such an image may contain up
to 16 million different colors.
5

Some grey-scale images have more grey-scales, for


instance 16 bit = 65536 grey-scales. In principle
three grey-scale images can be combined to form
an image with 281,474,976,710,656 greyscales.
There are two general groups of images: vector
graphics (or line art) and bitmaps (pixel-based or
images). Some of the most common file
formats are:
GIF an 8-bit (256 color), non-destructively
compressed bitmap format. Mostly used for web. It
has several sub-standards one of which is the
animated GIF.
JPEG: a very efficient (i.e. much information per
byte) destructively compressed 24 bit (16 million
colors) bitmap format. Widely used, especially for
web and Internet (bandwidth-limited).
TIFF : the standard 24 bit publication bitmap
format. It compresses non-destructively with, for
instance, Lempel-Ziv-Welch (LZW) compression.
PS Postscript, a standard vector format. Has
numerous sub-standards and can be difficult to
transport across platforms and operating systems.
PSD: A dedicated Photoshop format that keeps all
the information in an image including all the layers.

1.3 Color scale


the two main color spaces are RGB and CMYK.

1.3.1 RGB
The RGB color model is an additive color model in
which red, green, and blue light are added together
in various ways to reproduce a broad array of
colors. RGB uses additive color mixing and is the
basic color model used in television or any other
medium that projects color with light. It is the basic
6

color model used in computers and for web


graphics, but it cannot be used for print
production.
The secondary colors of RGB cyan, magenta, and
yellow are formed by mixing two of the primary
colors (red, green or blue) and excluding the
third color. Red and green combine to make yellow,
green and blue to make cyan, and blue and red
form magenta. The combination of red, green, and
blue in full intensity makes white.[figure4]

Figure [4]: The additive model of RGB. Red, green, and blue are the
primary stimuli for human color perception and are the primary
additive colours.

To see how different RGB components combine


together, here is a selected repertoire of colors and
their respective relative intensities for each of the
red, green, and blue components:

1.3.2 CMYK
The 4-colour CMYK model used in printing lays
down overlapping layers of varying percentages of
transparent cyan (C), magenta (M) and yellow (Y)
inks. In addition a layer of black (K) ink can be
added. The CMYK model uses the subtractive color
model.[figure5]

Figure [5]: The colors created by the subtractive model of CMYK


don't look exactly like the colors created in the additive model of
RGB Most importantly, CMYK cannot reproduce the brightness of
RGB colors. In addition, the CMYK gamut is much smaller than the
RGB .

2. Medical imaging
Medical imaging refers to the techniques and
processes used to create images of the human
body (or parts thereof) for clinical purposes
(medical procedures seeking to reveal, diagnose or
examine disease) or medical science (including the
study of normal anatomy and function).
As a discipline and in its widest sense, it is part of
biological imaging and incorporates radiology (in
the wider sense), radiological sciences, endoscopy,
(medical) thermography, medical photography and
microscopy (e.g. for human pathological
investigations). Measurement and recording
techniques which are not primarily designed to
produce images, such as electroencephalography
(EEG) and magneto-encephalography (MEG) and
others, but which produce data susceptible to be
represented as maps (i.e. containing positional
9

information), can be seen as forms of medical


imaging.
In the clinical context, medical imaging is generally
equated to radiology or "clinical imaging" and the
medical practitioner responsible for interpreting
(and sometimes acquiring) the images is a
radiologist. Diagnostic radiography designates the
technical aspects of medical imaging and in
particular the acquisition of medical images. The
radiographer or radiologic technologist is usually
responsible for acquiring medical images of
diagnostic quality, although some radiological
interventions are performed by radiologists.
As a field of scientific investigation, medical
imaging constitutes a sub-discipline of biomedical
engineering, medical physics or medicine
depending on the context: Research and
development in the area of instrumentation, image
acquisition (e.g. radiography), modeling and
quantification are usually the preserve of
biomedical engineering, medical physics and
computer science; Research into the application
and interpretation of medical images is usually the
preserve of radiology and the medical subdiscipline relevant to medical condition or area of
medical science (neuroscience, cardiology,
psychiatry, psychology, etc) under investigation.
Many of the techniques developed for medical
imaging also have scientific and industrial
applications.
Medical imaging is often perceived to designate
the set of techniques that noninvasively produce
images of the internal aspect of the body. In this
restricted sense, medical imaging can be seen as
the solution of mathematical inverse problems.
10

This means that cause (the properties of living


tissue) is inferred from effect (the observed signal).
In the case of ultrasonography the probe consists
of ultrasonic pressure waves and echoes inside the
tissue show the internal structure. In the case of
projection radiography, the probe is X-ray radiation
which is absorbed at different rates in different
tissue types such as bone, muscle and fat.

Ch2. Image Processing


Introduction:
Image processing is any form of signal
processing for which the input is an image, such as
photographs or frames of video; the output of
image processing can be either an image or a set
of characteristics or parameters related to the
image. Most image-processing techniques involve
11

treating the image as a two-dimensional signal and


applying standard signal-processing techniques to
it.[figure6]

[figure6]: show example of image processing.

Image processing usually refers to digital image


processing, but optical and analog image
processing are also possible. This article is about
general techniques that apply to all of them.

1. Segmentation
In computer vision, segmentation refers to the
process of partitioning a digital image into multiple
regions (sets of pixels "we will explain the term pixels later"). The
goal of segmentation is to simplify and/or change
the representation of an image into something that
is more meaningful and easier to analyze. Image
12

segmentation is typically used to locate objects


and boundaries (lines, curves, etc.) in images.
The result of image segmentation is a set of
regions that collectively cover the entire image, or
a set of contours extracted from the image. Each of
the pixels in a region are similar with respect to
some characteristic or computed property, such as
color, intensity, or texture. Adjacent regions are
significantly different with respect to the same
characteristic(s).[figure7]

[figure7]: show

example of segmentation

Some of the practical applications of image


segmentation are:
*Medical Imaging :
Locate tumors and other pathologies.
Measure tissue volumes.
13

Computer-guided surgery.
Diagnosis.
Treatment planning.
Study of anatomical structure.

*Locate objects in satellite images (roads, forests,


etc.) .
*Face recognition.
*Fingerprint recognition.
*Automatic traffic contolling systems.
*Machine vision.
Several general-purpose algorithms and
techniques have been developed for image
segmentation. Since there is no general solution to
the image segmentation problem, these
techniques often have to be combined with domain
knowledge in order to effectively solve an image
segmentation problem for a problem
domain :
1 - Clustering Methods.
2 - Histogram-Based Methods.
3 - Edge Detection Methods.
4 - Region Growing Methods.
5 - Level Set Methods.
6 - Graph Partitioning Methods.
7 - Watershed Transformation.
8 - Model based Segmentation.
14

9 - Multi-scale Segmentation.
10 - Semi-automatic Segmentation.
11 - Neural Networks Segmentation.
12 - Open Source Software.

2. Cluster analysis
is the classification of objects into
different groups, or more precisely, the partitioning
of a data set into subsets (clusters), so that the
data in each subset (ideally) share some common
trait - often proximity according to some defined
distance measure. Data clustering is a common
technique for statistical data analysis, which is
used in many fields, including machine learning,
data mining, pattern recognition, image analysis
and bioinformatics. The computational task of
classifying the data set into k clusters is often
referred to as k-clustering.
Clustering

Besides the term data clustering (or just


clustering), there are a number of terms with
similar meanings, including cluster analysis,
automatic classification, numerical taxonomy,
botryology and typological analysis.

15

2.1 K-means clustering


The K-means algorithm is an iterative technique
that is used to partition an image into K clusters.
The K-means algorithm assigns each point to the
cluster whose center (also called centroid) is
nearest. The center is the average of all the points
in the cluster that is, its coordinates are the
arithmetic mean for each dimension separately
over all the points in the cluster...
Example: The data set has three dimensions and
the cluster has two points: X = (x1, x2, x3) and Y =
(y1, y2, y3). Then the centroid Z becomes Z = (z1, z2,
z3), where z1 = (x1 + y1)/2 and z2 = (x2 + y2)/2 and
z3 = (x3 + y3)/2.
The algorithm steps are :
1-Choose the number of clusters, k.
2-Randomly generate k clusters and determine the
cluster centers, or directly generate k random
points as cluster centers.
3-Assign each point to the nearest cluster center.
4-Recompute the new cluster centers.
5-Repeat the two previous steps until some
convergence criterion is met (usually that the
assignment hasn't changed).

16

The main advantages of this algorithm are its


simplicity and speed which allows it to run on large
datasets.
Its disadvantage is that it does not yield the same
result with each run, since the resulting clusters
depend on the initial random assignments.
It minimizes intra-cluster variance, but does not
ensure that the result has a global minimum of
variance.

2.2 K-means algorithm


The k-means algorithm is an algorithm to cluster
n objects based on attributes into k partitions, k <
n. It is similar to the expectation-maximization
algorithm for mixtures of Gaussians in that they
both attempt to find the centers of natural clusters
in the data. It assumes that the object attributes
form a vector space. The objective it tries to
achieve is to minimize total intra-cluster variance,
or, the squared error function :

where there are k clusters Si, i = 1, 2, ..., k, and i


is the centroid or mean point of all the points xj Si.
The most common form of the algorithm uses an
iterative refinement heuristic known as Lloyd's
algorithm. Lloyd's algorithm starts by partitioning
the input points into k initial sets, either at random
or using some heuristic data. It then calculates the
mean point, or centroid, of each set. It constructs a
new partition by associating each point with the
closest centroid. Then the centroids are
17

recalculated for the new clusters, and algorithm


repeated by alternate application of these two
steps until convergence, which is obtained when
the points no longer switch clusters (or
alternatively centroids are no longer changed).
Lloyd's algorithm and k-means are often used
synonymously, but in reality Lloyd's algorithm is a
heuristic for solving the k-means problem, but with
certain combinations of starting points and
centroids, Lloyd's algorithm can in fact converge to
the wrong answer (ie a different and optimal
answer to the minimization function above exists.)
Other variations exist, but Lloyd's algorithm has
remained popular because it converges extremely
quickly in practice. In fact, many have observed
that the number of iterations is typically much less
than the number of points. Recently, however,
David Arthur and Sergei Vassilvitskii showed that
there exist certain point sets on which k-means
takes superpolynomial time: 2(n) to converge.
Approximate k-means algorithms have been
designed that make use of coresets: small subsets
of the original data.
In terms of performance the algorithm is not
guaranteed to return a global optimum. The quality
of the final solution depends largely on the initial
set of clusters, and may, in practice, be much
poorer than the global optimum.[citation needed] Since
the algorithm is extremely fast, a common method
is to run the algorithm several times and return the
best clustering found.
A drawback of the k-means algorithm is that the
number of clusters k is an input parameter. An
18

inappropriate choice of k may yield poor results.


The algorithm also assumes that the variance is an
appropriate measure of cluster scatter.

2.3 Demonstration of the


algorithm
The following images demonstrate the k-means
clustering algorithm in action, for the twodimensional case. The initial centres are generated
randomly to demonstrate the stages in more detail.

Shows the initial


Points are
randomized
associated with
centroids and a
the nearest
number of
centroid.
points.

Now the
centroids are
moved to the
center of their
respective
clusters.

19

Steps 2 & 3 are


repeated until a
suitable level of
convergence has
been reached.

2.4 Applications of the


algorithm
Image Segmentation

The k-means clustering algorithm is commonly


used in computer vision as a form of image
segmentation. The results of the segmentation are
used to aid border detection and object
recognition. In this context, the standard euclidean
distance is usually insufficient in forming the
clusters. Instead, a weighted distance measure
utilizing pixel coordinates, RGB pixel color and/or
intensity, and image texture is commonly used.

3. Wavelet
A wavelet is a mathematical function useful in
digital signal processing and image compression
(divide a given function or continuous-time signal
into different frequency components and study
each component with a resolution that matches its
scale) . The use of wavelets for these purposes is a
recent development, although the theory is not
new.
The principles are similar to those of Fourier
analysis, which was first developed in the early
part of the 19th century.
20

In signal processing, wavelets make it possible to


recover weak signals from noise . This has proven
useful especially in the processing of X-ray and
magnetic-resonance images in medical
applications. Images processed in this way can be
"cleaned up" without blurring or muddling the
details.
In Internet communications, wavelets have been
used to compress images to a greater extent than
is generally possible with other methods. In some
cases, a wavelet-compressed image can be as
small as about 25 percent the size of a similarquality image using the more familiar JPEG
method. Thus, for example, a photograph that
requires 200 KB and takes a minute to download in
JPEG format might require only 50 KB and take 15
seconds to download in wavelet-compressed
format.
is the representation of a
function by wavelets. The wavelets are scaled and
translated copies (known as "daughter wavelets")
of a finite-length or fast-decaying oscillating
waveform (known as the "mother wavelet").
A wavelet transform

Wavelet transforms have advantages over


traditional Fourier transforms for representing
functions that have discontinuities and sharp
peaks, and for accurately deconstructing and
reconstructing finite, non-periodic and/or nonstationary signals.In formal terms, this
representation is a wavelet series representation of
a square-integrable function with respect to either
a complete, orthonormal set of basis functions, or
an overcomplete set of Frame of a vector space
(also known as a Riesz basis), for the Hilbert space
of square integrable functions.
21

Wavelet transforms are classified into discrete


wavelet transforms (DWTs) and continuous wavelet
transforms (CWTs). Note that both DWT and CWT
are of continuous-time (analog) transforms. They
can be used to represent continuous-time (analog)
signals. CWTs operate over every possible scale
and translation whereas DWTs use a specific subset
of scale and translation values or representation
grid. [figure8]

[figure8]: show simple wavelet diagram

4. Results using MATLAB


Program:
The name MATLAB stands for matrix laboratory, it
is define as a high-performance language for
technical computing. It integrates computation,
visualization, and programming in an easy-to-use
22

environment where problems and solutions are


expressed in familiar mathematical notation.

*Typical uses of MATLAB include:- Math and computation.


-Algorithm development
-Data acquisition
-Modeling, simulation, and prototyping
-Data analysis, exploration, and visualization
-Scientific and engineering graphics
-Application development, including graphical user
interface building
In our project we will use MATLAB to perform
segmentation process in noise image by using
wavelet and then will perform
.K-mean clustering to it
so we must operate the MATLAB as following
sequences:(1)First, we open the MATLAB program and waiting until
the main page appear.

The main page of MATLAB consist of three sections (2)


(Command Window, Current Directory and Command
History) which help us to perform our job, we will save our
.images
23

(3) before start write program in the Command Window,


we must in first understanding the equation and then
using the appropriates MATLAB Code that represent each
part of the equation, and this is one of hard job in our
project, because if there is any mistake or error in code,
the result image will be affected.

:we show the original image (4)


24

:the image after using the wavelet code (5)

the final result image after using the K mean (6)


:clustering code for the wavelet image
25

#We will now discus how to make k-mean


clustering method with the MATLAB program:
It=imread('lung.gif');
We load the original image in the program
Imshow(It);
After that we use this command to show the
orginal image in the program

;I1=im2double(It)
This command will double the size of the image
26

'dwt2(I1,'bior3.5 = [cA,cH,cV,cD]);
This is the image after we do the wavelet
command on it

;tot=cat(3,cA,cD)
the command (cat) will combine the four image
that we get it from the wavelet in single image

;ab=im2double(tot
This command will double the size of the image
;ab1=reshape(ab,76*76,2)

this command will reshape the image


= [cluster_idx cluster_center] ) ;
kmeans(ab1,3,'distance','sqEuclidean','Replicates',3

This is the K-mean clustering command

;pixel_labels = reshape(cluster_idx,76,76)
this command will reshape the image after
clustering
;imshow(pixel_labels,[])
this command will show us the final image after
clustering
Finaly we get this image :

27

5. Conclusion :
During this project we learned a lot of
interesting things. We get some
experience in image processing
segmentation and K-mean clustring in
theory and in practice using Matlab-7
software. the benefit of the K-mean
clustering that its simplicity and speed
which allows us to run on large datasets.

28

6. References:
Medical imaging
http://en.wikipedia.org/wiki/Medical_imaging

image processing
http://en.wikipedia.org/wiki/Image_processing

Segmentation
http://en.wikipedia.org/wiki/Segmentation_
%28image_processing%29

Pixel
http://en.wikipedia.org/wiki/Pixel

Cluster analysis
http://en.wikipedia.org/wiki/Cluster_analysis

Clustering Methods
http://en.wikipedia.org/wiki/Segmentation_
%28image_processing
%29#Clustering_Methods

K-means algorithm
http://en.wikipedia.org/wiki/Kmeans_algorithm

Wavelet
http://whatis.techtarget.com/definition/0,,sid
9_gci213341,00.html

29

Вам также может понравиться