Professional Documents
Culture Documents
1)
Abbasgolipour et al. / Implementation of an Efficient Image Processing Algorithm / pp. 31-34
Submitted: 22/10/2009
Accepted: 12/01/2010
Appeared: 16/01/2010
HyperSciences.Publisher
Abstract— In order to extract useful features of captured images of bulk raisins by image processing
technique, an efficient algorithm was developed and implemented in visual basic language. The proposed
machine vision system consists of a video camera, a capture card, a lighting adjustable tunnel, a personal
computer, and mechanical part. The developed algorithm initially extracts the raisins by removing the
background from the taken images. It then sorts the raisins according to their RGB color and size
features. By a suitable combination of length and RGB color values raisins are graded it two classes.
Final step in the algorithm is the calculation of the center of gravity of each raisin to be later used for
automatic sorting and rejection of bad raisins. The proposed system was developed and tested and results
show that its accuracy is about 96%.
Keywords: Grading, Bulk raisin, Image processing, Machine vision, RGB, Color features, Software.
abolish inconsistent manual evaluation, and reduce
dependence on available manpower. Researches in this area
NOMENCLATURE indicate the feasibility of using machine vision systems to
CCR correct classification rate improve product quality while freeing people from the
traditional hand sorting of agricultural materials. Raji and
CCD charge-coupled device
Alamutu (2005) reviewed recent developments and
CoG canter of gravity applications of image analysis and computer machine vision
GUI graphical user interface in sorting of agricultural materials and products in the food
L length of each raisin industries. Basic concepts and technologies associated with
NBP number of bad raisins computer vision, a tool used in image analysis and automated
sorting were highlighted.
NGP number of good raisins
RGB Red-Green-Blue color coordinate system Computer vision has been used for quality inspection of
Ratio color ratio fruits. Quality inspections of fruits have two different
objectives: quality evaluation and defect finding. Machine
X G , YG coordinates of canter of gravity vision is the most important tool for external feature
Yi coordinate of the entering point measurements such as color intensity, color homogeneity,
Ymid the middle of the column bruises, size, shape and stem identification (Lee et al., 1999;
coordinate of the exit point Majumdar and Jayas, 2000; Shahin and Symons, 2001;
Yo
Paliwal et al., 2003; Shigeta et al. 2004). In a series of papers,
Njoroge et al. (2003) described the operations and
1. INTRODUCTION performance of an automated quality verification system for
agricultural products. Kondo et al. (2005) proposed a multi-
Raisin is one of the important and valuable exported products product grading system for agricultural products.
in Iran. Manual evaluation and sorting of raisin is costly and In recent years our research team have been conducting
inherently unreliable due to its subjective nature. The poor considerable research in the design and fabrication of sorting
classification and sorting methodology has caused a reduction machines. Omid, et al. (2009) developed an automatic
of exported product. Automatic raisin sorting system based trainable classifier, based on artificial neural network, for
on machine vision can improve the quality of the product, separating four different varieties of pistachio nuts. The
*
The financial support provided by the University of Tehran, Iran.
developed system, because of none destructivity, does not By studying and composing physical properties of the
cause damage to the open shell pistachio kernels, and machine vision system it can be understood that what is
therefore does not cause rejection by the consumer. Hence it defined as color by human. Color spaces are mathematical
can boost the exports. Lorestani et al. (2006) applied fuzzy perception of these properties. All color spaces are three
logic as a decision support system to grade golden delicious dimensional right angled coordinate systems that are shown
apples. Features such as color and size are measured through in Red, Green and Blue (RGB) spaces as intensities of red,
a data acquisition system consisted of apple’s sorter, webcam green and blue lights. Each color pixel in digital image
and a PC. Khojastehnazhand et al. (2009) developed a possesses a value between 0 to ( 2 24 − 1 ). For every pixel the
machine vision system to automatically determine the volume RGB values are determined by Eq (1):
and surface area of orange. This image processing procedure
can be readily applied to other axi-symmetric agricultural P( X , Y ) = B × 216 + G × 2 8 + R (1)
products such as eggs, pearl, pepper, carrot, limes and onions.
In order to grade the raisins into several groups (classes), a
The objective of this paper was to develop an efficient new algorithm was devised. For the sack of simplicity, here
algorithm for grading bulk raisins. In the following sections the case of sorting raisins in two classes of desirable and
the design and implementation of algorithm is presented and undesirable are presented. The RGB values are determined
discussed. using the following VB code for all pixels of background:
2. MATHERIALS AND METHODS Private Sub RGBcolor (ByVal Point As Long)
Blue = Point \ 256 ^ 2
2.1 Total system description Temp = Point Mod 256 ^ 2
Green = Temp \ 256
Color and size are the most important features for accurate Red = Temp Mod 256
grading of bulk raisins. Accordingly, a machine vision
system for grading raisins by color and size features was End Sub
designed and implemented. A picture of the prototype sorter
is shown in Fig. 1. 2.2 Machine vision algorithm
The hardware includes: a conveyer belt (80 cm in length and The algorithm consists of the following four steps (Fig. 2):
25 cm in width), an induction motor (MotoGen: Iran, 0.37 1. Background separation,
KW, 380V, 2.1A), a black box (lightning chamber), light 2. Program control transition,
sources, a video camera (Video Hi8, CCD-TRV128E PAL), a 3. Searching the lower and upper pixels about the
capture card (WinFast DV 2000) and a PC. middle of each column,
4. Extracting the required features and
characteristics.
In the case of raisin detection, it is essential to correctly
divide images into regions which are desired (raisins with
desired color content), undesired (raisins with undesired color
content) and background (surface of convertor).
Remove
Background
Fig. 1. Machine vision system for grading raisins.
Program control transition to
the middle of raisins column
As seen in Fig.1, raisins are discharged on the belt at the
entrance of the conveyer belt. The raisins pass below the
lightning chamber, located 27 cm away from the entrance. A Exploring lower and upper pixels
video camera mounted above the chamber, takes a then the middle of each column
32
International Journal of Signal and Image Processing (Vol.1-2010/Iss.1)
Abbasgolipour et al. / Implementation of an Efficient Image Processing Algorithm / pp. 31-34
.
Fig. 3. Histograms of blue color changes for background,
good and bad raisins.
IF (R >Rmin AND R<Rmax) AND (G >Gmin AND G The sample images of raisins used to test the proposed
<Gmax) THEN algorithm is shown in Fig. 5a. Result of applying the fore
NGP=NGP+1 mentioned algorithm is shown in Fig. 5b.
Else
NBP=NBP+1 From Fig. 5b it is observed that, firstly background has been
End IF segmented, secondly the bad-colored raisins are shown as
blue, and thirdly the raisins with inappropriate length are
Finally, upper pixels are examined and the total NGP and highlighted. The proper separation of background supports
NBP for a column are calculated. Useful details about an our selection of blue color for the algorithm. It is concluded
individual raisin can be obtained using the following this selection is very effective in correct raisin detection.
equations:
X + Xo Table 1 shows the confusion matrix obtained from tests on
XG = i (2) both of good and defected raisins and comparison of
2 proposed image processing algorithm with human expert.
Y + Yo The overall precision or correct classification rate (CCR) of
YG = i (3)
2 this image processing system was estimated as 96 percent by
comparison of proposed algorithm and human expert.
L = ( X o − X i ) 2 + (Yo − Yi ) 2 (4)
33
International Journal of Signal and Image Processing (Vol.1-2010/Iss.1)
Abbasgolipour et al. / Implementation of an Efficient Image Processing Algorithm / pp. 31-34
REFERENCES
Khojastehnazhand, M., Omid M. and Tabatabaeefar, A.
(2009). Determination of orange volume and surface area
using image processing technique. International
Agrophysics, 23, 237-242.
34