7
Detection of Contaminants in Cotton by using YDbDr Color Space Gurjinder Singh Sahdra Department of Computer Sci. and Tech. 111LPU University, Punjab, India 111[email protected] Abstract Contaminants in cotton plays important role for its poor quality. The digital image processing teqniques based on computer vesion provides a good way to eliminate such contaminants from cotton. This paper presents a robust algorithm for detection of contaminants in cotton. By converting the RGB images to YDbDr color space. YDbDr is composed of three components Y, Db and Dr. Y is the luminance, Db and Dr are the chrominance componants. By using YDbDr its helpful to distinguish luma and chroma information from RGB image. Iterative threshold segmentation is applied to binarize the image Y, Db, Dr. Performing fusion technique to the three binary images can fuse Luminance and chrominance image information together. For machine vision system. YCbCr and HSI color space has been implemented previously. In which the performance parameters like speed and accuracy of detection and also the detection of small contaminants or insects has to be improved. It is proved by experimental results that the YDbDr is effective and credible. Keywords: cotton contaminants; detection; YCbCr; HSI; YPbPr; YDbDr 1. Introduction Contamination has vital role in deciding the quality of cotton apart from essential properties such as length, strength, fineness. Contamination of raw cotton can take place at every step i.e. from the farm picking to the ginning stage. Contamination, even if it is a single foreign fibre, can lead to the downgrading of yarn, fabric or garments or even the total rejection of an entire batch and can cause irreparable harm to the relationship between growers, Kamaljot Singh Kailey Department of Computer Sci. and Tech. LPU University, Punjab, India [email protected] ginners, merchants, spinner and textile and clothing mills [1]. An International Textile Manufacturers Federation (ITMF) reported that claims due to contamination amounted to between 1.4 3.2% of total sales of 100% cotton and cotton blended yarns [2]. A fairly large number of cotton fibers recognition researches are based on RGB color space and YCbCr color space. However, color information is not well presented and extracted in RGB color space due to its limitations and some deficiencies. Reference [1] proposed Identification of Cotton Contaminants Using Neighborhood Gradient Based on YCbCr Color Space. Reference [2] proposed HSI color space to detect Foreign Fibers And Cotton Contaminants. In this paper we separate luminance and chrominance information in YDbDr color space. And design a cotton contaminants and foreign fibers detection algorithm. Thresholding iteration method is used to image binarizing process. 2. Design of the Proposed System 2.1 Diagram of Contaminants Detection System. The diagram of cotton contaminants detection system is shown in fig. 1, which consists of two main parts. First part is cotton image collection part and the second part is the contaminants detection part. In first part we collect images of raw cotton layers on the time of ginning and images are converted into digital signal through A/D conversion and sent to image processing system. Where needed features are extracted according to Luminance and chrominance by applying YDbDr color space and after the needed processing of the images of cotton the resulted image will be produced which will collect the information about contaminants or non contaminants. Finally after processing images will be printed in printer. Gurjinder Singh Sahdra et al ,Int.J.Computer Technology & Applications,Vol 3 (3), 1118-1124 IJCTA | MAY-JUNE 2012 Available [email protected] 1118 ISSN:2229-6093

2 nov

Embed Size (px)

DESCRIPTION

newspaper

Citation preview

Page 1: 2 nov

Detection of Contaminants in Cotton by using YDbDr Color Space

Gurjinder Singh Sahdra

Department of Computer Sci. and Tech.

111LPU University, Punjab, India

[email protected]

Abstract

Contaminants in cotton plays important role for its

poor quality. The digital image processing teqniques

based on computer vesion provides a good way to

eliminate such contaminants from cotton. This paper

presents a robust algorithm for detection of

contaminants in cotton. By converting the RGB

images to YDbDr color space. YDbDr is composed of

three components Y, Db and Dr. Y is the luminance,

Db and Dr are the chrominance componants. By

using YDbDr its helpful to distinguish luma and

chroma information from RGB image. Iterative

threshold segmentation is applied to binarize the

image Y, Db, Dr. Performing fusion technique to the

three binary images can fuse Luminance and

chrominance image information together. For

machine vision system. YCbCr and HSI color space

has been implemented previously. In which the

performance parameters like speed and accuracy of

detection and also the detection of small

contaminants or insects has to be improved. It is

proved by experimental results that the YDbDr is

effective and credible.

Keywords: cotton contaminants; detection;

YCbCr; HSI; YPbPr; YDbDr

1. Introduction Contamination has vital role in deciding the quality

of cotton apart from essential properties such as

length, strength, fineness. Contamination of raw

cotton can take place at every step i.e. from the farm

