## Materials and Methods
### The STARS Image Processing Workflow  
Our image processing workflow is based on four principles. It  
1. is founded on free and open-source software,
2. requires minimal user interaction,
3. supports VHSR satellite image processing, and
4. is tailored to smallholder farming applications. To adhere to these, the processing is scripted largely with R statistical programming language [28], custom Fortran and C++ utilities, Python, Linux shell scripts, GNU's Not Unix (GNU) Make, and third party libraries such as GDAL (Geospatial Data Abstraction Library). The system is set up on a server equipped with 8 \(\times\) 8 GB RAM memory, dual Intel Xeon E5-2640 v3 processors (2.6 GHz), and two 400 GB SSD, and it runs on a Debian Linux operating system. The source code is freely available at the STARS GitHub site ([[https://github.com/GIP-ITC-TwenteUniversity/stars-image-processing-workflow](https://github.com/GIP-ITC-TwenteUniversity/stars-image-processing-workflow)]([https://github.com/GIP-ITC-TwenteUniversity/stars-image-processing-workflow](https://github.com/GIP-ITC-TwenteUniversity/stars-image-processing-workflow))). The images are archived and processed from a Network Attached Storage (NAS) server with a total storage capacity of 50 TB, which is also the platform of dissemination to end-users. Table 2 lists representative samples of satellite images and their spatial and pixel dimension. The overarching idea is to create a fully automated system that processes the dataset and derives the required output. A single stream and single core process is followed for the first steps of image processing, where the earlier discussed pre-processing and dependencies are handled. Once the workflow of an image reaches a higher level product, the output is extracted depending on the scope of the task. The overall scheme is provided in Figure 3. The process starts with atmospheric correction using the 6S radiative transfer model. The produced.hdf file is converted to a GeoTIFF format, and the metadata from the original file are appended. The fourth step is a stitching operation of the tiles provided in a single delivery; for a DG delivery of 10 \(\times\) 10 km\({}^{2}\) area, this is often a number of four tiles. Subsequently, orthorectification using the NASA Shuttle Radar Topography Mission (SRTM) Version 3.0 Global 1 arcsecond DEM is implemented in GDAL based on the.rpc coefficient file (named.rpb in DG deliveries). Next, image registration based on a master image for each site is implemented to ensure a high coregistration accuracy. The last two steps of our image processing are the derivation of cloud- and tree masks. This is the highest level of post-processed image, based on which further scientific analysis can be carried out on calibrated data. Moving a step forward, timestamped statistical moments of the spectra and textural features are extracted for each target object such as a farm field, which are then collected in a crop spectral library. Since studies of smallholder farming are expected to also be taken up in low-income countries, we wanted to make it possible for local research and operational organizations to process satellite data with free access and minimal costs. Commercial software has certain disadvantages such as licensing restrictions for end-users, an inability to freely access the source code, long-term maintenance, and security and transparency [29]. All these issues are more easily dealt with in free and open-source software.