## 6 Conclusions  
The purpose of this study was to investigate the effectiveness of widely used vegetation indices calculated from Sentinel-2 images for the automatic detection of crop types using the random forest algorithm. The results showed that three vegetation indices yielded the highest accuracy, namely MCARI (\(OA\) = 86%, Kappa = 0.81), NDI45 (\(OA\) = 85%, Kappa = 0.81), and WDVI (\(OA\) = 85%, Kappa = 0.80). Although these indices have great potential when used separately, their combination led to lower accuracy (\(OA\) = 78%, Kappa = 0.72).  
An additional goal of this study was to evaluate the effect of dimensionality reductions on automatic crop type mapping. However, four different combinations of components were used and the classification results and the reduction in the dimensionality using PCA did not show an increase in the mapping accuracy in all variants. For example, simultaneous use of the three initial PCA components exhibited an \(OA\) of 78% and Kappa coefficient of 0.72. Unfortunately, this is still not a satisfactory result.  
Additionally, our experiments show that between April and September the most important period in which the spectral data should be captured is June and August. This is because in June, stages such as the flowering, fruit development, and vegetation growth (Figure 2) appear for different plant species in that period. Similarly, in September various species are harvested. Therefore, when designing the methodology for crop type detection, the images from key periods for each specific plant cultivated in the study should be included.  
Vegetation indices show considerable potential for the automatic detection of crop fields. Using the MCARI, NDI45, and WDVI, we were able to accurately classify the fields in our selected study area. However, it should be taken into account that these indices may not show such satisfactory accuracy when classifying fields sown with crop species different from those presented in this study. In addition, a major drawback of optical data is the need to acquire cloudless images, which can be a very difficult task in some areas. In future research related to the automatic detection of fields, it will be worth considering additional optical images from other missions, as well as use of radar images which, because of their characteristics, can be acquired regardless of the time of day and weather conditions.  
Conceptualization, K.P.-F.; methodology, K.P.-F.; software, K.P.-F.; validation, K.P.-F.; formal analysis, K.P.-F. and M.P.; investigation, M.P.; resources, K.P.-F. and M.P.; data curation, M.P.; writing--original draft preparation, K.P.-F. and M.P.; writing--review and editing, K.P.-F. and M.P.; visualization, M.P.; supervision, K.P.-F.; project administration, K.P.-F.; funding acquisition, K.P.-F. and M.P. All authors have read and agreed to the published version of the manuscript.  
This research was funded by the Ministry of Education and Science, grant number: MEiN/2021/205/DIR/NN4 under the program: \"Best of the best 4.0.\", under the Knowledge Education Development Operational Program co-financed by the European Social Fund (application number for funding, POWR.03.03.00-00-P019/18). The APC/BPC is financed/co-financed by Wroclaw University of Environmental and Life Sciences.  
Sentinel-2 data are freely available via [[https://scihib.copernicus.eu/](https://scihib.copernicus.eu/)]([https://scihib.copernicus.eu/](https://scihib.copernicus.eu/)) (accessed on 25 October 2020). Data containing information about the crop types in.shp captured within the field are available to share upon request.  
The authors declare no conflict of interest.  
User accuracy for the spectral indices used in this study.