DEVELOPMENT OF A LASER PROFILOMETER FOR THE GENERATION OF 3D- MODELS TO MEASURE THE VOLUME OF FERTILIZER APPLIED BY FERTILIZER SOWERS

1 Agriculture Engineer Ph.D. in Agriculture Engineering Researcher, CEA/IAC. lino@iac.sp.gov.br 2 Electrical Engineer Ph.D. in Agriculture Engineering, Professor IFSP. davila@ifsp.edu.br 3 Electrical Engineer Ph.D. in Agriculture Engineering, Professor UNIFAJ. marcosgebra@terra.com.br 4 Agronomist Ph.D. in Agriculture Engineering, Professor UNICAMP. inacio@agr.unicamp.br 5 Industrial Automation Technologist, CEA/IAC. costasilvadenival@gmail.com

objects. The objective of this work was to develop a methodology and to build a prototype of a threedimensional scanner based on laser triangulation. A prototype was built, with a gantry structure containing a car on which are a laser diode and a camera. This car is driven by an endless shaft driven by an electric motor with variable speed. When moving the car, the laser module produces a line on the surface of the object that is filmed by a camera fixed at a known angle, obtaining the necessary information to generate the 3D model of the object. Tests were made on regular objects: hubcaps, pyramids and cobblestones and the results showed that the 3D-models produced had the same dimensions. Tests were also made on irregular objects such as soil surface and fruit. The prototype proved to be solid for generating 3D models of objects.

