Fast Pasture Classification Method using Ground-based Camera and the Modified Green Red Vegetation Index (MGRVI)

org


I. INTRODUCTION
Extensive animal husbandry in mountainous areas is highly dependent on grass and its condition in meadows and pastures. The pastures are used during the summer for raising cattle gradually by parts, while the fodder is set aside to feed the animals in the winter. However, the production of grass is not unlimited and depends on various factors -topography, the impossibility of using mechanization to a large extent, the short vegetative cycle in high places (longer retention of snow, temperature differences and precipitation, drought). The intensive use of pastures and the incorrect management and selection of the appropriate capacity of the area in relation to the animals kept on it can cause degradation of the used pastures and lead to subsequent damage of them and to the environment. Therefore, the assessment of aboveground biomass is important in order to achieve the goal of rational use of pasture resources and to maximize the quantity and quality of milk and meat production. Natural grass associations are not only accepted as a huge natural resource that enables environmentally friendly and lowcost rearing of ruminants, but they also have significant ecological functions: they protect the soil from water and wind erosion and groundwater from pollution [1][2][3], reduce the effect of greenhouse gasses, absorbing part of CO 2 in the process of photosynthesis, preserve biodiversity [4,5].
The meadows and pastures in Bulgaria occupy 27.8% of the usable area of the country, but a large number of them are not used in a systematic and regulated manner, as a result of which the grasslands degrade, and this also leads to a decrease in the productivity and quality of the obtained biomass [3]. Identifying and applying adequate measures requires a good knowledge of their condition [6,7]. This necessitates conducting research on the density of grass vegetation, evenness of grazing, participation of valuable cereal and legume species and the ratio between them, presence of shrubs, pests and pollution [8,9]. Grass communities are used by grazing and mowing (individually or in combination), which when carried out correctly limit the spread and development of shrubs and trees, suppress the dominance of rough and poisonous species, weeds and ruderals. Traditional grazing management factors are number, type and category of grazing animals, spatial and temporal distribution of forage demand, timing and length of grazing periods [10]. Overgrazing of grassland leads to the loss of valuable perennial species and subsequent soil erosion [11][12][13][14]. The lack of grazing also has a negative impact on the grassland, leading to the spread of weeds, overgrowth and the reduction of the grazing area [15].
Very often, the decrease in pasture productivity is also a result of the uneven distribution of grazing. According to [16], in arid and semi-arid regions, timely corrections of animal numbers and practices that are applied to alleviate unwanted selective grazing of animals improve grazing uniformity and are more effective in maintaining and improving pasture productivity than fencing and rotational grazing systems. Improving grazing uniformity can help both to increase productivity and to preserve biodiversity and habitats in grasslands [17]. By accurately determining the degree of grazing, it is possible to improve the management of the www.ijacsa.thesai.org pasture territory, to provide data for predictive and simulation models for its effective use [18].
Conventional methods for evaluating the indicators determining the extent and uniformity of grazing and the productivity of the rangeland area are subjective, timeconsuming and only applicable to small-scale rangeland monitoring. These methods are particularly difficult in large, remote areas. Conventional methods involve laborious crawling over large areas, cutting and drying a large number of samples of a certain area (e.g., 0.25 m 2 ), where the dried biomass values are recalculated to a larger area.
In order to maintain natural pastures in a state of high productivity, to increase the efficiency of their use, it is necessary to prospectively introduce innovative methods and technologies for remote and rapid analysis to estimate the density of the grass cover, the degree of grazing, the botanical composition, the productivity and quality of the vegetation from the point of view of precision agriculture and the intelligent management of natural grass associations.
Different automated approaches are used to assess the condition of pastures, in addition to the standard on-site sampling methods of the pasture itself. One of these approaches is to use sensors, to measure soil indicators and parameters, to send data about them to a software application and, based on the processing and analysis of this data, to make predictions about the state of the biomass on the surface [19][20][21][22]. It is obvious that this method is not particularly good and reliable. The information obtained through it about the condition of the plants on the surface is not direct, and on the basis of various indicators of the soil, attempts are made to make predictions about the plants.
Recently, the methods using various sensors and cameras on board unmanned aerial vehicles (UAV) are relevant and intensively developed. Their development provides new alternatives for collecting data from meadows, as they are much more mobile and offer different possibilities than those of agricultural machinery and agricultural aviation, and even satellite images. There is already quite a bit of research into the applicability of such technologies [23,24] and definitely this approach gives promising results in biomass estimation compared to manual field measurements. Key advantages of such approach include access to hard-to-reach areas, slow flight speed and, respectively, the possibility of good quality photography, development of technologies in this area and cameras allow detailed images; there is no risk for the people who use the technique or for the pilots for example. The disadvantages of this approach are that this type of equipment is still relatively expensive, and working with it is also not so simple and requires certain knowledge and experience, which is why not every farmer will decide on such a step to purchase such devices.
The use of cameras with multispectral sensors allows to compile/determine vegetation indices, based on RGB and infrared images and use these indices to estimate grassland surface biomass [25,26]. Remote sensing is an effective tool to address the challenges of grassland vegetation sampling to establish land cover characteristics and accurately account for grassland biomass given its high spatio-temporal variability and large spatial scales [27][28][29]. Understanding this variability and how it differs regionally can help improve rangeland management by informing how to adjust stocking levels in atypical years and avoid overgrazing or insufficient forage availability in drought years [30].
According to [31], the monitoring of the condition of the grass cover of pastures is of crucial importance for their good management, as the combination of data from conventional field surveys with remote sensing (with a moderate resolution) will help to increase the accuracy of the quantitative assessment of trends in the changes of grass cover and productivity of the pasture area. And digital image analysis (aerial photographic analyses) can be a fast and precise technique for estimating the proportion of different plant groups in the grassland [32,33].
Different studies have investigated the application of remote sensing for assessment of pastures' biomass. For example, in [34] the authors compared two grazing practices for evaluation of the vegetation characteristics of a pasture: high-resolution satellite and UAV imagery. Different vegetation indices were used, such as NDVI, EVI2, LAI, WDRVI, etc., all of which require the use of near-infrared spectrum. The results showed that both approaches provide a useful tool for the farmers to optimize the management of the pasture. Similarly, in [35] UAV obtained RGB and multispectral imaging was used for assessing the pasture biomass using NDVI, NDRE, GNDVI and GRVI vegetation indices. To the best of our knowledge, no previous studies have suggested the application of ground-based cameras for assessment of the pasture condition.
All these methods for biomass estimation have their advantages and several common drawbacks -it is not easy for a farmer or even a herdsman to make this estimate himself. Furthermore, most of them rely on vegetation indices that need the infrared spectrum, which adds a significant limitation and increases the price of the sensor. This research is aimed at developing a methodology based on image processing that allows easy assessment of the condition of pastures using ordinary photographic images (even from a phone). If the images taken by livestock keepers are properly stored (for example, image databases are organized [36]), they can subsequently be used for more in-depth analysis and matching to trace how the grazing process has progressed [37]. Based on the analysis of the images, along with historical data on temperature, humidity and soil condition, it is also possible to predict what the pasture's condition may be expected to be for some period of time in the future.
The goal of this study is to develop a model which allows fast assessment of the biomass condition of pastures and meadows, which is based on a ground-based visual spectrum camera. The method should be applicable with a wide range of devices, including mobile phones, and allow easy approximation of the grazed areas.

