You are on page 1of 61

HEALTH MONITORING OF FETAL ULTRASOUND

IMAGE USING ACTIVE CONTOUR MODEL


A PROJECT REPORT

Submitted by

MUTHU SORNAMATHY M (950819106046)

MARI ASHWINI B (950819106038)


NANDHINI S.B. (950819106047)
ASHA S (950819106007)

In partial fulfillment for the award of the degree


Of
BACHELOR OF ENGINEERING
IN
ELECTRONICS AND COMMUNICATION ENGINEERING

GOVERNMENT COLLEGE OF ENGINEERING,TIRUNELVELI


ANNA UNIVERSITY : CHENNAI 600 025

APRIL 2023

ANNA UNIVERSITY : CHENNAI 600 025


1
BONAFIDE CERTIFICATE

Certified that this project “ HEALTH MONITORING OF FETAL


ULTRASOUND IMAGE USING ACTIVE CONTOUR MODELS” is the
bonafide work of

MUTHU SORNAMATHY M(950819106046)

MARI ASHWINI B(950819106038)

NANDHINI SB(950819106047)

ASHA S (950819106007)

who carried out the project work under my supervision.

SIGNATURE SIGNATURE

Dr.M.Vijaya Raj M.E.,Ph.D.,MISTE., Mrs.M.Kalaiselvi.,M.E.,

HEAD OF THE DEPARTMENT SUPERVISOR


Department of Electronics and Department of Electronics and

Communication Engineering , Communication Engineering,

Government College of Engineering, Government College of Engineering,

Tirunelveli-627 007. Tirunelveli-627007.

CERTIFICATE EVALUATION

I
College Name : Government College of Engineering, Tirunelveli-627 007

Branch : Electronics and Communication Engineering.

Semester : VIII Semester.

S NO NAME OF THE TITLE OF THE PROJECT NAME OF THE GUIDE


STUDENT WITH DESIGNATION

1 Muthu Sornamathy M Health Monitoring of Mrs.M.KALAISELVI


(950819106046) Fetal Ultrasound Image Department of
using Active Contour Electronics and
Models Communication
Engineering.

2 Mari Ashwini B
(950819106038)
3 Nandhini S B
(950819106047)
4 Asha S
(950819106007)
The report of the project work submitted by the above students in fulfillment for
the award of Bachelor of Engineering in Electronics and Communication
Engineering of Anna University was evaluated and confirmed to be the work
done by the above students and then evaluated. Submitted for the Viva-voce
on____________.

INTERNAL EXAMINER EXTERNAL EXAMINER

ACKNOWLEDGEMENT
First and foremost, we thank the glorious Almighty of God for blessing us
with all that was required for the completion of our project.

I
We are thankful to Dr.S.Sidharthan M.E.,Ph.D., The Principal, Government
College of Engineering, Tirunelveli for his support towards the student
community and nurturing their caliber.

We extend our sincere thanks to our beloved Head of the Department


Dr.M.Vijaya Raj M.E.,Ph.D., MISTE., for his overwhelming support in all
our endeavours.

We record our gratitude to our Project Guide Mrs.M.Kalaiselvi M.E., for


his encouraging words, unfailing availability and valuable guidance that
enabled us to complete this project successfully. His keen interest and
support towards us are most heartily encouraged.

We extend our sincere thanks to our Faculty Advisor Prof.V.Selvakumar


M.E., for her suggestions in initiating the project and for her support
throughout the completion of our project.

We sincerely thank all our teaching and non-teaching staff for their help in
the completion of our project.
Finally, we thank our friends and family for their encouragement and help
in the execution of our project work.

ABSTRACT

Analysis of the health condition of the fetus on ultrasound is needed by medical

personnel as well as pregnant women who are pregnant. At a young age the

I
pregnancy is still a great time to do the analysis on the condition of the baby in

the womb. But most of this process can only be done by experts, namely

medical personnel. It is necessary for a segmentation process on the results of

the ultrasound image processing that aims to help medical personnel, patients

are pregnant women and the general public to determine how the development

of the fetus to grow healthy or whether there is any abnormality. The parameters

which will be used as the basis for determining the level of health of the fetus in

early pregnancy, the length of the fetus (Crown Rump Length) and the

gestational sac diameter (gestational sac). The parameters are expected to be

visible after the ultrasound image through a phase of segmentation by using

Active Contour Models. This method uses the principle of minimizing the

energy to detect specific features in the image.

TABLE OF CONTENTS

CHAPTER NO. TITLE PAGE NO.


ACKNOWLEDGEMENT
INTRODUCTION

I
ABSTRACT
LIST OF TABLES
LIST OF FIGURES

