1-Auto Certificate

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 58

Sri Indu Institute of Engineering & Technology

CHAPTER-1
INTRODUCTION & EXISTING SYSTEM

The certificate generation system is a system which allows the digital


automation of the mark-sheets of the students. The system will generate the mark-
sheets in Portable Document Format which is globally accepted format for files. The
PDF document is very difficult to modify and requires the use of the complex
software.
To simply put, system is to provide the mark-sheet for credits based grading
system in user friendly and secure manner. The credits based grading system enables
a much require shift in focus from teacher-centric to learner-centric education. It also
focuses on the continuous evaluation which will enhance the quality of education. It is
very much essential to implement credits based grading system based higher
education worldwide.
The efficiency of the system would increase in a leap and bounds considering
the fact that system will be automated & would corruption free. Along with the
mentioned privileges, it also ensures security & spreads the awareness about the
university rules and regulation.

LITERATURE REVIEW:

The certificate generation system is kind of a document generator. There


have been number of technologies proposed to generate the document or reports

1.1 EXISTING SYSTEM:

1.1.1 Digital Signature based mark-sheet generator:

A digital signature or the digital signature scheme is type of asymmetric


cryptography used to the security properties of hand written signature on the paper.
The output of signature process is digital signature. It provides authenticity and
integrity to data.

ECE 1
Sri Indu Institute of Engineering & Technology

1.1.2 Digital academic transcript using encrypted QR code:

Mark-sheet embed the digital form in mark sheet using encrypted QR code, so
that any unauthorized user cannot retrieve any information.

1.2 Disadvantage of Existing System:


1.2.1 Association of digital signature and trusted time stamp:

Digital signature algorithm and protocol do no inherently provide the certainty


about the date and time at which underlying document was signed.

1.2.2 Non repudiation:


In cryptographic context, the word repudiation refers to any act disclaiming
responsibility for message. It is used to remove old expired certificates from
repository. It is matter for security policy and responsibility of authority to keep oldest
available via internet on demand certificates for a period of time if non-repudiation
data service is provided.

1.2.3 Unavailability of hardware:


Even though the use of QR code in a mark-sheet that possess ability to scan
QR code. Also for scanning purpose one must have hardware which adds a cost to
system.

1.2.4 Lack of user-friendly interface:


Due to use of DOS or user interface which are not user friendly. It also uses
various difficult commands to complete the number of tasks. The existing system fails
to provide a good user interface. Also understanding of the user interface of existing
system is tedious and time consuming whereas the new system is self-explanatory and
easy to use as far as user interface is concerned.

1.3 PROPOSED SYSTEM:


The certificate generation system is to ensure an efficient certificate
management using huge data and to provide mark- sheets for credit based grading
ECE 2
Sri Indu Institute of Engineering & Technology

system (CBGS) in very user-friendly manner by not making it very complex.

ECE 3
Sri Indu Institute of Engineering & Technology

The system being automated and generalized, the system ensures to reduce
errors by reducing manual efforts. An added asset to the feature of system is that it
aims at improving and easing out the work of the existing system in very sophisticated
way.
The technology is rapid and able to generate, store & display the mark-sheets
of the students. The system provides advance reaction capabilities and automatic
operator of the internal calculation based on university rules with the information
from the database. It also works with various standards of the mark-sheets.

1.4 WORKING OF CGS:


In this proposed system, the admin of the system enters the marks of each
student. That information will be stored in internal collection information database. In
this system, percentage and grade is calculated manually.
After the marks of the students entered by the admin, it generates the gadget-
sheet and the mark-sheet of all the students automatically with the grades calculated.
Mark-sheets will be in PDF format. PDF marks-sheets cannot be easily tampered with
and required use of complex software. The PDF file of mark-sheet of every student
will be stored in the separate database. And then application makes mark-sheet

Figure.1.1: System architecture of Certificate Generation System

ECE 4
Sri Indu Institute of Engineering & Technology

1.5 ALGORITHM:
This is how our system will work. Steps for the implementation of system are
as follow:
Step 1: If admin is operating the system, login id and password. If student is
operating the system, they can access the system by providing the registration id.
Step 2: Check if provided login id and password or registration id is correct, if
not go back to step 1 and if correct proceed for the step 3.
Step 3: If admin is operating the system, he can access the system by updating
the database, changing the data in the database and can get the required information
from the database. If students are operating the system, the can only view the data.
Step 4: Then system will generate the gadget sheet of all the students and it
calculates the grade and grade point of each and every student as per the Credit based
grading system (CBGS).
Step 5: Then this system will generate the mark sheet by fetching the grades,
pointers and credits from the gadget sheet previously developed.
Step 6: Then this information of students’ marks are available to access to
students by providing authentication. Admin will get requested mark sheet in PDF
mark sheet for printing purpose. And only marks can be accessible to student.

Steps 7: These mark sheets then can be made printable by converting it into
portable document format.

ECE 5
Sri Indu Institute of Engineering & Technology

Figure 1.2: Flowchart for Certificate Generation System

1.6 TECHNOLOGY AND CONCEPT:


PHP is used for web development works as a server-side scripting language
and also it is used for general purpose programming. PHP code is interpreted by a
web server with the PHP processor generates the resulting page which interprets the
PHP code. It also includes interface capacity of command line and can be used
standalone graphical application.
The formulae for calculation of grade performance index (GPI):
ECE 6
Sri Indu Institute of Engineering & Technology

1.6.1 Semester Grade Performance Index (SGPI): The performance of


semester is indicated by a number called semester grade performance index. SGPI is
weighted average of the grade points obtained in all the courses by the student during
the semester.
SGPI
1.6.2 Cumulative Grade Performance Index (CGPA):
An up to date of an overall performance of student from the time he/she
enrolled in the university is obtained by calculating a number called cumulative grade
performance index. It is calculated in similar manner of SGPI. CGPA is responsible to
reflect final pass or fail status of student.
CGPI

The rule is given below:


Table 1: Letter grades and their equivalent grade points applicable for under graduates

Percentage Letter Grade


of marks Obtain Grade Points
80.00 and above O 10
75.00-79.99 A 9
70.00-74.99 B 8
60.00-69.99 C 7
55.00-59.99 D 6
45.00-49.99 E 5
40.00-44.99 P 4
Less than 40.00 F 0

ECE 7
Sri Indu Institute of Engineering & Technology

CHAPTER-2
SOFTWARE TOOL-MATLAB
2.1 First look over the topic:

