Introduction

Agricultural management demands enormous amounts of energy resources and labor due to machinery operations such as seedbed preparation, tillage, crop protection interventions and harvest. Efficient in-field operations can reduce non-productive machinery movement (Filip et al., 2020). The direction in which a field is operated and the orientation of crop rows (cultivation direction) depends on various factors such as field size and shape, access and exit points to the field, drainage and irrigation technologies, available machinery, work organization reasons (places for bunker unloading of potatoes and beets), direction of slope and in-field obstacles. Often, the cultivation direction has been a result of the farmers´ experience and has been passed from one generation to the next (Oksanen & Visala, 2009). The weight of agricultural machinery and tractors has steadily increased due to mechanization progress in agriculture, leading to soil compaction and loss of soil functions (Keller & Or, 2022). Headlands have the highest traffic intensity consisting of wheel passes and wheel load compared to non-headland and are thus strongly constrained in soil functions (Augustin et al., 2020) leading to significant yield depression (Sunoj et al., 2021). Cultivation direction also affects water erosion rate as sowing along the contours reduces the velocity of surface runoff compared to sowing up and down the slope (Barbosa et al., 2021).

The emerging glyphosate ban in the European union will affect, in particular, farms with no-tillage and conservation agriculture technologies experiencing increasing challenges for chemical weed control (Kudsk & Mathiassen, 2020). This can be compensated by mechanical weeding, but will result in increased labor costs (Bocker et al., 2018). The consideration of the efficient cultivation direction of individual fields can mitigate the cost increase caused by additional weed control activities.

Path planning is an important element in the research area of precision farming. For example, by driving an optimized field-work pattern (B-pattern), a reduction of energy consumption of 3–8% can be achieved (Rodias et al., 2017). By dividing complex field polygons into simpler structures and calculating the optimal path within these subfields, a reduction of turning maneuvers and headlands can be achieved (Bochtis & Oksanen, 2009; Hofstee et al., 2009; Jin & Tang, 2010; Taïx et al., 2006). However, it has not yet been shown what optimization potentials are possible for a large number of existing agricultural fields by comparing the present and the optimal cultivation direction. This is mainly due to the fact that it is not yet possible to automatically identify current sowing directions of fields at the landscape level.

The detection and removal of permanent traffic lanes from aerial images for a few fields has already been established as a proof of concept to more easily identify archaeological sites of interest (crop or soil markers) using Fast Fourier Transformation (Perkins, 1996). The direction of cultivation of individual fields has also been used to evaluate hillslope and gully erosion (Wang et al., 2016). Wang et al. (2016) used satellite imagery to identify the sowing direction, which they visually inspected and manually mapped as lines in a geographic information system. Scholand and Schmalz (2021) identified the cultivation direction of 300 land parcels and compared them to the mean aspect of the fields derived from the digital elevation model for soil conservation measure. The fast line detector algorithm of the OpenCV library (Bradski, 2000) was used to identify linear structures on fields. However, all methods have their limitations as they cannot detect the direction of cultivation of subfields (fields with more than one main cultivation direction), require unique linear elements (permanent traffic lanes) and cannot be applied at the landscape level to several thousand fields.

The use of Gabor filter image analyses allows the detection of the alignment of linear features. It has been used so far in different applications of computer vision in agriculture: automated vineyard detection and characterization (Rabatel et al., 2008), spatial modeling of crop/weed images to test different weed detection methods (Jones et al., 2009), determination and distinction between different corn leaf diseases (Mousavi et al., 2016) and as an image preprocessing technique for automated weed classification processes (Albraikan et al., 2022).

This study aimed to present a novel method that automatically identifies the current cultivation directions using a modified Gabor filter for several thousand arable fields covering more than 200 000 ha and thus captures entire landscapes. At the same time, a path planning algorithm was developed to identify the optimal cultivation direction for a maximum reduction of turning maneuvers and thus a reduction of soil compaction, headland and time- and energy-intensive in-field operations. The algorithm was tested for agricultural fields of the federal state Brandenburg in Germany to compare the optimal cultivation directions with the present cultivation directions and potential savings were identified.

Methods

Study site

