You are on page 1of 8

International Journal of Mechanical and Production

Engineering Research and Development (IJMPERD)


ISSN (P): 2249-6890; ISSN (E): 2249-8001
Vol. 7, Issue 3, Jun 2017, 87-94
TJPRC Pvt. Ltd.

IMPROVED EDGE DETECTION IN HSV COLOR SPACE

JAEHO YANG1, GANGSEONG LEE2, YOUNGPYO HONG3 & SANGHUN LEE4


1
Department of Plasmabiodisplay, Kwangwoon University, Seoul Korea
2,4
Department of Ingenium College of Liberal Arts, Kwangwoon University, Seoul Seoul Korea
3
Department of Hospital Management, International University of Korea, Jinju Korea
ABSTRACT
Background/Objectives

In this paper, we propose a new method to convert image data into HSV color space data separated into three
color channels in order to implement merged edge detection techniques after a noise removal in the S channel.
Methods/Statistical analysis: The proposed algorithm was used with Gaussian blur pre-processing to reduce the noise in
the image, unlike how a Sobel operator is commonly applied to a grayscale image after 3-channel color space separation
on the image where the edge is detected. After the color space has been converted to the HSV color space according to
binary human vision from a conventional RGB color space, each of the channels (H,S,V) is separated using the Sobel
Operator. Findings: The results for each channel are compared, and then the surrounding pixel and comparison

Original Article
operations are executed to remove contour noise occurring in the S Channel. Improvements/Applications: In this
manner, the noise removal filter is applied, and finally, the S and V channels are combined applying a filter to the end
result and showing that the edges have been effectively detected.

KEYWORDS: Gaussian Blur, Edge Detection, RGB to HSV Conversion & Removal Noise filter

Received: Mar 28, 2017; Accepted: Apr 24, 2017; Published: May 05, 2017; Paper Id.: IJMPERDJUN201711

1. INTRODUCTION

Data Edge detection is an important technique that has been implemented in a wide variety of imaging
applications, and a basic step in such image processing techniques is to detect the boundary of an object at
different points in the extracted image or to identify text1. Different operators are useful during edge detection,
including a Canny operator, Sobel operator, and Prewitt Operator2,3. Of these, the Sobel operator has the advantage
that it can be robust against noise in all directions of the edge extraction. Nevertheless, it generates a gray scale
image for detection for which more than 90% of color loss occurs instead of carrying out edge detection in color
space4,5.

In this paper, we conduct edge detection in color space to improve upon the limitations of edge detection
in grayscale6. The R, G, B color space is a widely used color space, but it is not suitable for in certain cases
because people are very sensitive to changes in brightness. Therefore, the R, G, B color space provides
information that does not correspond to the sensitivity of the human eye7. In this paper, each color is divided after
converting the original image into the HSV color space to include brightness information, and the Sobel operation
is conducted for each of the H, S, V channels. The noise removal filter is used on the edge of the S channel
according to the contour back conditions by comparing the center pixel to those in four directions (up, down, left,
right). Finally, we propose an algorithm to merge the image contour of the V-channel in order to obtain a more

www.tjprc.org editor@tjprc.org
88 JaeHo Yang, GangSeong Lee, YoungPyo Hong & SangHun Lee

effective edge detection result for the contour than what can be obtained in grayscale operations.

2. RELATED RESEARCH
2.1. Gaussian Blur

Noise removal is an important step for image processing8,9,10, and the Gaussian blur technique uses a Gaussian
function as a large-blurring algorithm to soften the image. The mask calculated from the Gaussian function convolution
processes a set of surrounding pixels for each pixel to save a new pixel value. The Process of Gaussian blur is as follows.
For a pixel in the image (x,y), (sigma) is the standard deviation and G (x, y) is the value of the applied pixel as the
Gaussian blur.

G x, y =
(1)

The size of the Gaussian blur mask is 1,3,5,... and can be set to an odd number such. We thus use the 3 X 3 mask
value for the mask matrix as follows.