picking to the ginning stage. Contamination, even if

it is a single foreign fibre, can lead to the

downgrading of yarn, fabric or garments or even the

total rejection of an entire batch and can cause

irreparable harm to the relationship between growers,

Kamaljot Singh Kailey

Department of Computer Sci. and Tech.

LPU University, Punjab, India [email protected]

ginners, merchants, spinner and textile and clothing

mills [1]. An International Textile Manufacturers

Federation (ITMF) reported that claims due to

contamination amounted to between 1.4 – 3.2% of

total sales of 100% cotton and cotton blended yarns

[2]. A fairly large number of cotton fibers recognition

researches are based on RGB color space and YCbCr

color space. However, color information is not well

presented and extracted in RGB color space due to its

limitations and some deficiencies.

Reference [1] proposed Identification of

Cotton Contaminants Using Neighborhood Gradient

Based on YCbCr Color Space. Reference [2]

proposed HSI color space to detect Foreign Fibers

And Cotton Contaminants. In this paper we separate

luminance and chrominance information in YDbDr

color space. And design a cotton contaminants and

foreign fibers detection algorithm. Thresholding

iteration method is used to image binarizing process.

2. Design of the Proposed System 2.1 Diagram of Contaminants Detection

System. The diagram of cotton contaminants detection

system is shown in fig. 1, which consists of two main

parts. First part is cotton image collection part and

the second part is the contaminants detection part. In

first part we collect images of raw cotton layers on

the time of ginning and images are converted into

digital signal through A/D conversion and sent to

image processing system. Where needed features are

extracted according to Luminance and chrominance

by applying YDbDr color space and after the needed

processing of the images of cotton the resulted image

will be produced which will collect the information

about contaminants or non contaminants. Finally

after processing images will be printed in printer.

Gurjinder Singh Sahdra et al ,Int.J.Computer Technology & Applications,Vol 3 (3), 1118-1124

IJCTA | MAY-JUNE 2012 Available [email protected]

1118

ISSN:2229-6093

Page 2: 2 nov

Figure 1: Diagram of cotton contaminants detection

system

2.2 Algorithm for Detection of Cotton

Contaminants. Our proposed method firstly transforms the RGB

color space images into YDbDr color space to obtain

luminance component Y and chrominance

components Db and Dr. after getting three different

images Y, Db and Dr. The iterative threshold

algorithm is used for image binarization of three

images Y, Db and Dr. after binarization the three

binary images are fused to get the final fused image.

The final fused image is obtained as the resulted

image of the contaminants detection algorithm.

Figure 2: Flowchart of cotton contaminants detection

algorithm.

3. Analysis of Cotton Contaminants After analyzing plenty of cotton impurity images,

we find that the gray value of cotton fibers is white or

mainly concentrates on a range near to it under

natural lighting conditions. Due to the different

illumination intensity, cotton fiber properties and

level, the position of cotton fiber

pixel have some difference in color space. On the

whole, the pixels in color space meet some certain

distributions under certain light. Common foreign

fiber contaminants in color space have the following

several distributions.[1]

Color is darker near to black, and the gray

value is low, such as black hair and particles

from cottonseed, etc.

Color is much lighter and easy to reflect

with high brightness, such as plastic fiber

and mulch, etc.

Color is not pure, but deviate into a kind of

color, such as colored cotton thread and

polypropylene fiber, etc.

Color is near to cotton fiber, such as wool

and white hair, etc.

4. Selection of Color Space There are different types of color spaces exit. All

the color spaces are for different applications.

Selecting the appropriate color space is the primary

stage for color image processing. Proper color space

can not only save calculation, but also avoid missing

useful information as far as possible.[2]

4.1 RGB Color Space RGB color space is the most fundamental and

commonly used color space of image processing.

Color information initially collected by image

acquisition devices is RGB value, which is also

finally used by color display devices. RGB model

uses three basic components values of R, B and G to

represent color. In this system, any color calculated is

all within the RGB colorized cube. However, RGB

color space has great shortcomings, the main one of

which is that it is not intuitionistic, so it is hard for us

to know color’s cognitive attributes expressed by a

value from its RGB value. Then, RGB color space is

one of the most uneven color spaces, as the visual

difference between two colors cannot be expressed as

the distance between two color points. In addition,

the correlation between RGB is much high, and RGB

space is sensitive to noise in low intensity area.[1]

4.2 YCbCr Color Space YCbCr, Y′CbCr, or Y Pb/Cb Pr/Cr, also written as

YCBCR or Y′CBCR, is a family of color spaces used as

a part of the color image pipeline in video and digital

photography systems. Y′ is the luma component and