In this study, data of the Integrated Administration and Control System (IACS) were used (EU, 2009). IACS is a Europe-wide system where farmers submit their managed fields as georeferenced polygons in order to receive subsidies. The data set consisted of all agricultural fields in the year 2019 in Brandenburg/Germany with a quantity of 212 693 georeferenced polygons including information about the crop species.

Only polygons with (a) a minimum size of 5 ha and (b) arable crop production were considered for the analysis. The reduced data set consists of 10 854 polygons with a total of 54 distinct arable crops.

Due to the large number of fields with differences in sizes and shapes, the compactness of all field geometries was calculated using the following equation (Oksanen, 2007):

$${\text{Compactness}} = \frac{{4\, \times \,\pi \, \times \,{\text{A}}}}{{P^{2} }}$$
(1)

where A is the area [\(m^{2}\)] of the field and p is the perimeter [\(m\)] of the field. The resulting Compactness has values between zero to one (except zero).

Images

Airborne images of Brandenburg from 2019 were used to determine the current cultivation directions (Fig. 1). Images from 2019 were available for a total area of 10 575 km2 in Brandenburg with a resolution of 0.2 m pixel width (DOP, 2021). This corresponds to 35.9% of the total area of Brandenburg. Only aerial photographs with full extent polygons were used.

Fig. 1
figure 1

Study area A Germany with the highlighted area being the federal state of Brandenburg and B Brandenburg with the crosshatched areas corresponding to the areas covered by airborne imagery in 2019

Software and data pipeline

Figure 2 provides an aggregated overview of the main steps for data processing. Data handling, image analyses and path planning optimization were performed using Python programming language. Anaconda Navigator (Version 1.10.0) (Anaconda, 2020) was used for package management and Jupyter Notebook (Version 6.1.4) (Kluyver et al., 2016) was applied as an interactive development environment.

Fig. 2
figure 2

Flowchart of major data processing steps. First, a field polygon is picked in the “Select field” step. For every selected field polygon, the current cultivation direction is identified in the “Image processing” step (detected). Furthermore, for each field polygon the optimal cultivation direction is calculated in the “Path planning” step. For the optimal and detected cultivation direction, turning maneuvers and the area of headland are compared in the “Path evaluation” step

Model for the automated determination of current cultivation directions

To determine the cultivation direction, geometrical patterns within the fields are used in airborne images. These patterns result from the repeated driving on the fields and can be caused by different plant cultivation techniques (permanent traffic lanes or patterns resulting from basic soil cultivation, sowing or harvesting). As these patterns are mainly developed through sprayer and tillage machinery in arable farming, this method is limited to arable farming sites.

In addition to the main cultivation direction, there is the cultivation direction of the headland (Fig. 3) which are boundary areas of the field polygon that are needed to turn the machinery in order to cultivate the central field area. Since some arable fields have complex geometries, farmers may have several cultivation directions (more than one main cultivation direction).

Fig. 3
figure 3

Visualization of different spatial definitions for one field and its optimized path

Image processing

Division of fields through sub-boxes

To identify all possible cultivation directions (cultivation direction of all subfields), each field is divided into equally distributed quadratic sub-boxes with 25 m edge length. All sub-boxes are defined by their corners \(C_{{\left\{ {i,j} \right\}}}\),\({ }C_{{\left\{ {i + 1,j} \right\}}}\),\({ }C_{{\left\{ {i,j + 1} \right\}}}\) and \(C_{{\left\{ {i + 1,j + 1} \right\}}}\) for all \(i,j \in {\mathbb{N}}\). Each corner \(C_{{\left\{ {i,j} \right\}}}\), is calculated using Eq. 2:

$$C_{{\left\{ {i,j} \right\}}} = s + i\, \times \,Q1 + j\, \times \,Q2$$
(2)

where s is the lower left Point P(\(x_{min}\)/\(y_{min}\)) of the bounding box of the field polygon. Q1 and Q2 are the edge lengths of the sub-boxes [m]. All sub-boxes were created as geodataframes using Geopandas (Jordahl, 2014) and intersected with the field polygon. Only the sub-boxes that were completely within the field boundaries were used for further analyses.

Image extraction

From each of the sub-boxes of all fields, the image data from the airborne images were extracted using RasterIO (Gillies et al., 2013) Each image I(x,y,c) is a function of the spatial dimension, x and y and their four channels c (infrared, blue, green and red) (Fig. 4).

Fig. 4
figure 4

