 Open Access
 Total Downloads : 829
 Authors : Neetika Bairwa, Navneet Kumar Agrawal
 Paper ID : IJERTV3IS090643
 Volume & Issue : Volume 03, Issue 09 (September 2014)
 Published (First Online): 23092014
 ISSN (Online) : 22780181
 Publisher Name : IJERT
 License: This work is licensed under a Creative Commons Attribution 4.0 International License
Counting of Flowers using Image Processing
Neetika Bairwa M Tech Student Department of ECE
CTAE, MPUAT, Udaipur
Navneet Kumar Agrawal
Assistant Professor Department of ECE
CTAE, MPUAT, Udaipur
Abstract Flower counting is used in yield estimation of a particular crop using precision agriculture (PA) [1]. The current manual counting is erroneous and timeconsuming [2]. The counting algorithm given by Sarkate, et. al. [3] is suffering from overlapping problem. To fulfill this challenge, we develop an algorithm for computer visionbased system for automated, fast and precise counting of flowers.
In developed algorithm we count yellow Gerbera flower captured under polyhouse. Detection and counting of flower can be done using HSV color space [4] and Circular Hough Transform (CHT) [5]. 15 images are processed and their simulation results shows that the counting of flowers giving accuracy of 95.01% using developed algorithm which is much better than algorithm given by Sarkate, et. al. 2013.
The developed algorithm is also applied on Marigold flower captured in open field having accuracy of 94.66% and Coltsfoot flower which are taken from internet having accuracy of 84.50%.
KeywordsCircular Hough Transform; Computer vision; Counting Algorithm; Yield Prediction.

INTRODUCTION
Floriculture is a discipline of horticulture concerned with the cultivation of flowers and ornamental plants for floral industry and for garden. Floriculture crops include houseplants, bedding plants, pot plants and cut flowers. Cut flower is used in business in which flower are usually sold in bunches or as bouquets with foliage. Cut flowers are used in drink, decoration, for making medicine, cosmetics, etc.
Precision agriculture offers a way to automated site specific management application to improve economic and environmental sustainability. Yield prediction is an important step in PA using computer vision system. Yield prediction is done by counting of flower in the field. In manual count, results are erroneous due to greater amount of exhaustion of a continuous and repetitive work. The process is also tedious and time consuming.
Sarkate, et al. [5] counted Gerbera flowers using HSV color space and histogram analysis. Proposed algorithm did not give accurate results for overlapped flowers. Harmsen et al. [6] did flower counting using a multi target tracking algorithm that accurately identifies the relevant characteristics of the flower. The plant rotates in front of a camera, and a series of consecutive pictures are taken. Tracking algorithm detects, predicts, and count flowers in number of plants.
Salvo et al. [7] predicted blueberry based on counting of the number of flower buds. Bud counting relates the number
of enough fruit for the harvest and also relates weather variable. Dorz et al. [8] estimated tangerine yield by counting of tangerine flower using machine vision. Flowers are counted with the help of Gaussian filter and RGB color detection method.
Counting algorithm is an important step in yield estimation so that it should be accurate and precise. If yield is overestimated, the money will be lost in preorders of ships and trucks and a large investment may be blocked because of excessive packaging. If underestimated, problem of insufficient packers, packing material, collectors and lack of time to arrange vehicles [1].
It is the need of the hour to develop an automatic counting algorithm to facilitate the task and do it quickly, with greater accuracy and precision. In the present study we developed a decision support system that could generate results for counting of flowers and which will be useful in yield information and serve as base for management & planning of flower marketing.

MATERIAL AND TOOLS
Gerbera flower images are captured at Hauser, Tamil Nadu under polyhouse and Marigold images are taken from Rajasthan Agriculture College, Udaipur in open field using digital camera (Nikon 11 Megapixels). Coltsfoot flower images are downloaded from the internet. Figure 1 shows some sample test images. The distance between the camera and the flower is 1 to 4 meters. Images are not used directly. They are resized into 500X300 pixels. In the experiment images were processed using Dual Core processor with 2 GHz frequency and 2 GB RAM. Experiment was carried out on MATLAB R2013a.

Gerbera flower images in polyhouse

Marigold flower images in open field

Coltsfoot flower images downloaded from the internet
Fig.1. Sample test images


PROPOSED ALGORITHM
For the counting algorithm the entire process is divided into small sections. Figure 2 gives the process flow chart, to be carried out for the simulation work.

Preprocessing of image
Images were taken in sections of the polyhouse and field because view of entire field is strenuous to capture in individual image. Also image containing big area of field may result in blurring and thereby poor discrimination of the flowers. Therefore, images were taken in parts of the field and processed individually. Gaussian filter is used for smoothing and enhancement of image. Gaussian filter is an image processing filter whose impulse response is Gaussian function. It is designed to minimize rise and fall time with no overshoot. This property provides the minimal group delay. Gaussian filter enhances the input image by convolution with Gaussian function [9].