G x, y = (2)

When comparing an original image with one processed with a Gaussian blur (Figure 1), the noise suppression can
be seen to soften the cross-sectional area of the binary image.

Figure 1: (a) Original Image (b) Result Image of Sobel Operator

2.2. RGB and HSV Color Space

The RGB color space consists of the red, green, and blue primary colors. When each color is added to the mixture,
the brightness increases. However, RGB color information does not provide saturation and brightness11, and the HSV color
space indicates the color brightness (H), saturation (S), and degree of light and dark for a particular color (V)12. The RGB
image information does not properly indicate the change in brightness in the image in a manner that corresponds to human
vision. Thus, contour detection in a color image is carried out after color space conversion to HSV13. The conversion to the

Impact Factor (JCC): 6.8765 NAAS Rating: 3.11


Improved Edge Detection in HSV Color Space 89

HSV color space from the RGB color space is as follows. The procedure is as follows.

" # $ % # & ''


!
H = (3)
( # $ % # & $ &

"-./ 0, 1, 2 '
,
S=1+ (4)
#%$%&

V 04142
,
(5)

2.3. Sobel Operator

The boundary of the object in the image, or the edge, is detected according to the presence of an object using
various edge detection methods, including the Prewitt, Canny, Sobel, and Roberts techniques. The Sobel operator is a
method that extracts the line of an edge14,15 with
th strong noise, and it is an exemplary method that uses the first derivative
value to extract an edge in any direction applying a horizontal mask and vertical mask. Since the image data is arranged in
constant intervals without a mathematical differential operation, it is calculated by obtaining the difference between the
adjacent pixels. The Sobel horizontal mask and the vertical mask operator are as follows.

(6)

(7)

Figure 2: (a) Original Image (b) Resulting Image with the Sobel Operator

3. PROPOSED WORK

In this paper, a Gaussian filter is applied after converting an image into the HSV color space from the RGB color
space where H, S, and V comprise each channel. After that, the Sobel operator is performed in each channel to detect the
edges. Before merging each detected image, a 3x3 mask is applied to the S channel to remove unwanted texture, and then
the S channel is merged with V to show the final results.

www.tjprc.org editor@tjprc.org
90 JaeHo Yang, GangSeong Lee, YoungPyo Hong & SangHun Lee

Figure 3: A Flow Chart of Proposed Method

3.1. Converted to HSV Color Space in the RGB Color Space after Using Edge Detection Sobel Operator

The image is converted to the HSV color space from the RGB color space, and the HSV channels are divided to
then produce the respective edges after applying a Sobel operator. Finally, the edges detected from the S and V channels
are merged into one image. Figure 4 shows a comparison of the results of the Sobel operator for the RGB color space and
HSV color space. The results shows that in the RGB color space, noise in the data results in edges and blocks not being
detected, but the HSV color space can detect edges and blocks like of the noise.

Figure 4: (A) Result Image of Sobel Operator in RGB


(B) Result Image of Sobel Operator in HSV

3.2. Using the Edge Detection Sobel Operator in the H,S,V Channel

To obtain an outline for each component, the information is first divided into each of H, S, and V channels. The
H channel has a problem in that edges turn into blocks. In the S channel, there also has a problem in the texture for the
edges of the object.

Figure 5: (a) Resulting Image for the Sobel Operation in the H (b) Resulting Image for the
Sobel Operation in the S (c) Resulting Image for the Sobel Operation in the V

The above results show that only the S channel should be used without H and V channels.

Impact Factor (JCC): 6.8765 NAAS Rating: 3.11


Improved Edge Detection in HSV Color Space 91

3.3. Noise Removal Filter

Since the S channel indicates the color saturation, the Sobel operation can also be used to detect the edges and
texture due to certain characteristics. A 3x3 filter is used to remove the unnecessary textures, and Figure 6 shows the filter
operation.

Figure 6: Remove Noise Filter

The resulting mask is in one of four of the vertical and horizontal directions relative to the center pixel, and it is
)) value of the C pixel, which shows an original value or values of zero.
even greater than the threshold ()