Every single day world is evolving very fast. Rapid development of the computer
technology has affected all the scientific areas. Medicine, automation, data analysis,
finances, biology, chemistry, economics and many, many more have benefited from the
technology expansion. People got interested in the possibilities of information technology
and they have noticed that computer can help them with daily tasks. This need has
motivated software programmers to create new systems, that would incorporate the ease
of use with the effectiveness of work. Those big changes have influenced also computer
related fields, including computer graphics as well as an image processing. Soon all
artists were about to experience a huge step towards the simplification of working with
graphics. The Internet was flooded with new applications used to process pictures. Some
of them are free and some others are commercial.
In the same time programmers were working on designing a system, that
would perform operations on vectors and matrixes in a simple, interactive way. Not
long time after creating MATLAB it became very popular, especially among teaching
facilities. Many libraries has been developed, among them Image Processing Toolbox.
In comparison to other image processing program it doesn’t score many points. First
of all, it is not free. Secondly, it does not provide an easy learnable environment –
some programming skills are needed. On the other hand it gives multiple
opportunities of illustrating mathematical equations. ’Normal’ applications lose with
MATLAB in the area of an image recognition and filters adaptation. No program
works better with using for example morphological transformation than MATLAB. It
also gives a lot of possibilities for creating linear and nonlinear filters. High level
programming language that hides unnecessary details from designers can definitely be
considered as an asset too. In order to decide if MATLAB is the right tool to
implement a software with, the future programmer has to take a closer look on the
main purpose of the application.
2.2 Main objectives of the study:
There are few goals resultant from this thesis. Main purpose is to learn new

ECE 8
Sri Indu Institute of Engineering & Technology

information from the topic of an image processing area. In additional, dissertation

ECE 9
Sri Indu Institute of Engineering & Technology

presented here will cover material from following fields:


 Computer graphics
 Raster and vector graphics;
 Additive and subtractive color models;
 Various colormaps and their attributes;
 Selected file formats;
 Commonly used image transformations;

 MATLAB

o Quick glance on what MATLAB is;


o Data representation;
o Exemplary toolboxes and libraries;

 Image Processing Toolbox


o Image enhancement functions;
o Spatial transformation commands;
o Selected filters usage;

 MATLAB Guide Tool


o Main controllers of Graphic User Interface;
o Property Inspector appliance;
o Creation of the menu;

MATLAB library Image Processing Toolbox has mostly found usefulness in


medical purposes and mathematical problems. This thesis has been created to
demonstrate the ability of MATLAB to have a ’regular’ image processing functionality as
well.
In order to achieve that I will design and implement an image processing
application.

Methods of realization are described in the following subchapter.

2.3 Realization methods and techniques:

There are many ways to support the learning process. Finding information

ECE 1
Sri Indu Institute of Engineering & Technology

might be a hard task if is it not well structured. The most helpful tools are written
materials.

ECE 1
Sri Indu Institute of Engineering & Technology

Stu-dies of previously mentioned topics are based on few books concerning image
processing and MATLAB. Some of the information may be withdrawn from
Cracow’s University of Technology lectures. Other valuable pieces of data might be
found on the Internet. The website of MATLAB producer Math works is also a wide
source of the toolboxes, as well as their functions and parameters.
After a broad study of all the topics of interest, the project of an application
will be created. In order to achieve that, a sketch draft will be drawn in the beginning.
Then the main window will be built, along with all the elements of the Graphical User
Inter- face. This process will be supported with MATLAB GUIDE tool, described
later. The next step of application production is designing the menu bar. Before
programming the actual code, it is very important to define possible constraints and
errors. Specification of these problems in the early stage of the project management
may have crucial influence on the program structure. Whole process of creating the
application will be followed by few tests along with results and comments. Finally, I
will present conclusions and point out the areas of the future development.

ECE 1
Sri Indu Institute of Engineering & Technology

CHAPTER-3

COMPUTER GRAPHICS

3.1 Computer graphics in details:


To understand better the idea of computer graphics, the definition should be
taken into consideration. Everything that refers to the representation and manipulation
of image data by a computer stands for term computer graphics. What also can be
called with that term are various technologies used to create and manipulate images.
There are two types of computer graphics – raster and vector Ozimek Lectures from
Computer Graphics on Cracow University of Technology.
Raster graphics is a way of presenting images as a grid of small rectangles
pixels. Those grids, also known as matrixes are often called bitmaps. Each matrix is
built out of certain amount of rows and columns. Looking deeper, each row contains
some quantity of pixels and each pixel is assigned its position and color in the image
more pixels image contains more accurate picture will be. Important information is
that every bitmap is characterized by size given in pixels and by number of bits per
pixel. The second feature is called a color depth, which represents the number of
colors that can be used to present the image Ozimek Lectures from Computer
Graphics on Cracow University of Technology. It can be easily calculated with proper
amount of bits used to encode all the colors (1 bit = 2 colors, 2 bits = 4 colors, 3 bits =
8 colors, etc.).
Raster graphics has also one additional trait: image resolution. It is strictly
connected with size of an image, the amount of rows (height) and columns (width)
mentioned before define resolution. There is also a different way to describe that term
the resolution is given as one number, which is the quantity of all the pixels that
image contains divided per one million. This is a product of multiplying number of
rows per number of columns and it is presented in megapixels. That outcome is also
the amount of pixels that influences on size of an image, while saved on the hard
drive. More pixels will need more space to store them. Also known fact is that more
pixels give more detailed image. The conclusion would be to save pictures with high
resolution but skillfully optimize the size while saving.

ECE 1
Sri Indu Institute of Engineering & Technology

Raster graphic images lose the quality while zooming in and it becomes

ECE 1
Sri Indu Institute of Engineering & Technology

“pixelated”. Secondly, saving images as a raster graphic gives the user bigger variety
of file for-mats. Vector graphics images do not provide many exterior file formats for
saving them separately from the vector graphic processing programs. Other
dissimilarity refers to transforming one type of graphics into another. Vector graphics
can be easily saved as bitmaps, which requires giving the resolution. On the other
hand changing raster graphics into vector image is a very difficult process.
3.2 Color systems:
Thinking about computer graphics, more features should be taken under the
investigation. In order to understand their meaning, color systems (or often called
color models) need to be presented. Color system used in computer graphics is usually
described as a three color system. It means that each color on the image is depicted
with three numerical values. Those values describe the color used in the picture.
Because of those three important numbers, all color systems have been divided into
two groups: additive and subtractive. For each one different algorithm is applied.
Additive color systems are based on adding three primary colors – red, green
and blue to black and mixing them towards getting new colors. More colors are
mixed, more close to white new result is. This color system is mostly used in
computer
There are three well known, common color systems: RGB, CMYK and HSV.
First one, additive system RGB stands for red (R), green (G) and blue (B). It is widely
used for any image file formats. Graphics that is using RGB model represents each
pixel as a three numerical values in brackets. First value is the amount of red, second
stands for green and the third one is blue. Those values are used to create color
presented on the screen. All values can’t outreach 255 and can’t be lower than 0. For
example trip-let (0,0,0) stands for black when (255,255,255) goes as white color.
Every other mix of values stands for different color. For better understanding how
colors are changing, Figure 1 presents the cube of RGB color. Axe X stands for red, Y
for green and Z for blue. With moving along all axes different colors can be created.

ECE 1
Sri Indu Institute of Engineering & Technology

Figure 3.1: Cube of RGB color model