RGB image to HSV color image conversion
For flower recognition in counting algorithm three different types of method are possible using shape, color and texture. HSV color space is used for flower color extraction. A threedimensional representation of the HSV color space is a hexagon where the angular axis represents the hue shown in figure 3. Hue is defined as an angle of interval 0 to 2 with respect to red axis. Red has an angle 0, green has 2 /3, blue
4 / 3 and red again at 2 [10]. The image is usually expressed in RGB color space. The transformation between HSV and RGB is nonlinear. The conversion from RGB to HSV is defined by the following expressions
V = 1/3R + 1/3G + 1/3B (1)
Start
= 2 + 2 1 2
Where x and y are
(2)
Image capturing and preprocessing
Converting RGB image to HSV image
x = 1/sqrt(6)R – 1/sqrt(6)G + 2/sqrt(6)B (3)
y = 1/sqrt(6)R – 1/sqrt(6)G (4)
H = arctang(Y/X) (5)
, =
Histogram Analysis
60 Ã—
+ 0, =
= 60 Ã— + 360, = <
Thresholding technique
60 Ã—
Morphological operation
60 Ã—
+ 120, =
+ 240, =
Circle fitting algorithm
=
0, = 0
1 , (6)
Counting of circles
Fig.2. Flowchart of counting algorithm
Where
0,360
, , , , 0,1
background (0), else to the foreground (1) given by equation
7. Resultant image is called binary image shown in figure 6.
g(x, y) = 1 if f(x, y) T
= 0 otherwise
(7)
Fig.3. Conical representation of HSV color model

Histogram Analysis
In computer vision applications, image histograms can be useful tools for finding hue value for particular color extraction and thresholding. The information contained in the graph is a representation of pixel distribution as a functio of hue variation. Image histograms can be analyzed for peaks and which can be used to determine hue range. Hue range acts as a high and low threshold value in image segmentation. Figure 4 shows the Gerbera flower and figure 5 shows histogram of Gerbera flower in which hue range for Gerbera color is in between 0.13 to 0.15 approximately. In practical application we widen the hue range because flowers contain shades of color. In the similar way we can calculate the hue range for other flowers.
Fig.4. Gerbera flower
Fig.5. Histogram of Gerbera flower

Thresholding Technique
Image segmentation is a process of separating useful information from the background, on the basis of some features. The color is one of the most widely used visual features for segmentation. The pixel whose hue level is less than or greater than the threshold will be assigned to the
Fig.6. Binary image

Morphological Operation
The collection of nonlinear operations related to the geometric shape in an image is called morphological operations which rely only on the relative ordering of pixel values. Therefore these operations are especially suited to the processing on binary images. There are two morphological operations used in developed algorithm, namely hole filling and erosion. A hole is defined as background region surrounded by a connected border of foreground pixel region. Holes are present in binary image during the segmentation process they are removed using hole filling operation.
Erosion is the process of eliminating all the boundary elements from an extracted flower region, leaving the region smaller in area by one pixel all around its perimeter. Erosion is useful for smoothing of edges and to remove too small area which acts as noise in counting of flowers [11].

Circle Fitting Algorithm
Circular Hough transform (CHT) based algorithm for finding circles in images. This approach is used because of its robustness in front of noise and occlusion.
The first step for CHT is to create an accumulator space or parameter space which is made up of a cell for each pixel, initially its value is set to 0. Here we set 3 accumulator space for simply understanding the method of CHT. After initialization of the accumulator array, the program scans the edge points and making circle of radius r on input image edge. The interesting image feature points are those that belong to a circle characterized by equation 2 having its center of coordinates (a, b) and radius r.
(x a) 2 + (y b) 2 = r2 (8)
The objective is to find out the (a, b) coordinates of the centers for each circle. Each point (x, y) of the circle is represented as a circle in Hough space of known radius r as shown in figure 7. The intersection point (a, b) of these circles in Hough space is the center of the circle in (x, y) space. In figure 7 only three circles are shown, but this process is iterative along with all the pixels that confirm the
circle edge. The noise is also available but it hardly coincides on a common center of Hough space [12].
Fig.7. Representation in Hough space for a circle [12]
After successful detection of circles we count the number of circles and which are equal to the number of flowers. Fig 8 shows test image after circle fitting algorithm. Counting results of all the images are combined and then we estimate yield for flowers.
Fig.8. Image after circle fitting algorithm