5 6% ,7 < =
;
9 5 6,7 <=
5 6,7
5 6,7% < = @
:
5 6,7
5 6 ,7 < =
(8)
9
80 ?

Since the filter is applied to all values for all pixels in the image, the filter for the contour in the V-channel
V () is
as follows.

DDC BBC 6,7 (9)

Thus, the noise removal filter, removes unnecessary textures. Figure 7 shows the resulting image after applying
the noise removal filter in the V channel

Figure 7: (A) Result Image of Sobel in V Channel (B) Result Image of V Channel Using Proposed Filter

Figure 8 shows the process to find the optimal threshold for the filter, and it was measured at 50 units. The results
show that when the threshold is too low, there is less texture removal. If you go to a value of 100 or more for the threshold,
threshold
the contourr is deleted in addition to the unwanted texture.

www.tjprc.org editor@tjprc.org
92 JaeHo Yang, GangSeong Lee, YoungPyo Hong & SangHun Lee

Figure 8: (A) Proposed Method (=0) (B) Proposed Method (=50)


(C) Proposed Method (=100) (D) Proposed Method (=150)

4. EXPERIMENTAL RESULTS

This study use Open CV in Visual Studio 2013 on a Windows 7 environment. The following images show (a) the
original image, (b) RGB color space to gray scale conversion with the results of a Sobel operator, (c) RGB color space
after conversion to the HSV space and then applying a Sobel operator, (d) the proposed method ( = 50 ).

Figure 9: Edge Detection Result of Simple Image (A) Original Image (B) after the Conversion
RGB to Gray using Sobel Operator (C) after the Split RGB using
Sobel Operator (D) Proposed Method (=50)

Figure 9 shows the images resulting from an experimental run, showing that for a simple image, the result
provided by the proposed method (d) has detected more edges than that in the RGB color space (b).

Figure 10: Edge Detection Result of Complex Image (A) Original Image (B) after the Conversion
RGB to Gray using Sobel Operator (C) after the Split RGB using
Sobel Operator (D) Proposed Method(=50)

Figure 10 shows that the (c) more edges and textures are detected for many unnecessary objects in the RGB color
space converted into HSV, relative to that of a conventional RGB color space (b), but the proposed method (d) shows
results with clearer edges and removal of unwanted textures.

Impact Factor (JCC): 6.8765 NAAS Rating: 3.11


Improved Edge Detection in HSV Color Space 93

Figure 11: Edge Detection Result of Toys Image (A) Original Image (B) Gray Scale using Sobel Operator
(C) after the Split RGB using Sobel Operator (D) Proposed Method (=50)

Figure 11 shows many kinds of toys, and only a part of each toy is detected with a conventional RGB method, but
the proposed method shows the removal of unnecessary textures and detects the edges of the toys.

Figure 12: Edge Detection Result of Flower Image (A) Original Image (B) Gray Scale using Sobel
Operator(C) After the Split RGB using Sobel Operator (D) Proposed Method (=50)

Figure 12 shows the results of edge detection in an image of a flower. In a conventional RGB color space,
detection is weak in the central part of the flower (b). On the other hand, the proposed algorithm (d) accurately detects the
edges and removes unwanted textures.

5. CONCLUSIONS

This paper proposes a method for edge detection using the Sobel operator by first carrying out a conversion to the
HSV color space to produce single H, S, V channels in order to improve upon the shortcomings of the loss of color in the
RGB color space, which does not correspond with the sensitivity of the human eye. The results are first compared for each
of the H, S, V channels, and H is shown to produce unnecessary blocking edge detection. The S channel can be used to
remove the texture of the object using the proposed filter, so the S channel results are used after that. This process detects
more edges than a single channel. Future research based on this algorithm is proposed to study its use in image processing
techniques, such as object recognition and character recognition.

6. ACKNOWLEDGEMENTS

