edge segmentation techniques for thai paphiopedilum images
TRANSCRIPT
Proceeding Book of Sakon Nakhon Rajabhat University International Conference
ST-9
Edge Segmentation Techniques for Thai Paphiopedilum Images
Wanchai Kosorn, Put Panuwanitchakorn, Janjira Payakpate*
Department of Computer Science and Information Technology, Faculty of Science, Naresuan
University, 99 Moo 9 Tambon ThaPho, Muang District, Phitsanulok , 65000,Thailand
*Corresponding Author: [email protected]
Received 7 August 2015; Revised 31 August 2015; Accepted 1 September 2015; Available online 1 October 2015
ABSTRACT
The purpose of this research was to identify the species of Thai Paphiopedilum, an orchid endemic
to Thailand, by using an edge segmentation technique to analyze photographic images of the
flowers. Suitable edge segmentation techniques were investigated and the most suitable identified.
There are five edge segmentation techniques: the Sobel Method, the Roberts Method, the Prewitt
Method, the Canny Method and the Laplacian of Gaussian Method. An image of each of the
fourteen species of orchid was selected and encoded as the four types of image extension: Joint
Photographic Experts Group (.JPEG), Portable Network Graphics (.PNG), Graphics Interchange
Format (.GIF) and Bitmap Image File (.BMP). Each of the fifty-six images was processed with each
edge segmentation techniques using MATHLAB R2008B. To compare the edge segmentation
techniques on each image, the root mean square error (RMSE) of each image result showed that the
RMSE of the Canny method on the .JPEG and .GIF images were less than that of the other methods
(5.24E+05, 4.37E+05). For the .PNG images, the Prewitt method was the most suitable method
with a RMS less than the other four methods. The Robert method was the most suitable for .BMP
images. Further study will be undertaken to implement a system of identification of these Thai
Paphiopedilum orchids from images.
Keywords: Edge Detection Technique, Thai Paphiopedilum
INTRODUCTION
The purpose of this study was to investigate
the use of edge segmentation techniques to
enable the identification of specific flower
species from photographs of the flower. An
orchid native to Thailand, Paphiopedilum,
was chosen for the investigation. There are 14
species of this native orchid which has a
flower with complex striping making it
difficult to identify by visual inspection alone.
Only an expert can identify the specific
species in this way.
Edge segmentation is the process of detecting
a line around objects in an image. The line
around an object can be used for calculating
the area of that object, its shape and other
identifying characteristics of the object.
However, accurately finding the edge of the
object is not easy, particularly in low
resolution images where there is little
difference between the foreground and the
background. The light intensity of the image
is also a factor in being able to find the edge
of the object. In Edge-based segmentation of
an image, the edge refers to the area where
the change of gray scale is significant. There
are various characteristics of change which
we can refer to as step edge or ramp edge
(Lee, 2015). Step edge is the edge which
Proceeding Book of Sakon Nakhon Rajabhat University International Conference
ST-10
occurs from the gray scale value in the pixel
having a substantially higher value to that of
the next pixel. Ramp edge is the edge where
the change is gradual. Here, the Slope value is
inversely proportional to the blurring of the
border of the image itself.
Since the complexity and detail of orchids,
especially in this case the Paphiopedilum
orchid, makes identification quite difficult,
the idea pursued in this research is to offer a
convenient and easy way to achieve this. This
means providing a guide to the selection of
edge segmentation techniques which are best
suited to the purpose. In this paper, we
discuss detecting an edge by an edge
segmentation technique such as the Sobel
Method, the Prewitt Method, the Canny
Method, Laplacian of Gaussian Method or
Roberts Method to find the best and most
suitable method for each file type (.JPEG,
.PNG, .GIF, .BMP). The images of fourteen
species of Paphiopedilum were collected.
Then the five methods of edge segmentation
are applied. Finally, the analysis part was run
on MATLAB. Root Mean Square Error
(RMSE) is used for the comparison (Chai,
2014).
MATERIALS AND METHOD
Research on the performance analysis of the
Canny and the Sobel segmentation techniques
is shown in Fig. 1. Face recognition (Sattasit,
2006) is defined as the process of
automatically identifying and verifying a
person from a digital image of their face. Face recognition is one important application in
which edge segmentation plays a key role.
Computer based face recognition systems for
security applications are a widely researched
topic as facial features provide unique
biometric identity for users. Face recognition
systems are based on object recognition and
tracking technologies. One of the important
steps in object recognition is successful edge
identification and extraction.
Fig. 1 Face recognition (Rangarajan, 2015)
Another example, as shown in Fig. 2, is a
machine vision system for counting
corrugated cardboard (Siriamornrat, 2010).
This research presents a method for counting
the number of corrugated cardboard sheets
using a machine vision system and image
processing techniques.
Fig. 2 Machine vision system for counting
corrugated cardboard (Siriamornrat, 2010).
Edge Segmentation Techniques
Fig.3 illustrates an area of an image being
displayed as the binary value of the image pixels
(adapted from Saini, 2010).
Fig. 3 An area of the image being displayed as the
binary value of image pixel (adapted from Saini,
2010).
Proceeding Book of Sakon Nakhon Rajabhat University International Conference
ST-11
Sobel Method
The Sobel edge segmentation operation
extracts all of the edges in an image,
regardless of direction. The Sobel has the
advantage of providing both a differencing
and smoothing effect. It is implemented as the
sum of two directional edge enhancement
operations. Both of them are shown in Fig. 4.
Gx = [−1 0 +1−2 0 +2−1 0 +1
]; Gy = [1 2 10 0 0
−1 −2 −1]
Fig. 4 Masks used for the Sobel segmentation
technique (Rangarajan, 2015)
The operator consists of a pair of 3×3
convolution kernels. One kernel is simply the
other rotated by 90°. The kernels can be
applied separately to the input image, to
produce separate measurements of the
gradient component in each orientation (Gx
and Gy) the gradient magnitude is given by:
Equations (1) and (2)
|G| = √Gx2 + Gy
2 (1)
Typically, an approximate magnitude is
computed using:
|𝐺| = |𝐺𝑥| + |𝐺𝑦| (2)
Which is much faster to compute.
Gradient calculation is shown in Fig. 5
(Rangarajan, 2015). After that, the threshold
is calculated (Fig. 6). Threshold is the
simplest method of image segmentation.
From a grayscale image, thresholding can be
used to create binary images. When the value
of Equation (2) in the image is less than 12,
the threshold of that pixel is equal to 0. On the
other hand, if the value of Equation (2) in the
image is more than 12, the threshold of that
pixel is equal to 1. Where the value of
Equation (2) from the image is equal to 12,
the threshold of that pixel depends on the
value of the surrounding pixels.
Fig. 5 Gradient Calculation (Karnjanadecha,
2007).
Fig. 6 Threshold Calculation (Saini, 2010).
Prewitt Method
The Prewitt method (Rangarajan, 2015)
detects two types of edges - vertical and
horizontal edges. Edges are calculated by
using the difference between the
corresponding pixel intensities of an image.
The masks are called derivative masks. Fig. 7
shows a two mask matrices.
Gx = [−1 0 +1−2 0 +2−1 0 +1
]; Gy = [1 2 10 0 0
−1 −2 −1]
Fig. 7 Masks used for the Prewitt segmentation
technique (Rangarajan, 2015).
Gx = [+1 0
0 −1] ; Gy = [
0 +1
−1 0]
Fig. 8 Masks used for the Robert segmentation
technique (Saini, 2010).
Roberts Method
The Roberts method (Saini, 2010) performs a
simple, quick to compute, 2-D spatial gradient
measurement of an image. Pixel values at
each point in the output represent the
Image |𝐺| = |𝐺𝑥| + |𝐺𝑦| Threshold =12
Proceeding Book of Sakon Nakhon Rajabhat University International Conference
ST-12
estimated absolute magnitude of the spatial
gradient of the input image at that point. The
operator consists of a pair of 2×2 convolution
kernels as shown in Fig.8. Both kernels are
designed to respond maximally to edges
running at 45° to the pixel grid, one kernel for
each of the two perpendicular orientations.
The kernels can be applied separately to the
input image, to produce separate
measurements of the gradient component in
each orientation (Gx and Gy). These can then
be combined together to find the absolute
magnitude of the gradient at each point and
the orientation of that gradient. The gradient
magnitude is given by: Equations (3) and (4)
|G| = √Gx2 + Gy
2 (3)
Typically, an approximate magnitude is computed
using:
|𝐺| = |𝐺𝑥| + |𝐺𝑦| (4)
Which is much faster to compute.
Laplacian of Gaussian Method
The Laplacian is a 2-D isotropic measurement
of the 2nd spatial derivative of an image. The
Laplacian of an image highlights regions of
rapid change in intensity and is therefore
often used for edge detection. The Laplacian
is often applied to an image that has first been
smoothed. A Gaussian smoothing filter is
used in order to reduce the sensitive noise of
an image. The operator normally takes a
single gray level image as input and produces
another gray level image as output. Equation
(5) reveals the Laplacian L (x, y) (Shubham
Saini, 2010).
L(x, y) = 𝜕2𝐼
𝜕𝑥2 + 𝜕2𝐼
𝜕𝑦2 (5)
Since the input image is represented as a set
of discrete pixels, we have to find a discrete
convolution kernel that can approximate the
second derivatives in the definition of the
Laplacian. Three mask matrices are shown in
Fig. 9.
Gx = [0 1 01 −4 10 1 0
] ; Gy = [1 1 11 −8 11 1 1
]
Fig. 9 Masks used for the Laplacian of Gaussian
segmentation technique (Saini, 2010).
Because the measurement is calculated as a
second derivative, the measurement is an
approximation. So the image must first be
smoothed via the Gaussian Filter. This pre-
processing step reduces the high frequency
noise components prior to the differentiation
step. The 2-D LoG function with Gaussian
standard deviation is shown in Equation (6).
LoG(x, y) = −1
𝜋𝜎4[1 −
𝑥2+ 𝑦2
2𝜎2] 𝑒
− 𝑥2+ 𝑦2
2𝜎2 (6)
Canny Method
The Canny edge segmentation is totally
different from the previously described edge
segmentation techniques. It is an
approximation which allows optimization of
the edge-searching problem. The steps of
Canny (Saini, 2010) are shown in Fig. 10.
Fig. 10 Four Step calculation in the Canny
segmentation technique (Saini, 2010).
Proceeding Book of Sakon Nakhon Rajabhat University International Conference
ST-13
Step 1: Smoothing with Gaussian.
The first step is to remove noise. Using the
Gaussian filter framework, noise will be
reduced, resulting in a smoother image.
Step 2: Gradient Calculation
Find the gradient of the image. This shows the
changes in intensity, which indicates the
presence of edges. This actually gives two
results, the gradient in the x direction and the
gradient in the y direction.
Step 3: Non-maxima Suppression
Fig. 11 illustrates non-maximal suppression.
Edges will occur at the point where the
gradient is at the maximum. The magnitude
and direction of the gradient are computed at
each pixel (Saini, 2010).
Fig. 11 Borders and directions of the gradient
(Saini, 2010).
Fig. 12 Graph shows the range of value High
threshold and Low thresholds. (Saini,
2010)
Step 4: Threshold
The threshold (Saini, 2010) value is classified
into the high threshold (T1) and the low
threshold (T2). The graph in Fig. 12 shows
the range of T1 and T2. If the pixel value is
greater than T1 the threshold value of that
pixel is 1 and if the pixel value is less than T2
the threshold value of that pixel is 0. Where
the pixel value is between T1 and T2 the
threshold value can be either 1 or 0 depending
on the surrounding pixels.
Fig. 13 Conceptual Framework.
Root Mean Square Error (Chai, 2014)
The Root Mean Square Error (RMSE) is
measuring the difference between predicted
values. It is used to indicate the accuracy of
the predicted value
n
XXRMSE
n
i idelmoiobs
1
2
,, )(
(7)
CONCEPTUAL FRAMEWORK
This research consisted of three steps. Fig. 14
shows the conceptual framework.
Step 1: Collect & Convert Images. Images of
the Paphiopedilum orchard were collected
from various sources. The images were
converted into gray scale with resolution of
640x480 pixels. The images of each species
were saved into files of the four different
graphical types (.JPG, .PNG, .GIF and .BMP)
Collect & Convert (Grayscale and size image 640 x 480 pixel)
Proceeding Book of Sakon Nakhon Rajabhat University International Conference
ST-14
(a) is Gray scale. (b) is Sobel method. (c) is Canny
method. (d) is Prewitt method. (e) is Roberts
method. (f) is Laplacian of Gaussian method
Fig. 14 Paphiopedilum villosum image with
extension .JPEG and five segmentation algorithms
(a) is Gray scale. (b) is Sobel method. (c) is
Canny method. (d) is Prewitt method. (e) is
Roberts method. (f) is Laplacian of Gaussian
method
Fig. 15 Paphiopedilum villosum image with
extension .PNG and five segmentation algorithms
(a) is Gray scale. (b) is Sobel method. (c) is Canny
method. (d) is Prewitt method. (e) is Roberts
method. (f) is Laplacian of Gaussian method
Fig. 16 Paphiopedilum villosum image with
extension .GIF and five segmentation algorithms.
(a) is Gray scale. (b) is Sobel method. (c) is Canny
method. (d) is Prewitt method. (e) is Roberts
method. (f) is Laplacian of Gaussian method
Fig. 17 Paphiopedilum villosum image with
extension .BMP and five segmentation algorithms
Step 2: Apply the edge segmentation
techniques (Sobel Method, Prewitt Method,
Roberts Method, Canny Method and
Laplacian of Gaussian Method) on the images
in all four graphics image types from Step 1
by using MATLAB.
Step 3: Compare the Root Mean Square Error.
RMSE
Scope of data
1. Images of Paphiopedilum native species in
Thailand.
2. One image each of fourteen species of
Paphiopedilum.
3. Files in the formats .JPEG .PNG .GIF
.BMP (640x480 pixel)
Scope of Comparison
The analysis was undertaken on MATLAB
R2008b, comparing the five edge detection
methods: Sobel Method, Prewitt Method,
Roberts Method, Canny Method and
Laplacian of Gaussian Method.
Proceeding Book of Sakon Nakhon Rajabhat University International Conference
ST-15
RESULTS AND DISCUSSION
The results are shown in Fig. 14 – Fig.17. In
Fig. 14, Paphiopedilum villosum images with
.JPG extension were processed by the five
edge segmentation techniques. (a) is a gray
scale image. (b) is the result with the Sobel
method. (c) is the result with the Canny
method. (d) is the result with the Prewitt
method. (e) is the result with the Robert
method. (f) is the result with the Laplacian of
Gaussian. Other figures (Fig. 15 – Fig. 17),
are Paphiopedilum villosum images in the
order .PNG, .GIF and BMP.
The comparison of RMSE is shown in Table
1.
TABLE 1 Value of the Root Mean Square Error
Each of the extensions.
CONCLUSION
The comparison of Edge Segmentation
techniques on images of the Paphiopedilum
orchid was undertaken. The various edge
segmentation techniques investigated were
the Sobel method, Roberts method, Prewitt
method, Canny method and Laplacian of
Gaussian Method. Images of fourteen species
of Thai Paphiopedilum orchids were
collected. All of them were encoded and
converted into graphics format images; Joint
Photographic Experts Group - JPEG, Portable
Network Graphics -PNG, Graphics
Interchange Format -GIF and Bitmap Image
File – BMP. Each image was analysed by
each edge segmentation method via
MATLAB R2008B. The Root Mean Square
Error (RMSE) was calculated in order to
compare the results from each algorithm for
each species. The results show that the Canny
method is suitable for image segmentation in
the file extensions .JPEG and .GIF. In the
case of .PNG, the value of RMSE indicates
that the Prewitt method is appropriate for this
extension. The last one, .BMP, RMSE of the
Roberts method is the lowest.
REFERENCES
Chai, T. (2014). Root mean square error (RMSE)
or mean absolute error (MAE) –
Arguments against avoiding RMSE in the
literature. University of Maryland, USA
Karnjanadecha, M. (2007). Image Processing.
Prince of Songkla University, Songkla.
Kreawsuwan, J. (2006). Detecting and correcting
the orientation of the image by using a
support vector machine. B.A.Ed. thesis.
King Mongkut's Institute of Technology,
Bangkok.
Lee, T. (2015) Edge Detection Analysis. National
Taiwan University, Taiwan
Rangarajan, S. (2015), Algorithms for Edge
Detection. Retrieved from
http://www.ee.sunysb.edu/~cvl/ese558/s2
005/Reports/Srikanth%20Rangarajan/sub
mission.doc
Saini, S. (2010). Comparative study of image edge
detection algorithms. Vellore Institute of
Technology, India
Sattasit, A. (2006). The system detects speed limit
signs from video. M.S thesis, King
Mongkut's Institute of Technology,
Bangkok.
Siriamornrat, T. (2010). Sheet Counting Machine
Using Panoramic Vision System.
Retrieved from http://annualconference.ku.ac.th/cd53/08_
04 8_O318.pdf
Vijayarani, S. (2013). Performance Analysis of
Canny and Sobel Edge Detection Algorithms
in Image Mining. Bharathiar University, India
Name
type Sobel Canny Prewitt Roberts Log
.JPEG 0.165𝑥10−3 0.524𝑥10−4 0.165𝑥10−3 0.152𝑥10−3 0.906𝑥10−4
.PNG 0.164𝑥10−3 0.120𝑥10−3 0.184𝑥10−5 0.234𝑥10−4 0.819𝑥10−4
.GIF 0.159𝑥10−3 0.436𝑥10−4 0.159𝑥10−3 0.148𝑥10−3 0.848𝑥10−4
.BMP 0.165𝑥10−3 0.538𝑥10−4 0.165𝑥10−3 0.240𝑥10−4 0.753𝑥10−4