Figure 3.2: Comparison of RGB and CMYK color systems

ECE 1
Sri Indu Institute of Engineering & Technology

3.3 Color maps:

Basic knowledge about image properties and colormaps is important for image
processing. Colormap is a set of limited colors used in displaying image. There are
few different colormaps such as bitmap, grayscale, index color, high color and true
color. This chapter describes each one of them briefly.
Bitmap can be defined in many various ways. Usual meaning of bitmap is map
of bits. Considering image processing, bitmap gives the user possibility to store one bit
per pixel. Information included in that bit defines if the pixel has color (bit = 1) or
doesn’t have a color (bit = 0). White color is often used as option of “having the color”
Grayscale is a colormap that usually stores information about the image in
eight bits per pixel. Like mentioned before, with eight bits it is possible to create scale
of 256 shades of gray. Sometimes grayscale is described as carrying only one pixel
which stores information about brightness of black. Result is a scale of different tones
of gray. All range of gray may be represented as RGB triple value. All three numbers
have to be equal, for example (123,123,123) or (3,3,3).
Another useful colormap is called indexed colormap. Each pixel of image
stores in-formation about index to the place in colors array, for example set by the
user. The biggest palette can contain 256 colors. Indexed color is very useful. It saves
computer’s memory and disk space. Smaller color palettes can be used to represent
icons and pictures with small range of colors. Indexed colormap also supports setting
transparent color. Picking transparent pixels is very helpful when it comes to images
with irregular shapes. Thanks to that feature object on image can be put on a
background without necessity of deleting rectangular shape.
More advanced colormap is called true color. Information about the image is
stored in 24 bits, which equals 3 bytes. Each color from RGB model gets 8 bits for
storage of information about shade and channel of color. True color system uses at
least 256 tones of each color (red, green and blue), which gives huge range of usable
colors
- 16.777.216 possible variations. This system is often used in high quality
photographs and complex images Ozimek, lectures from Digital image processing.
There are plenty of colormaps but one more worth describing is called high

ECE 1
Sri Indu Institute of Engineering & Technology

color. It offers very wide range of colors, bigger than in true color system. The

ECE 1
Sri Indu Institute of Engineering & Technology

description of point on the image contains 16 bits of information. This amount allows
to code from 0 to 65535 different values for one RGB color, which gives
65535*65535*65535 color variations. The precision in high color system is twice
much better than in true color. Mostly because that high color is used while
photographing more prevalent colors, for example skin tones or skies Ozimek lectures
from Digital image processing.
In true color and high color system images, picture can be separated into three
RGB channels. Each color channel might be useful while processing computer
graphics. Having the knowledge about color maps and color systems is very
important.

3.4 File formats:


For people working with advanced graphics it is quintessential to understand
similarities and differences between image files formats. One of the biggest
dissimilarities is the algorithm used to compress the size of a file. There is lossless
and lossy algorithm. Lossless way reduces size without losing quality of picture but
also it cannot compress file to a very small size. Lossy method allows decreasing
image size but not without consequences – quality of picture becomes poor Ozimek
lectures from Digital image processing.
File formats can also be divided with regard to type of graphics. From raster
graphics, among others, the most commonly used formats are JPEG, GIF and PNG.
When it comes to vector graphic there are not many formats because most of them are
formats specified by an image processing program, like for example AutoCAD or
CorelDraw. EPS format is worth noticing. It can be implemented to save both types of
graphics. First group compared will be raster graphics formats and it is based on
lectures from Digital image processing, provided by Cracow University of
Technology.
Abbreviation JPEG stands for Joint Photographic Experts Group. The
compression for this file type is lossy. Information that is discarded while compression
cannot be noticed with human eye though. JPEG supports about 16 millions of colors.
One less demanding way of saving files is GIF format. Acronym GIF
translates as Graphic Interchange Format. It is limited to 256 colors, therefore may be
used for simple web images, logos, etc. Despite lossless compression, GIF has worse

ECE 1
Sri Indu Institute of Engineering & Technology

quality of picture mostly due to small range of colors.


When it comes to vector graphics EPS – Encapsulated PostScript, is mostly

ECE 2
Sri Indu Institute of Engineering & Technology

known format. What is interesting, it can save raster graphics as well as vector
images. It contains information needed for printing and very often small-sized
preview of the image. EPS format files usually take bigger disk space than other
graphic files formats. Most often users save vector graphics in their “natural
environment” in order to keep ability of processing them later.

3.5 Image transformations:


There is a group of transformations that are about to improve the properties of
an im-age. Brightness, contrast, hue, saturation and threshold are the most widely used.
Brightness, called also luminance helps when image is too dark or too light.
Some value is added to RGB colors in order to make picture lighter and some value is
subtracted from those components to make image darker. Changing contrast is
making difference in properties of the picture which makes the object more
distinguishable from the background Ozimek, lectures from Digital image processing.
Higher contrast underlines shadows and highlights of the image. Properties hue and
saturation are connected with each other. They both refer to color manipulation. Hue
changes the way picture is perceived. It can tinge picture with any color, so it will be
seen like it was behind a color filter. Saturation of color means that the color can be
fully saturated or faded. The last value from possible saturation decrease results in
grayscale.Thresholding is a bit more complicated operation. Input image is usually in
grayscale but color picture also works. Output image is a bitmap, where black stands
for back-ground pixels and white for foreground objects. The only parameter of
thresholding
The other group of transformations applies to changes in size or shape of the
image. Extending width and height, rotation and twisting image against the axes are
just small piece of the whole group containing coordinates transformations. When
talking about rotation the angle is the parameter.

ECE 2
Sri Indu Institute of Engineering & Technology

CHAPTER-4
MATLAB ENVIRONMENT

4.1 What exactly is MATLAB?

The name MATLAB comes from two words: matrix and laboratory.
According to The MathWorks (producer of MATLAB), MATLAB is a technical
computing language used mostly for high-performance numeric calculations and
visualization. It integrates computing, programming, signal processing and graphics in
easy to use environment, in which problems and solutions can be expressed with
mathematical notation. Basic data element is an array, which allows for computing
difficult mathematical formulas, which can be found mostly in linear algebra. But
MATLAB is not only about math problems. It can be widely used to analyze data,
modeling, simulation and statistics. Mat-lab high-level programming language finds
implementation in other fields of science like biology, chemistry, economics,
medicine and many more.
In the following paragraph which is fully based on the Marth Works ‘Getting
started with MATLAB I introduce the main features of the MATLAB
Most important feature of MATLAB is easy extensibility. This environment
allows creating new applications and becoming contributing author. It has evolved
over many years and became a tool for research, development and analysis.
MATLAB also features set of specific libraries, called toolboxes. They are collecting
ready to use functions, used to solve particular areas of problems. MATLAB System
consist five main parts. First, Desktop Tools and Development Environment are set of
tools helpful while working with functions and files. Examples of this part can be
command window, the workspace, notepad editor and very extensive help
mechanism. Second part is The MATLAB Mathematical Function Library. This is a
wide collection of elementary functions like sum, multiplication, sine, cosine, tangent,
etc. Besides simple operations, more complex arithmetic can be calculated, including
matrix inverses, Fourier trans- formations and approximation functions. Third part is
the MATLAB language, which is high-level array language with functions, data
structures and object-oriented programming features. It allows programming small

