Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 11

ABSTRACT

The purpose for this study is to investigate a software application that can show
how the image is process in computer platform. The process will be done in converting
the picture to matrix model by using MATLAB program. Picture will be shown when
program is running successfully. Real image or picture will be resulted from the matrix
using the function in the MATHLAB. User can use varies of functions such as filter or
rotate depending on the user itself. In this study, the picture or real image used is from
Internet, scanner and etc. Basic mathematical calculation does not apply in this project
as it only used MATHLAB program. The significant of this project is to educated user to
learn how the image can be changes after the function indicated by the program.
INTRODUCTION
1.1 Introduction
Image processing is any form of signal processing for which the input is an
image, such as photographs; 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 treating the image as a two-dimensional signal and applying standard
signal-processing techniques to it. Image processing – converting the image to another
form by using direction in MATLAB/Toolboxes/Image Processing tables for example is
image input/output, color operation, image enhancement/ analysis and another method.
Image processing and computer vision practitioners tend concentrate on a
particular area of specialization. People refer to their research interests as “texture”,
“surface mapping”, “video tracking”, and the like. Nevertheless, there is a strong need to
appreciate the spectrum and hierarchy of processing levels.

Image processing is the manipulation of the image by using a computer, with the
objective to enhance or evaluate some aspect of an image which is not readily apparent
in its original form. This is done through the development and implementation of
processing means necessary to operate on the image. Processing image using a digital
computer provides the greatest flexibility and power for general image processing application,
since the programming of a computer can be changed easily which allows
operation to be modified quickly.

Interest in image processing technique dates back to early 1920’s when digitized
pictures of world news events were first transmitted by submarine cable between
Newyork and London. However, application of digital image processing concepts did
not become widespread until the middle 1960’s, when third-generation digital computers
began to offer the speed and storage capabilities required for practical implementation of
image processing algorithms. Since then, this area has experienced vigorous growth and
has been subjected of study and research in such fields as engineering, computer science,
statistics, information science, physics, chemistry and medicine.
The result of these efforts have established the value of image processing
technique in of problem with application in diverse fields, including automated factory
controlled, astronomy, meteorology, agriculture, medicine, art and military application.
With the increasing availability of reasonably inexpensive hardware and some very
importance application on the horizon, image technology is expected to continue its
growth and to play an important role in the future.
From the MATLAB software we have the Toolbox for image processing and
Professional MATLAB. MATLAB is the interactive environment, scientists and
engineers are able to analyze and develop algorithms with exceptional improvements n
productivity and creativity. As a result of new algorithms with application-specific uses.
The MathWorks offers a series of application toolboxes that contain set of MATLAB ofr
the Linear algebra, high-speed computational kernel, extensive mathematical
functionality, data analysis, 2-D and 3-D graphic rapid algorithm development, matrix
based programming environment. In MATLAB Toolboxes professional version but
priced at a lower rate for academic use.
Objective of The Project
The objective of this project is actually to educate newcomer to basic and
fundamental technique in image processing through integrated image processing
software. All fundamental algorithms of image processing will be exposed through this
package. This package will also provided easy-to-learn mechanisms turn user-friendly
by pop-up menu and graphic-orientation environment

These operations include preprocessing, spatial filtering, image enhancement,


feature detection, image compression and image restoration involves process which
restores a degraded image to something close to the ideal. Generally, in computer vision,
especially in MATLAB program (image understanding or scene analysis) involves
technique from image processing, pattern recognition and artificial intelligent.
Particularly, MATLAB program offers many features and are more multifaceted then
any calculator. MATLAB toolbox is a tool for making mathematical calculations.
1.3 Scope of Project
Study and understand the image processing in varies method, mainly in
MATLAB. Create a GUI (Graphical User Interface) MATLAB program with several
functions.

Summary of Work
Every digital image processing system can be represented by a block diagram
containing three main elements, as shown in figure 1.1. The 4 major elements of every
image processing system include the following,

Figure 1.1 Process block


