Download as pdf or txt
Download as pdf or txt
You are on page 1of 43

We are IntechOpen,

the world’s leading publisher of


Open Access books
Built by scientists, for scientists

4,200
Open access books available
116,000
International authors and editors
125M
Downloads

Our authors are among the

154
Countries delivered to
TOP 1%
most cited scientists
12.2%
Contributors from top 500 universities

Selection of our books indexed in the Book Citation Index


in Web of Science™ Core Collection (BKCI)

Interested in publishing with us?


Contact book.department@intechopen.com
Numbers displayed above are based on latest data collected.
For more information visit www.intechopen.com
Chapter 1

Digital Image Processing with MATLAB

Mahmut Sіnecen

Additional information is available at the end of the chapter

http://dx.doi.org/10.5772/63028

Abstract

The chapter relates to the Image Processing Toolbox in MATLAB. We learn about its
general information and some examples will be solved using it. After finishing this
chapter, you can use MATLAB Image Processing Toolbox and write script for
processing of images.

Keywords: MATLAB, digital, image, processing, Fundamental

1. Digital image processing

The image may be defined as a two‐dimensional visual information that are stored and displayed.
An image is created by photosensitive devices which capture the reflection light from two‐
dimensional surface of object in the three‐dimensional real world (Figure 1). Each image has
intensity or gray value in x – y coordinate plane. If it is finite and discrete quantities, image is
called digital image. In Figure 2, some digital images are shown.

Digital image processing (DIP) has the different techniques for processing of digital images.
DIP has been applying many fields with technological advances, such as Medicine, Geograph‐
ical Information Technologies, Space Sciences, Military Applications, Security, Industrial
Applications.

1.1. Pixel

Pixels, which are called pel or picture elements, may be defined as the smallest addressable
element in the digital image. Pixels of a color image have Red, Green, and Blue gray values
(Figure 3).

© 2016 The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons
Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution,
and reproduction in any medium, provided the original work is properly cited.
2 Applications from Engineering with MATLAB Concepts

Figure 1. Image.

Figure 2. Digital images.


Digital Image Processing with MATLAB 3
http://dx.doi.org/10.5772/63028

Figure 3. Pixels of a color image.

1.1.1. Pixels relationships

1.1.1.1. Neighbors of a pixel

A pixel has three different neighbor types that are 4, 8, and diagonal. As shown in Table 1,
neighbor of a pixel (p) in the x, y point of image (f) is defined in that 4‐neighbors;

f(x - 1, y - 1) f(x - 1, y) f(x - 1, y + 1)

f(x, y - 1) p f(x, y + 1)

f(x + 1, y - 1) f(x + 1, y) f(x + 1, y + 1)

Table 1. Neighbor of a pixel.

N4(p) is shown as 4‐neighbor of p pixel. Any pixel p in the image has two vertical and horizontal
neighbors, and each of them is a unit distance of p, given by

N 4 ( p )  = {f ( x, y - 1) , f ( x - 1, y ) , f ( x, y + 1) , f ( x + 1, y )}

Diagonal neighbors;

Although diagonal neighbors are the same of 4‐neighbor, neighbor pixels are the corner of
pixels (p) and each of them is at Euclidean distance of p, given by
4 Applications from Engineering with MATLAB Concepts

N D ( p )  = {f ( x - 1, y - 1) , f ( x - 1, y + 1) , f ( x + 1, y + 1) , f ( x + 1, y - 1)}

8‐neighbors;

8‐neighbors is a combination of N4(p) and ND(p) and shown as N8(p).

ïìf ( x - 1, y - 1) , f ( x - 1, y + 1) , f ( x + 1, y + 1) , f ( x + 1, y - 1) , ïü


N8 ( p )  = í ý
ïîf ( x, y - 1) , f ( x - 1,y ) , f ( x, y + 1) , f ( x + 1, y ) ïþ

1.1.1.2. Adjacency