EXPERIMENTAL RESULTS
Developed algorithm is same as algorithm given by Sarkate et. al. except circle fitting algorithm. CHT is used in developed algorithm at last stage to solve the problem of overlapping. Results for counting of Gerbera flower are shown in table 1 showing that the overall accuracy of counting flower is 95.01% for developed algorithm. Accuracy can be calculated using following expression
% = 100 (9)
In the similar way we can calculate the accuracy of counting for Marigold and Coltsfoot flower. The overall accuracy of Marigold is 94.66% and Coltsfoot flower is 84.50% shown in table 2 and 3. The accuracy results of these flowers are not compared with Sarkate, et al. 2013 algorithm because they dont have the same platform for comparison.
Table 1. Manual and Algorithmic results comparison of
Image No.
Manual Count
Algorithmic Count (Sarkate, et. al. 2013)
Accuracy
(%)
Developed Algorithmic Count
Accuracy
(%)
1.
7
6
85.71
7
100
2.
9
9
100
8
88.88
3.
7
6
85.71
7
100
4.
5
3
60
5
100
5.
7
6
85.71
6
85.71
6.
13
11
84.61
12
92.30
7.
5
4
80
5
100
8.
9
8
88.88
9
100
9.
6
5
83.33
6
100
10.
6
5
83.33
5
83.33
11.
4
3
75
4
100
12.
10
9
90
10
100
13.
8
6
75
6
75
14.
7
5
71.42
7
100
15.
6
6
100
6
100
Overall Accuracy
83.24%
95.01%
Gerbera flower
Fig.9. Comparision between Manual and Algorithmic count Table 2. Manual and developed algorithmic results comparison of
Marigold flower
Image
No.
Manual
Count
Developed
Algorithmic Count
Accuracy
(%)
1.
33
30
90.90
2.
23
21
91.30
3.
30
29
96.66
4.
18
17
94.44
5.
18
18
100
Overall Accuracy is 94.66%
Table 3. Manual and developed algorithmic results comparison of
Coltsfoot flower
Image No.
Manual Count
Developed Algorithmic Count
Accuracy
(%)
1.
15
13
86.66
2.
8
6
75
3.
13
10
76.92
4.
13
12
92.30
5.
12
11
91.66
Overall Accuracy is 84.50%

CONCLUSION

A. Syal Garg, and S. Sharma, A Survey of Computer Vision Methods for Counting Fruits and Yield Prediction, 2013, vol.2, pp 23197323.

Q. Wang, S. Nuske, M. Bergerman, and S. Singh, Automated Crop Yield Estimation for Apple Orchards, 13th International Symposium on Experimental Robotics (ISER 2012), 2012, pp 115.

R. S. Sarkate, N. V. Kalyankar, and P. B. Khanale, Application of Computer Vision and Color Image Segmentation for Yield Prediction precision, IEEE International Conference on Information Systems and Computer Networks (ISCON), 2013, pp 913.

S. Sural, Q. Gang, S. Pramanik, Segmentation and Histogram Generation using the HSV Color Space for Image Retrieval,
International Conference on Image Processing, 2002, pp II589II592

J. Cauchie, V. Fiolet, D. Villers, Optimization of an Hough Transform Algorithm for the Search of a Center, Journal of Pattern Recognition, 2008, vol.41, pp 567574.

S. R. Harmsen and N. J. J. P. Koenderink, Multitarget Tracking for Flower Counting using Adaptive Motion Models, Computers and Electronics in Agriculture, 2009, vol.65, pp 718.

S. Salvo,C. Munoz, J. Avila, J. Bustos, M. RamÃrezValdivia, C. Silva, and G. Vivallo, An Estimate of Potential Blueberry Yield using Regression Models that Relate the Number of Fruits to the Number of Flower Buds and to Climate Variables, Scientia Horticulturae, 2012, vol.133, pp 5663.

U. O. Dorj, M. Lee, S Senthilkumar, A Novel Technique for Tangerine Yield Estimation via Flower Detection 2nd International Conference on Information Science and Technology, 2013, vol.7, pp 405412.

W. AlNauimy, Comparative Study between Different Denoising Filters for Speckle Noise Reduction in Ultrasonic BMode Images 8th International Computer Engineering Conference (ICENCO), 2012, pp 3036.

J. M. ChavesGonzalez, M. A. VegaRodriguez, J. A. GomezPulido, and J. M. SanchezPerez, Detecting Skin in Face Recognition System: A Colour Space Study, Digital Signal Processing, 2010, vol. 20, pp 806823.

Y. Wenzhong, A Counting Algorithm for Overlapped Chromosomes 3rd IEEE International Conference on Bioinformatics and Biomedical Engineering (ICBBE 2009), 2009, pp 13.

E. A. MurilloBracamontesa, M. E. MartinezRosasb, M. M. Miranda Velascob, H. L. MartinezReyesb, J. R. MartinezSandovalb and H. C. DeAvilab, Implementation of Hough Transform for Fruit Image Segmentation. Journal of Procedia Engineering, 2012, vol. 35, pp 230 239.
In developed algorithm HSV color space transformation of RGB image provides a better segmentation. After color segmentation based image, circle fitting algorithms is applied and then counting can be done. Here we use Circular Hough Transform for circle fitting algorithm which is more robust and it solves the problem of overlapping of flowers. Results of both algorithm shows that developed algorithm is much better than Sarkate, et. al. algorithm. Accuracy results for open field images are approximately same compared to polyhouse images result. Internet images have less accuracy because images are compressed and not clear.
In the developed algorithm, if the flower was covered by foliage more than 65% of flower region than it was difficult to detect and count.
ACKNOWLEDGMENT
The authors are indebted to the department of Electronics and Communication, CTAE Udaipur and Indian Horticulture Consultancy Works, Hauser, Rajasthan Agriculture College, Udaipur for providing field images and helping in carrying out the study and the experimental work in the laboratory.
REFERENCES