ECE 2
Sri Indu Institute of Engineering & Technology

applications as well as large and

ECE 2
Sri Indu Institute of Engineering & Technology

complex programs. Fourth piece of MATLAB System is its graphics. It has wide tools
for displaying graphs and functions. It contains two and three-dimensional
visualization, image processing.

4.2 Data representation:

Data representation in MATLAB is the feature that distinguishes this


environment from others. Everything is presented with matrixes. The definition of
matrix by MathWorks is a rectangular array of numbers. MATLAB recognizes binary
and text files. There is couple of file extensions that are commonly used, for example
*.m stands for M-file. There are two kinds of it: script and function M-file. Script file
contains sequence of mathematical expressions and commands. Function type file
starts with word function and includes functions created by the user. Different
example of extension is *.mat. Files *.mat are binary and include work saved with
command File/Save or Save as.
Since MATLAB stores all data in matrixes, program offers many ways to create
them.
The easiest one is just to type values. There are three general rules:

i. the elements of a row should be separated with spaces or commas;


ii. to mark the end of each row a semicolon ‘;’ should be used;
iii. square brackets must surround whole list of elements.

After entering the values matrix is automatically stored in the workspace


(MathWorks, 2002, chapter 3.3). To take out specific row, round brackets are
required. In the 3x3 matrix, pointing out second row would be third column . In order
to re-call one precise element bracket need to contain two values. For example (2,3)
stands for third element in the second row. Variables are declared as in every other
programming language. Also arithmetic operators are represented in the same way
certain value is assigned to variable. When the result variable is not defined,
MATLAB creates one, named Ans, placed in the workspace. And stores the result of
last operation. One command worth mentioning is plot command. It is responsible for
drawing two dimensional graphs. Although this command belongs to the group liable
for graphics, it is command from basic MATLAB instructions, not from Image
Processing toolbox. It is not suitable for processing images, therefore it will not be

ECE 2
Sri Indu Institute of Engineering & Technology

described.

ECE 2
Sri Indu Institute of Engineering & Technology

Figure 4.1:The example of three dimensional matrix, built in MATLAB

As mentioned before, MATLAB stores images in arrays, which naturally suit


to the re-presentation of images. Most pictures are kept in two-dimensional matrices.
Each element corresponds to one pixel in the image. For example image of 600 pixels
height and 800 pixels width would be stored in MATLAB as a matrix in size 600
rows and 800 columns. More complicated images are stored in three-dimensional
matrices. True color pictures require the third dimension, to keep their information
about intensities of RGB colors. They vary between 0 and 1 value.
The most convenient way of pointing locations in the image, is pixel
coordinate system. To refer to one specific pixel, MATLAB requires number of row
and column that stand for sought point. Values of coordinates range between one and
the length of the row or column. Images can also be expressed in spatial system
coordinates. In that case positions of pixel are described as x and y. By default, spatial
coordinates correspond with pixel

4.3 Endless possibilities:

As mentioned earlier, MATLAB offers very wide selection of toolboxes. Most


of them are created by Math work but some are made by advanced users. There is a
long list of possibilities that this program gives. Starting from automation, through
electrical engineering, mechanics, robotics, measurements, modeling and simulation,
ECE 2
Sri Indu Institute of Engineering & Technology

medicine, music and all kinds of calculations. Next couple of paragraphs will shortly
present some toolboxes available in MATLAB. The descriptions are based on the
theory from Mrozek (2001, 387 – 395) about toolboxes and Math work com Very
important group of toolboxes are handling with digital signal processing.
Communication Toolbox provides mechanisms for modeling, simulation,
designing and analysis of functions for the physical layer of communication systems.
This tool-box includes algorithms that help with coding channels, modulation,
demodulation and multiplexing of digital signals. Communication toolbox also
contains graphical user interface and plot function for better understanding the signal
processing. Similarly, Signal Processing Toolbox, deals with signals. Possibilities of
this MATLAB library are speech and audio processing, wireless and wired
communications and analog filter designing.
Another group is math and optimization toolboxes. Two most common are
Optimization and Symbolic Math toolboxes. The first one handles large-scale
optimization problems. It contains functions responsible for performing nonlinear
equations and methods for solving quadratic and linear problems. More used library is
the second one. Symbolic Math toolbox contains hundreds of functions ready to use
when it comes to differentiation, integration, simplification, transforms and solving of
equations. It helps with all algebra and calculus calculations.
Small group of MATLAB toolbox handles statistics and data analysis.
Statistics toolbox features are data management and organization, statistical drawing,
probability computing and visualization.

ECE 2
Sri Indu Institute of Engineering & Technology

CHAPTER-5
IMAGE PROCESSING TOOLBOX

5.1 Color transformation functions:

As mentioned previously, this chapter will describe in details some of the


Image Processing Toolbox functions. For ability to distinguish them from the text,
they will be written in italics. For better understanding parameters that all functions
take, they will be shown in the brackets next to the name of given function. ‘A’ will
mean exemplary input image. All descriptions are based on the website
www.mathworks.com, which provides wide compendium of knowledge about all
MATLAB functions, including those from Image Processing Toolbox. First group of
operations is responsible for changes and information concerning color transformation
of images.
Couples of functions do not change anything in the picture but they are crucial
when it comes to gain information about it, without need of opening the actual object
of interests returns value 1 if the image is black white, and value 0 otherwise. Some
operations have sense only when executed on binary graphic files.
For example adjusting contrast, brightness or other changes, usually made on
colorful pictures, would not work with black white images. Function is gray(A),
similarly to previous one, checks colormap of the image. As the name suggests, this
time function returns value 1 if the picture is grayscale and value 0 otherwise.
It may also become useful while deciding if some operations can be performed
on the file informs if examined file is the RGB image. These three functions are
essential when it comes to deciding about changing the colormap or color system.
Knowing if the picture is black white, grayscale or RGB determines what
transformations can be done to the file. There would be no point in trying to make
some changes to the image, if they are inoperative for some color models or maps.
Command colormap(map) is connected with the previously mentioned,
however, it is not Image Processing Toolbox function. It exists in MATLAB main
library. It sets current image colormap to one that stands in the brackets as a
parameter. There is about twenty ready-built colormaps in MATLAB. Some
interesting examples of them are: jet, gray, hot and bone.

ECE 2
Sri Indu Institute of Engineering & Technology

HSV stands for hue-saturation-value colourmap. It starts from red and goes
through yellow, green, cyan, blue, magenta and comes back to red. It is very often
used to display periodic functions in MATLAB.

Figure 5.1:Ready-built colormaps from MATLAB Image


Processing Toolbox