II. MATERIALS AND METHODS
As already stated, this study aims to develop a methodology that allows assessing the grazed area of pastures, which can be divided into three steps, as shown in Fig. 1.  www.ijacsa.thesai.org Step 1. Take a photo For the first step any visual spectrum (RGB) camera can be used, which is either ground-based or UAV-based. However, it is important to know the dimensions in meters of the observed quadrilateral. In the current study it is assumed that the quadrilateral is an isosceles trapezoid, i.e., the camera is horizontally leveled with the ground.
Step 2. Perform classification Several RGB indices are explored in [38]. All of them are affected by the illumination quality of the images being used and care should be taken when using it to process images where there are areas affected by shadowing. Therefore, in our study we use a relatively flat pasture with a sufficiently large area and without trees shading it.
In this step a classification is performed in order to distinguish the grazed and ungrazed parts of the pasture. It is based on the MGRVI, proposed in [39]. It is considered to give the best results when separating vegetation from soil and is defined as follows: (1) where and are the red and green components, respectively, of a RGB colored pixel. MGRVI takes values from -1 (when and ) to +1 (when and ).
Next, all pixels of the image are classified in one of the two categories: 1) If MGRVI<=0 then it is assumed to represent a grazed area; 2) If MGRVI>0 then it is assumed to represent an ungrazed area.
Step 3. Evaluate the actual size of the grazed and ungrazed areas In order to implement this step, the following approximations are made: 1) It is assumed that the pasture is perfectly flat and the camera is horizontally leveled; 2) It is assumed that all pixels on the same row represent the same width and height of the pasture.
It is known that under the above conditions the rectangular image, captured by the camera, corresponds to an isosceles trapezoidal ground surface (Fig. 2). Let its two bases be m (the short one, which is near the camera) and n (the long one, which is away from the camera), its two legs are with equal size d, and all of them are measured in meters. If the image is represented with x horizontal and y vertical pixels, it is necessary to obtain the corresponding ground surface to each pixel.
If the image has y vertical pixels (from 1 to y), then there are y+1 horizontal lines (from 0 to y) separating them (Fig. 2). Considering the shortest line (Line y) has length m and the longest one (Line 0) has length n, then the length of the k th line ( ) can be obtained with: where takes values from 0 to y.
If the image has x pixels (from 1 to x), then the width of all pixels on the k th row can be approximated as an average of their two bases (Fig. 3): where takes values from 1 to x.
Next, in order to approximate the corresponding height of each row of pixels, the height of the trapezoid should be obtained: In order to account for the influence of the perspective on the pixel height, a coefficient is defined for each pixel row, which is obtained according to: Then the corresponding pixel height of the k th row can be approximated with: Finally, the corresponding area of each pixel on the k th row can be obtained with:  A number of photos of the pasture were made, using a Mobotix Mx-M16TB-R079 camera. It includes an optical sensor with resolution 3072x2048 px and an infrared sensor with resolution 336x252 px, though in this study only the visual spectrum data has been used. Two photos were selected for additional analysis, which are presented in Fig. 6:  Image 1 (left) contains a part of the pasture, where the condition is mostly ungrazed. It can also be seen that there is an area in the upper part of the image, which represents an artificial object;  Image 2 (right) contains a part of the pasture, which is mostly grazed. Furthermore, it contains a person standing on the field, which allows investigating the influence of artificial objects on the developed methodology. The QGIS 3.0 software has been used to implement the image analysis and classification part of the methodology. Initially the MGRVI vegetation index is used to create raster contours for each input image, as shown in Fig. 7. From it can be unambiguously confirmed that the contours are dividing the grazed from the ungrazed areas of the pasture very precisely. This confirms that the chosen vegetation index is appropriate for the situation. Next, according to the developed methodology, the pixels of the images are classified into grazed and ungrazed. This is implemented by converting the contours to polygons and classifying them in two classes based on their fid property. The results from the classification for the two testing images are presented in Fig. 8.
Next, the developed methodology for analysis of the classified images has been implemented in a specialized software tool, using the Microsoft Visual Studio 2019 environment. It has been used to evaluate the grazed and ungrazed areas of the pasture, the results from which are summarized in Table I. According to the performed analysis, Image 1 represents a pasture, where 21% (57 m 2 ) of the area is either grazed or represents artificial objects, and 79% (218 m 2 ) of the area is ungrazed. These results indicate that this part of the pasture is in good condition and the animals could still be kept there.  The analysis of the obtained results allows us to make several observations. The performed classification using the MGRVI index allows correct identification of grazed and ungrazed areas of the pasture under the current conditions of www.ijacsa.thesai.org the investigated pasture. Nevertheless, it should be noted that the study was done in a period without significant rainfall and with lower temperatures. Therefore, it could be speculated that the MGRVI index might be inappropriate in periods of intense growth, such as mid spring to early summer, when there is no significant color difference between grazed and ungrazed areas. This shows that more studies might be required if a complete solution is to be created.
As was already mentioned Image 2 partly contains the contours of a human being, which means that the actual condition of the pasture behind him is unknown. And even though in this study this area was classified as grazed, this should not be considered as a rule. The analysis was performed only with data from the visual spectrum, and therefore the results of the classification depend entirely on the color of the clothes the person is dressed in. Similar conclusion can be made for Image 1, where the top pixel lines represent an artificial object. It was also classified as a grazed area because of the color of the object, yet in the general case the classification could be different.
Considering the aforementioned, the general recommendation that could be made when taking such photos is to try not to include any artificial objects within the photographed area. Another option might be to add an additional spectrum (such as infrared), which allows easy identification of some artificial objects. For example, living creatures would naturally return higher temperature than the surroundings. Similar results are expected from artificial objects, which were exposed to continuous solar radiation. Naturally, the inclusion of additional spectrum would require the modification of the vegetation index used.
The proposed method has several limitations, which should be considered when using it. It provides an assessment of the state of the pasture by showing its total and actual productivity, yet it cannot assess and give an idea of the suitable for consumption grass within the pasture, because the animals have their preferences and do not graze all types of grass. According to the accepted approximations, the pasture should be flat, if accurate classification of it should be conducted, which is another limitation of the proposed model. If the observed area is not ideally flat, this will create some errors in the calculations. The impact of the aforementioned limitation might be reduced if the evaluation of the area is performed using a UAV, yet this would require the farmer to make an relatively significant investment for acquiring the appropriate tools. Furthermore, the ability to pilot a UAV requires a certain qualification, which most of the farmers do not have.
That is the reason the proposed method was not intended to provide highly accurate results, but to perform fast and easy approximation of the grazed area, which is an important factor for the rotation of animals on pastures. An important advantage of this study is that it does not require the use of expensive equipment and specific technologies, because it relies on commonly available tools, such as the cameras of mobile phones. This way the developed model could be used by pretty much all farmers if appropriate tools are provided, and the only requirement towards the users is to have general knowledge on working with mobile devices.

IV. CONCLUSIONS
This study presents the development of a method for fast assessment of the grazed pasture areas with the use of groundbased cameras. The classification is based on the MGRVI index, which is known to allow easy differentiation between areas with grazed and ungrazed vegetation. The created classification map is then resized in order to account for the effect of the perspective, which allows fast and relatively accurate assessment of the actual grazed and potentially ungrazed areas in m 2 and in percentages.
The main advantage of the proposed model is that it does not require expensive equipment, such as UAVs, but rather relies on commonly available technologies such as the cameras of mobile phones. This way if an appropriate tool, which implements the proposed methodology is developed, it could offer decision-making support for all farmers in the process of rotating their animals on pastures, without any specific technological or knowledge requirements. The development of such user-friendly mobile application is an important follow-up task, which would allow applying the developed methodology in practice.