1 INTRODUCTION
1.1 GENERAL
1.2 THE IMAGE PROCESSING
SYSTEM
1.2.1 DIGITIZER
1.2.2 IMAGE PROCESSOR
` 1.2.3 DIGITAL COMPUTER
1.2.4 MASS STORAGE
1.2.5 HARD COPY DEVICE
1.2.6 OPERATOR CONSOLE
1.3 IMAGE PROCESSING FUNDAMENTAL
1.3.1 IMAGE PROCESSING
TECHNIQUES
1.3.2 IMAGE ENHANCEMENT
1.3.3 IMAGE RESTORATION
1.3.4 IMAGE ANALYSIS
1.3.5 IMAGE COMPRESSION
1.3.6 IMAGE SYNTHESIS
1.4 APPLICATIONS OF DIGITAL
IMAGE PROCESSING
1.4.1 MEDICAL APPLICATIONS
1.4.2 SATELLITE IMAGING
1.4.3 COMMUNICATION
1.4.4 RADAR IMAGING SYSTEM
1.4.5 DOCUMENT PROCESSING
1.4.6 DEFENCE/INTELLIGENCE

I
2 LITERATURE SURVEY

3 OVERVIEW OF THE PROJECT

3.1 EXISTING SYSTEM


3.2 PROPOSED SYSTEM
3.3 BLOCK DIAGRAM
3.4 PROJECT DESCRIPTION
3.4.1 GRAY SCALE
3.4.2 MORPHOLOGICAL
OPERATIONS

4 MODULES
4.1 IMAGE SEGMENTATION
4.2 ACTIVE CONTOUR MODEL
4.3 INTEGRAL PROJECTIONS
4.3.1 MODULE 1
4.3.2 MODULE 2
4.3.3 MODULE 3
4.3.4 MODULE 4

5 SOFTWARE SPECIFICATIONS

5.1 MATLAB
5.2 FEATURES OF MATLAB
5.3 INTERFACING WITH
OTHER LANGUAGES
5.3.1 DEVELOPMENT ENVIRONMENT
5.3.2 DEVELOPMENT ALGORITHM

I
AND APPLICATIONS
5.3.3 THE MATLAB LANGUAGE
5.3.4 MATLAB EDITOR
5.3.5 CODE ANALYZER
5.3.6 MATLAB PROFILER
5.3.7 DIRECTORY REPORTS
5.3.8 DESIGNING GRAPHICAL USER
I INTERFACES
5.4 ANALYZING AND ACCESSING DATA
5.4.1 DATA ANALYSIS
5.4.2 DATA ACCESS
5.4.3 VISUALIZING DATA
5.4.4 2-D PLOTTING
5.4.5 3-D PLOTTING AND VOLUME
V VISUALIZATION
5.5 PERFORMING NUMERIC
COMPUTATIONS

6 RESULT ANALYSIS

7 CONCLUSION

8 APPENDIX

9 REFERENCE

LIST OF FIGURES

I
FIG NO. TITLE PAGE NO

1.1 BLOCK DIAGRAM FOR IMAGE

PROCESSING SYSTEM

1.2 BLOCK DIAGRAM OF FUNDAMENTAL

SEQUENCE INVOLVED IN

IMAGE PROCESSING SYSTEM

1.3 IMAGE PROCESSING TECHNIQUE

3.1 BLOCK DIAGRAM FOR HEALTH

MONITORING OF FETAL

ULTRASOUND IMAGE

3.2 AMPLITUDE FUNCTION OF TWO,

REAL VARIABLES A (X,Y)

3.3 BINARY IMAGE WITH OBJECT AND

BACKGROUND CONNECTIVITY.

3.4 (a)DILATION D(A,B) (b)EROSION E(A,B)

3.5 CARTESIAN GRID (a) N4 (b) N8

4.1 FLOWCHART OF IMAGE

SEGMENTATION PROCESS

6.1 THE INPUT IMAGE WHERE WE

HAVE TO SELECT THE REGION

OF WORKING

6.2 SEPARATING THE FETAL REGION

FROM SAC BY REGION OF

ITERATION PROCESS

I
6.3 IMAGE SEGMENTATION USING

ACTIVE CONTOUR MODE

6.4 THE HEALTH STATUS OF FETUS

WILL BE SHOWN AS OUTPUT COMMAND

LIST OF TABLES

TABLE NO. TITLE PAGE


NO.

I
3.1 COMPARISON TABLE ON HEALTHY FETUS

CHAPTER 1

INTRODUCTION

1.1 GENERAL

I
The term digital image refers to processing of a two dimensional picture by
a digital computer. In a broader context, it implies digital processing of any two
dimensional data. A digital image is an array of real or complex numbers
represented by a finite number of bits. An image given in the form of a
transparency, slide, photograph or an X-ray is first digitized and stored as a
matrix of binary digits in computer memory. This digitized image can then be
processed and/or displayed on a high-resolution television monitor. For display,
the image is stored in a rapid-access buffer memory, which refreshes the
monitor at a rate of 25 frames per second to produce a visually continuous
display.

1.2 THE IMAGE PROCESSING SYSTEM

Digitizer Mass Storage

Image Processor Digital Operator


Computer Console

Hard Copy
Device
Display

FIG 1.1 BLOCK DIAGRAM FOR IMAGE PROCESSING SYSTEM

I
1.2.1 DIGITIZER:
A digitizer converts an image into a numerical representation suitable for
input into a digital computer. Some common digitizers are

1. Microdensitometer
2. Flying spot scanner
3. Image dissector
4. Videocon camera
5. Photosensitive solid- state arrays.

1.2.2 IMAGE PROCESSOR:


An image processor does the functions of image acquisition, storage,
preprocessing, segmentation, representation, recognition and interpretation and
finally displays or records the resulting image. The following block diagram
gives the fundamental sequence involved in an image processing system.

Problem Image Representation &


Segmentation
Domain Acquisition Description
n

Knowledge Result
Preprocessing Recognition &
interpretation
Base

FIG 1.2 BLOCK DIAGRAM OF FUNDAMENTAL SEQUENCE INVOLVED IN AN


IMAGE PROCESSING SYSTEM

As detailed in the diagram, the first step in the process is image acquisition
by an imaging sensor in conjunction with a digitizer to digitize the image. The

13
the next step is the preprocessing step where the image is improved being fed as
an input to the other processes. Preprocessing typically deals with enhancing,
removing noise, isolating regions, etc. Segmentation partitions an image into its
constituent parts or objects. The output of segmentation is usually raw pixel
data, which consists of either the boundary of the region or the pixels in the
region themselves. Representation is the process of transforming the raw pixel
data into a form useful for subsequent processing by the computer. Description
deals with extracting features that are basic in differentiating one class of
objects from another. Recognition assigns a label to an object based on the
information provided by its descriptors. Interpretation involves assigning
meaning to an ensemble of recognized objects. The knowledge about a problem
domain is incorporated into the knowledge base. The knowledge base guides the
operation of each processing module and also controls the interaction between
the modules. Not all modules need to be necessarily present for a specific
function. The composition of the image processing system depends on its
application. The frame rate of the image processor is normally around 25 frames
per second.

1.2.3 DIGITAL COMPUTER:

Mathematical processing of the digitized image such as convolution,


averaging, addition, subtraction, etc. are done by the computer.

1.2.4 MASS STORAGE:

The secondary storage devices normally used are floppy disks, CD ROMs
etc.

1.2.5 HARD COPY DEVICE:

The hard copy device is used to produce a permanent copy of the image
and for the storage of the software involved.

1.2.6 OPERATOR CONSOLE

14
The operator console consists of equipment and arrangements for
verification of intermediate results and for alterations in the software as and
when required. The operator is also capable of checking for any resulting errors
and for the entry of requisite data.

1.3 IMAGE PROCESSING FUNDAMENTAL:

Digital image processing refers to processing of the image in digital form.


Modern cameras may directly take the image in digital form but generally
images originate in optical form. They are captured by video cameras and
digitized. The digitization process includes sampling, quantization. Then these
images are processed by the five fundamental processes, at least any one of
them, not necessarily all of them.

1.3.1 IMAGE PROCESSING TECHNIQUES:


This section gives various image processing techniques.

Image Enhancement

Image Restoration

IP Image Analysis

Image Compression

Image Synthesis

FIG1.3: IMAGE PROCESSING TECHNIQUES

1.3.2 IMAGE ENHANCEMENT:

15
Image enhancement operations improve the qualities of an image like
improving the image’s contrast and brightness characteristics, reducing its noise
content, or sharpening the details. This just enhances the image and reveals the
same information in a more understandable image. It does not add any
information to it.

1.3.3 IMAGE RESTORATION:


Image restoration like enhancement improves the qualities of image but
all the operations are mainly based on known, measured, or degradations of the
original image. Image restorations are used to restore images with problems
such as geometric distortion, improper focus, repetitive noise, and camera
motion. It is used to correct images for known degradations.

1.3.4 IMAGE ANALYSIS:

Image analysis operations produce numerical or graphical information


based on characteristics of the original image. They break into objects and then
classify them. They depend on the image statistics. Common operations are
extraction and description of scene and image features, automated
measurements, and object classification. Image analysis is mainly used in
machine vision applications.

1.3.5 IMAGE COMPRESSION:

Image compression and decompression reduce the data content necessary


to describe the image. Most of the images contain a lot of redundant
information, compression removes all the redundancies. Because of the
compression the size is reduced, so efficiently stored or transported. The
compressed image is decompressed when displayed. Lossless compression
preserves the exact data in the original image, but Lossy compression does not
represent the original image but provides excellent compression.

1.3.6 IMAGE SYNTHESIS:

16
Image synthesis operations create images from other images or non-
image data. Image synthesis operations generally create images that are either
physically impossible or impractical to acquire.

1.4 APPLICATIONS OF DIGITAL IMAGE PROCESSING:

Digital image processing has a broad spectrum of applications, such as


remote sensing via satellites and other spacecraft, image transmission and
storage for business applications, medical processing, radar, sonar and acoustic
image processing, robotics and automated inspection of industrial parts.

1.4.1 MEDICAL APPLICATIONS:

In medical applications, one is concerned with processing of chest X-


rays, cineangiograms, projection images of transaxial tomography and other
medical images that occur in radiology, nuclear magnetic resonance (NMR) and
ultrasonic scanning. These images may be used for patient screening and
monitoring or for detection of tumors’ or other diseases in patients.

1.4.2 SATELLITE IMAGING:

Images acquired by satellites are useful in tracking of earth resources;


geographical mapping; prediction of agricultural crops, urban growth and
weather; flood and fire control; and many other environmental applications.
Space image applications include recognition and analysis of objects contained
in image obtained from deep space-probe missions.

1.4.3 COMMUNICATION:

Image transmission and storage applications occur in broadcast television,


teleconferencing, and transmission of facsimile images for office automation,
communication of computer networks, closed-circuit television based security
monitoring systems and in military communications.

1.4.4 RADAR IMAGING SYSTEMS:

17
Radar and sonar images are used for detection and recognition of various
types of targets or in guidance and maneuvering of aircraft or missile systems.

1.4.5 DOCUMENT PROCESSING:

It is used in scanning, and transmission for converting paper documents


to a digital image form, compressing the image, and storing it on magnetic tape.
It is also used in document reading for automatically detecting and recognizing
printed characteristics.

1.4.6 DEFENSE/INTELLIGENCE:

It is used in reconnaissance photo-interpretation for automatic


interpretation of earth satellite imagery to look for sensitive targets or military
threats and target acquisition and guidance for recognizing and tracking targets
in real-time smart-bomb and missile-guidance systems.

Analysis of fetal health conditions on the image of ultrasound is needed


by medical personnel and pregnant women who are pregnant. At a young
gestational age fetal analysis is important to determine the location of
pregnancy, fetal age, fetal number, screening of the first congenital defects and
abnormalities that may occur in the fetus . Because the advantages of ultrasound
image processing are safe for patients, this imaging technique is more
interesting than other retrieval techniques. But the processing is often found to
be noise, low contrast, and poor image quality, making it difficult for medical
personnel themselves to perform the analysis process. This segmentation can be
done to group and simplify the process of fetal ultrasound image processing
analysis. Segmentation is an important part of image processing in health sector.
Segmentation has been widely applied to ultrasound image processing with
various methods where there are deficiencies and advantages. So far, various
image segmentations have been performed using methods such as Watershed,

18
Clustering, Active Contour , Edge Detection Algorithms and so on. In this
segmentation research on ultrasound images to determine the health of the fetus
will be performed. Prior to the segmentation process, preprocessing should be
done first to improve the quality of ultrasound image, by increasing contrast and
eliminating noise. The Segmentation method used is Active Contour Models
method. This method performs the process by collecting several points which
are then connected and controlled by a line. The output of the segmentation
process is a fetal ultrasound image where the fetus and gestational sac have
been separated from the background object. Furthermore, long measurements
were taken. With this method is expected to lower the quality of ultrasound
image processing can be improved so as to facilitate the determination of fetal
health.

INTRODUCTION OF FETAL ULTRASOUND

Fetal ultrasound is a test used during pregnancy. It creates an image of the


baby in the mother's womb (uterus). It’s a safe way to check the health of an
unborn baby. During a fetal ultrasound, the baby’s heart, head, and spine are
evaluated, along with other parts of the baby. The test may be done either on the
mother’s abdomen (transabdominal) or in the vagina (transvaginal).

There are several types of fetal ultrasound:

Standard ultrasound - The test uses sound waves to create 2-D images on a
computer screen.

Doppler ultrasound - This test shows and measures the movement of blood
through the uterus, umbilical cord, in the baby’s heart, or around the baby's
body.

19
Ultrasound uses an electronic wand called a transducer to send and receive
sound waves. No radiation is used during the procedure. The transducer is
moved over the abdomen, and sound waves move through the skin, muscle,
bone, and fluids at different speeds. The sound waves bounce off the baby like
an echo and return to the transducer. The transducer converts the sound waves
into an electronic image on a computer screen.

20
CHAPTER II
LITERATURE SURVEY

I)Gustavo Carneiro 1, Bogdan Georgescu, Sarah Good, Dorin Comaniciu


We propose a novel method for the automatic detection and measurement
of fetal anatomical structures in ultrasound images. This problem offers a
myriad of challenges, including: difficulty of modeling the appearance
variations of the visual object of interest, robustness to speckle noise and signal
dropout, and large search space of the detection procedure. Previous solutions
typically rely on the explicit encoding of prior knowledge and formulation of
the problem as a perceptual grouping task solved through clustering or
variational approaches. We propose a novel system for fast automatic detection
and measurement of fetal anatomies that directly exploits a large database of
expert annotated fetal anatomical structures in ultrasound images. Our method
learns automatically to distinguish between the appearance of the object of
interest and background by training a constrained probabilistic boosting tree
classifier. This system is able to produce the automatic segmentation of several
fetal anatomies using the same basic detection algorithm. We show results on
fully automatic measurement of biparietal diameter (BPD), head circumference
(HC), abdominal circumference (AC), femur length (FL), humerus length (HL),
and crown rump length (CRL). Notice that our approach is the first in the
literature to deal with the HL and CRL measurements. Extensive experiments
(with clinical validation) show that our system is, on average, close to the
accuracy of experts in terms of segmentation and obstetric measurements.
Finally, this system runs under half second on a standard dual-core PC
computer.

II)Mohammad Talebi, Ahamd Ayatollahi, Ali Kermani

21
.

Image segmentation is one of the earliest and most important stages of


image processing and plays an important role in both qualitative and
quantitative analysis of medical ultrasound images but ultrasound images have
low level of contrast and are corrupted with strong speckle noise. Due to these
effects, segmentation of ultrasound images is very challenging and traditional
image segmentation methods may not lead to satisfactory results. The active
contour method has been one of the widely used techniques for image
segmentation; however, due to low quality of ultrasound images, it has
encountered difficulties. In this paper, we presented a segmental method
combined genetic algorithm and active contour with an energy minimization
procedure based on genetic algorithms. This method has been proposed to
overcome some limits of classical active contours, as contour initialization and
local minima (speckle noise), and have been successfully applied on medical
ultrasound images. Experimental result on medical ultrasound image show that
our presented method only can correctly segment the circular tissue’s on
ultrasound images

III)Sonia Dahdouh,Antoine Serrurier,Gilles Grange,Elsad.A.,Isabelle Bloch

This paper presents a novel shape-guided variational segmentation


method for extracting the fetus envelope on 3D obstetric ultrasound images.
Indeed, due to the inherent low quality of these images, classical segmentation
methods tend to fail at segmenting these data. To compensate for the lack of
contrast and of explicit boundaries, we introduce a segmentation framework that
combines three different types of information: pixel intensity distribution, shape
prior on the fetal envelope and a back model varying with fetus age. The
intensity distributions, different for each tissue, and the shape prior, encoded
with Legendre moments, are added as energy terms in the functional to be
optimized. The back model is used in a post-processing step. Results on 3D

22
ultrasound data are presented and compared to a set of manual segmentations.
Both visual and quantitative comparisons show the satisfactory results obtained
by this method on the tested data.

IV)Gusti Ayu Almira, T. Harsono, +2 authors J. S. Michael Saputra[2016]


One step in the image processing is filtering that is located in the
preprocessing. In the context of fetal analysis on the ultrasound image, filtering
is really needed to enhance the quality of the ultrasound image. This study
conducted analysis of performance between Gaussian and bilateral filters in the
fetal length. Peak signal to noise ratio (PSNR) was used to measure the quality
of reconstruction of the image compression. In case of early pregnancy, fetal
analysis is important to determine some disabilities that might cause
miscarriage. One indicator parameter for determining the fetal health of the
early pregnancy is Crown Rump Length (CRL) or fetal length. Calculation of
fetal length was performed with different filters (Gaussian and bilateral) after
segmentation was carried out. According to the experimental data, using
Gaussian filters with kernels 3×3; 5×5; and 7×7, PSNR was achieved
consecutively 31 dB, 28 dB, and 27dB. Furthermore, in the same ultrasound
image, PSNR is 30 dB when the filter is bilateral. At the same time, fetal length
was also counted separately for Gaussian and bilateral filters. The results of
mean fetal length were 6.5 cm, 9.9 cm, 9.4 cm for Gaussian filter with kernel:
3×3, 5×5, 7×7 respectively; while the system obtained fetal length 5.6 cm for
bilateral filter. It is seen that by using a bilateral filter, the fetal length achieved
quite accurately characterized with a mean error of fetal length is quite small.

CHAPTER III

23
OVERVIEW OF THE PROJECT

3.1 EXISTING SYSTEM


It is impractical to compare the performance of models derived from
different populations with each other, but since these models are routinely used
on the Indian population, the performance of the newly derived models was
compared with the performance of existing models. For this comparison, only
models that have been found to have a systematic error of ±10% in the Indian
population in earlier studies were selected. The validation data set was used for
this comparison.

3.1.1 DRAWBACKS
1)It requires a very large amount of data in order to perform better than other
techniques.
2)It takes more time to train the dataset.

3.2 PROPOSED SYSTEM


Medical ultrasound (sonography) is an ultrasound imaging diagnostic
technique used to image internal organs and muscles, their size, structure, and
pathology wounds, making this technique useful for examining organs.
Obstetric sonography is commonly used during pregnancy.Sonographic
diagnostics generally operate at frequencies from 2 to 13 megahertz. While in
physics the term "ultrasound" includes all acoustic energy with a frequency
above human hearing (20,000 Hertz), its general use in medical imaging
involves a cluster of frequencies hundreds of times higher. Digital image
processing is one of the areas in the computer world that began to grow since
humans understand that computers are not only able to handle text data, but also
image data. Image processing terminology is used. These digital biomedical
image processing processes generally aim to detect objects and to perform

24
further measurements and then be used to support the diagnostic process. Pre-
processing process is often referred to as low-level processing. At that stage, it
is usually necessary to improve the quality of the image, as well as the process
of detecting the sides or lines of boundaries between different objects, such as
between bone and tissue or between healthy tissue and diseased tissue. Image
analysis in the form of detection or identification of objects can be done through
the process of image classification process to several objects and the process of
comparison between the object characteristics observed with knowledge of the
familiar object characteristics. The process of diagnosis based on the results of
this image processing is not enough just to see the difference in the gray level of
the image elements between the sick and healthy parts, but also through the
differentiation of the size of body parts observed with the body parts under
normal circumstances. The measurement of the magnitude of an object in the
image can be done by counting the number of pixels which states the gray level
of the category of the object. This sonography shows the image of the head of a
fetus in the womb. In the case of pregnancy, Ultrasound (USG) is used by a
gynecologist (DSOG) to estimate the gestational age and estimate the day of
delivery.

3.3 BLOCK DIAGRAM

25
INPUT IMAGE Marks the fetal processing area and gestational sac

Fetal Segmentation -
Segmentation of Pregnancy Pouch Region Filtering

Determine the health of the fetus, whether the fetus Comparison of diameter - Integral
is healthy or not Projection

FIG 3.1: BLOCK DIAGRAM FOR HEALTH MONITORING OF FETAL


ULTRASOUND IMAGE

3.4 PROJECT DESCRIPTION

3.4.1 GRAYSCALE:
In photography and computing, a grayscale or greyscale digital image is
an image in which the value of each pixel is a single sample, that is, it carries
only intensity information. Images of this sort, also known as black-and-white,
are composed exclusively of shades of gray, varying from black at the weakest
intensity to white at the strongest. Grayscale images are distinct from one-bit bi-
tonal black-and-white images, which in the context of computer imaging are

26
images with only the two colors, black, and white (also called bilevel or binary
images). Grayscale images have many shades of gray in between. Grayscale
images are also called monochromatic, denoting the presence of only one
(mono) color (chrome).Grayscale images are often the result of measuring the
intensity of light at each pixel in a single band of the electromagnetic
spectrum (e.g. infrared, visible light,ultraviolet, etc.), and in such cases they are
monochromatic proper when only a given frequency is captured. But also they
can be synthesized from a full color image; see the section about converting to
grayscale.

INPUT FETAL FETAL FETAL ERROR


LENGTH LENGTH LENGTH LENGTH
REFERENC MEASURE DIFFEREN DIFFEREN
E D CE CE
j01.bmp 2.03 cm 2.13 cm 0.1 cm 4.9%
j03.bmp 1.73 cm 1.59 cm 0.14 cm 8.09%
j04.bmp 2.60 cm 2.65 cm 0.05 cm 1.92%
j05.bmp 3.83 cm 3.86 cm 0.03 cm 0.78%
j08.bmp 3.45 cm 3.2 cm 0.25 cm 7.24%
j13.bmp 4.25 cm 4.59 cm 0.34 cm 8%
j14.bmp 5.23 cm 5.18 cm 0.05 cm 0.95%
j16.bmp 1.38 cm 1.25 cm 0.13 cm 9.42%
Average 5.16%
error
measuremen
t

TABLE NO :3.1 COMPARSION ON HEALTH CONDITION

3.4.2 MORPHOLOGICAL OPERATIONS:

27
To find the exact features we have to segment the lung region from the
chest CT scan image for easy computation. For segmenting the lung region
from the chest CT scan image morphological operation is carried out.

We defined an image as an (amplitude) function of two, real (coordinate)


variables a(x,y) or two, discrete variables a[m,n]. An alternative definition of an
image can be based on the notion that an image consists of a set (or collection)
of either continuous or discrete coordinates. In a sense the set corresponds to the
points or pixels that belong to the objects in the image. This is illustrated in
figure below which contains two objects or sets A and B. Note that the
coordinate system is required. For the moment we will consider the pixel values
to be binary as discussed in Section 2.1 and 9.2.1. Further we shall restrict our
discussion to discrete space (Z2). More general discussions can be found in .

FIG 3.2: AMPLITUDE FUNCTION OF TWO, REAL


VARIABLES A(X,Y)

A binary image containing two object sets A and B.

The object A consists of those pixels a that share some common property:

28
A={α ∨ property ( α )=TRUE }

As an example, object B  consists of {[0,0], [1,0], [0,1]}.

The background of A is given by Ac (the complement of A) which is


defined as those elements that are not in A:

Ac={α |α ∉ A }
We introduced the concept of neighborhood connectivity. We now observe that
if an object A is defined on the basis of C-connectivity (C=4, 6, or 8) then the
background Ac has a connectivity given by 12 - C. The necessity for this is
illustrated for the Cartesian grid in Figure 36.

FIG 3.3: BINARY IMAGE WITH OBJECT AND BACKGROUND


CONNECTIVITY.

A binary image requiring careful definition of object and background


connectivity.

FUNDAMENTAL DEFINITIONS
The fundamental operations associated with an object are the standard set
operations union, intersection, and complement { ,  , c} plus translation:

29
* Translation - Given a vector x and a set A, the translation, A + x, is defined
as:

A+x={α + x ∨ α ∈ A }

Note that, since we are dealing with a digital image composed of pixels at
integer coordinate positions (Z2), this implies restrictions on the allowable
translation vectors x.

The basic Minkowski set operations--addition and subtraction--can now


be defined. First we note that the individual elements that comprise B are not
only pixels but also vectors as they have a clear coordinate position with respect
to [0,0]. Given two sets A and B:

Minkowski addition:

A⊕ B=β ∈ B(A+ β

 Minkowski subtraction -

A⊖ B=β ∈ B(A+ β

DILATION AND EROSION

From these two Minkowski operations we define the fundamental


mathematical morphology operations dilation and erosion:

Dilation:

D(A,B)=A⊕ B=β ∈ B(A+ β

Erosion:

E(A,B)=A⊖ ( − B )= β ∈ B (A- β

where -B={- β ∨ β ∈ B }. These two operations are illustrated in figures


below for the objects defined

30
FIG 3.4: (A) DILATION D(A,B) (B) EROSION E(A,B)

A binary image containing two object sets A and B. The three pixels in B are
"color-coded" as is their effect in the result.

While either set A or B can be thought of as an "image", A is usually


considered as the image and B is called a structuring element. The structuring
element is to mathematical morphology what the convolution kernel is to linear
filter theory.

Dilation, in general, causes objects to dilate or grow in


size; erosion causes objects to shrink. The amount and the way that they grow
or shrink depend upon the choice of the structuring element. Dilating or eroding
without specifying the structural element makes no more sense than trying to
lowpass filter an image without specifying the filter. The two most common
structuring elements (given a Cartesian grid) are the 4-connected and 8-
connected sets, N4 and N8.

31
FIG 3.5: CARTESIAN GRID (a) N4 (b) N8

The standard structuring elements N4 and N8.

Dilation and erosion have the following properties:

Commutative -

D(A,B)=A⊕ B=B ⊕ A=D ( B , A )

Non-Commutative -

E(A,B)≠ E ( B , A )

Associative -

A⊕ ( B⊕ C )=¿⊕ B⊕ C

Translation Invariance -

A⊕ ( B+ x )=( A ⊕ B )+ x

Duality -

Dc(A,B)=E(Ac,-B)

32
Ec(A,B)=D(Ac,-B)

With A as an object and Ac as the background, eq. says that the dilation of an


object is equivalent to the erosion of the background. Likewise, the erosion of
the object is equivalent to the dilation of the background.

Except for special cases:

Non-Inverses -

D(E(A,B),B)≠ A ≠ E ( D ( A , B ) , B )

Erosion has the following translation property:

Translation Invariance-

A⊖ ( B+ x )=( A + x ) ⊖ B=( A ⊖ B ) + x A2

Dilation and erosion have the following important properties. For any arbitrary


structuring element B and two image objects A1 and A2 such that   A1 is a
proper subset of A2:

Increasing in A:

D(A1,B)⊂ D ( A , B )

E(A1,B)⊂ E ( A , B )

For two structuring elements B1 and B2 such that  B1  is a proper subset of  B2:

Decreasing in B:

E(A,B1 )⊃ E 2)

The decomposition theorems below make it possible to find efficient


implementations for morphological filters.

Dilation -

33
A⊕ ( B∪C )=( A ⊕ B ) ∪ ( A ⊕ C )=( B ∪C ) ⊕ A

Erosion-

A⊖ ( B∪C )=( A ⊖ B ) ∩ ( A ⊖ C )

Erosion-

(A⊖ B⊖ C= A ⊖ ( B ⊕C )

MultipleDilations-

nB=(B⊕ B⊕ B ⊕ ......⊕ B

CHAPTER IV

MODULES

4.1 IMAGE SEGMENTATION

Segmentation process is a process to separate between one object with another

34
object or between objects with background contained in an image. With the
process of segmentation, each object in the image can be taken individually so it
can be used as input for other processes. Given the importance of the
segmentation process, it takes a segmentation method that can 2017
International Seminar on Application for Technology of Information and
Communication (iSemantic) 193 perform accurate object separation. Inaccuracy
of the segmentation process may lead to subsequent inaccuracies. In this final
project method used for the segmentation process that is Active Contour
Models.

4.2 ACTIVE CONTOUR MODEL:

The concept of Active contours models was first introduced in 1987 and later
developed by various researchers. Active contour uses the principle of
minimizing energy that detects certain features in the image, is a flexible curve
(surface) that can adapt dynamically to the desired edge (edge) or object in the
image (can be used for object segmentation automatically). This system consists
of a set of interconnected and controlled points by a straight line, as shown in
Figure 2.3, Active contour is described as a number of consecutive controlled
points with each other. The determination of objects in the image through active
contour is an interactive process. Users should estimate the initial contour, as
shown in Figure 2.3., The specified contour is almost close to the object feature
form. Furthermore, contour will be attracted towards the feature in the image
because of the influence of internal energy that produces the image. The active
contour parameter for a set of controlled coordinate points in contour can be
defined as follows 1) Where x (s) and y (s) are the coordinates x and y on the
contour and s is the normalization index of the control point. The energy
function described in the active contour consists of two components, namely
internal energy and external energy. The internal force creates a compact curve
(elastic force) and the limits turn very sharply (flexural force). External forces

35
tend to make the curve move toward the boundary of the object. The internal
energy as a sum of elastic energy and flexibility energy can be expressed as
follows :

Eint = E elastic + E bend =Į(s) + ȕ(s) . .........................(2)

The energy of elasticity and flexibility can be defined as follows :

E elastic =Į(s) ......................................(3)

And E bend =ȕ(s) .......................................(4)

The energy minimization function can be shown as follows : Esnake = Where


Eint is the internal energy of the curve, Eimage is the energy of the image, and
Econ is the external energy. After the segmentation is done the accuracy test by
comparing the image that is segmented manually with the image of the program
segmentation results.’

Region Filtering is used to remove contours away from center points and small
contours by estimating the area of each contour. Contours on fetal cavity images
are selected only on the inner contours only. Contours with an area smaller than
the specified limit value are removed (not considered) from the contour. The
value of the boundary of the contour and radius has been determined based on
the radius that has been selected.

4.3 INTEGRAL PROJECTION:

Integral projection is a method used to search the region or location of an


object. This method can be used to detect the boundaries of different image
areas, so that can be searched for the location of faces and feature-feature. This
method can also be called the integral row and column of pixels, since this
integral adds pixels per row and pixels per column. From this method it will be
easy to find the area where the object is needed

36
4.3.1 MODULE 1:

INPUT IMAGE

● Here, we are giving the collected dataset as input from the system.
4.3.2 MODULE 2:

INPUT IMAGE

PREPROCESSING

● The aim of pre-processing is an improvement of the image data that


suppresses undesired distortions or enhances some image features
relevant for further processing and analysis tasks. 
There are 4 different types of Image Pre-Processing techniques and they are
listed below.

1. Pixel brightness transformations/ Brightness corrections.


2. Geometric Transformations.
3. Image Filtering and Segmentation.
4. Fourier transform and Image re-saturation.

4.3.3 MODULE 3:
INPUT IMAGE

PREPROCESSING

SEGMENTATION

● Image segmentation is a method in which a digital image is

37
● broken down into various subgroups called Image segments which helps
in reducing the complexity of the image to make further processing or
analysis of the image simpler. Segmentation in easy words is assigning
labels to pixels. All picture elements or pixels belonging to the same
category have a common label assigned to them. For example: Let’s take
a problem where the picture has to be provided as input for object
detection. Rather than processing the whole image, the detector can be
inputted with a region selected by a segmentation algorithm. This will
prevent the detector from processing the whole image thereby reducing
inference time.

4.3.4 MODULE 4:

INPUT IMAGE

PREPROCESSING

SEGMENTATION

CNN

FIG 4.1: FLOWCHART OF IMAGE SEGMENTATION PROCESS

It is assumed that the reader knows the concept of Neural Network.


When it comes to Machine Learning, Artificial Neural Networks perform really
well. Artificial Neural Networks are used in various classification tasks like
image, audio, words.

38
CHAPTER 5

SOFTWARE SPECIFICATION

5.1 GENERAL

39
MATLAB (matrix laboratory),a numerical computing environment
and fourth-generation programming language. Developed by Math Works,
MATLAB allows matrix manipulations, plotting of functions and data,
implementation of algorithms, creation of user interfaces, and interfacing with
programs written in other languages, including C, C++, Java, and Fortran.

Although MATLAB is intended primarily for numerical computing,


an optional toolbox uses the MuPAD symbolic engine, allowing access
to symbolic computing capabilities. An additional package, Simulink, adds
graphical multi-domain simulation and Model-Based
Design for dynamic and embedded systems.

In 2004, MATLAB had around one million users across industry and
academia. MATLAB users come from various backgrounds
of engineering, science, and economics. MATLAB is widely used in academic
and research institutions as well as industrial enterprises.

MATLAB was first adopted by researchers and practitioners in  control


engineering, Little's specialty, but quickly spread to many other domains. It is
now also used in education, in particular the teaching of linear
algebra and numerical analysis, and is popular amongst scientists involved
in image processing. The MATLAB application is built around the MATLAB
language. The simplest way to execute MATLAB code is to type it in the
Command Window, which is one of the elements of the MATLAB Desktop.
When code is entered in the Command Window, MATLAB can be used as an
interactive mathematical shell. Sequences of commands can be saved in a text
file, typically using the MATLAB Editor, as a script or encapsulated into
a function, extending the commands available.

MATLAB provides a number of features for documenting and sharing


your work. You can integrate your MATLAB code with other languages and

40
applications, and distribute your MATLAB algorithms and applications.

5.2 FEATURES OF MATLAB

⮚ High-level language for technical computing.


⮚ Development environment for managing code, files, and data.
⮚ Interactive tools for iterative exploration, design, and problem solving.
⮚ Mathematical functions for linear algebra, statistics, Fourier analysis,
filtering, optimization, and numerical integration.
⮚ 2-D and 3-D graphics functions for visualizing data.
⮚ Tools for building custom graphical user interfaces.
⮚ Functions for integrating MATLAB based algorithms with external
applications and languages, such as C, C++, Fortran, Java™, COM,
and Microsoft Excel.

MATLAB is used in a vast area, including signal and image processing,


communications, control design, test and measurement, financial modeling and
analysis, and computational. Add-on tool boxes (collections of special-purpose
MATLAB functions) extend the MATLAB environment to solve particular
classes of problems in these application areas.

MATLAB can be used on personal computers and powerful server


systems, including the Cheaha compute cluster. With the addition of the Parallel
Computing Toolbox, the language can be extended with parallel
implementations for common computational functions, including for-loop
unrolling. Additionally this toolbox supports offloading computationally
intensive workloads to Cheaha the campus compute cluster. MATLAB is one of
a few languages in which each variable is a matrix (broadly constructed) and
"knows" how big it is. Moreover, the fundamental operators (e.g. addition,
multiplication) are programmed to deal with matrices when required. And the
MATLAB environment handles much of the bothersome housekeeping that

41
makes all this possible. Since so many of the procedures required for Macro-
Investment Analysis involve matrices, MATLAB proves to be an extremely
efficient language for both communication and implementation.

5.3 INTERFACING WITH OTHER LANGUAGES

MATLAB can call functions and subroutines written in the C


programming language or FORTRAN. A wrapper function is created allowing
MATLAB data types to be passed and returned. The dynamically loadable
object files created by compiling such functions are termed "MEX-files"
(for MATLAB executable).

Libraries written in Java, ActiveX or .NET can be directly called from


MATLAB and many MATLAB libraries (for example XML or SQL support)
are implemented as wrappers around Java or ActiveX libraries. Calling
MATLAB from Java is more complicated, but can be done with MATLAB
extension, which is sold separately by MathWorks, or using an undocumented
mechanism called JMI (Java-to-Mat lab Interface), which should not be
confused with the unrelated Java that is also called JMI.

As alternatives to the MuPAD based Symbolic Math Toolbox available


from MathWorks, MATLAB can be connected to Maple or Mathematica.

Libraries also exist to import and export MathML.

5.3.1 Development Environment

⮚ Startup Accelerator for faster MATLAB startup on Windows,


especially on Windows XP, and for network installations.
⮚ Spreadsheet Import Tool that provides more options for selecting and
loading mixed textual and numeric data.
⮚ Readability and navigation improvements to warning and error

42
messages in the MATLAB command window.
⮚ Automatic variable and function renaming in the MATLAB Editor.

5.3.2 Developing Algorithms and Applications

MATLAB provides a high-level language and development tools


that let you quickly develop and analyze your algorithms and applications.

5.3.3 The MATLAB Language

The MATLAB language supports the vector and matrix operations that
are fundamental to engineering and scientific problems. It enables fast
development and execution. With the MATLAB language, you can program
and develop algorithms faster than with traditional languages because you do
not need to perform low-level administrative tasks, such as declaring variables,
specifying data types, and allocating memory. In many cases, MATLAB
eliminates the need for ‘for’ loops. As a result, one line of MATLAB code can
often replace several lines of C or C++ code.

At the same time, MATLAB provides all the features of a traditional


programming language, including arithmetic operators, flow control, data
structures, data types, object-oriented programming (OOP), and debugging
features.

MATLAB lets you execute commands or groups of commands one at a


time, without compiling and linking, enabling you to quickly iterate to the
optimal solution. For fast execution of heavy matrix and vector computations,
MATLAB uses processor-optimized libraries. For general-purpose scalar
computations, MATLAB generates machine-code instructions using its JIT
(Just-In-Time) compilation technology.

43
This technology, which is available on most platforms, provides
execution speeds that rival those of traditional programming languages.

5.3.3.1 Development Tools

MATLAB includes development tools that help you implement your


algorithm efficiently. These include the following:

5.3.4 MATLAB Editor 

Provides standard editing and debugging features, such as setting


breakpoints and single stepping.

5.3.5 Code Analyzer 

Checks your code for problems and recommends modifications to


maximize performance and maintainability

5.3.6 MATLAB Profiler 

Records the time spent executing each line of code

5.3.7 Directory Reports 

Scan all the files in a directory and report on code efficiency, file
differences, file dependencies, and code coverage

5.3.8 Designing Graphical User Interfaces

By using the interactive tool GUIDE (Graphical User Interface


Development Environment) to layout, design, and edit user interfaces. GUIDE
lets you include list boxes, pull-down menus, push buttons, radio buttons, and
sliders, as well as MATLAB plots and Microsoft ActiveX controls.
Alternatively, you can create GUIs programmatically using MATLAB

44
functions.

5.4 ANALYZING AND ACCESSING DATA

MATLAB supports the entire data analysis process, from acquiring data
from external devices and databases, through preprocessing, visualization, and
numerical analysis, to producing presentation-quality output.

5.4.1 Data Analysis

MATLAB provides interactive tools and command-line functions for


data analysis operations, including:

● Interpolating and decimating


● Extracting sections of data, scaling, and averaging
● Thresholding and smoothing
● Correlation, Fourier analysis, and filtering
● 1-D peak, valley, and zero finding
● Basic statistics and curve fitting
● Matrix analysis

5.4.2 Data Access

MATLAB is an efficient platform for accessing data from files,


other applications, databases, and external devices. You can read data from
popular file formats, such as Microsoft Excel; ASCII text or binary files; image,
sound, and video files; and scientific files, such as HDF and HDF5. Low-level
binary file I/O functions let you work with data files in any format. Additional
functions let you read data from Web pages and XML.

5.4.3 Visualizing Data

45
All the graphics features that are required to visualize engineering and
scientific data are available in MATLAB. These include 2-D and 3-D plotting
functions, 3-D volume visualization functions, tools for interactively creating
plots, and the ability to export results to all popular graphics formats. You can
customize plots by adding multiple axes; changing line colors and markers;
adding annotation, Latex equations, and legends; and drawing shapes.

5.4.4 2-D Plotting

Visualizing vectors of data with 2-D plotting functions that create:

● Line, area, bar, and pie charts.


● Direction and velocity plots.
● Histograms.
● Polygons and surfaces.
● Scatter/bubble plots.
● Animations.

5.4.5 3-D Plotting and Volume Visualization

MATLAB provides functions for visualizing 2-D matrices, 3-D


scalar, and 3-D vector data. You can use these functions to visualize and
understand large, often complex, multidimensional data. Specifying plot
characteristics, such as camera viewing angle, perspective, lighting effect, light
source locations, and transparency.

3-D plotting functions include:

● Surface, contour, and mesh.


● Image plots.
● Cone, slice, stream, and isosurface.

46
5.5 PERFORMING NUMERIC COMPUTATION

MATLAB contains mathematical, statistical, and engineering functions


to support all common engineering and science operations. These functions,
developed by experts in mathematics, are the foundation of the MATLAB
language. The core math functions use the LAPACK and BLAS linear algebra
subroutine libraries and the FFTW Discrete Fourier Transform library. Because
these processor-dependent libraries are optimized to the different platforms that
MATLAB supports, they execute faster than the equivalent C or C++ code.

MATLAB provides the following types of functions for performing


mathematical operations and analyzing data:

● Matrix manipulation and linear algebra.


● Polynomials and interpolation.
● Fourier analysis and filtering.
● Data analysis and statistics.
● Optimization and numerical integration.
● Ordinary differential equations (ODEs).
● Partial differential equations (PDEs).
● Sparse matrix operations.
MATLAB can perform arithmetic on a wide range of data types,
including doubles, singles, and integers.

CHAPTER 6

SCREENSHOT

47
1

FIG 6.1:THE INPUT IMAGE WHERE WE HAVE TO SELECT THE


REGION OF WORKING

FIG 6.2: SEPARATING THE FETAL REGION FROM SAC BY REGION


OF ITERATION PROCESS:

48
FIG 6.3: IMAGE SEGMENTATION USING ACTIVE CONTOUR
MODE:

49
FIG 6.4: THE HEALTH STATUS OF FETUS WILL BE SHOWN AS
OUTPUT COMMAND:

CHAPTER 7
CONCLUSION AND FUTURE SCOPE
7.1 CONCLUSION

The proposed method can be divided into contour initialization and


segmentation stages. The proposed approach was evaluated inUS images and
shown to be accurate, robust, and competitive with the state of the art.
Regarding the initialization stage, the proposed method is robust against the
initial point positioning. Concerning the segmentation stage, the proposed
hybrid energy functional showed high accuracy and feasibility to deal with the
characteristics of an US image.

50
7.2 FUTURE SCOPE

Limitations of ultrasound scan method on fetal are not completely clear,so


ultrasound scan is not suggested continuous monitoring .To overcome this
limitations ,in future Artificial Intelligence (AI) can provide quality assurance
for images.

CHAPTER 8

51
APPENDIX

MATLAB CODE:

clear all;

close all;

I = imread('5.jpg'); %-- load the image

I=rgb2gray(I);

fontSize = 16;

imshow(I, []);

axis on;

title('Original Grayscale Image', 'FontSize', fontSize);

set(gcf, 'Position', get(0,'Screen Size')); % Maximize figure.

message = sprintf('Left click and hold to begin drawing.\nSimply lift the mouse
button to finish');

uiwait(msgbox(message));

hFH = imfreehand(); %-- create initial mask

% Create a binary image ("mask") from the ROI object.

m = hFH.createMask();

I = imresize(I,.5); %-- make image smaller

m = imresize(m,.5); % for fast computation

subplot(2,2,1); imshow(I); title('Input Image');

subplot(2,2,2); imshow(m); title('Initialization');

subplot(2,2,3); title('Segmentation');

52
seg = region_seg(I, m, 1000); %-- Run segmentation

subplot(2,2,4); imshow(seg); title('Active Contour-Based Segmentation');

figure;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Label the binary image and compute the centroid and center of mass.

binaryImage=m

grayImage=I

% [bw,level]=fcm thresh(grayImage,0)

labeledImage = bwlabel(binaryImage);

measurements = regionprops(binaryImage, grayImage, ...

'area', 'Centroid', 'WeightedCentroid', 'Perimeter');

area = measurements.Area

centroid = measurements.Centroid

centerOfMass = measurements.WeightedCentroid

perimeter = measurements.Perimeter

% Calculate the area, in pixels, that they drew.

numberOfPixels1 = sum(binaryImage(:))

% Another way to calculate it that takes fractional pixels into account.

numberOfPixels2 = bwarea(binaryImage)

53
% Get coordinates of the boundary of the freehand drawn region.

structBoundaries = bwboundaries(binaryImage);

xy=structBoundaries{1}; % Get n by 2 array of x,y coordinates.

x = xy(:, 2); % Columns.

y = xy(:, 1); % Rows.

subplot(2, 3, 1); % Plot over original image.

hold on; % Don't blow away the image.

plot(x, y, 'LineWidth', 2);

drawnow; % Force it to draw immediately.

% Burn line into image by setting it to 255 wherever the mask is true.

burnedImage = grayImage;

burnedImage(binaryImage) = 255;

% Display the image with the mask "burned in."

subplot(2, 3, 3);

imshow(burnedImage);

axis on;

caption = sprintf('New image with\mask burned into image');

title(caption, 'FontSize', fontSize);

% Mask the image and display it.

% Will keep only the part of the image that's inside the mask, zero outside the
mask.

blackMaskedImage = grayImage;

54
blackMaskedImage(~binaryImage) = 0;

subplot(2, 3, 4);

imshow(blackMaskedImage);

axis on;

title('Masked Outside Region', 'FontSize', fontSize);

% Calculate the mean

meanGL = mean(blackMaskedImage(binaryImage));

% Put up crosses at the centroid and center of mass

hold on;

plot(centroid(1), centroid(2), 'r+', 'MarkerSize', 30, 'LineWidth', 2);

plot(centerOfMass(1), centerOfMass(2), 'g+', 'MarkerSize', 20, 'LineWidth', 2);

% Now do the same but blacken inside the region.

insideMasked = grayImage;

insideMasked(binaryImage) = 0;

subplot(2, 3, 5);

imshow(insideMasked);

axis on;

title('Masked Inside Region', 'FontSize', fontSize);

% Now crop the image.

leftColumn = min(x);

rightColumn = max(x);

topLine = min(y);

bottomLine = max(y);

55
width = rightColumn - leftColumn + 1;

height = bottomLine - topLine + 1;

croppedImage = imcrop(blackMaskedImage, [leftColumn, topLine, width,


height]);

% Display cropped images.

subplot(2, 3, 6);

imshow(croppedImage);

axis on;

title('Cropped Image', 'FontSize', fontSize);

% Put up crosses at the centroid and center of mass

hold on;

plot(centroid(1)-leftColumn, centroid(2)-topLine, 'r+', 'MarkerSize', 30,


'LineWidth', 2);

plot(centerOfMass(1)-leftColumn, centerOfMass(2)-topLine, 'g+', 'MarkerSize',


20, 'LineWidth', 2);

% Report results.

message = sprintf('Mean value within drawn area = %.3f\nNumber of pixels =


%d\nArea in pixels = %.2f\nperimeter = %.2f\nCentroid at (x,y) = (%.1f, %.1f)\
nCenter of Mass at (x,y) = (%.1f, %.1f)\nRed crosshairs at centroid.\nGreen
crosshairs at center of mass.\n Fetal Length Measurement = %.2f cm', ...

meanGL, numberOfPixels1, numberOfPixels2, perimeter, ...

centroid(1), centroid(2), centerOfMass(1), centerOfMass(2),width*0.01*2);

msgbox(message);

56
fetus_reference=[2.03 0 1.73 2.60 3.83 0 0 3.45 0 0 0 0 4.25]

fetal_length=width*0.01*2;

week_no=input('Enter the Week No :')

switch(week_no)

case 1

if(fetal_length>fetus_reference(week_no))

msgbox('Healthy Infant Fetus');

else

msgbox('InHealthy Infant Fetus');

end

case 2

if(fetal_length>fetus_reference(week_no))

msgbox('Healthy Infant Fetus');

else

msgbox('InHealthy Infant Fetus');

end

case 3

if(fetal_length>fetus_reference(week_no))

msgbox('Healthy Infant Fetus');

else

msgbox('InHealthy Infant Fetus');

end

57
case 4

if(fetal_length>fetus_reference(week_no))

msgbox('Healthy Infant Fetus');

else

msgbox('InHealthy Infant Fetus');

end

case 5

if(fetal_length>fetus_reference(week_no))

msgbox('Healthy Infant Fetus');

else

msgbox('InHealthy Infant Fetus');

end

case 6

if(fetal_length>fetus_reference(week_no))

msgbox('Healthy Infant Fetus');

else

msgbox('InHealthy Infant Fetus');

end

case 7

if(fetal_length>fetus_reference(week_no))

msgbox('Healthy Infant Fetus');

else

msgbox('InHealthy Infant Fetus');

58
end

case 8

if(fetal_length>fetus_reference(week_no))

msgbox('Healthy Infant Fetus');

else

msgbox('InHealty Infant Fetus');

end

case 9

if(fetal_length>fetus_reference(week_no))

msgbox('Healthy Infant Fetus');

else

msgbox('InHealty Infant Fetus');

end

case 10

if(fetal_length>fetus_reference(week_no))

msgbox('Healthy Infant Fetus');

else

msgbox('InHealthy Infant Fetus');

end

case 11

if(fetal_length>fetus_reference(week_no))

msgbox('Healthy Infant Fetus');

else

59
msgbox('InHealthy Infant Fetus');

end

case 12

if(fetal_length>fetus_reference(week_no))

msgbox('Healthy Infant Fetus');

else

msgbox('InHealthy Infant Fetus');

end

end

CHAPTER 9

60
REFERENCE

REFERENCES

[1] Gustavo Carneiro, Bogdan Georgescu, Sara Good, Dorin Comainiu.


Detection of Fetal Anatomies from Ultrasound Images using a Constrained
Probabilistic Boosting Tree.

[2] Chitresh Bhushan. 2009. Ultrasound Image Segmentation. Kharagpur, India

[3] Mohammad Talebi, Ahamd Ayatollahi, Ali Kermani. 2010. Medical


Ultrasound Image Segmentation Using Genetic Active Contour. Tehran, Iran.

[4] Sonia Dahdouh, Antoine Serrurier, Gilles Grange, Elsa D.A., Isabelle Bloch.
2014. Segmentation of Fetal Envelope from 3D Ultrasound Images based on
Pixel Intensity Statistical Distribution and Shape Priors. Paris, France.

[5] Adhi Pribadi, Johanes C. Mose, Firman F.W. 2011. Ultrasonografi Obstetri
& Ginekologi. Sagung Seto.

[6] A Dwi Puspitasari, Handayani Tjandrasa. 2011. Deteksi Kepala Janin pada
Gambar USG Menggunakan Fuzzy C-Means (FCM) dengan Informasi Spasial
dan Iterative Randomized Hough Transform (IRHT). Surabaya, Indonesia.

[7] J.Nithya. 2009. Detection of Intrauterine Growth Retardation Using Fetal


Abdominal Circumference. Tiruchengode, Tamil Nadu, India.

8] Sanjaya Shankar Tripathy. 2009. Automatic Health monitoring of Fetus from


Ultrasound Images using Level Set Algorithm. Tamil Nadu, India.

61

You might also like