CB and CR are the blue-difference and red

Gurjinder Singh Sahdra et al ,Int.J.Computer Technology & Applications,Vol 3 (3), 1118-1124

IJCTA | MAY-JUNE 2012 Available [email protected]

1119

ISSN:2229-6093

Page 3: 2 nov

difference chroma components. Y′ (with prime) is

distinguished from Y which is luminance, meaning

that light intensity is non-linearly encoded

using gamma correction. Y′CbCr is not an absolute

color space; rather, it is a way of encoding

RGB information. The actual color displayed

depends on the actual RGB primaries used to display

the signal. Therefore a value expressed as Y′CbCr is

predictable only if standard RGB primary

chromaticities are used.[1]

4.3 HSI Color Space It is more often to think about a color in terms of

hue and saturation than in term of additive or

subtractive components. hue is the attribute of the

visual sensation to one of the perceived colors; red,

yellow, green and blue or combination of two of

them. Intensity it is the total amount of light passing

through a particular area. Saturation represents the

purity of color. HSL and HSV are the two most

common cylindrical-coordinate representations of

points in an RGB color model, which rearrange the

geometry of RGB in an attempt to be more

perceptually relevant than the Cartesian

representation.[2] 4.4 YPbPr Color Space YPBPR

is a color space used in video electronics, in

particular in reference to component video cables.

YPBPR is the analog version of the YCBCR color

space the two are numerically equivalent, but

YPBPR is designed for use in analog systems whereas

YCBCR is intended for digital video. YPBPR cables

are also commonly referred to as Yipper cables.

YPBPR is commonly called "component video", but

this is imprecise, as there are many other types of

component video, mostly RGB which syncs either on

green or one or two separate signals.

4.5 YDbDr Color Space

In this paper for our proposed algorithm we using

YDbDr color space. YDbDr is composed of three

components Y, Db and Dr. Y is the luminance, Db

and Dr are the chrominance components. The three

component created from an original RGB (Red,

Green, Blue) source. The weighted values of RG and

B are added together to produce a single Y signal,

representing the overall brightness, or luminance, of

that spot. The Db signal is then created by subtracting

the Y from the blue signal of the original RGB, and

then scaling, and Dr by subtracting the Y from the

red, and then scaling by a different factor.

These formulae approximate the conversion between

the RGB color space and YDbDr.

R,G,B,Y ∈ [0,1]

Db, Dr ∈ [-1.333,1.333]

RGB to YDbDr :

Y = + 0.299R + 0.587G + 0.114B

Db = - 0.450R – 0.883G + 1.333B

Dr = - 1.333R + 1.116G + 0.217B

RGB image YDbDr Image

Figure 3: RGB to YDbDr Conversion

These are the two images the first image is RGB

image of cotton and the second image is the

conversion of RGB to YDbDr color space.

Y component Db component Dr component

Figure 4: Separation of layers Y,Db and Dr

These are the three images of three different

components of YDbDr color space. As Y component

Db component and Dr component.

5. Experiments and Results 5.1 Experiments in YCbCr Color Space

RGB image YCbCr image

Figure 5: RGB to YCbCr conversion

Fig. 5 shows the conversion of RGB to YCbCr color

space.

.

Gurjinder Singh Sahdra et al ,Int.J.Computer Technology & Applications,Vol 3 (3), 1118-1124

IJCTA | MAY-JUNE 2012 Available [email protected]

1120

ISSN:2229-6093

Page 4: 2 nov

Y component Cb component Cr component

Figure 6: separation of Y, Cb and Cr components

Fig. 6 shows the separation of Y, Cb and Cr

components of YCbCr color space.

Y binary Cb binary Cr binary

Figure 7: binarization of three components

Fig. 7 shows the binary images of YCbCr color

space. These images are further used for fusion to

obtain the final result of the detection algorithm.

Figure 8: final fused image in YCbCr color space

Figure 8 shows the final resulted fused image of

YCbCr color space. It detect all three contaminants

but it just shows the outlines of the big leaf

contaminant the inner part of the contaminant is not

detected by YCbCr color space. This is the biggest

drawback of the YCbCr color space. And also the

clarity of the final fused image is not as per the

requirement. From our more experiments we

observed that the YCbCr color space is not well

suited for the detection of colors like brown, yellow

and many other light colors. YCbCr is only suited for

dark colors. This is another drawback of YCbCR

color space.

5.2 Experiments in HSI Color Space

RGB image HSI image

Figure 9: RGB to HSI conversion

Fig. 9 shows the conversion of RGB to HSI color

space.

H component S component I component

Figure 10: separation of H, S, I components