There are three more functions connected with changing colormap of image.
Im2bw produces black white picture from grayscale, indexed or RGB file. There is
couple of possible ways of defying parameters. To convert grayscale to binary
graphics it is enough to put in the brackets name of file as a parameter. Optionally,
there is a place after the comma for level of threshold that will be used while
conversion. Default value is 0.5 which stands for average density of threshold.
This constant must range be-tween zero and one. If the input picture is RGB,
im2bw converts it first to gray shades and then to black white. When dealing with
indexed image, user can also put color-map of it in the brackets, just after name of the
file. Similar operation existing in the toolbox is rgb2gray. It converts RGB image to
grayscale by eliminating the hue and saturation from it. Two of standard MATLAB
library function can be also considered as image processing operation.
Rgb2hsv and hsv2rgb are responsible for changing colormap from RGB to
HSV and vice-versa. Each map is a matrix with some number of rows and three
columns. In the RGB image those columns represent intensity of red, blue and green
color and respectively in HSV image, hue, saturation and color value.

ECE 2
Sri Indu Institute of Engineering & Technology

A very useful function of the main MATLAB library is brighten command. It


brightens or darkens image opened in the axes. Parameter of this procedure has to
differ from between minus one and one. For all values from -1 to 0, it tones down the
colormap and correspondingly, from 0 to 1, lightens it. Since zero makes no changes,
it is excluded from both ranges. Brighten command works for all types of colormaps.

5.2 Spatial transformation functions:

Spatial transformation functions are separate group that is responsible for all
changes concerning size, rotating and cropping an image. A simple and effective
command it takes two arguments in the round brackets – the name of the picture and
after the comma, a value that stands for multiplier. If this number is between zero and
one, then the result image is smaller. Respectively, if this constant is greater than one,
therefore the output picture is bigger than the original.
There is an independent function responsible for cropping operation cuts the
image to the selected rectangle. A user defines the area with mouse and as a result,
cropped image is displayed in a new figure, if not specified differently. Holding key-
board button Shift down instead of rectangle, picked area will be a square. MATLAB
Image Processing Toolbox offers wide range of functions, designed to deal with
spatial transformations but the most important ones are described above.
MATLAB main library offers two additional functions, which are worth
mentioning. flips the image along vertical axis. The same way, flips picture along
horizontal axis. The only disadvantage is, that both commands are defined to work
with two-dimensional matrixes.
5.3 Open, Save, Display functions:

This group of Image Processing Toolbox handles basic operations like


opening, closing, displaying and saving the image file. In addition MATLAB library
contains couple of useful commands. read deals with reading image from graphics
file. As a para-meter in the brackets it takes the name of the file and its extension.
Among supported formats are bmp, gif, jpeg and tiff. read returns a two-
dimensional array if the image is grayscale and a three-dimensional one, if the picture
is color. The function mentioned above, allows also reading an indexed image and an
associating colormap with it. In order to do that, instead of giving one variable as a
ECE 3
Sri Indu Institute of Engineering & Technology

result, user needs to put second variable that will stand for the map, just after the
comma in square brackets.
A very useful function exists in Image Processing Toolbox. show is
responsible for displaying an image. It works with black and white, grayscale and
color pictures. Simply, matrix that includes a graphic file or just a filename can be
treated as a parameter for this procedure. Alternatively, the image can be displayed
with its colormap. Map should be given after the comma in the brackets, along the
filename. The shown picture has to be in the current directory or specified by the path
to the file.
5.4 Other functions:
Last paragraph of this chapter will describe miscellaneous functions from
Image Processing Toolbox and MATLAB main library. Often used to displays
various information about the image. Among all the data fields, returned by this
procedure there are nine of them that are the same with every file format. Those are:
Filename – contains name of the image;
File Mod Date – last date of modification;
File Size – an integer indicating the size of the file, in bytes;
Format – graphic file extension format;
Format Version – number or string describing the file format version;

5.5 MATLAB “GUIDE” TOOL:

5.5.1 User friendly graphical interface:

According to Galitz (2002, 15, 41 - 51), a graphical user interface can be


defined as set of techniques and mechanisms, used to create interactive
communication between a program and a user. The author of the book underlines the
importance of designing process by presenting essential rules. Proper visual
composition is a must.
The aim is to give the user aesthetically pleasant working environment.
Colors, alignment and simplicity of look should be considered carefully. Every
function, button or any other object should have its meaning, simple and
understandable by an average program user. Similar components should have
analogous looks and usage.
ECE 3
Sri Indu Institute of Engineering & Technology

Functions ought to perform quickly and result with wanted outcome.


Flexibility can be perceived in this topic as being sensitive to each user’s knowledge,
skills, experience, personal performance and other differences that may occur.

ECE 3
Sri Indu Institute of Engineering & Technology

An example of GUI with random components is presented in

Screen5.1: Example of graphical user interface with some of the components

After the first time saving, GUIDE stores the interface in two files- .fig file,
where the description of whole graphic part is placed and .m file, where the code that
controls the actions can be found. Each object properties are kept in the .fig file and
can be set directly from GUIDE tool, thanks to ready-built Property Inspector. All
actions, usually called ‘callbacks’ can be modified and changed in the .m file. Every
single component has ‘Tag’ property, which is used while creating the name of the
callback reference.
To get access to each attribute, Matlab offers command set. It requires
reference to the object that is about to be changed and the name of the property,
followed by its value. Among other characteristics, there is an action trigger - callback
operation. It is important to know, that any element can have its own specific
implementation of this function. Besides operations responsible for actions of objects,
there are two additional functions implemented in .m file:
Opening function – executes tasks before the interface becomes visible to the
user; Output function if need, it returns variables to the command line there is much
more behind mechanisms and techniques of programming GUI but this topic will be
explained closely in the next chapter.

ECE 3
Sri Indu Institute of Engineering & Technology

5.6 Main components of GUI:


5.6.1 Common knowledge:
All operative user interface components of MATLAB GUI are called
‘control’. They all contain various selections of properties to be set. After a
programmer double- clicks an object created in GUIDE, a window of Property
Inspector appears. It is a list of all changeable traits of the component, represented by
Figure below

Screen 5.2:Property Inspector

Most of GUIDE controls have common properties, responsible for the same
characteristics of a component. In addition every object has several supplementary
features. Each attribute can be queried with command get and changed by command
set, as mentioned before.
First group of attributes is responsible for control of visual style and
appearance. ‘Back ground color’ defines color of the rectangle of the control.
Similarly, ‘Fore- ground color’ sets tinge of the string that figures on the button.
Important field ‘CData’ allows to put a true color image on the button instead of the
text. Parameter ‘String’ places given word on the button. Line ‘Visible’ can take
either on or off value, the object can be visible or not. Even not seen, it still exists

ECE 3
Sri Indu Institute of Engineering & Technology

and allows getting all the in-


formation about it.

ECE 3
Sri Indu Institute of Engineering & Technology

Next collection of properties concerns information about the object. ‘Enable’