Image and MATLAB involves the conversion of scene into a digital
representation that can be processed by a digital computer. This can be performed by a sensor
system specially designed to view a scene and provide a digital representation of the scene.
Process block. When the images are installed in MATLAB, flowers picture for
example, the color of that image is first analyzed. In the process include several
functions of image processing technique.

Implementation Processes:
Introduction
Histogram is one of the technique most commonly used in contrast enhancement.
In many cases, the subjective contrast of an image is improved if one equalizes the
histogram of the histogram of gray-level of the picture elements argued that one should
make the histogram of the subjective brightness of the picture element uniform, or
equivalently making the gray-level histogram hyperbola is shape, it may hurt the further
machine analysis of the image.

Histogram
Histogram is graphical presentations of the frequency count of the occurrence
each intensity (gray level) in the image. The horizontal axis of the graph represents the
tonal variations, while the vertical axis represents the number of pixels in that particular
tone. The left side of the horizontal axis represents the black and dark areas, the middle
represents medium grey and the right hand side represents light and pure white areas.
The vertical axis represents the size of the area that is captured in each one of these
zones.

Blur/Deblurring Image Using Blind Deconvolution Algorithm


The Blind Deconvolution Algorithm can be used effectively when no
information about the distortion (blurring and noise) is known. The algorithm restores
the image and the point-spread function (PSF) simultaneously. What happens is that
what should be seen as a sharp point gets smeared out, usually into a disc shape. In
image terms this means that each pixel in the source image gets spread over and mixed
into surrounding pixels. Another way to look at this is that each pixel in the destination
image is made up out of a mixture of surrounding pixels from the source image.

Threshold / Edge Detection


An image processing method distinguishes an object from within an image area
by determining a stable threshold value of light intensity values from within the image
area. Received light is converted into image data denoting light intensity values of the
received light at a plurality of points from within the image area. A bright portion
average value denoting an average of the light intensity values which exceed a predetermined
threshold and a dark portion average value denoting an average of the
light intensity values which are less than the predetermined threshold are calculated. A
new threshold is obtained by applying the bright portion average value and the dark
portion average value to a predetermined dividing ratio. The object within the image
area is distinguished using the new threshold. The method is also applicable to the use
of multi value thresholds.

Enhancing Multispectral Color Composite Images


Enhance multispectral radiance or reflectance data to create an image that is
suitable for visual interpretation. Another way to enhance the true color composite is to
use a decorrelation stretch, which enhances color separation across highly correlated
channels.
Use decorrstretch to perform the decorrelation stretch. Again, surface features
have become much more clearly visible, but in a different way. The spectral differences
across the scene have been exaggerated

Identify the Round Object


Classify objects based on their roundness using bwboundaries, a boundary
tracing routine. In this process, the MATLAB will convert the picture to black and white
first before to remove the noise (pixels which do not belong to the objects of interest)
inside the picture.
Estimate each object's area and perimeter. Use these results to form a simple
metric indicating the roundness of an object

Metric = 4*pi*area/perimeter^2.
This metric is equal to one only for a circle and it is less than one for any other
shape. The discrimination process can be controlled by setting an appropriate threshold.
In this example use a threshold of 0.94 so that only the pills will be classified as round.

Digital Filters
The digital filter can be categorized as a low pass or high pass filter depending
on which part of the frequency spectrum it affects. The effect on a composite electrical
analog signal containing all frequency components. The output signal of the high pass
filter will contain the high frequency components. The output signal of the low pass
filter will contain the DC bias and low frequency components. The specific cutoff
frequency cab be varied the selection of the value used in the filter, but that is beyond
the scope of this course.

The low frequency components in an image are characterized by a slow change


in the contrast or values of adjacent pixel in relation to high frequency components, due
to the rapid change in contrast encountered at the edge of an object.

Low Pass Filter