Fig. 10 shows the separation of three layers of HSI

color space

H binary S binary I binary

Figure 11: binarization of H, S, I

Figure 12: final fused image in HSI color space

Fig. 12 shows the final fused image of HSI color

space. It failed to detect all contaminants as we can

saw it misses two of the upper side contaminants. So

Gurjinder Singh Sahdra et al ,Int.J.Computer Technology & Applications,Vol 3 (3), 1118-1124

IJCTA | MAY-JUNE 2012 Available [email protected]

1121

ISSN:2229-6093

Page 5: 2 nov

it is proved that HSI color space is only able to detect

large contaminants but its not suitable for detection

of small contaminants in cotton.

5.3 Experiments in YPbPr Color Space

RGB image YPbPr image

Figure 13: RGB to YPbPr Conversion

Fig. 13 shows the conversion of RGB to YPbPr color

space.

Y component Pb component Pr component

Figure 14 separation of Y, Pb, Pr Components

Fig. 14 shows the separation of three layers of YPbPr

color space.

Y binary Pb binary Pr binary

Figure 15: binarization Y, Pb, Pr

Fig. 15 shows the binary images of YPbPr.

Figure 16: final fused image in YPbPr color space

Fig. 16 shows the final fused image of YPbPr color

space. It detect all three contaminants from the cotton

image. And also with more accuracy than YCbCr

color space and HSI color space.

5.4 Experiments in YDbDr Color Space

RGB image YDbDr image

Figure 17: shows the conversion of RGB to YDbDr

color space

Y component Db component Dr component

Figure 18: separation of YDbDr components.

Fig. 18 shows three layers of YDbDr color space

separately as Y, Db and Dr.

Y binary Db binary Dr binary

Figure 19: binarization of YDbDr

Fig. 19 shows the binary images of Y, Db, Dr

Figure 20: final fused image in YDbDr color space

Gurjinder Singh Sahdra et al ,Int.J.Computer Technology & Applications,Vol 3 (3), 1118-1124

IJCTA | MAY-JUNE 2012 Available [email protected]

1122

ISSN:2229-6093

Page 6: 2 nov

Fig. 20 shows the final fused and resulted image of

YDbDr color space. It detect all the contaminants

from the cotton image. With more accuracy than

YCbCr color space and HSI color space. And with

more clarity than YPbPr color space.

6. Comparison We compare these four color spaces on the bases of

four parameters like time taken, variance, standard

deviation, and mean. The comparison results are as. Figure 21 clearly shows the difference between these

four color spaces as we can saw that YDbDr color

space takes less time then the other three color spaces

HSI takes more time among all other color spaces.

Figure 21: Time taken by all color spaces

Figure 22: mean difference between color spaces

Fig. 21 shows the mean difference among all the

color spaces. Figure shows that mean is almost equal.

YCbCr and HSI are little bit on the higher side.

While YPbPr and YDbDr are both little bit less than

YCbCr and HSI color space.

Figure 23: variance difference between all color

spaces

Fig. 21 shows the variance of all the color spaces. As

we can saw that the variance difference of YDbDr

color space is on the higher side compared to other

three color spaces. YCbCr and HSI both color spaces

are on the lower side. As we compared them with

YPbPr and YDbDr color spaces. YPbPr is also one

half as compared with YDbDr color space.

Figure 23: standard deviation difference between all

color spaces.

Gurjinder Singh Sahdra et al ,Int.J.Computer Technology & Applications,Vol 3 (3), 1118-1124

IJCTA | MAY-JUNE 2012 Available [email protected]

1123

ISSN:2229-6093

Page 7: 2 nov

Fig. 23 shows the standard deviation difference

between the four color spaces. As we can saw that

standard deviation of YDbDr is on the higher side

then the other three color spaces.

7. Conclusion The paper presents the implementation and

comparative analysis of the YDbDr, YPbPr, YCbCr

and HSI color spaces for the detection of

contaminants from the cotton. One of the main

objective of this paper is to detect small contaminants

or insects from the cotton with more clarity which

was not possible in YCbCr and HSI color space.

Graph shows the comparison between these four

color spaces. on the basis of time taken, mean,

variance, and standard deviation. Which shows that

YDbDr is better than other three color spaces.

Figures also shows that the small contaminants and

insects are more accurately detected in YDbDr color

space. Compared to Previously implemented color

spaces YCbCr and HSI. Various experiments has

been carried out on different images of cotton having

different contaminants like grass, bark insects, fibres

of different materials and colors like red, green,

black, yellow etc. the performance of this algorithm

in YDbDr color space is also better than other

previously implemented algorithms.