defines if the button is on, off or inactive. Option ON states that control is operational.
Respectively, alternative OFF, states disability of proceeding any action on the button.
In this case label is grayed out. Selecting inactive value allows showing component as
enabled, but in real, it is not working.
The kind of control is decided by ‘Style’ field. Possible values of this
parameter are: pushbutton, toggle button, radio button, check-box, edit, text, slider,
list box and popup menu. Every created object has its name, stored in ‘Tag’ property.
It assists in maintaining the application and navigates among the components.
Another useful attribute is ‘Tooltip String’.
Every time a user rolls a mouse over the control and leaves it there, a text set
in this place is shown. Those small hints can be helpful in case object is not
completely understandable. Last feature from this group is ‘User Data’. It allows
connecting any data with the component and can be reached with get function.
Third category deals with positioning, fonts and labels. ‘Position’ parameter is
responsible for placement of the object. It requires four values which are: the lower
left corner of the component (distance from the corner of the figure) and its height and
width. ‘Units’ field is used by MATLAB for measurements and interpretation of
distance. Attainable values can be inches, centimeters, points, pixels and characters.
Pixels are default setting.
There is couple of font properties. With them a programmer can decide ‘Font
Angle’ (normal, italics or oblique), ‘Font Name’ (font family), ‘Font Size’ and ‘Font
Weight’ (light, normal, demi or bold). Parameter ‘Horizontal Alignment’ determines
the justification of the text of the ‘String’ property. Possibilities to set are left, right
and center.
Last group of properties considers all actions performed by the application.
Attribute ‘Button Down’ executes callback function whenever a user presses the
mouse but-ton while the pointer is near or in five pixel-wide border around the
component. There is a field named ‘Callback’ containing a reference to either M-file
or valid MATLAB expression. Whenever an object is activated, a callback function
will be executed. Two next features – ‘Create ’ and ‘Delete’ work in the way opposite
to each other. First one specifies a callback routine that performs action when
MATLAB creates an control. Respectively, second trait starts an operation every

ECE 3
Sri Indu Institute of Engineering & Technology

time control

ECE 3
Sri Indu Institute of Engineering & Technology

object is destroyed.
This characteristic is definitely an asset, because a programmer can set some
actions just before a component will be removed from the application. A more
complex field, called ‘Interruptible’, contains information concerning actions
triggered by the user, during executing of one of callback functions. This property can
take on or off value. In the first case, MATLAB will allow second operation to
interrupt first one. Accordingly, if off is the selected option, the main callback will not
be interfered.
There are properties important only for particular controls. Next four
paragraphs will briefly describe some of the components and their additional features.

5.6.2 Buttons and Sliders:


Push buttons are important components because they allow a user to interact
with the program on a visual and simple level. Usually buttons are suggestive and
they convey their main purpose. There are four parameters, connected together. ‘Min’
and ‘Max’ specify the minimum and maximum slider values. Defaults are 0 for
minimum and 1 for maximum. MATLAB will not allow defining the lowest number
bigger than expected utmost numeral. Using both properties, ‘Slider Step’ attribute
can be deter-mined. As the name suggest, this characteristic calculates the size of the
step which a user may modify, by clicking arrows on this component.
The step of the slider is a two element vector. By default it equals the bracket
[0,01 0,1], which sets one percent change for clicks on the arrow button and ten
percent modification for clicks in the middle. Also feature ‘Value’ relies on previous
numbers. It is set to the point, indicated by the slider bar and a programmer can access
it with get function.
Figure shown below, represents exemplary Property Inspector for a slider bar.

ECE 3
Sri Indu Institute of Engineering & Technology

Screen5.3: An example of Property Inspector for a slider bar

5.6.3 Axes:

Axes component contains several additional attributes. ‘Box’ property defines


whether the region of the axes will be enclosed in two – dimensional or three
dimensional area. Options ‘X Tick’, ‘X Tick Label’ and ‘Y Tick’, ‘Y Tick Label’
allow a programmer to define what values will be displayed along the horizontal and
vertical axis. As a separator, the easiest way is to use this line ‘Also the location of
both lines can be set with help of ‘X axis Location’ and ‘Y Axis Location’ features.
‘X Grid’ and ‘Y Grid’ creates the g Besides all graphical attributes responsible for
outer look of the axes, this object contains also all features common for different
components.
A lot of properties will not be described here because they refer to appearance
of graphs, drawn with plot command, while this paper treats about image processing.
Therefore, axes will be used as an area of picture input and display. Figure 9
illustrates Property Inspector for an interface component – axes rid that might be
useful while cropping or resizing processed image (Marchand Holland, 2003, 248-
283).

ECE 3
Sri Indu Institute of Engineering & Technology

Screen 5. 4: An example of Property Inspector for axes

5.6.4 Creating menu:

Every decent application should have the menu bar. An average computer user
is ac-customed to possibility of getting most things done with the help of the menu.
That is why MATLAB enables programmers to create two kinds of menus:
Menu bar objects – drop-down menus whose titles are situated on the top of the
figure Context menu objects – pop-down menus that appear after a user right – click
one of the component after entering GUIDE Menu Editor it is possible to create a
hierarchical menu, with- out any limitations of items amount. This tool helps
programmers on many levels process of making menu becomes intuitive and simple.
It enables setting of menu properties with Property Inspector, for every menu and
submenu element
There are several properties that can be set just after new menu is generated.
‘Label’ defines the name of the item that will be dis played to the user. ‘Tag’ value
determines the name, needed to identify the callback function. ‘Separator above this
item’ is responsible for a slim line between logically divided menu elements. Another
attribute ‘Check mark this item’ displays a check next to the menu item and indicates

ECE 4
Sri Indu Institute of Engineering & Technology

the current state of this item. To ensure that users can select any option property Enable
this item’ has to be marked. (Marchand Holland, 2003, 432-440).
Menu Editor is presented in Figure 10, below.

Screen 5.5: An exemplary menu created in Menu Editor

The ‘Accelerator’ field defines the keyboard equivalent that a user can press to
activate particular menu object. Presence of the shortcuts is valuable addition to the
GUI. Thanks to them the time and effort of action is reduced. Sequence Ctrl +
Accelerator selects the menu item. Only items that do not have a submenu can be
connected with some shortcut. ‘Callback’ is previously explained reference to the
function that performs an action. Whenever a menu item has a submenu, all elements
from there are called ‘children’ of the mentioned item. Parameter ‘Children’ lists all
submenu elements in a column vector. If there is no ‘children’, the field becomes an
empty matrix Another feature decides if an option is available to the user. If it is not
then ‘Enable value is set to off. In that case, the name of the menu item is dimmed and
indicates that it is not possible to select it. For nicer visual effect, a programmer can

ECE 4
Sri Indu Institute of Engineering & Technology

change the font color of the menu labels with ‘Fore ground Color’ attribute .When it
comes to the context menu, only one option is responsible for it. ‘Con-text Menu’ as a
default, takes ‘none’ parameter.