The present Research has been conducted by the Research Grant of Kwangwoon University in 2016

www.tjprc.org editor@tjprc.org
94 JaeHo Yang, GangSeong Lee, YoungPyo Hong & SangHun Lee

REFERENCES

1. Lianghai Jin, Enmin Song, Lei Li, and Xiang Li. A Quatemion Gradient operator for color image edge detection2013 IEEE
International Conference on Image Processing. 2013Sept, 15-18, pp. 3040-3044.

2. Wenshuo Gao, Lei Yang. An Improved Sobel Edge Detection. Computer Science and Information Technology (ICCSIT).
2010 July, 9-11, pp. 67-71.

3. B. Kaur, A. Garg. Mathematical morphological edge detection for remote sensing images. Electronics Computer Technology
(ICECT), 2011 3rd International Conference on. 2011 April, 8-10, pp. 324-327.

4. Jianping Fan, Walid G. Aref, Monhand-Said Hacid, Ahmed K. Elmagarmid. An improved automatic isotropic color edge
detection technique, Pattern Recognition Letters.2001 Feb, 14, pp. 1419-1429.

5. Sarif Kumar Naik, C A Murthy, Standardization of edge magnitude in color images, IEEE Transactions on Image
Processing, 2006 Aug, 14, pp. 2588-2595.

6. Xin Chen, Houjin Chen. A novel color edge detection algorithm in RGB color space. IEEE 10th INTERNATIONAL
CONFERENCE ON SIGNAL PROCESSING PROCEEDINGS.2010 Oct, 24-28, pp. 793-796.

7. R. C. Gonzalez, and R. E. Woods. Digital ImageProcessing. 3rd edition, Pearson. 2008.

8. L. Yin, R. Yang, M. Gabbouj, and Y. Neuvo. Weighted median filters: a tutorial. IEEE Trans. Circuits and Systems II: Analog
and Digital Signal Processing2002 Aug, 06, pp. 157-192.

9. P. S. Marc and J. S. Chen. Adaptive smoothing: a general tool for early vision. Computer Vision and Pattern Recognition,
1989. Proceedings CVPR '89., IEEE Computer Society Conference on. 1989Jun, 4-8, pp. 618-624.

10. S. Wesolkowki, M. E. Jernigan, and R. D. Dony, Comparison of color image edge detectors in multiple color spaces, in Proc.
Int. Conf. Image Processing, 2000 Sept, 10-13.

11. Zhongshui Q U, Jianwei Wang, A Color YUV Image Edge Detection Method Based on Histogram Equalization
Transformation,2010 Sixth International Conference on Natural Computation, 2010, Aug, 10-12, pp. 3546-3549.

12. Lih-Jen Kau, Tien-Lin Lee, An HSV Model-based Approach for the Sharpening of Color Images, 2013 IEEE International
Conference on Systems, Man, and Cybernetics, 2013, Oct, 13-16, pp. 150-155.

13. Liu Feng; Lu Xiaoyu, Chen Yi, An efficient detection method for rare colored capsule based on RGB and HSV color
spaceGranular Computing (GrC), 2014 IEEE International Conference on, 2014, Oct, 22-24, pp.175-178.

14. Zhang Jin-Yu, Chen Yan, Huang Xian-Xiang, Edge Detection of Images Based on Improved Sobel Operator and Genetic
Algorithms, 2009 International Conference on Image Analysis and Signal Processing, 2009, April, 11-12, pp. 31-35.

15. D. Vaishnavi, T. S. Subashini. Image Tamper Detection based on Edge Image and ChaoticArnold Map. Indian Journal of
Science and Technology. 2015 Mar, 8(6), pp. 548-555.

16. P. Sujatha, K. K. Shdha. Performance Analysis of Different Edge Detection Techniques for Image Segmentation. Indian
Journal of Science and Technology. 2015 July, pp.1-6.

Impact Factor (JCC): 6.8765 NAAS Rating: 3.11

You might also like