8. Future Scope In future the implementation of this algorithm will

be purposed with any neural network technique for

classification. For automatic detection of

contaminants in real time.

References

[1] Chengliang Zhang, Xianying Feng, Lei Li, Yaqing Song (2010) “Identification of Cotton Contaminants Using

Neighborhood Gradient Based on YCbCr Color Space,”

2nd International Conference on Signal Processing Systems

(ICSPS), V(3), pp. V3-733 - V3-738 [2] Pooja Mehta; Naresh Kumar. “Detection Of Foreign

Fibers And Cotton Contaminants By using Intensity And

Hue Properties”, International Journal of Advances in

Electronics Engineering Publication year 2011. Page(s): 861 – 871

[3] Liu Shaojun, Wang Ku, "Detection of Damaged

Cottonseeds Using Machine Vision," ifita, vol. 2, pp.503-

506, 2009 International Forum on Information Technology and Applications, 2009

[4] Wenzhu Yang, Daoliang Lia, Xinhua Wei, Yuguo

Kang, Futang Li, “An automated visual inspection system

for foreign fiber detection in lint,” Computers and Electronics in Agriculture Volume 74 Issue 2, November,

2010 Pages 274-279

[5] Gaili Gao, Daoliang Li*, Shouhai Shang, Shulin Hou, “Accurate Time Control of Eliminating the Cotton Foreign

Fiber,” World Automation Congress (WAC), 2010 pages

235 – 240

[6] Rongfang Yuan; Beihai Zhou; Hui Qi; Huimin Yin;

“Bioinformatics and Biomedical Engineering,” 2009. ICBBE2009. 3rd International conference on Digital Object

Identifier: 10.1109/ICBBE.2009.5163239 Publication Year

2009, Page(s) 1-5

[7] Li Jingjing; Jiang Xiuming; Yang Gongyuan; “Electronic Measurement & Instruments (ICEMI),” 2011

10th International Conference on Volume: 2 Digital Object

Identifier: 10.1109/ICEMI.2011.6037764 Publication Year:

2011 , Page(s): 55 – 59 [8] Yupeng Zhang; Smith, P.W.; “Applications of

Computer Vision,” 2002. (WACV 2002). Proceedings.

Sixth IEEE Workshop on Digital Object Identifier:

10.1109/ACV.2002.1182156 Publication Year: 2002 Page(s): 51 – 56

[9] Jia Dong Yao; Ding Tianhuai; “Infrared and Millimeter

Waves,” 2004 and 12th International Conference on

Terahertz Electronics, 2004. Conference Digest of the 2004 Joint 29th International Conference on Digital Object

Identifier: 10.1109/ICIMW.2004.1422310 Publication

Year: 2004 , Page(s): 751 – 752

[10] A. Pai, H. Sari-Sarraf, E.F. Hequet, “Recognition of cotton contamination via X-ray microtomographic image

analysis,” IEEE Transactions on Industry Applications,

vol. 1, 2004, pp.77-85

[11] Tianhuai Ding, Xin Qu, “A real-time detection method for foreign fibers in cotton,” Chinese patent,

CN101403703, April,08,2009.

[12] Xianying Feng, Chengliang Zhang, Bingsheng Yang

and Lei Li,“Foreign fiber recognition and detection algorithm based on RGB color space,” Journal of

Shandong University(Engineering Science), Vol39, pp.

68-72, 2009.

[13] Caixia Guo, Jianchang Yuan, Shoufeng Jin, “Recognition algorithm of the foreign fibers in cotton by

BP neural networks,” Journal of Xi'an University of

Engineering Science and Technology, Vol. 20, pp. 542-

544, 2006. [14] Dongyao Jia and Ding Tianhuai, "Detecting foreign

fibres in cotton using a multi-spectral technique,"

Tsinghua Science and Technology, Vol. 45, pp. 193-196,

2005. [15] X in and Huai “ A Fast Feature Extraction Algorithm

for Detection of Foreign Fibre in Lint Cotton within a

Complex Background,” vol. 36, No 6 june, 2010

[16] Boshra D.Farah, “Measurements of trash contents and

grades in cotton using digital image analysis”. Proceedings

of ICSP’96 1545-1548

[17] Siddaiah, Murali, “Identification of trash types in

ginned cotton using neuro fuzzy techniques,” IEEE International Conference on Fuzzy Systems, v 2, 1999,

738-743

Gurjinder Singh Sahdra et al ,Int.J.Computer Technology & Applications,Vol 3 (3), 1118-1124

IJCTA | MAY-JUNE 2012 Available [email protected]

1124

ISSN:2229-6093