Screen 5.6:Simple, GUI with ready built menu

ECE 4
Sri Indu Institute of Engineering & Technology

CHAPTER-6
DESIGN AND IMPLEMENTATION OF AN IMAGE
PROCESSING APPLICATION

6.1 Where to start?

Every process of creating a computer program should be preceded with


careful con-sideration of the task. In this chapter I will describe how to implement an
image processing application with a Graphical User Interface using MATLAB .As
mentioned in earlier stages of the thesis, the program should be able to perform basic
operations on various images. Rotation, cropping, changing the colormap, blurring,
sharpening are only couple of examples of program’s functionality.
Particular steps taken towards achieving the goal are in order: design of the
window together with the procedure of placing the elements of GUI, construction of
the menu bar. Ready prototype of the application will be tested against some
scenarios with regard to the common usage examples. So how to begin this
interesting journey of soft-ware implementation?
6.2 Designing the window:
It is a good practice to start the window design with sketching a draft. With the
project on paper is it easier to imagine and plan functions, buttons and all other
elements of the application. MATLAB will help in creating the program on the
computer. After typing guide command, the choice window appears. There are two
tabs, one stands for creating new a GUI and the other one for opening an application
that already exists. From the first tabs is it possible to pick either some template or a
blank project. To start designing from the beginning, a blank GUI should be selected.
Screen, shown below, presents the quick start window.

ECE 4
Sri Indu Institute of Engineering & Technology

Screen 6.1:guide start window

Creating a new application window requires well thought draft. All


components need to be positioned in logical and functional way. Menu items have to
be understandable for the user. Chaos and mess should not be present in the layout of
the program.
First thing is adjusting the size of the window. In the Property Inspector, in the
field ‘position’, two last values stand for width and height, respectively. Two
reminding numbers set position of the figure on the screen. Next thing determines
if users are allowed to resize the window. For the safety reasons, resizing is not an
expected action. Thinking about the purpose of the program, axes in which image will
be displayed are second created component. Background color was changed to the
same color as the figure background, so if there is no picture loaded, white unused
area is not seen. Axes ticks were deleted because they are mainly used for various
kinds of plots – not for photographs processing. Thin, black border shows the area,
where image will
be loaded.

Brightness of the image can be regulated with next element that is placed on

ECE 4
Sri Indu Institute of Engineering & Technology

the right side of the axes. Buttons ‘+’ and ‘-‘will allow quick and convenient
method of

ECE 4
Sri Indu Institute of Engineering & Technology

changing luminosity of the picture. Static Textbox positioned above will tell the user
what is the purpose of the buttons. Second static textbox was designed to show the
user information, which he/she would like to withdraw from the image. At the end of
designing GUI one button was created: restoring function. It will be responsible for
loading the original picture to the axes in case the user did not like the effect of
transformations. In all components the font was changed to the Arial type, size of 12
and dark blue color. The outlook of the application window after the first step of
designing process is presented in Figure.

Figure 6.1:First step of designing the application window

Very important part of designing an application is creating a menu. Menu bar


for this program will contain: File, Transformations, Filters and Help headings. Each
heading will be briefly described in next paragraphs.

ECE 4
Sri Indu Institute of Engineering &

6.3 Menu File:


Menu item ‘File’ contains five elements, which are: Open, Save, Save with
compression, Info about the file and Exit. It is necessary to change each element’s
label and tag property. The reason is enabling easier maintenance within the
components. Also setting the ‘Accelerator’ field will make the application more
familiar to users. Accelerator parameter is responsible for a shortcut to the function.
Well known combinations are ctrl+O for opening a file, ctrl+S for saving the picture,
ctrl+I for image information and ctrl+Q for quitting the application. More of them
may be created to make the program easier to use for an experienced user.
For example subheadings for File heading have ‘Open’, ‘Save’, ’Exit’ tags. Those
tags menu items will be connected with a proper function that will execute an
expected action. Figure 14 presents menu item ‘File’ creation.

Screen 6.2: First part of menu bar designing

6.3.1 Menu Transformations:

The outlook of the Transformations menu heading is presented on the diagram


below.

ECE Depa rtme 35


Sri Indu Institute of Engineering &

Figure 6.2: Second part of menu bar designing

As shown in Figure 15, ‘Transformations’ menu heading will allow a user to


rotate flip and crop the image. There are two options for the rotation angle – 90
degrees clockwise and 90 degrees counterclockwise. It will be available to flip the
picture either vertically or horizontally, however, this option will become enabled
only if the picture is black white or in grayscale. As explained in previous section,
functions flip and flip are operable only on those kinds of pictures.

6.3.2 Menu Filters and Help:


Two headings considered in this paragraph are ‘Filters’ and ‘Help’. First one includes
three different ways to blur an image, sharpening, adding and removing noise along
with circulating effect of the picture. All those operations are based on filter and
special functions, explained previously. It is worth mentioning that option ‘add noise’
is created mostly to show the functionality of Matlab and function that removes the
noise from the image. Next option is a histogram equalization and correction of
contrast. It is also possible to convert a color picture into the grayscale or make it a
bit-map.
Last main menu item is ‘Help’. It is not that important for the application to
work but often users want to know facts about the program, the author and how it
actually works. Figure 16 shows fully designed menu bar.

ECE 3
Sri Indu Institute of Engineering &

Screen 6.3: Finished menu bar, some options presented

6.3.4 General rules of coding:

After creating the graphical user interface it is time to connect it with Matlab
functions. There are two ways of doing it: the first one demands from a programmer
in
.m file, where he has to create all the components. What is more, properties for each
element must be set using only text. This is not the fastest method.
Thankfully,GUIDE mechanism comes in handy here. It is enough to drag and drop
the objects into the workspace and set their parameters with Property Inspector,
mentioned earlier. With this option the application will need an additional .fig file that
contains the interface. The technique used in this thesis mixes both – visual creation
of the GUI along with programming inside the .m file.
Every application needs to be very carefully thought through. The programmer
has to remember about user mistakes as well as unexpected and unusual order of
actions. Next paragraph will present how the problem of limits and constraints was
handled.
Just after opening the application, the buffer of the image is empty therefore
no operations can be performed. First adjustment was to disable menu options until
the picture is loaded. Of course options of opening, closing and getting help stay
active. During the opening of the image, the type of the input file is checked.
Respectively, some of the functions get activated only for grayscale pictures. Next
thing is the message box that shows up to inform the user about the type of the image
and available processing options. Figures 17 and 18 present both adjustments.

ECE 3
Sri Indu Institute of Engineering &

Screen 6.4:Inactive menu options

Screen 6.5: Informative message box

Next i will describe how the functions explained above are actually
implemented. In the couple of next paragraphs i will point out the most important
parts of the code. Full listing can be found in Appendix Starting with the procedure of
opening the file there are couple of methods used in order to prevent errors. Firstly,
the image is loaded into the two variables, one for using and one for restoring. Thanks
to the command handles followed with a ‘dot’, variable becomes global. Function file
allows selecting the file from the computer.