If two pixels are neighbors and their gray level values satisfy some specified criterion, then
they are connected. A set of intensity values (V) is used to define adjacency and connectivity.
There are three types of adjacency (Figure 4).

Figure 4. Pixel adjacency.

4‐adjacency

p and q pixels are 4‐adjacency if they are N4(p) with values from V.

8‐adjacency

p and q pixels are 8‐adjacency if they are N8(p) with values from V.

m‐adjacency (mixed)

p and q pixels are m‐adjacency if;


• q is in N4(p) or,
Digital Image Processing with MATLAB 5
http://dx.doi.org/10.5772/63028

• q is in ND(p) and,

• N4(p) ⋂ N4(q) = ฀ with values from V.

1.1.1.3. Path

A path from pixel p with coordinate (x, y) to pixel q with coordinate (s, t) with values from V
is defined as 4‐ ,8‐ , or m‐paths depending on the type of adjacency specified.

According to V = {2,3,5}, If we want to find p and q pixels 4‐, 8‐ and m‐path, (Figure 5)

Figure 5. Finding 4‐, 8‐, m‐path between p and q pixels.

1.1.1.4. Distance measures of pixels

• Euclidean Distance (De)

( x - s)
2
De ( p, q ) = + ( y - t )2

• City‐block Distance (D4)

D4 ( p, q ) = x - s + y - t

• Chessboard Distance (D8)

D8 ( p, q ) = max( x - s , y - t )

• Dm Distance; it is defined as the shortest m‐path.


6 Applications from Engineering with MATLAB Concepts

According to V = {2,3,5}, if we want to find Dm distance from p pixel to q pixel (Figures 6, 7, 8);

Figure 6. Distance between p and q pixels.

Figure 7. Example about the shortest m‐path.

Figure 8. Solving example in the Figure 7.

Dm is 5 because orange path is shorter than blue path.


Digital Image Processing with MATLAB 7
http://dx.doi.org/10.5772/63028

Figure 9. Distance measuring types.


8 Applications from Engineering with MATLAB Concepts

1.2. Spatial resolution

Spatial resolution can be defined as the number of pixels per inch. Different spatial resolutions
of same image are shown in the Figure 10. Spatial resolution has different measuring methods
for different devices.

Figure 10 .Different spatial resolutions of same image.

1.2.1. Dots per inch (DPI)

DPI is generally used in monitors. Sometimes it is called PPI (Pixels Per Inch). But the two
expressions have a difference. DPI is also used for measuring spatial resolution of printers. It
means DPI defines how many dots of ink on printed image per inch.

1.2.2. Pixels per inch (PPI)

PPI is generally used in tablets, mobile phones, etc. If a and b are height and width resolutions
of image, we can calculate ppi value of any device using Equation 1.

a 2 + b2
PPI = (1)
Diagonal  Size  of  Devices

For example; 1080 × 1920 pixels, 5.5 inch Iphone 6s Plus PPI value;

10802 + 19202
PPI = 5.5 ≅ 401 (it is shown in apple web site)
Digital Image Processing with MATLAB 9
http://dx.doi.org/10.5772/63028

10802 + 19202
PPI = @ 401 (it  is  shownin
   apple  web  site)
5.5

1.2.3. Lines per inch (LPI)

LPI is referred lines of dots per inch of printers. Printer has different LPI values as shown in
Tables 2.

Printer LPI value


Screen printing 45–65 LPI

Laser printing (300 dpi) 65 LPI

Laser printing (600 dpi) 85–105 LPI

Table 2. LPI Value of Printer.

1.3. Image file formats

Image file formats are important for printing, scanning, using on the Internet, etc. The different
formats are used in the world. The most common formats are jpg, tif, png, and gif (Fig‐
ures 11). In this section, the most common file formats (JPG, TIF, PNG, and GIF) are explained.

Figure 11. Image formats.


10 Applications from Engineering with MATLAB Concepts

1.3.1. JPG (Joint Photographic Expert Group)