INTRODUCTION
One of the factors that most influence crop productivity is soil fertility. In order to maintain or even improve fertility, it is necessary to use fertilizers and correctives, which have an important participation in production costs. As a result, the correct dose and their uniform and efficient distribution are directly related to the profitability of agriculture.
The use of sowing-fertilizer machines is common in the implantation of grain crops in Brazil. These machines apply fertilizers directly to the sowing furrow. For Peche Filho et al. (2012) fertilizer application is one of the most important operations of the crop cycle, and possible failures may result in significant losses. Garcia (2007) mentions that the uniformity of distribution and its proper deposition become continuously important, since fertilizers are responsible for a large part of the total cost of production.
According to Brandt (2010), the fertilizer dispenser is the component of fertilizers that most affects the performance of this type of machine. Also, for Altmann et al. (2010), working inclination, the speed of activation and the type of fertilizer are the factors that most influence the functioning of these mechanisms.
Several methodologies have been used to evaluate the longitudinal distribution of the metering mechanisms of seeder-fertilizers.
In order to measure the flow of fertilizers applied by metering mechanisms, Ferreira et al. (2010) and Reynaldo (2013) used containers for collection in a determined period of time, which were later weighed.
On the other hand, Santos et al. (2014) measured the mass of fertilizer in the laboratory and in the field. The laboratory methodology consisted of measuring the mass of fertilizer deposited in the collecting pots over 5 meters, which were subsequently weighed. In the field methodology, the test was carried out by placing a 25-m gutter equipped with 9 x 7.5 cm collecting pots on the central line of the seeder-fertilizer machine. The fertilizer-conducting tube was placed over the collecting-gutter, thus, metering the fertilizer over the collecting pots which were placed over it.
Bica and Souza (2009) developed a mass-flow sensor, consisting of a steel-blade placed under the meter, which undergoes elastic deformation when the fertilizer falls on it. This deformation is measured by an extensometer. Dos Santos et al. (2016) developed a sensor that is based on the electromagnetic induction principle, in which two field-coils were excited with a signal in order to obtain the flow of fertilizers.
Optical profilometric techniques can be used for the study in several areas of agricultural engineering such as: mechanical behavior, analysis of shape and volume of biological materials, soil roughness, among others.
Among the various techniques, triangulation is probably the oldest method used for measuring the depth of points in space, being probably one of the most common techniques (FERNANDES, 2007, BESI, 1989. A laser beam is usually used to probe the object. It illuminates points on the surface of the object and through a camera placed at a certain angle it locates this point and after processing this information it is possible to determine the distance from the illuminated points. According to the distance of the object's surface, the point appears in different places on the image. This technique is denominated triangulation because a triangle is formed by the laser emitter, the camera and the point generated by the laser on the object's surface, Storbeck and Daan (2001) used the triangulation technique to recognize the fish species through volume. The system was able to satisfactorily classify approximately 98% of the fish. Noordam (2007) mentions that the company Green Vision developed a high-speed system for the selection of peppers based on three-dimensional analysis also by laser triangulation.
According to Clark (2000), the working principle of the "Folha de Luz" optical sensor consists of the projection of a plane of light (laser) on the surface to be measured. The intersection of this plane with the surface defines a line that is then captured by a visualization system that according to the triangulation technique is placed at a known distance and inclination in relation to the plane of light. The analysis of the obtained image resulted in the determination of the coordinates of points belonging to the assessed object in a system of known coordinates. A schematic drawing is shown in Figure 1. The objective of this work was to build a prototype of a three-dimensional scanner based on laser triangulation and to develop a methodology to determine the volume of fertilizers placed in a gutter.

MATERIAL AND METHODS
The work was carried out at the Image Laboratory of the Engineering and Automation Center of Instituto Agronômico Campinas (IAC), located in Jundiaí, São Paulo State. The experimental arrangement consisted of: Microcomputer with a Core i5-2410M model processor, with 3GB of RAM memory, 2.4G RF wireless camera, coupled to the computer via a USB port and na in-line laser diode 5mW and 650ηm.
It was built a prototype (Figure 2) consisting of a gantry that has an endless shaft, driven by an electric engine of variable speed. This shaft, when rotating, displaces a car with the diode that projects a laser line perpendicular to the surface of the object. In the same car, a camera was adapted, positioned with a 20º inclination of the laser source, which films the object as the car moves. To capture the video, AMCap v. 9.20 was used.
This methodology was carried out in three stages in which the first part corresponded to the construction of qualitative 3D Digital Models (MDT) with the initial tests, then the system was calibrated and in the third phase, a methodology was developed for the measurement of fertilizer volume.

Development of the methodology for MDT construction
For the treatment of the images, the ImageJ software was used, so for which it was built a routine that breaks the video into frames, turns each one into shades of gray, where the lighter region corresponds to the laser line, which contains information about the topography of the object under study. Then it corrects the deformations due to the observation angle and creates a new image that contains the topographic information of the object.

Figure 2. Laser-scanner setup
To test the methodology that creates the MDT of objects, a container with sand was used and the word "IAC" was written in a low relief and the scanning was carried out. Next, the same was done for a wax-banana model.

Calibration of the system
To calibrate the three dimensions of the MDTs obtained by the system and to test the accuracy of the measurements, seven rubber cubes were used, whose dimensions and volumes are shown in Table 1. Their volumes were calculated using the equation V= S 3 , where V is the volume and S is the side of the cube. These cubes were scanned and their respective MTs were built.
The dimensions of the smallest cube were used to correct the X, Y and Z coordinates by creating the correction factors for the coordinates of the MDTs. The X coordinate corresponds to the displacement of the laser/camera system, in which the number of photos required to cover a known distance, giving a photo/mm ratio. The Y coordinate is given by the number of pixels corresponding to the width of the object of a known width, giving a pixel/mm ratio. The Z coordinate is given by the displacement of the laser line projected on the plane and projected on an object of known height, giving a pixel / mm ratio. After calibration, the volumes obtained by the laser scanner were compared with the calculated volumes and using the Coefficient of Determination (R 2 ). This is a measure of adjustment of the volumes obtained by the laser scanner in relation to the calculated values. The higher the R², the greater the correlation between the measured and the calculated volume.

Methodology for the fertilizer volume quantification
In the development of the methodology for measuring the fertilizer volume, 4-14-8 granulated were used, with a density of 1.14 g/cm 3 . It was deposited in a 50x50x172-mm plastic angle brackets, with a downward apex, forming a "V" channel. Scans were made with the empty gutter and with five volumes of fertilizers deposited on it, 10, 20, 30, 40 and 50 ml, measured through a 0.5-ml precision graduated cylinder and weighed on a scale, Marte brand, model AS5500C, with an accuracy of one hundredth of a gram, as shown in Figure 3.
Through the developed routine, six images were generated, where I 0 , which corresponds to the empty gutter and I 10 , I 20 , I 30 , I 40 and I 50 to the gutter with the respective volumes of deposited fertilizers. These images in shades of gray, contain the topographic information of the empty gutters and with fertilizers, that is, they constitute their MDTs. The light areas inside them correspond to the regions with the highest elevation and the dark areas are those with the lowest elevation.
Each of the images (MDTs) of the gutter with fertilizers were subtracted from the image of the empty gutter, resulting in the images F 10 , F 20 , F 30 , F 40 and F 50 , , which show the respective amounts of  fertilizers contained in the gutters. After, they were filtered to eliminate any artifacts that could cause any error on the measurements.
For the calculation of the volume (pixels 3 ), the average value of the pixels of the images was determined and multiplied by their number of pixels.
In order to verify the effectiveness of the system, the volume was correlated to the mass of the fertilizer deposited in the gutter and then calculated.

Development of the methodology
The results below present the outcomes of the methodology used for the creation of qualitative MDTs of objects. Figure 4 shows the word "IAC" written in low relief on the earth surface, while Figure 5 shows the MDT of the same digitized surface, where the relief is represented in shades of gray, where the darker regions have lower elevations low and the lighter, the highest elevations. Figure 6 shows the same wireframe surface to highlight the relief. Figure 7 shows the topographic contours of the banana model in shades of gray, ( Figure 7A) and the same object in false color, showing its relief ( Figure 7B).  The system was able to build the qualitative MDTs of the objects.

System calibration
The results below show the process to calibrate the system (laser scanner) by transforming qualitative MDTs into quantitative ones. Figure 8 shows the MDT of the cube in false colors, which served to calibrate the system. Figure  9 shows the correlation between the volumes of the cubes calculated by means of the equation and those obtained by the laser scanner. As it can be seen, R 2 was 0.9999, which shows a very high correlation between the volumes, therefore revealing the high accuracy of the laser scanner.

Methodology for quantification of the fertilizer volume
The data below show the results from using the methodology to measure the volume of fertilizers placed in a gutter. Figure 10A shows the MDT resulting from the empty gutter in shades of gray, where the dark regions show the lowest dimensions (vertex) and the light ones show the upper edges. Figure 10B shows the 3D plot of the same MDT.   Figure 13 shows the correlation between the calculated volume and the deposited volume of fertilizer with an R 2 of 0.9941. Thus, it shows that the methodology was able to quantify the volume of fertilizer with a high degree of accuracy. LINO,A. C. L. et al. Figure 13. Correlation between the deposited and calculate volume of fertilizer

CONCLUSIONS
• The laser-triangulation based 3D scanner was able to digitize the topographic contours of various types of objects, including ground surface, objects with regular and irregular shapes. Also, it was able to calculate the volume of fertilizer deposited in the gutter.
• These initial studies show that the lasertriangulation based 3D scanner has the potential to evaluate fertilizer application by fertilizer-sowers.
• The studies should continue for the development of the technique