Instruction prevents from receiving an error when the user decides to cancel
opening. Command connects the name of the file with its path. This brings the
possibility of using read to load the picture. Later on show presents the image and all
the changes in GUI are updated with data command. Below are selected fragments of
the code.

[filename, pathname]=uigetfile(
{'*.jpg';'*.gif';'*.png';'*.bmp';'*.tif';'*.eps'},
'Select file');

if filename ==0
ECE 3
Sri Indu Institute of Engineering &

return;
end

handles.var=strcat(pathname,filename);
handles.plik=imread(handles.var)
; handles.oryginal =
imread(handles.var);

axes(handles.axes);
imshow(handles.plik);

if isgray(handles.plik) == 1

set(handles.histogram,'Enable','On');
guidata(hObject, handles);

msgbox('The image is in grayscale - all fuctions


active','Message');

Another function from the menu bar is saving the file. As discussed
previously, it can happen with or without the compression. Statement input file along
with in write are a fairly good mechanism of writing files. Compression allows to
decrease the size of an image which is presented in the chosen piece of code below.

[FileName,PathName]=uiputfile({'*.jpg';'*.tif';'*.png';'*
.gif'},'Save image');

imwrite(handles.plik,[PathName FileName],'Quality',50);

Next functionality worth mentioning is getting some information about the


processed picture. info helps to obtain that goal. Since metadata is stored in a structure
type, it is necessary to use ‘dot’ construction to access it. All information are
connected together with start command, which not only joins the text but also
separates them with one empty line. Later set function embeds that string text into the
information field.

ECE 3
Sri Indu Institute of Engineering &

i = imfinfo(fullfile(handles.pathname,

ECE 4
Sri Indu Institute of Engineering &

handles.filename)); A1 = i.Filename;
A = strvcat('File Name: ',A1);
C1 = num2str(i.FileSize);
C2 = strcat(C1,'Bajts');
C = strvcat('File Size: ',C2);
I = strvcat(A,C,D,E,F,G,H);
set(handles.text3,'String',I);

An example of spatial transformation is presented in the lines below.

handles.plik = imrotate(handles.plik,-
90,'bilinear','loose'); handles.plik =
fliplr(handles.plik); handles.plik =
imcrop(handles.plik);

Very important part of the application are filters. Blurring can be acquired
with three different methods, described in the previous section. Each filter is based on
connecting two powerful commands – special and filter. Adding noise takes a
parameter such as ‘salt pepper’, while removing noise is done with a median filter.
Some of the functions changes state of others, meaning their activation mode. There
would not be much sense in trying to change grayscale picture into a grayscale, for
example. Additionally, histogram equalization option was created in menu Also a
procedure that corrects contrast. Examples of code are illustrated below.
H = fspecial('gaussian');
handles.plik = imfilter(handles.plik,H);
H = fspecial('unsharp',0.05);
handles.plik = imfilter(handles.plik,H,'same');
handles.plik = imnoise(handles.plik, 'salt &
pepper',0.02); handles.plik =
medfilt2(handles.plik);
handles.plik = histeq(handles.plik);
handles.plik = imadjust(handles.plik);

ECE 4
Sri Indu Institute of Engineering &

Different type of functions, used in the application are those converting color
to grayscale and grayscale to bitmap. Since after transforming image to the black and
white it is not possible to regain the color data, most of the options are switched off.

handles.plik = rgb2gray(handles.plik);
set(handles.skala_szarosci,'Enable','Off');

handles.plik = im2bw(handles.plik);
set(handles.kontrast,'Enable','Off'
);
set(handles.skala_szarosci,'Enable'
,'Off');

After creating the first prototype of the program, an extra starting window was
de-signed. It allows selecting a language from English and Polish. To achieve
expected results openfig and close commands were used. Parameter for close is gcf,
which stands for handle to the current figure.
close(gcf);
openfig(english);

When the user decided that he wants to end image processing, he can close the
pro-gram from ‘File’ menu or with a shortcut ctrl+q.

ECE 4
Sri Indu Institute of Engineering &

CHAPTER-7

RESULTS AND DISCUSSION

The Automatic Certificate Generation project overview is shown in Fig. 1. File name
of the blank certificate (A) is used as input in the code. Details to be written on the
certificate are obtained from an Excel sheet (B). The data is written over the blank
certificate and many such certificates are generated by the MATLAB code (C). The
certificates generated by the program can be saved in a folder with a unique file name.

Screen7.1:Project overview for Automatic Certificate Generation

7.1 Description:
The three major steps involved in this project are shown in Fig. 2. Base image
can be in any colour and should be in tif, jpg or png format. The image generated by
the program retains properties of the base image. Source code given here only inserts
text on the image. Data to be written can be in either xls or xlsx format. MS Excel is
preferred as it’s a powerful mathematical and statistical tool. It allows data to be
internally computed and analysed within the file.

ECE 4
Sri Indu Institute of Engineering &

Figure 7.1: Major steps and procedures in the project

The generated MATLAB figures or images can be saved into separate files or
a single file as per requirement. By default, the code saves the generated image in
format with a unique name. With simple code modifications, images can also be
ported to a PDF file.

The position at which text is to be inserted can be identified using simple


image editor tools such as MS Paint and Picture Manager. Pixels or picture elements
are the most basic elements of an image. An image of 1024×768 resolution contains
786,432 pixels or nearly 0.79 megapixels. Pixel positions to be identified are as many
as the number of texts and numbers to be inserted on the image. The project code can
be very easily manipulated for similar image processing tasks.

7.2 Working environment:

Figure shows folder contents of the MATLAB working directory. Main Code,
Certificate Blank tittle and Registration_Details.xls files should be saved in the same
folder.

ECE 4
Sri Indu Institute of Engineering &

Figure 7.2: MATLAB working environment for Automatic Certificate


Generation

Main Code is the MATLAB M-file containing the main code, Certificate
Blank is the base image, and Certificate Topic from 1 through 6 are certificates
generated from the data in Registration_Details.xls. While running M-file, MATLAB
should be permitted to change directory to the location where the main folder is saved.

ECE 4
Sri Indu Institute of Engineering &

CHAPTER-8

CONCLUSION AND FUTURE SCOPE

8.1 CONCLUSION:
We have generated the gadget sheet calculating the grades, credits, grade
points of each courses and Grade Performance Index of whole semester considering
all the courses. Also determined the calculations for evaluation of marks for special
cases (ordinances for grace marks in case of failure as per the university rules).
The system automated and generalized the system ensures to reduce manual error by
reducing manual efforts. An added asset to the feature of the system is that aims at
improving and easing out the work of existing system in very sophisticated way.

8.2 FUTURE SCOPE:

Analysis and presentation of large data sets is a tedious task in applications


such as Big Data, IoT and sensors-actuators modelling. The project presented here can
be extended and customised for analysis and reports generation in these applications.

ECE 4

You might also like