One single sub-box image and all four channels (infrared, blue, green and red). All channels were used for angle detection (Color figure online)

Circle mask

For each quadratic sub-box with an edge length of h [pixel], skew lines (45°) would have a higher proportion of associated pixels compared to straight lines (e.g. 0°, 90°). To guarantee an equal weighting of all possible angles, a Circle Mask C was created using Eq. 3:

$$C\left( {x,y,h} \right) = \left\{ {\begin{array}{*{20}l} {1, if \sqrt {\left( {x - \frac{h}{2}} \right)^{2} + \left( {y - \frac{h}{2}} \right)^{2} } \le \frac{h}{2}} \\ {0, otherwise} \\ \end{array} } \right.$$
(3)

with \(x,y \in {\Omega }\) and

$$\Omega = {\mkern 1mu} \left\{ {{\text{x}},{\text{y}} \in \left. {\mathbb{N}} \right|x \le h, y \le h} \right\}$$
(4)

Gabor filter

A modified Gabor filter for each image of all sub-boxes was applied. Individual filters were generated to optimize the new, modified filter for common track widths, as well as track spacing. The modified filter G is defined in the spatial domain as follows:

$$G\left( {x,y,f,\theta ,\omega } \right) = \cos \left( {2\pi f\left( {x\sin \theta + y\cos \theta } \right) + \omega } \right)$$
(5)

where \(f\) is the spatial frequency of the cosine pattern, \(\theta\) is the angular direction of G relative to the x-axes and \(\omega\) is the offset that translates the pattern orthogonal to θ. All used values of \(\theta , f\) and \(\omega\) for all generated filters G can be found in Table 1.

Table1 Parameters used to create individual modified filters

To generate a response (resp) for all channels of the image for a given angle (\(\theta\)), frequency (f) and offset (\(\omega\)), Eq. 6 was applied to the image (I), the circle mask (C) and the modified filter (G):

$$resp\left( {\theta , f,\omega } \right) = \mathop \sum \limits_{c \in \varphi } \left| {\mathop \sum \limits_{{x,y \in {\Omega }}} I\left( {x,y,c} \right) \cdot C\left( {x,y,h} \right) \cdot G\left( {x,y,f,\theta ,\omega } \right) } \right|$$
(6)
$${\text{with}}\,\varphi = \left\{ {0,1,2,3} \right\}$$
(7)

The result of such an individual response is visualized in Fig. 5. In the upper left, the image with the first channel I(x,y,0) of an airborne sub-box with clearly visible permanent traffic lanes can be observed. In the first image row, the products of the circle mask C and the modified Gabor filter G with constant \(\omega\) and \(f\) and a total of nine different angles \(\theta\) are presented. The second row shows the response of the image, the circle mask C and the modified Gabor filter G in the spatial domain. The bottom line lists the individual responses with the highest value at an angle \(\theta\) of 72°.

Fig. 5
figure 5

Image I(x,y,0) with the first channel of a sub-box (upper left). For visualization, the image was multiplied with nine different modified Gabor Filters with angles between 0° and 179.5° resulting in nine spatial products (sp) and their respective response

To generate the total response for each angle, Eq. 8 was applied:

$$resp\_total\left( \theta \right) = \mathop \sum \limits_{f,\omega \in O} resp\left( {\theta ,f,\omega } \right)$$
(8)

with

$$O = \left\{ { Frequencies \times Offset } \right\}$$
(9)

The total response (resp_total) of the same image used in Fig. 5 was visualized in Fig. 6 with a maximum at 72°. The corresponding angle of the maximum value of resp_total is called \(\theta_{max}\) and is calculated using Eq. 10:

$$\theta_{max } = \mathop {\max }\limits_{\theta } {\text{ resp}}\_{\text{total}}\left( \theta \right)$$
(10)
Fig. 6
figure 6

Total response of all angles between 0 and 179.5° from all individual filters. The highest peak was reached at 72° and indicates the angle of the cultivation direction

The angle \(\theta_{max}\) corresponds to the detected cultivation direction for the respective sub-box and is used for the following analysis.

Cultivation direction per field

To identify one main cultivation direction for each field (\(\theta_{T}\)), the median angle of all \(\theta_{max }\) values per field was estimated using the L1 minimization (median). Due to the fact that for this method the difference of two angles in the range 0–180° is not necessarily the difference of its numerical values (e.g. diff (170°,10°) \(\ne\) 160°), the function Eq. 11 was used to calculate the absolute difference between two angles \(\theta_{A} , \theta_{B}\):

$${\text{angdiff}}\left( {\theta_{A} ,\theta_{B} } \right) = \min \left( {\left| {\theta_{A} + 180^\circ - \theta_{B} } \right|,\left| {\theta_{B} + 180^\circ - \theta_{A} } \right|,\left| {\theta_{A} - \theta_{B} } \right|} \right)$$
(11)

and minimized the sum of the absolute deviations:

$$\theta_{{T{ }}} = \mathop {\min }\limits_{\theta } \mathop \sum \limits_{{\theta_{i} \in {\Gamma }}} {\text{angdiff}}\left( {\theta ,\theta_{i} } \right)$$
(12)

where \({\Gamma }\) is the set of all estimated \(\theta_{max }\) values of the current field. To solve the minimization of Eq. 12, the sum for all possible values in the range from 0 to 179.75 with step sizes of ¼ was evaluated:

$$\theta \, = \,\left\{ {\frac{i}{4} | i < 720 \wedge i \in {\mathbb{N}}} \right\}$$
(13)

A step size of ¼ was used to reduce computing power while maintaining sufficient accuracy. To check the consistency of all angles, the difference of all possible angle pairs is calculated and plotted in a histogram for visual inspection. The set of all angle pair differences is defined as:

$$\Gamma _{d} = \left\{ {{\text{angdiff}} \left( {\uptheta _{i} ,\uptheta _{j} } \right)~|~\uptheta _{i} ,\uptheta _{j} ~ \in \Gamma ~ \wedge ~i < j} \right\}$$
(14)

The number of all unique possible angle pair combinations can be calculated using the binomial coefficients:

$$\left( {\begin{array}{*{20}c} n \\ k \\ \end{array} } \right) = \frac{n!}{{k!\left( {n - k} \right)!}}$$
(15)

where n is the number of all estimated \(\theta_{max }\) values per field and k is two representing the angle pairs. For example, 100 sub-boxes per field with 100 individual \(\theta_{max }\) values result in 4950 individual angle differences \(\theta_{Dif}\). If most of the \(\theta_{max }\) values of a field are similar, there will be a large number of small differences (Fig. 7A). If two different directions have been detected in one field (e.g. when farmers split fields with two cultivation directions 1 & 2), a high number of small differences (all angle pairs that have the same cultivation direction) and a high number of high differences (all angle pairs between direction 1 and direction 2) can be noted in the histogram (Fig. 7B). If the cultivation direction is not well identified (for example by artifacts, shadows, erosion phenomena, transverse harrowing, plowed fields), or due to a high proportion of headland (elongated fields and not optimally processed), many different \(\theta_{Dif}\) are expected. To visualize \(\theta_{max}\) per sub-box, linestrings for each sub-box with a length of 20 m and the orientation according to the total_respons \(\theta_{max}\) are generated (Fig. 7)

Fig. 7
figure 7

Analysis of angle differences showing the field polygons and their corresponding airborne images on the left, the generated linestrings for all sub-boxes in the middle and an angle difference histogram on the right A large field with one uniform cultivation direction and a high number of low angle differences B medium size field with two main cultivation directions and a high number of low and high differences

To evaluate the consistency numerically, the mean of the absolute deviations was estimated:

$$V\left( {{\uptheta }_{T} } \right) = \frac{1}{{len\left( {\Gamma } \right)}} \mathop \sum \limits_{{\theta_{i} \in {\Gamma }}} {\text{angdiff}}\left( {\theta_{i} ,\theta_{T} } \right)$$
(16)

and the percentage of all \(\theta_{max }\) values of a field whose deviation from \(\theta_{T}\) is less than 5°:

$$E\left( x \right) = \frac{1}{{len\left( {\Gamma } \right)}}\mathop \sum \limits_{{\theta _{i} \in {\Gamma }}} \left\{ {\begin{array}{*{20}l} {1,} & {if~angdiff\left( {\theta _{i} ,\theta _{T} } \right) < x} \\ {0,} & {otherwise} \\ \end{array} } \right.$$
(17)

where x is 5° and \({\Gamma }\) is the set of all estimated \(\theta_{max }\) values per field. High E(5°) values represent a large quantity of detected angles \(\theta_{max }\) with small deviations from the main angle per field \(\theta_{T}\) and can therefore be used as an indicator for a clearly uniform detected cultivation direction.

Ground truth of automatic angle detection

To assess the accuracy of the angles determined by the modified Gabor filter, sowing directions of sub-boxes in 800 different fields were determined manually. For this purpose, 50 fields from 16 different crop species were randomly selected. From those fields, only one random sub-box was chosen. For all of these 800 sub-boxes, lines were created manually according to the visually identifiable cultivation direction using QGIS (QGIS, 2021). The images were separated into two different categories: clearly recognizable consistent direction (distinct) (Fig. 8A–I) and non-consistent recognizable directions (indistinct) (Fig. 8J–R). One line was created in images with uniform direction, and two lines were added for the two most visible directions in images with inconsistent direction.

Fig. 8
figure 8

Examples of individual sub-boxes used for ground truthing. Images AI have clearly recognizable consistent direction with A Peas B Starchy potatoes C Clover grass D Lupins E Corn (silage) F Winter barley G Winter rapeseed H Winter triticale I Soft winter wheat. Images JR were categorized as non-consistent recognizable directions J Spring oats K Peas L Peas M Sunflower N Winter rapeseed O Winter rapeseed P Field grass Q Corn (biogas) R Corn (silage)

A line consists of a start point (\(x_{1}\)/\(y_{1}\)) and an end point (\(x_{2}\)/\(y_{2}\)). To calculate the angle between the line and the positive x-axis in the two-dimensional space, the arctan2 function was applied and converted from radians to degree with Eq. 18:

$$\theta = \left( {\frac{{atan2 \left( {y_{1} - y_{2} ,x_{1} - x_{2} } \right)\, \times \,180^\circ }}{\pi }} \right)$$
(18)

Since the arctan2 function returns values between \(- \pi\) and \(\pi\), but only angles between 0° and 180° are valid, Eq. 19 is required:

$$\theta= \left\{\begin{array}{ll}180^\circ - \,\left| \theta \right| &,\text{ if }\,\theta \,\, < 0 \\\theta &,\text{ }\text{otherwise} \\\end{array}\right.$$
(19)

To verify the output of the proposed method, the difference between the manually created cultivation direction and the angle calculated by the modified Gabor filters using Eq. 9 was assessed. In this case, \(\theta_{A}\) is the angle of the manually created line and \(\theta_{B}\) is the angle of the modified Gabor filter.

A success rate was used as a criterion for successful identification of the angle. Angle differences smaller than 1° are considered to be very accurately detected and angle differences smaller than 5° are considered to be accurately detected.

Path planning

Polygon simplification

Every single polygon consists of N single points Pi, which are connected to form a polygon. Since for path planning, any line between two adjacent points is considered as a potential cultivation direction, the polygons are first simplified to reduce the number of polygon edges to a realistic level. This is necessary because all polygons of the present dataset were created manually by farmers or by digitizing aerial photographs as part of the IACS and can therefore contain a large number of unrealistic points. For this purpose, several linestrings from two adjacent points were created. Two neighboring linestrings AB and BC consist of three points (A, B and C). The difference of angles between \(\theta\)(AB) and \(\theta\)(BC) is determined for each point of the polygon using Eq. 20

$$\Delta \theta = {\text{atan}}2{ }\left( {{\text{AB}}} \right) - {\text{ atan}}2\left( {{\text{BC}}} \right)$$
(20)

Every point B of the field polygon is removed, if \(\Delta \theta\) < 5°. This simplifies the respective polygon and reduces the time of processing of all different possible cultivation directions.

If a polygon contains a hole, this is also taken into account in the process of simplification. These inner field boundaries represent obstacles (e.g. areas within the field polygons that are not used for agriculture, such as protected habitats, power poles or kettle holes).

Path planning model

The goal of the path planning algorithm is to find the optimal direction of cultivation by minimizing the number of turning maneuvers. For the path planning procedure, a large number of parallel lines (multilinestring) for all possible two adjacent point combinations of the simplified field boundary were created and saved (brute force algorithm). The spacing between the lines is the working width. The first line generated has an offset of half a working width to the field polygon. All other lines of one multilinestring have an offset of 4 m to each other. The created multilinestring was intersected with the field polygon.

Headland is defined as the area required by the tractor at the end of the track in order to be able to turn and drive on the next parallel track. In this study, a minimum turning radius (r) of 6 m and a working width of 4 m was assumed. The tractor has to be able to turn easily to reach a parallel track. For a simple turn of the tractor, a total distance from the field boundary to the headland boundary of 16 m was assumed and is therefore in the range normally required by tractors for turning (Oksanen & Visala, 2009) (Fig. 9).

Fig. 9
figure 9

Visualization of two different turning maneuvers of a tractor with a working width (ww) of 4 m and a headland of 16 m. Worked areas are highlighted with blue stripes, the direction of the turning maneuver is marked with arrows. A The intersection of the track extension of the tractor and the field boundary results in a right angle, creating a straight boundary of the headland polygon. B The track extension of the tractor intersects the field boundary at an acute angle. The boundary of the headland is staircase-shaped, since the field-operation starts only when the center of attachment reaches a distance of 16 m from the boundary of the field polygon (Color figure online)

The individual lines of the multilinestring must be shortened to generate the headland. First, all angles of all the intersections between the lines and the corresponding sections of the field polygon had to be calculated. If the angle is less than 5°, the line is considered parallel to this field boundary and will not be truncated. If the angle of the intersection between the line and the field polygon is greater than 5°, the line is shortened. For this purpose, all non-parallel intersections of all lines are intersected with the negatively buffered (16 m) field polygon and a new multilinestring is created with the shortened and parallel lines. The number of total turning maneuvers for a specific processing direction equals the number of lines of the multilinestring minus one. The multilinestring with the lowest number of linestrings represents the optimal path. The headland is created automatically by adding a 2 m buffer with flat cap styles to the multilinestring and subsequent merging. The polygon created in this way (corresponds to the central field area) is then subtracted from the field polygon (Shapely.difference). The identified headland is therefore the areas where the tractor has to turn to further process the central field (Oksanen & Visala, 2009) (Fig. 3). This differs from other definitions: the headland is usually defined as the negative buffer of the field polygons and includes all boundary areas (Sunoj et al., 2021) or all areas of the field polygon that intersect with the tracks (Spekken & de Bruin, 2013).

Comparison of the current and optimized cultivation direction

To calculate the turn and headland differences between the current and the optimized cultivation direction, only fields with an identified cultivation direction of a high degree of confidence were used. For this purpose, \(V\left( {{\uptheta }_{T} } \right)\) (Eq. 16) was applied as a proxy. Fields with \(V\left( {{\uptheta }_{T} } \right)\) < 10 were assumed to be correctly identified. Furthermore, only fields that had relatively simple geometries with a compactness factor of > 0.3 were compared. The complexity of the field polygon increases with decreasing compactness factor, and with it the probability that the field has more than one current cultivation direction.

Results and discussion

Data and compactness

This section provides a summary description of the reduced IACS data set used for this study. The 16 most common crops are shown in Fig. 10. Corn was grown on 3571 polygons alone (corn silage, corn biogas and corn).

Fig. 10
figure 10

Top 16 arable crops in 2019 and the number of polygons with identical arable crops in Brandenburg

The polygons had a total area of 217 925 ha with a mean area of 20.1 ha. However, the median size is 14.4 ha, indicating a right skewed distribution of area sizes. The compactness of all 10 854 polygons ranged from 0.01 to 0.92 (Fig. 11). The mean compactness factor was 0.51, with 25% of the polygons having a compactness of less than 0.39 and 75% of all polygons had a compactness less than 0.65. Many polygons had obstacles that can affect the compactness by increasing the perimeter and reducing the area (Scholand & Schmalz, 2021). 32% of all polygons contained obstacles. The larger the polygons became, the more often they contained obstacles. 59.2% of all polygons larger than 50 ha and even 80.0% of all polygons larger than 100 ha contained obstacles.

Fig. 11
figure 11

All field polygons, their compactness factor, size [ha] and the cumulative frequency. Yellow dots represent polygons without obstacles, black dots represent polygons with obstacles (Color figure online)

Figure 12 shows three examples of polygons with different sizes and compactness factor from almost round (Fig. 12A) to very incompact polygons (Fig. 12C).

Fig. 12
figure 12

Field polygons with different compactness and field size (A) A High compactness with almost round shape, B medium compactness with concave properties and C extremely low compactness for a stretched polygon

Cultivation direction identification

A total of 2 905 746 sub-boxes were created for all 10 854 polygons and the individual cultivation direction was determined. Figure 13 shows the different steps to identify the cultivation direction of one field and all sub-boxes.

Fig. 13
figure 13

Identification of all cultivation directions for a field: A the field polygon and the airborne image with one highlighted sub-box B enlarged sub-box with a resolution of 125 × 125 pixels C all linestrings of all sub-boxes for this field polygon, D the total response of the sub-box (Fig. 13 B) with a \({\theta }_{max}\) of 1.5° and E histogram of all differences for all angles of the sub-boxes

For a large number of fields, cultivation directions \(\theta_{max }\) of sub-boxes with small deviations from the main angle and small mean values of the absolute deviations \(V\left( {{\uptheta }_{T} } \right)\) were detected (Fig. 14). The median of all E(5°) was 89.0%, the mean 80.8%. For 7477 arable fields (68.9% of all analyzed fields), more than 80% of all \(\theta_{max }\) of a field had less than 5° deviation from the corresponding main cultivation direction \({\uptheta }_{T}\). The mean V(\({\uptheta }_{T}\)) for these fields ranged from 0.1 to 17.1. These results underpin that for a large proportion of all fields, the main cultivation direction was uniformly identified. However, the identification accuracy varied considerably between crop species. While a large proportion of all winter wheat fields were identified with low V(\({\uptheta }_{T}\)) and high E(5°) values (Fig. 14A), fields with alfalfa grass had high V(\({\uptheta }_{T}\)) and low E(5°) values (Fig. 14B). Alfalfa grass is a perennial crop and thus uniform traffic patterns are rarely identified due to full vegetation coverage.

Fig. 14
figure 14

Scatterplot of all fields, their percentage of all \({\theta }_{max}\) values with deviation of less than 5° from \({\theta }_{T}\) called E(5°) and their mean of the absolute deviations \(V({\uptheta }_{T})\). A All fields with the crop species winter wheat are highlighted red and B all fields with the crop species field grass are highlighted green (Color figure online)

Ground truth of automatic angle detection

192 of the 800 sub-boxes contained indistinct patterns and were analyzed separately. The angle deviations and the success rates of all distinguished sub-boxes was summarized in Table 2 for each crop species.

Table 2 Number of sub-boxes used for ground truth evaluation of the cultivation direction identification procedure per crop with details on two different success rates, the mean and median of the angle pair deviations

The deviations of the angles varied between crop species. A high success rate of distinct sub-boxes for 5° deviations was found for 87.50% of all crop species. The success rate is reduced to 52.80% for deviations smaller than 1°. Clear differences can be seen between annual and perennial crops. Perennial crops (field grass, clover grass, alfalfa grass) had by far the lowest success rate (5°) with 50, 57.5 and 77.1% respectively, compared to soft winter wheat, spring barley and sunflower with a 100, 100 and 97.6% success rate, respectively. This could be due to the fact that perennially cropped fields had already established stands of the corresponding crops with uniform plant coverage and no typical recognizable cultivation direction patterns. Furthermore, no difference was identified between summer crops and winter crops which is explained by the fact that sowing had already taken place (sunflower, potatoes, lupins) or preparations (plowing or cultivating) had already been made (corn) on many fields with summer crops at the time the airborne imagery was captured. When looking at very small angular differences (success rate 1°), it is noticeable that winter triticale, soft winter wheat and sunflower were the crop species with the highest success rates with low median and mean values. In contrast, winter rapeseed had also a high success rate of 54.5%, but a high mean deviation (15.8°) of all 44 distinct sub-boxes (Table 2). The low median difference of 1° indicates that a large number of angle differences are low, but that there is a non-negligible proportion of high angle differences. This seems to be a problem in rapeseed and indicates that the identification of the processing direction needs to be optimized for single crop species in the future.

Optimized path planning

The reduced data set contains 3410 field polygons (see chapter ‘Comparison of the current and optimized cultivation direction’). The optimized path generated from the path planning algorithm has reduced the number of turn maneuvers and the area of headlands for many fields compared to the identified current cultivation direction. There are large differences in the possible savings of turn maneuvers between the individual fields. For 1061 fields, the number of turns for the optimized path was identical to the number of turns for the current identified path. The mean number of avoidable turns per field was 17.1 turns. The median of avoidable turns was 4 turns and for one field, a maximum of 294 turns could be saved. Through the path planning of 3410 fields, a total of 58 162 turns out of a total of 412 878 turns could be saved. This corresponds to 14.1% of all turns of all fields.

The headland was reduced by optimized path planning. With a total area of 76 870 ha, the identified headland was 6669 ha. The headland with optimized path planning was only 6162 ha, being 507 ha less (7.6% of the total headland). Figure 15 shows the relationship between field size and headland. With increasing field size, the total headland area increases (Fig. 15A) and the percentage of headland of the total area decreases (Fig. 15B).

Fig. 15
figure 15

Relation between field size and headland. Each blue point represents one field

Many fields were identified where optimized path planning would have led to a large reduction in the number of turn maneuvers. For 360 fields, optimized path planning could have reduced the number of turn maneuvers by more than 50 turns. For these 360 fields alone, a total of 31 061 turning maneuvers could have been saved through optimized path planning (Fig. 16).

Fig. 16
figure 16

Boxplot and individual data points of 360 fields, the number of turn maneuvers for the current (boxplot left hand side and blue data points) and the optimized cultivation direction (boxplot right hand side and orange data points). The green lines connect data points of the identical field and visualize the difference in the number of turns between current and optimized cultivation direction (Color figure online)

In Fig. 17, one example field was chosen where 257 turns could have been saved through optimized path planning. Optimized path planning could also reduce the headland by 2.4 ha in this field.

Fig. 17
figure 17

One exemplary field with a total area of 49.6 ha in Brandenburg. Optimized path planning could reduce the number of turns. A Aerial image of the field (red field boundary) with the clearly visible cultivation direction (permanent traffic lanes). B Recognized cultivation direction with 366 turns required for processing with 4 m working width. The blue polygon corresponds to the headland needed to turn the machine. C Optimized cultivation direction with the reduced number of turns. Due to visualization reasons only every sixth track was plotted (green lines with a distance of 24 m to each other) (Color figure online)

The possibilities for automated cultivation direction recognition and possible reduction of turning maneuvers and headland area through path planning could support farmers in optimizing their field work pattern. However, it is not always the number of turns that determines e.g. the total unproductive time in cultivating a field. Spekken & de Bruin (2013) showed that the total unproductive time of field operations can lead to different optimal cultivation directions depending on the equipment and thus different servicing times. Also, a non-optimal cultivation direction may have been chosen, due to high slopes or specific elevation pattern or because the orientation of the seed rows may influence solar interception as well as shading of weeds between the rows (Dhingra et al., 1986). Furthermore, no curved processing directions were considered in the identification of current processing directions or path planning. Curved paths are mainly important in highly irregular polygons or in fields with steep slopes (Garcia-Santillan et al., 2018).

Outlook

This approach is restriced to aerial images and IACS data from 2019, since a large area in Brandenburg was surveyed for 2019 and the data is available as open source. However, the method can be extended to satellite imagery. With satellite resolutions of < 3 m/pixel and with high temporal resolution, permanent traffic lanes are visible on satellite images and thus identifiable with the presented approach. Therefore, real-time determination of cultivation direction at a subfield level and path planning analyses could be conductede for large areas and entire states and integrated into decision support systems for agriculture. Additional data, such as the digital elevation model and indices derived from it, could be integrated and analyzed together with the cultivation direction at the subfield level to identify, for example hot spots of runoff or soil erosion.

Conclusions

A novel method for the successful and accurate identification of cultivation direction by analyzing aerial imagery using a modified Gabor filter was presented. The cultivation direction for thousands of arable fields was identified at both, the subplot level as well as for the whole field. The results vary in accuracy between individual arable crop species with high success rates from 77.3% to 100.0% for annual crops. The proposed path planning algorithm (minimizing turning maneuvers for a single pass) was able to identify potential savings in form of turning maneuvers and headland by comparing current to optimal cultivation direction. In total, 14.1% of all turning maneuvers and 7.6% of total headland area could be saved  if farmers would make use of the optimal cultivation direction.