The low pass filter will not affect low frequency components in the image data
and will attenuate the high frequency components as illustrated in figure 2.1. Random
speckles in an image can be considered as noise and are high frequency components
since the pixel values of adjacent pixels change very rapidly. The effect of the speckles
can be reduced by using a simple averaging filter. The coefficient matrix for an averaging filter
for a 3x3 local area convolution would contain nine elements as shown below.

Result of low pass (b) and high pass (c) digital filter on a composite signal (a)
containing both low and high frequency as well as a DC bias.
The value for the pixel in the output matrix is calculated by convoluting the
image data, p1,j with the coefficient matrix f1,j and placing the resultant value at the
center pixel of the area in the new image matrix. The clearly for low pass filter, the
coefficient values of a low pass filter can declared with matrix form as show below
figure 2.2;
METHODOLOGY:

Introduction
Basically, MATLAB software has many functions/commands to apply in image
processing. How to manipulate the program depending to us but must be practically
know what item is MATLAB program will be used. Creativity in MATLAB can make
the interesting result. Even, the complex data can be solved in MATLAB. Especially
when the data involved is very complex. Here, we can create some image from
converting data by using the some program in MATLAB, which just applied all
procedure in the MATLAB program. MATLAB toolbox is a tool for making
mathematical calculations. Image processing toolbox is user friendly programming
language with feature more advanced. In the program also used the GUI (Graphical User
Interface) to create develop the program.
Every digital image processing system can be represented by a block diagram
containing three main elements, as shown in figure 3.1. The 4 major elements of every
image processing system include the following,

Image and MATLAB involves the conversion of scene into a digital representation that
can be processed by a digital computer. This can be performed by a sensor system
specially designed to view a scene and provide a digital representation of the scene.
When the images are installed in MATLAB, flowers picture for example, the
color of that image is first analyzed. In the process include several functions of image
processing technique. Processed Image is the image display after the process.

Blur/Deblurring Image Using Blind Deconvolution Algorithm:


In this process, by referring to the M-file
a) LEN = 21, linear motion across 31 pixels
b) THETA = 11, angle of 11 degrees
c) PSF = fspecial('motion', LEN, THETA), point-spread function, PSF,
corresponding to the linear motion across 31 pixels (LEN=31), at an angle of 11
degrees (THETA=11).
d) blurred = imfilter(IMG, PSF, 'conv', 'circular'), simulate the blur, convolve the
filter with the image using imfilter.
e) noise_mean = 0; noise_var = 0.001;
blurred_noisy = imnoise(blurred, 'gaussian', ...noise_mean, noise_var), adding
the noise to the picture.
f) deconvwnr(blurred_noisy, PSF, 0.01) restore the blurred picture.

Enhancing Multispectral Color Composite Images Threshold / Edge


Detection

In this process, by referring to the M-file


a) truecolor = IMG, set the truecolor equal to the IMG
b) decorrstretched_truecolor = decorrstretch(truecolor, 'Tol', 0.01), Use
decorrstretch to perform the decorrelation stretch (followed by a linear contrast
stretch, as specified by the optional parameter-value pair 'Tol' and 0.1).
c) IMG=decorrstretched_truecolor, set the IMG equal to decorrstretched_truecolor
d) imshow(IMG), display the image IMG.

3.4 Threshold / Edge Detection

a) level = graythresh(IMG), bw = im2bw(IMG,level), level = graythresh(I)


computes a global threshold (level) that can be used to convert an intensity image
to a binary image with im2bw. level is a normalized intensity value that lies in
the range [0, 1]. The graythresh function uses Otsu's method, which chooses the
threshold to minimize the intraclass variance of the black and white pixels.
Multidimensional arrays are converted automatically to 2-D arrays using reshape.
The graythresh function ignores any nonzero imaginary part of I.
b) bw = bwareaopen(bw, 50), Morphologically open binary image (remove small
objects)
c) IMG=bw, set the IMG equal to bw
d) imshow(IMG), display the IMG to screen

3.5 Identify the Round Object

