Microsoft Word - 3-Agra_8098.doc 536 Original Article Biosci. J., Uberlândia, v. 27, n. 4, p. 536-543, July/Aug. 2011 IMAGE PROCESSING TO ASSESS THE SPATIAL VARIABILITY OF WEEDS IN NO-TILLAGE PROCESSAMENTO DE IMAGENS PARA AVALIAR A VARIABILIDADE ESPACIAL DE PLANTAS DANINHAS EM SISTEMA DE PLANTIO DIRETO Darly Geraldo SENA JR. 1 ; Marcelo Marques COSTA 2 ; Vilmar Antonio RAGAGNIN 1 ; Karolina Fernandes Costa GOBBI 3 ; Francisco de Assis de Carvalho PINTO 4 ; Onilio Venâncio de OLIVEIRA NETO 3 1. Professor adjunto, Universidade Federal de Goiás – UFG, Campus Jataí, Jataí, GO, Brasil. darly.sena@gmail.com; 2. Engenheiro Agrônomo, mestrando no Programa de Pós-graduação em Engenharia Agrícola da Universidade Federal de Viçosa - UFV, Viçosa, MG, Brasil; 3. Engenheiro Agrônomo, UFG, Campus Jataí, Jataí, GO, Brasil; 4. Professor Associado, UFV, Viçosa, MG, Brasil. ABSTRACT: The aim of this work was to describe the weed spatial variability in a no-tillage system area in Jataí, GO, Brazil. A regular grid was used on a 22 hectares field achieving 29 sample points. The total shoot dry matter of weeds was determined on an area of 0.5 m 2 and also separated on broadleaf and grassy types. Images of the sample area were classified using a supervised classifier into three classes: straw, leaves, and uncovered. The soybean leaves were manually segmented from the leave class. The images were also processed using an automatic threshold method, separating the leaves from the background. On the processed images were calculated the covered areas by each class. All variables were submitted to correlation and geostatistical analysis. A significant correlation was verified between covered area by plants and the shoot dry matter. The supervised classification and the automatic threshold method achieved similar results. When the soybean leaves were segmented, the broadleaf weeds cover area determination improved, but had no influence on the correlation with total dry matter of weeds and cover area. Spatial dependence was only verified when the two types of weeds were studied separately. KEYWORDS: Spatial dependence. Geostatistics. Glycine max. INTRODUCTION The weeds compete strongly with the crops, but they could be useful in terms of nutrient recycling and soil cover, helping prevent soil erosion. Besides this, they could be used as an indicator of chemical and physical properties of the soil, since correlation between weeds and soil properties was verified (WALTER et al., 2002). The vegetation and humus types could also be used as indicators of nutrient regime and ecological classification (WILSON et al., 2001). Data collection regarding weeds could be arduous, since it demands analysis of plants in sample points within the area, species identification and dry matter quantification. In general, grid sampling is considered the most efficient method to identify spatial properties of the soil and crop, but the high number of samples increases the cost. Spatial weed distribution studies to site-specific control require data collection on certain spatial resolution, in a short time and at low costs (NORDMEYER, 2006). Nevertheless, the economic viability of weeds site-specific control using herbicides was verified, and the difference in estimated net returns covered all costs of site- specific post emergence herbicide application (RIDER et al., 2006). Once a spatial dependence was verified among sample values, it is possible to generate a continuous surface using interpolation methods (ISAAKS; SRIVASTAVA, 1989). When the spatial distribution of weeds occurs in patches, geostatiscal methods could be used to map this variable (SCHAFFRATH et al., 2007). With these methods, a mathematical model is adjusted to the data in order to describe the spatial variability. This model represents the semivariance as a function of the distance, and is used on the interpolation process. The most used method of interpolation is kriging, which generally grants more accurate results (JOHANN et al., 2004). Machine vision systems present a great potential to be used on data collection for precision agriculture, where images would be used to extract information (PINTO et al., 2001). Promissory results on automated weed detection were obtained using an image processing method to estimate total density and cover of broad-leaved weed seedlings in cereal fields (BERGE et al., 2008). An automatic method for the generation of weed maps also has been developed using images from a CCD camera mounted on a tractor (HAGUE et al., 2006). With Received: 13/09/10 Accepted: 03/03/11 537 Image processing… SENA JR., D. G. et al. Biosci. J., Uberlândia, v. 27, n. 4, p. 536-543, July/Aug. 2011 the popularization of digital cameras, personal computers, image processing software, and global positioning systems, machine vision systems could be an option to cost reduction in data collection for precision agriculture. Georeferencing the data could be possible to identify spatial variability on weeds distribution and allow site-specific control (ZANIN et al., 1998), using patch spraying where herbicides are applied only on the areas where the weed population economically justify the application. Another option is to vary the herbicide to maximize the weed control (WILES, 2009). The weed maps could also be used as an aid to define management zones. This work is based on the hypothesis that the use of image processing methods can facilitate data collection and identification of spatial variability of weeds. In this way, the aim with this study was to describe the weed spatial variability in a soybean crop no-tillage system area and evaluate methods of image processing to aid the data collection for weeds spatial distribution studies. The correlation of the data with the shoot dry matter of broadleaf and grassy weeds was evaluated and geostatistical analysis was also performed. MATERIAL AND METHODS The work was carried out at Campus Jataí of the Universidade Federal de Goiás, on the State of Goiás, Brazil. The area was cultivated with soybean as the first crop and sorghum as the second one on the previous season. This succession of cultures has been used on the area for at least eight years. In order to cultivate the area, herbicide was applied a week before seeding the soybean crop, 0.45 m between rows. About 15 days after the crop emergency, data collection was performed in an area of 22 ha, approximately, using a grid of 90 x 90 m, achieving 29 points. On each sample point, the data was collected on a area of 0,5 m 2 limited by a frame. On the same point, a digital image was taken (Figure 1), using a 7.2 Mpixel camera. To biomass quantification, the aerial part of the weeds was cut close to the soil, separated in grassy and broadleaf weeds and put in paper bags. The material was dried at temperature of 70 degrees centigrade using ventilated oven, where it remained for 72 hours. Figure 1. Image obtained before weeds shoot dry matter collection, about 15 days after emergency of the soybean crop, showing the frame used to delimit the sample area of 0.5 m 2 . The images were cut leaving the area inside the frame and processed on the software SPRING version 3.4, calculating the area covered by leaves, straw, and the uncovered area, using the maximum likelihood method. On each image, at least 15 samples on each class were used. Sample evaluation was done, removing that with high level of confusion among classes. After classification and conversion to thematic data, the pixels were counted on each class and the proportion of each one was calculated. Also using the SPRING software, an edition tool was used to distinguish the leaves of weeds and the soybean crop, manually. So the class leaves was divided in two classes, obtaining for each image the percent cover of soil, straw, weeds, and crop (soybean). A third method was used on Matlab version 6.5 software. The original images were processed using the excess green index (MEYER et al., 1998) and thresholded using the Otsu technique (OTSU, 1979). This technique is based on discriminant 538 Image processing… SENA JR., D. G. et al. Biosci. J., Uberlândia, v. 27, n. 4, p. 536-543, July/Aug. 2011 analyses of pixel values by the assumption that they could be classified in two classes, background and object, and the threshold is the value that better distinguishes the two groups. The correlation between the data obtained from the three methods of image processing and the shoot dry matter was evaluated. Geostatiscal analyses of the data were performed using the demonstration version of the software GS+, submitting each model to a cross validation analysis. The kriging interpolation technique was used to create the maps of each variable. RESULTS AND DISCUSSION The average performance and the sample confusion among samples were evaluated using the SPRING software. The overall performance of classification was higher than 90% on the acquisition sample for all the images. The leaves class achieved the better results, while soil and straw showed some confusion (Figure 2). Figure 2. Image segmentation procedure and classification (a) original image after cutting, (b) classified image with three classes leaves (green), soil (blue) and straw (beige), (c) classified image with the class soybean leaves (red), and (d) image processed and thresholded showing the leaves in white and soil and straw on the background. Based on the results from the supervised classification (Table 1), one could notice that the major variation among images was on the class leaves. Since the images were taken when the soybean crop was on the V1 stage and considering a good work on seedling and uniform emergence, we could attribute this variation to the weeds distribution. To support the discussion, after the edition, removing the soybean leaves, it is possible to verify that a high variability on weed cover among images exists. However, the percent cover area of weeds was relatively low. Changes in the cover area by straw and soil after the edition were attributed to the confusion among classes on leaves’ edges. These results indicate that a simpler and faster image processing method to distinguish the leaves from background could allow achieve information on weed distribution on crop fields. 539 Image processing… SENA JR., D. G. et al. Biosci. J., Uberlândia, v. 27, n. 4, p. 536-543, July/Aug. 2011 Table 1. Percentage cover area and coefficient of variation of the classes with the maximum likelihood classification and after the edition to create the class soybean leaves Parameters Supervised classification Edited images leaves straw soil weeds soybean straw soil Cover area (%) 24.2 36.9 38.9 17.0 7.6 38.9 36.6 Variation coefficient (%) 50.0 25.7 27.9 70.0 41.5 27.9 27.6 It was verified a correlation of 0.78 (p<0.0001) between cover area by leaves on supervised classification and total shoot dry matter of weeds (Table 2). Using the excess green index and automatic threshold a similar result was achieved, a correlation of 0.77. Without the soybean leaves, removed by edition, the correlation between cover area by weeds and total shoot dry matter was 0.76. These results are strongly similar, due to the low variation on cover area by soybean leaves on the images. The shoot dry matter of broadleaf weeds and percentage cover of leaves showed a correlation of 0.89 on the supervised classification and the same value on the automatic threshold, and a high correlation (0.98) showing that the first one could be replaced by the second on weeds cover area studies. The threshold method could be worthwhile, allowing an automatic data collection, cheaper and with less human interference on class sample collection. A relationship between the automatic and manual measurements made using high resolution photographs taken from a CCD camera mounted on a tractor was also verified.However overestimate crop and weed density (HAGUE et al., 2006). After the edition, the correlation between cover area by weeds and total shoot dry matter was of 0.94. On the other hand, the correlation between grassy weeds shoot dry matter and percentage cover by weeds was only 0.12% with the same processing. These results indicate that the strategy of using digital images cover area to infer the shoot dry matter of weeds is less efficient to grassy than to broadleaf weeds. So, if the information of the type of weed is relevant on certain fields conditions, additional procedures could be necessary. Table 2. Simple correlation coefficients amongthe analyzed variables 1 . broadleaf DM Grassy DM Total DM weeds edited soybean edited leaves 3 classes Soil 3 classes straw 3 classes grassy DM -0.12 Total DM 0.69 0.29 weeds edited 0.94 0.12 0.76 soybean edited 0.14 0.40 0.31 0.23 leaves 3 classes 0.89 0.22 0.78 0.97 0.45 Soil 3 classes -0.57 -0.33 -0.70 -0.66 -0.21 -0.67 straw 3 classes -0.47 0.08 -0.20 -0.48 -0.34 -0.52 -0.29 leaves threshold 0.89 0.21 0.77 0.95 0.44 0.98 -0.71 -0.44 1 broadleaf DM: shoot dry matter of broadleaf weeds; grassy DM: shoot dry matter of grassy weeds; total DM: total shoot dry matter of weeds; weeds edited: percentage area covered by weeds after edition; soybean edited: percentage area covered by soybean leaves after edition; leaves 3 classes: percentage area covered by leaves on supervised classification; soil 3 classes: percentage area covered by soil on supervised classification; straw 3 classes: percentage area covered by straw on supervised classification; and leaves threshold: percentage area covered by leaves on automatic threshold method. Some efforts have been done aiming automatic separation of broad leaved and grassy weeds. A feature-based plant discrimination algorithm to separate monocotyledonous and dicotyledonous plants based on images of sugar-beet fields was developed and achieved good results on mono and dicotyledonous plant identification (SCHUSTER et al., 2007). No spatial dependence was found for percentage cover area by plants, straw, and soil from the images. No spatial dependence was also found for total shoot dry matter of weeds. These results did not allow the elaboration of maps of this variables using the kriging procedure. In another work, that aimed to evaluate the effect of sampling scale of weeds, maps were produced using the inverse distance weighted method, without geostatiscal 540 Image processing… SENA JR., D. G. et al. Biosci. J., Uberlândia, v. 27, n. 4, p. 536-543, July/Aug. 2011 analysis (LAMASTUS; SHAW, 2005). Spatial dependence was only verified when the two groups of weeds, broadleaf, and grassy, were studied separately. For the shoot dry matter of grassy weeds, the ratio C/(Co+C) was 99.9%. This ratio is a statistic that provides a measure of the proportion of the sample variance (Co+C) that is explained by spatially structured variance (C). This value represents a strong spatial dependence (CAMBARDELLA et al., 1994). The model selected was the spherical, showing a determination coefficient of 0.816 and a range of 1026 m (Figure 3a). The linear regression between the estimated and actual data on the cross validation showed a regression coefficient of 1.059, determination coefficient of 0.53, and an intercept of -1.385 (Figure 3b) S e m iv a r ia n c e S e m iv a r ia n c e Distance (m) Estimated DM (g m -2) 0.0 224.1 448.3 672.4 896.5 0.0 5.6 11.2 16.8 22.5 S e m iv a ri a n c e A c tu a l D M ( g m -2 ) 21.6 24.1 26.6 29.2 31.7 21.6 24.1 26.6 29.2 31.7 (a) (b) Figure 3. Grassy weeds shoot dry matter semivariogram (a) and (b) grassy weeds shoot dry matter cross validation. The shoot dry matter of broadleaf weeds showed a moderate spatial dependence (CAMBARDELLA et al., 1994). The spherical model showed the ratio C/(Co+C) of 52,5 %, determination coefficient of 0.662, and range of 533 m (Figure 4a). The cross validation regression showed a regression coefficient of 0.986, determination coefficient of 0.258 and intercept of 0.486 (Figure 4b). S e m iv a r ia n c e Distance (m) S e m iv a ri a n c e 0.0 187.5 375.0 562.5 750.0 0.0 6.2 12.4 18.7 24.9 Estimated DM (g m-2) 22.4 26.0 29.6 33.2 36.8 A c tu a l D M ( g m -2 ) 22.4 26.0 29.6 33.2 36.8 (a) (b) Figure 4. Broadleaf weeds shoot dry matter semivariogram (a) and broadleaf weeds shoot dry matter cross validation (b). On a visual analysis one could notice that on the same area with higher shoot dry matter of broadleaf weeds there was an occurrence of lower dry matter of grassy weeds (Figure 5a and 5b). The higher occurrence of grassy weeds was verified on the borders and on the major part of the field, a lower level of this type of weed was noticed. On the other hand, the broadleaf weeds showed a higher concentration on the center of the field, but a more uniform class distribution, with less abrupt transition than the grassy weeds. This information on the distribution pattern of weeds could be used as additional data for management zone delineation, in conjunction with 541 Image processing… SENA JR., D. G. et al. Biosci. J., Uberlândia, v. 27, n. 4, p. 536-543, July/Aug. 2011 other data, such as topography, productivity, soil type, area history, soil moisture, organic matter content, and others. This distribution pattern could occur simply for the type of distribution pattern of each type of weed, but it could indicate different soil conditions (WALTER et al., 2002; WILSON et al., 2001). Certain types of weeds are more adapted to conditions of compacted soils or soils with low fertility, which leads them to prevail under these conditions. 31.7 29.7 27.6 25.6 23.6 21.6 DM (g m-2) (a) 32.0 30.4 28.8 27.3 25.7 24.1 DM (g m-2) (b) Figure 5. Grassy weeds shoot dry matter (a) and broadleaf weeds shoot dry matter spatial distribution (b). A directed sampling strategy on the zones of prevalence of each type of weed could indicate if this relationship is occurring on the area, and the reasons for the predominance of certain type of weeds on each region. Another possibility is that the grassy weeds are spreading across the area from outbreaks that originated at the edges of the field. In this case, an effort to control on these areas can prevent greater dispersion of these species. The inverse spatial distribution provides the lack of spatial dependence when the two types of weeds are studied together. For this reason the data obtained from the images did not show spatial dependence, since the data of the two types of weeds were grouped. Probably, if the images were processed separating the data from grassy and broadleaf weeds, spatial dependence could be verified. The soil and straw data obtained from the images did not show spatial dependence also, since that most of them are under the leaves of weeds and crop. Once the spatial distribution of leaves was random on the area, it was not possible to notice if the spatial distribution of straw and exposed soil was random or not. To this type of study, the images must be taken before the emergency of the crop and weeds. 542 Image processing… SENA JR., D. G. et al. Biosci. J., Uberlândia, v. 27, n. 4, p. 536-543, July/Aug. 2011 With the type of image processing method used on this work, if there is an interest of using two types of herbicides, one for broad and other for grassy weeds, the method could not help with the grid used. On this field, grassy and broadleaf weeds must be studied separately, since their distribution could be considered random when treated as one group. A more intense grid could also be tried, since a spatial dependence structure could be found at lower distances. It is also possible that if the groups were separated in species a better result would be achieved. CONCLUSIONS The cover area by leaves, determined on images, has a significant correlation with weeds biomass, especially broadleaf weeds. The excess green index and automatic threshold can replace the supervised classification method, since they showed similar results and the first one presented advantages considering the processing time. On the study area, the image processing methods used were not able to identify the spatial dependence of weeds, using a grid of 90 x 90 m The spatial dependence of broadleaf and grassy weeds, on the study area, must be evaluated separately and not as a unique group. RESUMO: O objetivo com esse trabalho foi descrever a variabilidade especial de plantas daninhas em área cultivada sob plantio direto em Jataí, GO, Brasil. Uma grade regular foi utilizada em área de 22 ha, totalizando 29 pontos amostrais. A matéria seca total de plantas daninhas foi determinada em área de 0,5 m 2 e também separada em plantas de folhas largas e folhas estreitas. Imagens da área de amostragem foram classificadas utilizando-se classificador supervisionado em três classes: palha, folhas e solo descoberto. As folhas das plantas de soja foram segmentadas manualmente a partir da classe folhas. As imagens também foram processadas utilizando-se método de limiarização automática, através da separação as folhas do fundo. Nas imagens processadas, calculou-se a área coberta por cada classe. Todas as variáveis foram submetidas a análises de correlação e geoestatísticas. Correlação significativa foi verificada entre área coberta por plantas e matéria seca total. A classificação supervisionada e a limiarização automática obtiveram resultados semelhantes. Quando as folhas da soja foram segmentadas, a determinação da infestação por plantas daninhas de folhas largas foi favorecida, mas não se verificou influência na sua correlação com a matéria seca total de plantas daninhas e área coberta. Dependência espacial só foi identificada quando os dois tipos de plantas daninhas foram estudados separadamente. PALAVRAS-CHAVE: Dependência especial. Geoestatística. Glycine max. REFERENCES BERGE, T. W.; AASTVEIT, A. H.; FYKSE, H. Evaluation of an algorithm for automatic detection of broad- leaved weeds in spring cereals. Precision Agriculture, Dordrecht, v. 9, p. 391-405, 2008. CAMBARDELLA, C. A.; MOORMAN, T. B.; NOVAK, J. M.; PARKIN, T. B.; KARLEN, D. L.; TURCO, R. F.; KONOPKA, A. E. Field-scale variability of soil properties in Central Iowa soils. Soil Science Society of America Journal, Madison, v. 58, n. 5. p. 1501-11, 1994. HAGUE, T.; TILLETT, N. D.; WHEELER, H. Automated crop and weed monitoring in widely spaced cereals. Precision Agriculture, Dordrecht, v. 7, p. 21–32, 2006. ISAAKS, H. E.; SRIVASTAVA, R. M. An introduction to applied geoestatistics. New York, Oxford. University Press. 1989. JOHANN, J. A.; OPAZO, M. A. U.; SOUZA, E. G.; ROCHA, J. V. Variabilidade espacial dos atributos físicos do solo e da produtividade em um Latossolo Bruno distrófico da região de Cascavel, PR. Revista Brasileira de Engenharia Agrícola e Ambiental, Campina Grande, v. 8, p. 212-219, 2004. 543 Image processing… SENA JR., D. G. et al. Biosci. J., Uberlândia, v. 27, n. 4, p. 536-543, July/Aug. 2011 LAMASTUS, F. E.; SHAW, D. R. Comparison of Different Sampling Scales to Estimate Weed Populations in three Soybean Fields. Precision Agriculture, Dordrecht, v. 6, p. 271–280, 2005. MEYER, G. E., MEHTA, T., KOCHER, M. F., MORTENSEN, D. A., SAMAL, A. Textural Imaging and Discriminant Analysis for Distinguishing Weeds for Spot Spraying. Transactions of the ASAE, St. Joseph, v. 41, p. 1189-1197, 1998. NORDMEYER, H. Patchy weed distribution and site-specific weed control in winter cereals. Precision Agriculture, Dordrecht, v. 7, p. 219–231, 2006. OTSU, N. A Threshold selection method from gray-level histograms. IEEE transactions on systems, man and cybernetics, New York, v. 9, p. 62-66, 1979. PINTO, F. A. C., SENA JR, D. G., QUEIROZ, D. M., GOMIDE, R. L. Visão artificial na agricultura de precisão In: Balastreire, L. A. (Ed). Avanços na Agricultura de Precisão no Brasil no período de 1999-2001 ed. Piracicaba : ESALQ, 2002, p. 309-316 RIDER, T. W.; VOGEL, J. W.; DILLE, J. A.; DHUYVETTER, K. C.; KASTENS, T. L. An economic evaluation of site-specific herbicide application. Precision Agriculture, Dordrecht, v. 7, p. 379-392, 2006. SCHAFFRATH, V. R.; TORMENA, C. A.; GONÇALVES, A. C. A.; OLIVEIRA JUNIOR, R. S. Variabilidade espacial de plantas daninhas em dois sistemas de manejo de solo. Revista Brasileira de Engenharia Agrícola e Ambiental, Campina Grande, v.11, p. 53-60, 2007. SCHUSTER, I.; NORDMEYER, H.; RATH, T. Comparison of vision-based and manual weed mapping in sugar beet. Biosystems Engineering, London, v. 98, p. 17-25, 2007. WALTER, A. M.; CHRISTENSEN, S.; SIMMELSGAARD, S. E. Spatial correlation between weed species densities and soil properties. Weed Research, Oxford, v. 42, p. 26-38, 2002. WILES, L. J. Beyond patch spraying: site-specific weed management with several herbicides. Precision Agriculture, Dordrecht, v. 10, p. 277-290, 2009. WILSON, S. M.; PYATT, D. G.; MALCOLM, D. C.; CONNOLLY, T. The use of ground vegetation and humus type as indicators of soil nutrient regime for an ecological site classification of British forests. Forest Ecology and Management, Amsterdam, v. 140, p. 101-116, 2001. ZANIN, G.; BERTI, A.; RIELLO, L. Incorporation of weed spatial variability into the weed control decision- making process. Weed Research, Oxford, v. 38, p. 107-118, 1998.