Keywords

1 Introduction

There are about 250,000 named flower species in the world; on a daily basis, we can see many blooming flowers in the roadside, garden, park, mountain path, wild field, greenhouses, etc. [1]. Floriculture is a discipline of horticulture concerned with the cultivation of flowers and ornamentals plants for floral industry and for the garden. Floriculture crops include houseplants, bedding plants, pot plants, and cut flowers. The cut flower is used in business in which flower is usually sold in bunches or as bouquets with foliage. Cut flowers are used in drink, decoration, for making medicine, cosmetics, etc. Currently, everyday the utilization of technology within the field of agriculture is increasing day by day for reducing the workforce and increasing the assembly capability. Produced flowers sold in the market by the farmers in the form of the bunch. But in the market, these flowers sold in the form of units; hence the profit gain by the agent is more than the farmer because a farmer does not know how many (in units) flowers are there in his garden. Bairwa [2] addressed issues in flower counting. Fifteen Gerbera flower images are processed and applied image processing techniques to achieve 95.01% of accuracy over manual counting. Nandyal and Jagadeesha [3] conferred a crop growth prediction system using machine vision in which the fruit region is found using edge detection and circular fitting algorithm. Wijethunga et al. [4] developed machine-controlled enumeration approach with application to kiwifruit enumeration system. Three easy enumeration strategies followed by a minimum distance classifier-based segmentation technique in L * a * b * color space is discussed. The recognition accuracy is above 90%. Sarkate et al. [5] counted Gerbera flowers using Hue Saturation Value (HSV) color space and histogram analysis. The proposed algorithm is given less accurate result due to overlapped flowers. Dorz et al. [6] estimated tangerine yield by counting of the tangerine flower using machine vision. Flowers are counted with the help of Gaussian filter and RGB color detection method. Salvo et al. [7] predicated blueberry based on the counting of a number of flowers buds. Bud counting relates the number of enough of fruit for the harvest and also relates weather variable. Sural et al. [8] have studied the important properties of HSV color space and developed and framework for extracting features which is used for both segmentation and histogram generation in their approach. They used the saturation value of a pixel to extract the object. Cauchie et al. [9] Presented improved Hough transform which applied to search of a common center of circular or partial circular object present in an image. The designed algorithm is applied for analysis of x-ray diffraction. Dorj et al. [10] developed color detection and counting algorithm, and the tangerine flower, under natural lighting condition, it used Gaussian filter to reduce noise and illumination adjustment for better clarity. The algorithm is capable of detecting and counting partially and semipartially occluded tangerine flowers with the error of 10%.

2 Proposed Methodology

Marigold flower images are captured by the digital camera. The distance between the camera and the flower is less than one meter. In the experiment, images were processed using Dual Core processor with 2 GHz frequency and 2 GB RAM. The experiment was carried out on MATLAB R2016a. Flower counting is used to yield approximation or estimation of a particular crop in floriculture field. The manual counting is costly and time-consuming. In this work, to develop an algorithm for computer vision-based automated system for fast and precise counting of flowers. The flowchart Fig. 1 shows the stepwise process of marigold flower detection and counting.

Fig. 1
figure 1

Flowchart of marigold flower detection and counting

2.1 Collection of Sample

The steps intend to capture an image through the camera. The quality of the image depends on camera parameters such as lighting condition, size of objects, and distance from the image. For better results, cameras with higher resolution are preferred. Figure 2 shows the two variety of marigold flower.

Fig. 2
figure 2

Sample images of marigold flower

2.2 HSV Color Transform

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. Figure 3 shows the original image, HSV transformed image, scaling of HSV and Binary image.

Fig. 3
figure 3

a Original image b HSV transformed image c Scaling of HSV d Binary image

2.3 Circular Hough Transform

The circular Hough transform is a feature extraction technique to detect circles. This is a special type of Hough transform which can detect multiple numbers of circles with unknown radius. The CHT iterate through possible radii. First, it is required to produce accumulator metrics by dividing parameter space into the bucket as per grid. The component in the accumulator metrics denotes the numbers of circles within the parameter area that passes through the corresponding grid cell. Initially, every element in the metrics zeroes and for each edge point in the original space form a circle and increase the amount of grid cell which the circle passing through. This method is known as voting. After voting, we are able to find neighborhood maxima in the accumulator metrics. The location of the local maxima in the corresponding to the circle center. The voting process is as follows:

  1. Step 1:

    For each pixel (x, y) find the possible radius between 10 and 60.

  2. Step 2:

    For each pixel (x, y) find the possible theta between 0 and 360.

  3. Step 3:

    Update the polar coordinate for center using equation

    $$ \begin{aligned} {\text{a}} & = {\text{x}} - {\text{r}}*\cos ({\text{t}}*{\text{PI}}/180); \\ {\text{b}} & = {\text{y}} - {\text{r}}*\sin ({\text{t}}*{\text{PI}}/180); \\ \end{aligned} $$
  4. Step 4:

    Update voting by A[a, b, r]+ = 1 (Fig. 4).

    Fig. 4
    figure 4

    a Binary image, b Circle fitting image

3 Experimental Results

In the developed algorithm, HSV color space transformation of RGB image provides a better segmentation. After color segmentation, circle fitting algorithms are applied and then counting can be done according to a number of the center present. Here, we use circular Hough transform for circle fitting, which is more robust and solves the problem of overlapping of flowers. The advantage of this algorithm is that it is capable of detecting and counting marigold flower even if in occluded and/or overlapping condition (Tables 1 and 2).

Table 1 Performance evaluation of manual count and algorithmic count with false counting
Table 2 Comparison between manual and algorithmic count with false counting

The performance of the developed algorithm is measured by a number of false detections with respect to manual count which is illustrated below.

$$ {\text{Error}}\;{\text{in}}\;\% = \frac{{{\text{Number}}\;{\text{of}}\;{\text{False}}\;{\text{Counts}}}}{{{\text{Number}}\;{\text{of}}\;{\text{Manual}}\;{\text{Counts}}}} \times 100. $$

4 Conclusion

In the developed algorithm, HSV color space transformation of RGB image provides a better segmentation. After color segmentation-based image, circle fitting algorithms are applied and then counting can be done. Here, we use circular Hough transform for circle fitting algorithm which is more robust and is capable of counting the occluded as well as overlap flower. The developed algorithm successfully detects and counts the marigold flower of an open field with an error of 5%. The perspective algorithm will facilitate to design an automatic counting system of marigold flower and will be capable of providing information to farmers about flower production.