a) I = rgb2gray(RGB);threshold = graythresh(I);bw = im2bw(I,threshold),


computes a global threshold (level) that can be used to convert an intensity image
to a binary image with im2bw. level is a normalized intensity value that lies in
the range [0, 1]. The graythresh function uses Otsu's method, which chooses the
threshold to minimize the intraclass variance of the black and white pixels.
Multidimensional arrays are converted automatically to 2-D arrays using reshape.
The graythresh function ignores any nonzero imaginary part of I.
b) bw = bwareaopen(bw,30), Using morphology functions, remove pixels which do
not belong to the objects of interest. remove all object containing fewer than 30
pixels
c) se = strel('disk',2);bw = imclose(bw,se), fill a gap in the pen's cap
d) bw=imfill(bw,'holes');imshow(bw);[B,L]=bwboundaries(bw,'noholes'), fill any
holes, so that regionprops can be used to estimate the area enclosed by each of
the boundaries
e) IMG=label2rgb(L, @jet, [.5 .5 .5]);imshow(IMG)hold on, Display the label
matrix and draw each boundary
f) For k=1:length(B);boundary = B{k};plot(boundary(:,2),boundary(:,1), 'w',
'LineWidth', 2)
end
stats = regionprops(L,'Area','Centroid');threshold = 0.94, loop over the
boundaries
g) for k = 1:length(B);boundary = B{k}, obtain (X,Y) boundary coordinates
corresponding to label 'k'
h) delta_sq=diff(boundary).^2;perimeter=sum(sqrt(sum(delta_sq,2))), compute a
simple estimate of the object's perimeter
i) area = stats(k).Area, obtain the area calculation corresponding to label 'k'
j) metric = 4*pi*area/perimeter^2, display the results
k) if
metric>threshold; centroid = stats(k); Centroid; plot(centroid(1),centroid(2),'ko');
end
mark objects above the threshold with a black circle

3.6 Rotate

In this process, by referring to M-file


a) image=double(IMG);s=size(image);result=zeros(s(2),s(1),s(3)),
Allocating memory for fast execution
b) i = 1:s(1)
j=1:s(2);
k=s(2)-j+1;
result(k,i,:)=image(i,j,:),Computing the new matrix
c) res=uint8(result);
IMG=res;
imshow(IMG), Displaying the rotated image

3.7 Open Image

In this process, by referring to M-file


Loading the Image
[filename, pathname, filterindex]=uigetfile( ...
{'*.jpg','JPEG File (*.jpg)'; ...
'*.*','Any Image file (*.*)'}, ...
'Pick an image file');
var=strcat(pathname,filename);
ORI_IMG=imread(var);
IMG=ORI_IMG;
% Showing the origional image
imshow(IMG);title('original image')

3.8 Reset

In this process, by referring to M-file


a) global IMG ORI_IMG;IMG=ORI_IMG;, reset the image after process
b) imshow(IMG);title('original image'), show the image

3.9 Save image

In this process, by referring to M-file

a) image=uint8(IMG), define a 8-bit unsigned integer.


b) [filename,pathname] = uiputfile( ...
{'*.jpg', 'JPEG Image File'; ...
'*.*', 'All Files (*.*)'}, ...
'Save current image as');
Open standard dialog box for saving files, displays a dialog box titled 'Save
current image as’ with the filter specifier set to .jpg file, JPEG Image file and all
files.
c) var=strcat(pathname,filename,'.jpg'), horizontally concatenates corresponding
rows of the character arrays pathname, filename and ‘.jpg’.
d) imwrite(image,var), write the image to pc in the format specified by var

3.10 Show original picture

In this process, by referring to M-file


a) (get(handles.checkbox3,'Value') == 0),
subplot(1.2,0.99,1.05); Deleting all subplots present
imshow(IMG);
b) subplot(1.3,1.8,1), imshow(ORI_IMG),title('original image'); Displaying
origional image
c) subplot(1.3,1.8,2), imshow(IMG); Displaying the rotated image

You might also like