JPEG or JPG is the most common standard for compressing digital image. It is used in web
pages, document, email, etc. Because digital images have smaller size than other file formats.
However, JPEG images have very low resolution.

1.3.2. TIF (Tagged Image File Format)

TIFF or TIF has the best resolution for using commercial works. Although it is very high quality,
the files have very big size.

1.3.3. GIF (Graphics Interchange Format)

GIF, which was used 8‐bit video for the people connecting to internet using dial‐up modem,
was designed by CompuServe.

1.3.4. PNG (Portable Network Graphics)

PNG file format has smaller size than TIF and more resolution than GIF and JPG. Nowadays,
it is used in the web pages because of having transparency property.

2. Basic image processing with MATLAB

MATLAB is a very simple software for coding. All data variable in MATLAB are thought a
matrix and matrix operations are used for analyzing them. MATLAB has the different
toolboxes according to application areas. In this section, MATLAB Image Processing Toolbox
is presented and the use of its basic functions for digital image is explained.

2.1. Read, write, and show image

imread() function is used for reading image. If we run this function with requiring data, image
is converted to a two‐dimensional matrix (gray image is two‐dimensional, but, color image is
three‐dimensional) with rows and columns including gray value in the each cell.

I = imread(‘path/filename.fileextension');

imread() function only needs an image file. If the result of imread() function is equal to a
variable, a matrix variable (I) is created. File name, extension, and directory path that contains
image must be written between two single quotes. If script and image file are in the same folder,
path is not necessary.

The matrix variable of image is showed using imshow() function. If many images show with
sequence on the different figure windows, we use “figure” function for opening new window.
Digital Image Processing with MATLAB 11
http://dx.doi.org/10.5772/63028

imwrite() function is used to create an image. This function only requires a new image file
name with extension. If the new image is saved to a specific directory, the path of directory is
necessary.

2.2. Image reverse

Image reserve technique, each all elements of the matrix is replaced to be the top row elements
to bottom row and the bottom row elements to top row. In the other words, the image rotates
on the vertical axis.

MATLAB Image Processing Toolbox does not have function for it. Either the script is written
or flipdim function can be used (Figure 12).
12 Applications from Engineering with MATLAB Concepts

Figure 12. Vertical and horizontal reverse.

2.3. Image mirroring

Mirroring technique is the rotating of reversed image on the horizontal axis. In MATLAB
Image Processing Toolbox has imrotate() function for rotating image. This function needs three
properties which are image matrix variable, rotating angle, and interpolation method
(Figure 13).

Figure 13. Image rotate.

I_rotate = imrotate(Image Matrix Variable, Angle, Interpolation Method)

Interpolation method

• ‘nearest’: Nearest‐Neighbor Interpolation


Digital Image Processing with MATLAB 13
http://dx.doi.org/10.5772/63028

• ‘bilinear’: Bilinear Interpolation

• ‘bicubic’: Bicubic Interpolation

Example

2.4. Image shift

Sometimes, an image can be wanted to shift up to certain pixel value on the horizontal and
vertical axis. imtranslate() function is used to shift of an image. In the Figure 14 the image shifts
15 px right and 25 px bottom.

Figure 14. Image shift.


14 Applications from Engineering with MATLAB Concepts

2.5. Image resize

If an image is displayed big or small size for showing details or general view, its resolution
must be changed. These situations are called zoom‐in and zoom‐out. Digital cameras or
photosensitive devices use optic lenses for zoom‐in and zoom‐out. But, interpolation methods
are only used for digital images. Most common problem of interpolation methods is the
changing quality of image (Figures 15, 16).

Figure 15. Zoom‐in and zoom‐out.

I_resize = imresize(I, Resize Rate, Interpolation Method)

I is image variable, if Resize Rate is bigger than 1, it means zoom‐in, otherwise zoom‐out.
Digital Image Processing with MATLAB 15
http://dx.doi.org/10.5772/63028

Figure 16. Image resize.

3. Image enhancement

In some cases, an image has useless or insufficient information for extracting objects because
of different defects. So that, the image must be processed using different digital image
processing techniques for removing the defects or artifacts. In this section, some principal
methods are explained for increasing the visibility and decreasing defects.

3.1. Brightness

Brightness of an image is adjusted with adding or subtracting a certain value to gray level of
each pixel.

 b > 0 Brightness  incerease


G ( i , j ) =  F ( i , j ) + b  
b < 0 Brightness  decrease

I_adjust = imadjust(I, [low_in; hig_in], [low_out;high_out])

New image (I_adjust) intensity values are between low_out and high_out gray values
(Figure 17).
16 Applications from Engineering with MATLAB Concepts

Figure 17. Changing brightness of the image.

Figure 18. Adjusting Brightness of Color Image.

The MATLAB script above is used for gray image, but we want to change brightness of color
image, so, we must change all intensity values of R (red), G (green) and B (blue) channel of the
image (Figure 18).

3.2. Contrast

Contrast of an image can be changed by multiplying all pixel gray value by a certain value.
Digital Image Processing with MATLAB 17
http://dx.doi.org/10.5772/63028

c > 0 contrast  increase


G ( i, j ) = c * F ( i, j )  
c < 0 contrast  decrease

MATLAB Image Processing Toolbox has the Contrast Adjust tool to change contrast of an
image. As shown in Figure 19, GUI allows the user for changing contrast using handling.

Figure 19. Adjust contrast tool.

3.3. Negative

Intensity values of image are reversed as linear for negative image (Figure 20).
18 Applications from Engineering with MATLAB Concepts

Figure 20. Negative Image.

Figure 21. Thresholding.


Digital Image Processing with MATLAB 19
http://dx.doi.org/10.5772/63028

3.4. Thresholding
Thresholding is generally used for converting image to binary image (0 and 1 gray value). The
algorithm of thresholding is defined in Equation 2.

ìï I ( x, y ) ³ T        1 
G ( x, y ) = í (2)
ïî I ( x, y ) < T         0

I is original image, x and y are row and column number, T is threshold value, G is new image
fter applying threshold (Figure 21).

Figure 22. Histogram of the image.

Gray value Counting of pixel number


75 2

76 38

77 0

78 389

79 1245

80 0

81 1518

Table 3. Histogram of Specific Gray Values.

3.5. Histogram
Histogram counts the number of gray value of pixels in the images. Each pixel in the image
has gray value between 0 and 255. As shown in Table 3, counting pixels give us information
about image or objects in the image. The histogram of image is shown in Figure 22.
20 Applications from Engineering with MATLAB Concepts

The histogram of image is calculated using imhist(image) function in the MATLAB.

3.6. Histogram equalization


Histogram equalization is defined a technique for adjusting contrast of an image using all gray
values to equalize as much as possible. Some situations work fine and image are shown very
well; sometimes, it is not good and new image is darker than original image (Figure 24).

1 1 1 1 1

3 3 0 0 2

3 3 2 2 2

6 4 4 2 6

6 7 7 5 5

Table 4. An Image Pixel Gray Values.

We explain histogram equalization with an exam. You think about an image, and, its intensity
mapping is shown below. There are eight possible gray levels from 0 to 7. If we apply histogram
equalization to the image pixel gray values that are shown in Table 4, how new image
histogram will be?
Step 1: Find histogram of the image (Table 5)

I 0 1 2 3 4 5 6 7

f(I) 2 5 5 4 2 2 3 2

Table 5. Histogram.

Step 2: Calculate Cumulative Frequency Distribution (CFD)

I 01 2 3 4 5 6 7

f(I) 25 5 4 2 2 3 2

CFD 2 2 + 5 = 7 7 + 5 = 12 12 + 4 = 16 16 + 2 = 18 18 + 2 = 20 20 + 3 = 23 23 + 2 = 25

Table 6. Calculate Cumulative Frequency Distrubiton (CFD).

Step 3: Calculate new pixel gray value using Equation 3


Digital Image Processing with MATLAB 21
http://dx.doi.org/10.5772/63028

æ CFD ( v ) - CFDmin ö
h ( v ) = floor ç x ( L - 1) ÷ (3)
ç ( MxN ) - CFD ÷
è min ø

h is new gray value, v is pixel number, MxN is image row and column value, L is gray level
(in our image L is 8)
If we calculate the 4 number pixel;

h(4) = floor ((16 - 2) / ((5 x5) - 2) x(8 - 1)) @ floor (4, 26) @ 4

Figure 23. Original and new image gray values.

After all pixel gray values are calculated using Equation 3 the results of new gray values will
be like in Table 7.

I 0 1 2 3 4 5 6 7

f(I) 2 5 5 4 2 2 3 2

CFD 2 7 12 16 18 20 23 25

h 0 1 3 4 4 5 6 7

Table 7. New Gray Values.

After histogram equalization is applied to the image, new gray values are shown in the
Figure 23.
22 Applications from Engineering with MATLAB Concepts

Figure 24. Histogram equalization.

Matlab Image Processing Toolbox has the different filter types as shown in Table 8.

4. Color

Humans have very good photosensitive devices that are called eyes. Newton discovered that
the light has different color spectrum passing through the glass prism. We think human eye
is a glass prism that is called the lens. The lens focuses light to the retina of eyes. So that, humans
see visible color spectrum of light reflected from the objects. Color spectrum is shown in the
Figure 25. Human senses wavelength of light between 400 and 700 nm.

Figure 25. Color spectrum.


Digital Image Processing with MATLAB 23
http://dx.doi.org/10.5772/63028

Eyes see colors as combining of primary that are Red (R), Green (G), and Blue (B). So that, all
visible colors are produced from primary colors. Secondary colors, which are produced with
adding of primary colors, are Yellow (Red + Green), Magenta (Red + Blue), and Cyan (Green 
+ Blue) as shown in Figure 26.

Figure 26. Primary and secondary colors.

In the MATLAB Image Processing Toolbox, a color image has three‐dimensional uint8 (8‐bit
unsigned integer) data. Each dimension corresponds to a color channel that is Red, Green, or
Blue channel. If we want, we can process each color channel. As shown in Figure 27, each color
channel splits from image.

Figure 27. R, G, B channel values in the MATLAB workspace.


24 Applications from Engineering with MATLAB Concepts

Figure 28. R, G, B channel.

4.1. HSI

As shown in Figure 29 each color represents three components as H (Hue), S (Saturation), I


(Intensity). The Hue, which can be defined rate of pure color, is an angle form between 0° and
360°. Red, Green, Blue are 0°, 120°, and 360°, and Yellow, Cyan, and Magenta are 60°, 180°,
Digital Image Processing with MATLAB 25
http://dx.doi.org/10.5772/63028

300°. The Saturation, which shows how the color to be pure, takes value between [0, 1]. The
intensity is the dimensions of lightness or darkness. The range of intensity is between 0 (black)
and 1 (white).

Figure 29. HSI components.

MATLAB use rgb2hsv(image) or write script using Eqs. (4)–(6) for converting the color image
to HSI components. If we want to convert from HSI image to RGB image, we use hsv2rgb(hsi
image).

ì 1 ü
ì q if  B £ G ï éë( R - G ) + ( R - B ) ûù ï
H =í    with q -1
  =  cos í 2 (4)
1 ý
î360 - q if  B > G ï é( R - G )2 + ( R - B )( G - B ) ù 2 ï
îë û þ
26 Applications from Engineering with MATLAB Concepts

3
S =1- é min ( R, G , B ) ûù (5)
( R + G + B) ë

1
I= [ R + G + B] (6)
3

Figure 30. HIS of the image.

4.2. YIQ

YIQ, which is defined by the National Television System Committee (NTSC), produces the
luminance and the chrominance. We use Equation 7 for producing of YIQ components from
RGB image (Figure 31), and Equation 8 is used for converting from YIQ to RGB.

éY ù é0.299 0.587 0.114 ù é R ù


ê I ú = ê0.596 -.0274 -0.322 ú êG ú
ê ú ê úê ú (7)
êëQ úû êë 0.211 -0.523 0.311 úû êë B úû

é R ù é1 0.986 0.621 ù éY ù
êG ú = ê1 -.0272 -0.649 ú ê I ú
ê ú ê úê ú (8)
êë B úû êë1 -1.106 1.703 úû êëQ úû
Digital Image Processing with MATLAB 27
http://dx.doi.org/10.5772/63028

Figure 31. YIQ of the Image.

4.3. Gray image

Gray image is produced using Equation 9 by NTSC standards. However, we can calculate
different methods, but MATLAB uses NTSC standards and it has rgb2gray(RGB image)
function (Figure 32).
28 Applications from Engineering with MATLAB Concepts

GI = 0.299 R + 0.587G + 0.114 B (9)

Figure 32. Gray image.

Other methods;
• The average; GI = 0.33R + 0.33G + 0.33B
• The lightness; GI = (max(R,G,B) + (min(R,G,B))/2
• The luminosity; GI = 0.21R + 0.72G + 0.07B
Digital Image Processing with MATLAB 29
http://dx.doi.org/10.5772/63028

5. Morphologic operations

MATLAB Image Processing Toolbox only use binary image for morphologic operations such
as opening, closing, etc.

5.1. Structuring element


Structuring element (SE) is a shape that has different sizes (3 × 3, 4 × 4, 5 × 5, etc.) and shapes
(Figure 33). SE is applied to an image for drawing results on how the objects change in the
image (Figure 34). SE is generally used for dilation, erosion, opening, closing operations.

Figure 33. Different structuring elements.

5.2. Dilation
Dilation is a morphologic processing for growing an object in the binary image. It is shown
with ⊕ image (Figure 35).

C = AÅ B

C is the new image, A is the original image, and B is the structuring element.
30 Applications from Engineering with MATLAB Concepts

Figure 34. Dilation.

5.3. Erosion

Erosion is the other morphologic operator of a binary image for using eroding the pixels of
objects in the image. It is shown as ⊖ symbol.

C = A! B
Digital Image Processing with MATLAB 31
http://dx.doi.org/10.5772/63028

Figure 35. Erosion.

5.4. Opening and closing

As shown in (Figure 36), opening and closing are the combination of erosion and dilation
operators as shown in Equations 10 and 11.

C = ( A ! B) Å B (10)

C = ( A Å B) ! B (11)
32 Applications from Engineering with MATLAB Concepts

Figure 36. Opening and closing.

5.5. Convolution

Convolution is generally used for modifying the spatial characteristic of an image (Figure 38).
In the convolution, a new pixel gray value is found by the weighted average pixels that are
neighbor of it. Neighbor pixels gray value is weighted by a matrix coefficient that is called
convolution kernel. According to the applications, kernel matrix has different sizes such as 3 
× 3, 5 × 5, 7 × 7 (Figure 37).

Mathematical definition of convolution is shown in Equation 12;

j =- n i =- m
G ( x, y ) = å å k ( i, j ) F ( x - i, y - j ) = k * F
n m
(12)

k: convolution kernel matrix

F: processing image

if w and h are row and column of image ⇒(m = (w - 1)/2)|(n = (h - 1)/2)


Digital Image Processing with MATLAB 33
http://dx.doi.org/10.5772/63028

Figure 37. Kernel matrices.

Matlab Image Processing Toolbox has the different filter types as shown in Table 8.

Value Description
average Averaging filter
disk Circular averaging filter (pillbox)
gaussian Gaussian low‐pass filter
laplacian Approximates the two‐dimensional Laplacian operator
log Laplacian of Gaussian filter
motion Approximates the linear motion of a camera
prewitt Prewitt horizontal edge‐emphasizing filter
sobel Sobel horizontal edge‐emphasizing filter

Table 8. Matlab Image Processing Toolbox Filter Types.


34 Applications from Engineering with MATLAB Concepts

Figure 38. Applying different filters.

5.6. Edge detection

Edge detection is used for finding the border of objects in the image (Figure 39). Common edge
detection algorithms are Sobel, Canny, Prewitt, Roberts, etc.
Digital Image Processing with MATLAB 35
http://dx.doi.org/10.5772/63028

Figure 39. Edge detection.

5.7. Labeling

Pixels are assigned different labels because of belonging to different regions (or components
or objects). In Figure 40, the objects in the image have the different label values and show
different colors in the MATLAB.

Figure 40. Labeling.

[Boundary,Labels] = bwboundaries(binary image, ‘noholes') function uses for labeling. Firstly,


the image must be binary image, if it is not, you must convert to binary image. Secondly, all
objects must be white (1) and background must be black (0) for using ‘noholes’ method. We
use this function with two variables. One of them is address of boundary pixels, and other one
is label numbers and their addresses.
36 Applications from Engineering with MATLAB Concepts

6. Sample application

The last section in this chapter is a sample application that is about extraction of some
morphological features of multiple apricots in a digital image. Firstly, original and background
digital images are read (Figures 41, 42). After that, cropped original image is subtracted from
background image. Cropping process is used for extracting specific area from original image
(Figure 42). Subtracted image (Figure 44) converts to gray image as shown in Figure 45.
Thresholding process is applied to gray image for converting binary image (Figure 46).
Sometimes, some artifacts can occurred in binary images. Before labelling, connecting pixel
groups which are smaller than specific value (smaller than 50 px in this application) are
removed (Figure 47). After labelling (Figure 48), we can find all objects morphological features
as shown in Figure 49.

Figure 41. Original digital image.

Figure 42. Background image.


Digital Image Processing with MATLAB 37
http://dx.doi.org/10.5772/63028

Figure 43. Background image.

Figure 44. Subtracting from background to cropped image.

Figure 45. Converting gray image.


38 Applications from Engineering with MATLAB Concepts

Figure 46. Thresholding.

Figure 47. Remove artifacts.

Figure 48. Labelling.


Digital Image Processing with MATLAB 39
http://dx.doi.org/10.5772/63028

Figure 49. Show morphological features.


40 Applications from Engineering with MATLAB Concepts
Digital Image Processing with MATLAB 41
http://dx.doi.org/10.5772/63028

Author details

Mahmut Sіnecen

Address all correspondence to: mahmut@adu.edu.tr

Adnan Menderes University, Computer Engineering Department, Aydin, Turkey

References

[1] Rafael C. Gonzalez, Richard E. Woods. Digital image processing. 3rd ed. United States
of America: Pearson; 2008. 943 p.
42 Applications from Engineering with MATLAB Concepts

[2] John C. Russ. The image processing handbook. 5th ed. United States of America: CRC
Press; 2007. 795 p.

[3] Henri Maitre. Image processing. 1st ed. Great Britain: Wiley‐ISTE; 2008. 359 p.
[4] Maria Petrou; Costas Petrou. Image processing the fundamentals. 2nd ed. Singapore:
Wiley; 2010. 781 p.
[5] John D. Cook. Three algorithms for converting color to grayscale [Internet]. 24.08.2009.
http://www.johndcook.com/blog/2009/08/24/algorithms‐convert‐color‐grayscale/.
Accessed 02.01.2016

[6] Shindong Kang. http://www.slideshare.net/uspace/ujavaorg‐deep‐learning‐with‐


convolutional‐neural‐network [Internet]. 26.05.2015 . http://www.slideshare.net/
uspace/ujavaorg‐deep‐learning‐with‐convolutional‐neural‐network. Accessed
29.12.2015

[7] Sung Kim. Applications of Convolution in Image Processing with MATLAB [Internet].
20.08.2013. http://www.math.washington.edu/∼wcasper/math326/projects/
sung_kim.pdf. Accessed 12.12.2016

You might also like