Next Article in Journal
LSTMConvSR: Joint Long–Short-Range Modeling via LSTM-First–CNN-Next Architecture for Remote Sensing Image Super-Resolution
Previous Article in Journal
Application of a Bicubic Quasi-Uniform B-Spline Surface Fitting Method for Characterizing Mesoscale Eddies in the Atlantic Ocean
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Technical Note

Agronomic Information Extraction from UAV-Based Thermal Photogrammetry Using MATLAB

Department of Soil, Plant and Food Science, University of Bari Aldo Moro, Via Amendola 165/A, 70126 Bari, Italy
*
Author to whom correspondence should be addressed.
Remote Sens. 2025, 17(15), 2746; https://doi.org/10.3390/rs17152746
Submission received: 15 June 2025 / Revised: 4 August 2025 / Accepted: 5 August 2025 / Published: 7 August 2025

Abstract

Thermal cameras are becoming popular in several applications of precision agriculture, including crop and soil monitoring, for efficient irrigation scheduling, crop maturity, and yield mapping. Nowadays, these sensors can be integrated as payloads on unmanned aerial vehicles, providing high spatial and temporal resolution, to deeply understand the variability of crop and soil conditions. However, few commercial software programs, such as PIX4D Mapper, can process thermal images, and their functionalities are very limited. This paper reports on the implementation of a custom MATLAB® R2024a script to extract agronomic information from thermal orthomosaics obtained from images acquired by the DJI Mavic 3T drone. This approach enables us to evaluate the temperature at each point of an orthomosaic, create regions of interest, calculate basic statistics of spatial temperature distribution, and compute the Crop Water Stress Index. In the authors’ opinion, the reported approach can be easily replicated and can serve as a valuable tool for scientists who work with thermal images in the agricultural sector.

1. Introduction

Precision agriculture (PA) is a dynamic site-specific management strategy for agricultural activities, in which data are collected, processed, analyzed, and combined with other information to guide decision-making based on spatial and temporal variability [1]. This approach optimizes the use of natural resources (e.g., water, fertilizers, plant protection products), improves quality and crop productivity, and promotes sustainable farming practices. The improvements in remote sensing technologies and the decrease in sensors’ cost have allowed the adoption of cost-effective methods for large-scale monitoring [2]. The effectiveness of these technologies in PA strategies is influenced by several factors [3], including the following: (i) the platform employed for monitoring, (e.g., agricultural tractors, unmanned ground vehicles (UGVs), unmanned aerial vehicles (UAVs), or satellites), which strongly influences the spatial and temporal resolution of the acquired data; (ii) the region of the electromagnetic spectrum employed by the sensor (visible, infrared, microwave); (iii) the number and width of the spectral bands; and (iv) the spectral resolution of the sensor. To date, in the agricultural sector, the most employed sensors for monitoring activities are visible (RGB) and near infrared (NIR) cameras. Several studies [4,5,6,7,8,9] used images collected by satellites or UAVs in these spectral regions to evaluate the condition of the vegetation and estimate plant parameters, thanks to vegetation indices. These are defined as a combination of different wavebands, and the most common include the Normalized Difference Vegetation Index (NDVI), the Soil-Adjusted Vegetation Index (SAVI), and the Triangular Greenness Index (TGI). However, these indices are influenced by several factors such as temperature and cloud cover and are obtained considering relatively slow response variables; indeed, their value changes only when evident visible damages occur to crops [10,11]. Nowadays, the use of thermal cameras capable of providing temperature measurements of soil, plants, and crops is increasing in popularity in the agricultural sector. Temperature is a rapid response variable, enabling the early detection of stress conditions in advance compared to visual symptoms, overcoming the limitations imposed by RGB and NIR cameras [12,13]. The operating principle of a thermal camera is that any object emits radiation, and its amount is proportional to the emissivity and temperature of the object. The higher the temperature of the object, the greater the intensity of radiation emitted by it [14]. Thermal cameras have the potential to be applied in several application fields in the agricultural sector, such as soil and crop monitoring for efficient irrigation management, crop health and disease assessment, monitoring of crop maturity and yield, and the identification of anomalies in irrigation systems [15]. A key application is the identification of temperature anomalies in leaves, linked to physiological variations induced by water or nutrient shortage conditions [16]. When a plant is in conditions of water stress, it tends to decrease the opening of the stomata or close them completely, reducing or interrupting the evapotranspiration cooling processes and increasing leaf temperature [17]. This temperature difference is at the base of the definition of water stress indices, such as the Crop Water Stress Index (CWSI). This index provides farmers with fundamental agronomic information to implement precision irrigation strategies, according to the real needs of the crop [18].
One limitation in the widespread use of thermal cameras is the scarcity of open-source and commercial software capable of elaborating thermal images. One commercial software program able to process thermal images is PIX4D Mapper, which is a professional photogrammetry software widely employed for aerial mapping to create accurate 3D models, orthomosaics, digital surface models (DSMs), and point clouds from images acquired by UAVs [19]. However, it is unable to correctly generate thermal orthomosaics using images collected by certain thermal cameras, such as the Zenmuse H20T and Zenmuse H20N, and by some DJI drones, such as the Mavic 3T Enterprise, Matrice 30T, and Mavic 2 Dual Enterprise Advanced. These devices save thermal images in the radiometric-JPEG (R-JPEG) format, which embeds temperature data in each pixel. Unfortunately, PIX4D Mapper cannot directly process images of this format due to the encryption of the images’ metadata by the manufacturer. As a result, the software will treat thermal images as RGB, and the processed orthomosaic will not display the real temperature values [20]. To overcome this limitation and correctly process the thermal images acquired by the previously mentioned devices, the images must be converted into the radiometric TIFF format. For this scope, an open-source interface was used [21]. However, thermal orthomosaics elaborated by this software are suitable only for visualization; indeed, it is not possible to obtain the temperature value of each pixel. Moreover, the evaluation of the spatial temperature distribution within a region of interest (ROI), as well as the calculation of thermal stress indices, such as the CWSI, is not allowed. This agronomic information is crucial in PA applications, where the knowledge of the area in which the PA strategy must be applied is fundamental.
This paper reports on the implementation of an approach to extract the temperature of each point of thermal orthomosaics, define regions of interest (ROIs), calculate basic statistics of temperature and CWSI spatial distribution, and save the obtained data for further post-processing analysis. The novelty of this work lies in the employed methodology; indeed, a custom script in MATLAB® R2024a has been implemented for the scope. To the authors’ knowledge, this is the first study that proposes such an approach, and in the authors’ opinion, the proposed methodology can be easily replicated and can be very useful for researchers and experts working in this field.

2. Materials and Methods

2.1. Thermal Imaging

Any object with a temperature above absolute zero emits electromagnetic radiation. Thermal imaging deals with the measurement of the emitted radiation by objects in the thermal infrared (TIR) region. Generally, the long-wave infrared (LWIR) region, from 8 µm to 14 µm, is the most used range in thermal imaging because Earth surface materials, such as vegetation, soil, and water, emit radiation in this region at environmental temperature without significant interference from the atmosphere and the radiation coming from the sun [22]. Thermal cameras are passive sensors able to measure the radiation emitted by an object’s surface without direct contact with the object itself and convert it into a temperature represented as a Grayscale Value. It is important to highlight that, even when radiometrically calibrated cameras are employed, differences in illumination and in properties of the surface, such as material and roughness, affect the thermal emissivity; thus, only similar surfaces can be reliably compared [23].
The physics law, which explains the radiation emission in the TIR region, is the Stefan–Boltzmann law (1):
E = ε∙σ∙T4
where E is the flux of radiation measured in W∙m−2 emitted by a body, ε is the emissivity, σ is a constant, and T is the temperature of the body.
Leaf temperature depends on its energy balance, which is influenced not only by the emitted radiation but also by the degree of shading, the inclination with respect to the direction of the sun, the heat losses related to the wind, and the air humidity [24]. To correctly relate leaf temperature to a water stress condition, it is necessary to consider all the aforesaid factors; however, this would require the measurement of multiple variables and a complex analysis [25]. Thus, empirical approaches based on the definition of indices correlated with water stress conditions have been proposed; one of the most widespread is the CWSI.

2.2. Crop Water Stress Index (CWSI)

The CWSI was developed by Idso et al. [26] and Jackson et al. [27] and measures the transpiration rate occurring from a plant, considering the interaction of the system plant–soil–weather condition. When a plant is irradiated by solar energy, the leaves use a portion of it during the process of water evaporation to decrease their temperature. If a plant has adequate watering, it transpires at its potential rate; however, in water shortage conditions, the plant closes the stomata, decreasing the transpiration rate, and an increase in the leaves’ temperature takes place [28]. This empirical method represents a well-established method, and it is the most employed index to evaluate the crop water stress in conditions of a high crop canopy percentage and uniform canopy conditions. The CWSI can be directly strongly correlated with plant water status indicators, like leaf water potential and stomatal conductance, and indirectly with soil moisture. The empirical approach for the evaluation of the CWSI requires the knowledge of three variables: the canopy temperature (Tc), the air temperature (Tair), and the relative humidity (RH). Inaccuracies in the determination of the CWSI are related to the degree of accuracy of Tair and RH parameters. The CWSI is calculated based on the empirical equation suggested by Idso et al. [26] by (2):
CWSI = ((Tc − Tair) − (Tc − Tair)LL)/((Tc − Tair)UL − (Tc − Tair)LL)
where the canopy-air temperature difference (Tc − Tair) is normalized in the formula by two thresholds, indicated by subscripts LL and UL, which represent the non-water-stressed baseline and the non-transpiring baseline, respectively [29]. The CWSI varies from 0 (well-watered crops) to 1 (fully stressed crops). The thresholds have been calculated as (3) and (4):
(Tc − Tair)LL = a × VDP + b
(Tc − Tair)UL = c
where coefficients a, b, and c are specific for the crop. In the manuscript the considered crop was tomato. The coefficients for tomatoes were taken from the literature and were equal to −2.51, −1.04, and 4.26, respectively [30]. The vapor pressure deficit (VDP), which represents an indicator for the evaporation potential, is given by (5):
VDP = es − ea = es − es × RH/100
where es is the saturation vapor pressure, and ea is the actual vapor pressure. The saturation vapor pressure is given by (6):
es = 0.6108 × exp (17.27 × Tair/Tair + 237.3)
The relationships (5) and (6) point out that es depends on Tair and ea depends on Tair and RH. These relationships have been implemented in the developed MATLAB® script to calculate the CWSI.

2.3. Employed Drone and Flight Mission Description

The thermal monitoring activity was carried out by the DJI Mavic 3T drone (SZ DJI Technology Co., Ltd., Nanshan, Shenzhen, China), in a processing tomato field of Taylor variety located in Torremaggiore (41°36′18.4”N 15°12′21.4”E a.s.l.), in Apulia region (Southeastern Italy) on 8th August 2024, when the crop canopy percentage was nearly 85–90%. Tair and RH were measured by an on-site weather station during the flight mission and were equal to 31 °C and 65%, respectively. The flight mission was performed at noon on cloud-free days to correctly measure Tc, giving the most accurate estimation of the CWSI [28]. The mapped area, with the respective geo-localization information and dimensions, is shown in Figure 1.
The DJI Mavic 3T drone is a compact commercial drone (dimensions 348 × 283 × 108 mm without propellers and weight of 920 g including propellers). Its maximum flight speed is 15 m/s in Normal mode, and its maximum angular velocity is 200°/s; the Lithium-Ion Polymer (LiPo) battery (5000 mAh/77 Wh) ensures a flight time of 45 min in favorable weather conditions, allowing the coverage of up to 2 km2 in a single flight [31]. The drone relies on the GNSS for precise localization and wide-angle collision sensors, positioned on all its sides, for omnidirectional obstacle avoidance. The DJI Mavic 3T is equipped with a dual-camera system, composed of a 48 MP RGB camera with a wide-angle lens and a thermal camera, operating in the LWIR range 8–14 µm, with an integrated uncooled Vanadium Oxide (Vox) microbolometer with a 640 × 512 resolution [31] and an accuracy of ±2 °C. The Vox microbolometer is a small but rugged thermal detector that changes its resistance when TIR radiation is absorbed [32]. The main features of the integrated thermal camera are as follows: (i) Diagonal Field of View (DFOV) of 61°; (ii) focal length of 9.48 mm; (iii) principal point coordinates: 3.92 mm along the x axis and 3.14 along the y axis; (iv) radial distortion parameters R1 = −0.354, R2 = 0.159, and R3 = −0.166 and tangential distortion parameters T1 = 0.001 and T2 = 0; and (v) focusing from 5 m and 28 × zoom. The gimbal ensures the stabilization of the thermal camera in the range −135°/40° for tilt, −45°/45° for roll, and −27°/27° for pan. The drone has two selectable temperature ranges: from −20 °C to 150 °C in high-gain mode and from 0 °C to 500 °C in low-gain mode [31]. The R-JPEG images acquired by the thermal camera are in 8-bit format. The main parameters set for the performed flight mission are summarized in Table 1.
The Mavic 3T thermal camera is radiometrically calibrated by the manufacturer by default; however, to avoid the influence of possible sensor drifts and environmental factors that can affect temperature readings it was calibrated using a reference surface placed close to the take-off point, whose temperature was measured using a handheld infrared thermometer (FLIR TG54-2) before and after the flight. The actual choice of the speed and the route altitude of the flight was determined as a trade-off between the accuracy of the mapping activity and an acceptable flight time. The ground sampling distance (GSD) is defined as the distance measured on the ground between the centers of two adjacent pixels, and its value affects the accuracy of the survey, as smaller values correspond to greater spatial resolution [33]. The GSD measured in cm/pixel and the Dw measured in meters are given by (7) and (8):
GSD = (SW × H × 100)/(FR × IMW),
Dw = (GSD × IMW)/100
where SW is the width of the thermal sensor in millimeters (7.68 mm), H is the flight height in meters (25 m), FR is the focal length of the thermal camera (9.48 mm), and IMH is the image width in pixels (640 pixels) [31]. Based on the flight parameters set, a GSD of 3.3 cm/pixel and a corresponding DW of 21.1 m were obtained. The frontal and side overlap ratios were set to 80%. With these flight parameters, the number of collected thermal images was 3054. The course angle represents the drone’s orientation with respect to the navigation path. This parameter was set to 225° to follow the tomato rows. Imposing these parameters, the resulting flight time was 52 min. The flight route followed by the DJI Mavic 3T drone during the performed flight mission is reported in Figure 2.

2.4. MATLAB® Script

MATLAB® is a platform developed by MathWorks that integrates computation, visualization, and programming [34]. In this study MALAB® was preferred over other programming languages because it can also be used by non-expert developers, thanks to its high level of abstraction and simpler management of libraries and syntax. A custom script implemented in MATLAB® R2024a was developed to extract the temperature and the CWSI of each point of the thermal orthomosaic, define ROIs, calculate basic statistics of temperature and CWSI spatial distribution, and save the obtained data. A pseudocode of the developed MATLAB® script is reported in Appendix A, and the complete code is freely available as an attachment to the manuscript and can be run on a PC having a valid MATLAB® license. Firstly, to be correctly elaborated by the PIX4D Mapper software, the 3054 thermal images acquired during the performed flight mission must be converted from R-JPG format to TIFF format, using an open-source tool [21].

2.4.1. Loading and Conversion to Grayscale of the Reflectance Map

The script starts with the loading of the reflectance map exported from the PIX4D Mapper software. Generally, thermal images are represented in a single intensity channel (grayscale) because this format is simpler and faster to process. Grayscale images are usually generated in 8-bit; thus, the pixel value (“Grayscale Value”) ranges from 0 (black color) to 255 (white color), and any value in between represents the different shades of gray. The “rgb2gray” MATLAB® function performs the conversion from RGB to grayscale by eliminating hue and saturation but retaining the intensity value. The weighted formula employed for the conversion is reported in (9):
Grayscale Value = 0.299 × R + 0.587 × G + 0.114 × B
where the coefficients of the formula consider the human eye’s sensitivity, which is more sensitive to the green color, followed by red and blue.

2.4.2. Definition of Parameters and Map Geo-Localization

The parameters useful for the computation of temperature values of the orthomosaic and for the CWSI have been defined, i.e., the minimum and maximum temperature values extracted from the thermal orthomosaic generated by PIX4D Mapper, the air temperature Tair, the relative humidity RH, and the area of the entire mapped region, measured in hectares. To geo-localize the mapped area, the geographical coordinates of the corners of the monitored area are required. Generally, these coordinates are provided in the degree, minutes, and seconds (DMS) format. However, the conversion to the Decimal Degree (DD) format is required because most of the mathematical operations in the geographic coordinate system are based on this format. The formula for the conversion is given by (10):
Coordinate in DD format = Degrees + Minutes/60 + Seconds/3600

2.4.3. Temperature and CWSI Extraction

To extract the temperature value from each pixel (“Temperature Pixel”), the linear relationship (11) was used:
Temperature Pixel = minTemp + (Grayscale Value)/255 × (maxTemp − minTemp)
where minTemp and maxTemp are the minimum and maximum temperature values of the thermal orthomosaic generated by PIX4D Mapper, and the term (Grayscale Value)/255 is used to normalize the pixel value from the interval 0–255 to 0–1. The temperature value obtained for each pixel is then stored in a matrix (defined as “Temperature Matrix”), which can be used for further post-processing analysis. Once the matrix is completed, the elaborated geo-localized thermal orthomosaic is displayed, and the temperature distribution is easily visualized thanks to a color-bar. Cooler temperatures are represented in shades of blue and higher temperatures in shades of red. To compute the CWSI the relationships (2), (3), (4), (5), and (6) were implemented in the MATLAB® script. The CWSI value for each pixel is then stored in a matrix (defined as “CWSI Values”). Also in this case, when the matrix is completed, the elaborated geo-localized CWSI map is shown.

2.4.4. Creation of Regions of Interest (ROIs) and Data Exportation

To improve the functionalities of the script, the possibility was implemented for the user thanks to the “impoly” MATLAB® function, to interactively select using the mouse one or multiple polygonal ROIs (“Selected ROIs”) within the elaborated thermal orthomosaic. Each ROI is characterized by a unique color.
To uniquely identify and isolate the pixels belonging to a Selected ROI, a binary mask was used. The “createMask” MATLAB® function defines a binary mask (“mask value”), which identifies with a value of 1 the pixels inside the defined polygonal ROI; otherwise, it gives a value of 0. The vector “Temperature Selected ROIs” is used to save the temperature values of each Selected ROI for further post-processing analysis. The temperature values are extracted using relationship (12):
Temperature Selected ROIs = Temperature Matrix .* mask value
where the operator * is used for multiplication element by element in matrices.
For each Selected ROI, several basic statistics to deeply understand the temperature spatial distribution were calculated: (i) average temperature; (ii) minimum and maximum values; (iii) standard deviation and median value; (iv) interquartile range (IQR); and (v) percentage of points falling within temperature ranges of 5 °C, from the minimum to the maximum value. Regarding the CWSI, its basic statistics, i.e., mean, standard deviation, minimum, and maximum, were computed to better understand the spatial distribution.
Moreover, knowing the area of the mapped region, the number of pixels occupied by the defined ROIs was calculated, together with their percentage of occupation with respect to the entire area. This information can be obtained by counting the number of pixels inside each region and multiplying this value by the area occupied by each pixel (13):
Area Selected ROI [ha] = Selected ROI Pixel [pixel] * GSD2 [cm2/pixel] × K
where K is the constant to convert the area from cm2 to ha.
The temperature and CWSI values of each point within a Selected ROI, together with the respective geographical coordinates (latitude and longitude), were saved in a csv file, which can then be used for further post-processing analysis. The spatial referencing accuracy of the geographical data was the same as that obtained in the PIX4D Mapper.

3. Results

Starting from the 3054 thermal images acquired during the performed flight mission and converted into TIFF format, the PIX4D Mapper software elaborates the corresponding thermal orthomosaic (Figure 3a) and the reflectance map (Figure 3b).
The temperature of the soil surface at three geo-referenced sampling points in the inter-row was measured using the FLIR TG54-2 handheld infrared thermometer and taken as ground truth measurements to validate the temperature data acquired by the Mavic 3T. Figure 3a shows the generated thermal orthomosaic, in which the different temperatures were represented by a color-bar, with lower temperatures in shades of black (from 22.98 °C to 32.77 °C), medium temperatures in shades of violet (from 32.77 °C to 48.14 °C), and higher temperatures in shades of yellow (from 48.14 °C to 63.61 °C). The elevated temperatures along the field edges and in the inter-rows are due to the presence of bare soil in those areas because the vegetation did not fully cover the field. However, this thermal orthomosaic is just for visualization, and the temperature data of each pixel cannot be exported and downloaded. Additionally, this orthomosaic does not provide farmers with agronomic information about crop water stress conditions, and the software does not allow calculation of thermal stress indices. Therefore, due to these limitations, the development of custom software solutions is needed.
Firstly, the reflectance map generated by the PIX4D Mapper software (Figure 3b) must be uploaded as the input to the MATLAB® script, along with the parameters explained in Section 2.4.2. The geo-localized thermal orthomosaic obtained by running the implemented MATLAB® script is shown in Figure 4.
In Figure 4 temperature values are visualized as a color-bar, with cooler areas depicted in shades of blue, medium values in shades of green, and warmer areas in shades of red. The corresponding CWSI map is reported in Figure 5.
Figure 5 points out that the calculated CWSI ranges from zero, when the crop is well irrigated (depicted in shades of blue), to one, when a water stress condition occurs (depicted in shades of yellow).
Within the elaborated thermal orthomosaic, the user can interactively draw with the mouse one or more polygonal ROIs (Figure 6a,b).
Figure 6a shows that for the Selected ROI, the following agronomic information was computed: (i) area of the region and percentage of occupation compared to the entire mapped area; (ii) basic statistics (average, minimum, maximum, median, standard deviation, and IQR) to better understand the temperature spatial distribution; (iii) percentage of points within specific temperature ranges; and (iv) CWSI and its basic statistics (mean, standard deviation, minimum, and maximum) to give insight about possible plant water stress conditions. For each ROI, all the extracted agronomic information was displayed. Thanks to this information it is possible to evaluate the temperature spatial distribution and the presence of water stress conditions, making some important agronomic considerations and proposing the implementation of PA corrective strategies.
Figure 6b shows the use case in which two ROIs (blue and red polygons) have been defined. The red polygon exhibited a higher mean temperature (30.0 °C) and higher variability (standard deviation: 1.78 °C and IQR: 1.68 °C) compared to the region defined by the blue polygon (mean temperature: 28.87 °C, standard deviation: 0.98 °C, and IQR: 1.22 °C). Considering the CWSI, the mean value of the red polygon was higher compared to the blue polygon (0.43 vs. 0.33). These differences in the two Selected ROIs can be easily seen at first sight in the histograms presented in Figure 6b. It is possible to conclude that the spatial variability of the temperature is higher in the red ROI compared to the blue one, and considering the CWSI values in the red ROI, there is a moderate water stress condition in plants, which requires the implementation of precision irrigation strategies.
Finally, the MATLAB® script saves the extracted information for each ROI in a csv file. Figure 7 shows an example of the csv file in the output from the MATLAB® script.
The file includes the latitude, longitude, temperature, and CWSI value of each point belonging to the Selected ROI. This data can be used for further post-processing analysis.

4. Discussion

4.1. Thermal Mapping Using UAVs

Currently, few satellites are equipped with sensors operating in the TIR region, which are able to acquire thermal images. Moreover, since the wavelength of a signal is inversely proportional to its energy, satellites’ spatial resolution for thermal images is low. Indeed, the thermal radiation emitted in the LWIR region has a low energy content because this region is at longer wavelengths compared to visible and NIR radiation [35]. Consequently, thermal sensors installed on satellites, viewing large areas of the Earth’s surface, need large detector elements to obtain detectable TIR radiation, resulting in low spatial resolution [36]. These quite poor features make satellites not employable for the monitoring of small areas. For instance, two of the most employed satellites for thermal monitoring are Landsat 8 and Terra (EOS AM-1) satellites, which have spatial resolutions of 100 m and 1 km, respectively, and a temporal resolution of 16 days and daily, respectively [37]. If thermal satellite images acquired by the Landsat 8 satellite were used for the monitoring of the mapped area examined in the present paper, only the temperature of two pixels would be available due to the small area monitored (1.9 ha). This information would not be informative and would not allow accurate thermal monitoring.
Conversely, as demonstrated in this study and confirmed by several studies [38,39,40], a high-resolution monitoring of the thermal variability of an area can be carried out with excellent results using UAVs equipped with thermal cameras. These sensors are increasing in popularity as the payload in UAVs because, as also shown in this study, they can achieve centimeter-scale spatial resolution, thanks to the moderate flight heights. Moreover, UAVs provide extreme flexibility regarding the temporal resolution, which can be determined depending on the application.
To benchmark the methodology developed in the present manuscript, the temperature values measured at the three considered geo-referenced sampling points using the FLIR TG54-2 handheld infrared thermometer were compared with the ones obtained using the developed MATLAB® script and the DJI Thermal Tool. The results are summarized in Table 2.
Table 2 points out that the methodology developed in the present manuscript is as accurate as the DJI Thermal Tool if the temperature data measured using the FLIR TG54-2 handheld infrared thermometer are considered as ground truth measurements. It is important to highlight that the temperature values extracted using the MATLAB script are always within the accuracy of the infrared thermometer employed for the measurements, and the Mean Absolute Error (MAE) is relatively low.

4.2. Advantages of the Developed MATLAB® Script

Commercial photogrammetry software, such as PIX4D Mapper, offers limited functionalities for data processing and information extraction. For instance, the extraction and saving of the temperature value of each point of a thermal orthomosaic, as well as the definition of thermal stress indices, is not possible. Another tool employed to analyze images acquired by the DJI Mavic 3T is the proprietary software DJI Thermal Analysis Tool. This tool allows the user to identify the main temperature information (mean, minimum, and maximum values) of a single point or a selected area. However, it can analyze one thermal image at a time and gives an orthomosaic in the input, which is not recommended because the low resolution of the thermal camera causes loss of temperature information. This aspect represents an important limitation for the use of this tool. To overcome the limitations imposed by using commercial software for the elaboration of thermal images, a custom solution must be implemented. Chen et al. [41] and Zhang et al. [42] developed algorithms to detect ROIs in a set of optical multispectral remote sensing images, but no agronomic information was provided in the output. Ciężkowski et al. [43] employed a UAV to compute the CWSI in wetland habitats; however, it was not specified in which software the maps were obtained. Ramos-Fernández et al. [44], always using a UAV, compared the CWSI under different irrigation regimes in rice fields and made a statistical analysis, but the study did not show the map of the spatial distribution of the CWSI. To the authors’ knowledge, no studies were conducted to extract agronomic information from thermal orthomosaics acquired by UAVs using MATLAB®. The script developed in this study extrapolates agronomic information that otherwise cannot be obtained in any commercial software by enabling the following: (i) extraction and collection of useful agronomic information, such as the temperature and the CWSI spatial distribution for each geo-localized point within a thermal orthomosaic; (ii) evaluation of important basic statistics for the Selected ROIs.
It is important to highlight that the proposed approach can be used for the post-processing of thermal images acquired by all the UAVs available on the market because it is totally independent of the employed device. It is important to mention that the approach presented in this manuscript has a very high processing speed, in the range of seconds for the elaboration of a thermal map like the one proposed (1.95 ha). The selection of several ROIs inevitably slows down the process a little bit; for example, the selection of an ROI of 0.5 ha required ~90 s to be elaborated and provided in the output information. Regarding the memory, the same considered ROI generates an output csv file of 7.3 MB. With this information we can conclude that the approach can also be easily scaled over large images.
To strengthen the relevance of the method, future works will include the evaluation of agronomic and biochemical stress indicators directly measured on the leaves by using portable proximal sensors. Thanks to this approach, which will fuse proximal and remote sensing, the implemented MATLAB® script could become very useful for the evaluation of the effectiveness of PA applications, such as spot irrigation and spraying.
While this work was focused particularly on thermal-based CWSI extraction for single-date UAV acquisitions, future extensions could integrate multi-date analysis pipelines, as demonstrated by Rana et al. [45], in which YOLOv8 and the Grounded segment anything model (SAM) were employed for crop growth monitoring across multiple UAV surveys. Such temporal scaling of UAV data could further enhance water stress management techniques using crop-specific CWSI dynamics.

5. Conclusions

The integration of thermal cameras into UAVs is greatly improving agricultural monitoring, ensuring remote temperature measurements with high spatial and temporal resolution. Thermal imaging is increasing in importance thanks to its high informative content in applications such as plant and soil monitoring, irrigation scheduling, and crop maturity monitoring. Unfortunately, to date, few commercial software programs can process thermal images, and their features are very limited. In this paper an approach based on the development of a MATLAB® script to extract agronomic information from thermal images acquired by the DJI Mavic 3T drone was described. It allows us to extract the temperature and CWSI spatial distribution with their main statistics and create ROIs. The proposed approach can be easily replicated and adapted, providing farmers and researchers with a powerful tool for implementing PA strategies. Future studies will focus on the extension of the CWSI method for evaluating crop stress conditions in fractional vegetation cover areas, the use of other thermal processing pipelines, and the implementation of the developed MATLAB® script on a microcontroller to extract agronomic information directly in the field.

Author Contributions

Conceptualization, F.P. and G.P.; methodology, F.P., G.P., A.F. and S.P.; software, F.P.; validation, F.P.; formal analysis, F.P., G.P. and A.F.; investigation, F.P. and G.P.; data curation, F.P.; writing—original draft preparation, F.P.; writing—review and editing, F.P., G.P., A.F. and S.P.; visualization, F.P.; supervision, S.P.; project administration, S.P.; funding acquisition, S.P. All authors have read and agreed to the published version of the manuscript.

Funding

This research was carried out within the Agritech National Research Center and received funding from the European Union Next-GenerationEU (PIANO NAZIONALE DI RIPRESA E RESILIENZA (PNRR)—MISSIONE 4 COMPONENTE 2, INVESTIMENTO 1.4—D.D. 1032 17 June 2022, CN00000022). CUP H93C22000440007. This manuscript reflects only the authors’ views and opinions; neither the European Union nor the European Commission can be considered responsible for them.

Data Availability Statement

The data presented in this study is available upon request from the corresponding author. The data is not publicly available due to software limitations.

Conflicts of Interest

The authors declare no conflicts of interest.

Appendix A

START
-
Upload the reflectance map generated by the PIX4D Mapper software
-
Convert image to grayscale (1 channel)

-
Define the geographical coordinates of the corners of the mapped area
-
Set the minimum temperature (°C), corresponding to pixel value 0 (minTemp)
-
Set the maximum temperature (°C), corresponding to pixel value 255 (maxTemp)
-
Set the dimension of the mapped area (in ha)
-
Set the parameters for the computation of the CWSI (Tair, RH, coefficients a, b, and c)
-
Initialize the matrix (Temperature Matrix) to store the temperature values of each pixel of the reflectance map uploaded in the input

  FOR each pixel of the reflectance map, calculate the corresponding temperature based on its Grayscale Value
-
Temperature Pixel = minTemp + (Grayscale Value/255) * (maxTemp − minTemp)
-
Store the obtained temperature value in the Temperature Matrix
-
Compute the CWSI and store the obtained values in CWSI Values
   END FOR

Display the Temperature Matrix values as thermal orthomosaic along with the corresponding CWSI map

  WHILE user continues selecting regions
-
Selected ROI = the user creates polygonal areas on the thermal orthomosaic with the mouse input
-
Extract from the Temperature Matrix the temperature values of the Selected ROI using the mask value
-
Calculate the basic statistic of the temperature distribution for each Selected ROI
-
Compute the area of each ROI (Area Selected ROI) and its percentage compared to the total area
-
Calculate the basic statistics of the CWSI for each Selected ROI
-
Ask user for input: “Press Enter to select another region or type ‘end’ to stop the process”

     IF the user types ‘end’
       Break the loop
       Save the data in a csv file
     END IF

   END WHILE

END

References

  1. Krishna, K.R. Precision Farming: Soil Fertility and Productivity Aspects, 1st ed.; Apple Academic Press: Point Pleasant, NJ, USA, 2013. [Google Scholar]
  2. Sishodia, R.P.; Ray, R.L.; Singh, S.K. Applications of Remote Sensing in Precision Agriculture: A Review. Remote Sens. 2020, 12, 3136. [Google Scholar] [CrossRef]
  3. Khanal, S.; Fulton, J.; Shearer, S. An overview of current and potential applications of thermal remote sensing in precision agriculture. Comput. Electr. Agric. 2017, 139, 22–32. [Google Scholar] [CrossRef]
  4. Mazzia, V.; Comba, L.; Khaliq, A.; Chiaberge, M.; Gay, P. UAV and machine learning based refinement of a satellite-driven vegetation index for precision agriculture. Sensors 2020, 20, 2530. [Google Scholar] [CrossRef] [PubMed]
  5. Candiago, S.; Remondino, F.; De Giglio, M.; Dubbini, M.; Gattelli, M. Evaluating multispectral images and vegetation indices for precision farming applications from UAV images. Remote Sens. 2015, 7, 4026–4047. [Google Scholar] [CrossRef]
  6. Dash, J.P.; Pearse, G.D.; Watt, M.S. UAV multispectral imagery can complement satellite data for monitoring forest health. Remote Sens. 2018, 10, 1216. [Google Scholar] [CrossRef]
  7. de Castro, A.I.; Shi, Y.; Maja, J.M.; Peña, J.M. UAVs for vegetation monitoring: Overview and recent scientific contributions. Remote Sens. 2021, 13, 2139. [Google Scholar] [CrossRef]
  8. Giovos, R.; Tassopoulos, D.; Kalivas, D.; Lougkos, N.; Priovolou, A. Remote sensing vegetation indices in viticulture: A critical review. Agriculture 2021, 11, 457. [Google Scholar] [CrossRef]
  9. Gao, S.; Zhong, R.; Yan, K.; Ma, X.; Chen, X.; Pu, J.; Gao, S.; Qi, J.; Yin, G.; Myneni, R.B. Evaluating the saturation effect of vegetation indices in forests using 3D radiative transfer simulations and satellite observations. Remote Sens. Environ. 2023, 295, 113665. [Google Scholar] [CrossRef]
  10. Liu, Y.; Li, Y.; Li, S.; Motesharrei, S. Spatial and temporal patterns of global NDVI trends: Correlations with climate and human factors. Remote Sens. 2015, 7, 13233–13250. [Google Scholar] [CrossRef]
  11. Wessels, K.J.; Van Den Bergh, F.; Scholes, R.J. Limits to detectability of land degradation by trend analysis of vegetation index data. Remote Sens. Environ. 2012, 125, 10–22. [Google Scholar] [CrossRef]
  12. Stark, B.; Smith, B.; Chen, Y. Survey of thermal infrared remote sensing for Unmanned Aerial Systems. In Proceedings of the International Conference on Unmanned Aircraft Systems (ICUAS), Orlando, FL, USA, 27–30 May 2014; pp. 1294–1299. [Google Scholar]
  13. Anderson, M.C.; Hain, C.; Otkin, J.; Zhan, X.; Mo, K.; Svoboda, M.; Wardlow, B.; Pimstein, A. An intercomparison of drought indicators based on thermal remote sensing and NLDAS-2 simulations with U.S. drought monitor classifications. J. Hydrometeorol. 2013, 14, 1035–1056. [Google Scholar] [CrossRef]
  14. Vollmer, M.; Möllmann, K.P. Infrared Thermal Imaging: Fundamentals, Research and Applications; John Wiley & Sons: Hoboken, NJ, USA, 2018. [Google Scholar]
  15. Messina, G.; Modica, G. Applications of UAV thermal imagery in precision agriculture: State of the art and future research outlook. Remote Sens. 2020, 12, 1491. [Google Scholar] [CrossRef]
  16. Pineda, M.; Barón, M.; Pérez-Bueno, M.L. Thermal imaging for plant stress detection and phenotyping. Remote Sens. 2020, 13, 68. [Google Scholar] [CrossRef]
  17. Chaves, M.M.; Costa, J.M.; Zarrouk, O.; Pinheiro, C.; Lopes, C.M.; Pereira, J.S. Controlling stomatal aperture in semi-arid regions—The dilemma of saving water or being cool? Plant Sci. 2016, 251, 54–64. [Google Scholar] [CrossRef]
  18. Bonfante, A.; Monaco, E.; Manna, P.; De Mascellis, R.; Basile, A.; Buonanno, M.; Cantilena, G.; Esposito, A.; Tedeschi, A.; De Michele, C.; et al. LCIS DSS—An irrigation supporting system for water use efficiency improvement in precision agriculture: A maize case study. Agric. Syst. 2019, 176, 102646. [Google Scholar] [CrossRef]
  19. PIX4Dmapper, Version 4.4.12. Professional Photogrammetry Software for Drone Mapping. Available online: https://www.pix4d.com/product/pix4dmapper-photogrammetry-software (accessed on 5 September 2024).
  20. Caputo, T.; Bellucci Sessa, E.; Marotta, E.; Caputo, A.; Belviso, P.; Avvisati, G.; Peluso, R.; Carandente, A. Estimation of the uncertainties introduced in thermal map mosaic: A case of study with PIX4D mapper software. Remote Sens. 2023, 15, 4385. [Google Scholar] [CrossRef]
  21. Open-Source Interface to Convert R-JPEG Images into TIFF. Available online: https://github.com/MiroRavaProj/DJI-Tools-and-Stuff (accessed on 20 September 2024).
  22. Eisele, A.; Chabrillat, S.; Hecker, C.; Hewson, R.; Lau, I.C.; Rogass, C.; Segl, K.; Cudahy, T.J.; Udelhoven, T.; Hostert, P.; et al. Advantages using the thermal infrared (TIR) to detect and quantify semi-arid soil properties. Remote Sens. Environ. 2015, 163, 296–311. [Google Scholar] [CrossRef]
  23. Salisbury, J.W.; D’Aria, D.M. Emissivity of terrestrial materials in the 8–14 μm atmospheric window. Remote Sens. Environ. 1992, 42, 83–106. [Google Scholar] [CrossRef]
  24. Chen, J.M.; Liu, J.; Cihlar, J.; Goulden, M.L. Daily canopy photosynthesis model through temporal and spatial scaling for remote sensing applications. Ecol. Model. 1999, 124, 99–119. [Google Scholar] [CrossRef]
  25. Chirouze, J.; Boulet, G.; Jarlan, L.; Fieuzal, R.; Rodriguez, J.C.; Ezzahar, J.; Er-Raki, S.; Bigeard, G.; Merlin, O.; Garatuza-Payan, J. Intercomparison of four remote-sensing-based energy balance methods to retrieve surface evapotranspiration and water stress of irrigated fields in semi-arid climate. Hydrol. Earth Syst. Sci. 2014, 18, 1165–1188. [Google Scholar] [CrossRef]
  26. Idso, S.B.; Jackson, R.D.; Pinter, P.J., Jr.; Reginato, R.J.; Hatfield, J.L. Normalizing the stress-degree-day parameter for environmental variability. Agric. Meteorol. 1981, 24, 45–55. [Google Scholar] [CrossRef]
  27. Jackson, R.D.; Idso, S.B.; Reginato, R.J.; Pinter, P.J., Jr. Canopy temperature as a crop water stress indicator. Water Resour. Res. 1981, 17, 1133–1138. [Google Scholar] [CrossRef]
  28. Berni, J.A.J.; Zarco-Tejada, P.J.; Sepulcre-Cantó, G.; Fereres, E.; Villalobos, F. Mapping canopy conductance and CWSI in olive orchards using high resolution thermal remote sensing imagery. Remote Sens. Environ. 2009, 113, 2380–2388. [Google Scholar] [CrossRef]
  29. Alordzinu, K.E.; Li, J.; Lan, Y.; Appiah, S.A.; AL Aasmi, A.; Wang, H. Rapid Estimation of Crop Water Stress Index on Tomato Growth. Sensors 2021, 21, 5142. [Google Scholar] [CrossRef]
  30. Boyaci, S.; Kociecka, J.; Atilgan, A.; Liberacki, D.; Rolbiecki, R.; Saltuk, B.; Stachowski, P. Evaluation of Crop Water Stress Index (CWSI) for High Tunnel Greenhouse Tomatoes under Different Irrigation Levels. Atmosphere 2024, 15, 205. [Google Scholar] [CrossRef]
  31. DJI Mavic3T. Available online: https://enterprise.dji.com/it/mavic-3-enterprise (accessed on 5 September 2024).
  32. Li, C.; Skidmore, G.D.; Han, C.J. Uncooled VOx infrared sensor development and application. In Infrared Technology and Applications XXXVII; SPIE: Bellingham, WA, USA, 2011; Volume 8012, pp. 541–548. [Google Scholar]
  33. Lee, J.H.; Sull, S. Regression tree CNN for estimation of ground sampling distance based on floating-point representation. Remote Sens. 2019, 11, 2276. [Google Scholar] [CrossRef]
  34. MATLAB® 2024. Available online: https://it.mathworks.com (accessed on 10 September 2024).
  35. Agam, N.; Kustas, W.P.; Anderson, M.C.; Li, F.; Neale, C.M. A vegetation index based technique for spatial sharpening of thermal imagery. Remote Sens. Environ. 2007, 107, 545–558. [Google Scholar] [CrossRef]
  36. Quattrochi, D.A.; Goel, N.S. Spatial and temporal scaling of thermal infrared remote sensing data. Remote Sens. Rev. 1995, 12, 255–286. [Google Scholar] [CrossRef]
  37. Negahbani, S.; Momeni, M.; Moradizadeh, M. Improving the Spatiotemporal Resolution of Soil moisture through a synergistic combination of MODIS and LANDSAT8 Data. Water Resour. Manag. 2022, 36, 1813–1832. [Google Scholar] [CrossRef]
  38. Sagan, V.; Maimaitijiang, M.; Sidike, P.; Eblimit, K.; Peterson, K.T.; Hartling, S.; Esposito, F.; Khanal, K.; Newcomb, M.; Pauli, D.; et al. UAV-based high resolution thermal imaging for vegetation monitoring, and plant phenotyping using ICI 8640 P, FLIR Vue Pro R 640, and thermomap cameras. Remote Sens. 2019, 11, 330. [Google Scholar] [CrossRef]
  39. Santesteban, L.G.; Di Gennaro, S.F.; Herrero-Langreo, A.; Miranda, C.; Royo, J.B.; Matese, A. High-resolution UAV-based thermal imaging to estimate the instantaneous and seasonal variability of plant water status within a vineyard. Agric. Water Manag. 2017, 183, 49–59. [Google Scholar] [CrossRef]
  40. Maes, W.H.; Huete, A.R.; Steppe, K. Optimizing the processing of UAV-based thermal imagery. Remote Sens. 2017, 9, 476. [Google Scholar] [CrossRef]
  41. Chen, J.; Zhang, L. Joint multi-image saliency analysis for region of interest detection in optical multispectral remote sensing images. Remote Sens. 2016, 8, 461. [Google Scholar] [CrossRef]
  42. Zhang, L.; Yang, K.; Li, H. Regions of interest detection in panchromatic remote sensing images based on multiscale feature fusion. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2014, 7, 4704–4716. [Google Scholar] [CrossRef]
  43. Ciężkowski, W.; Szporak-Wasilewska, S.; Kleniewska, M.; Jóźwiak, J.; Gnatowski, T.; Dąbrowski, P.; Góraj, M.; Szatyłowicz, J.; Ignar, S.; Chormański, J. Remotely Sensed Land Surface Temperature-Based Water Stress Index for Wetland Habitats. Remote Sens. 2020, 12, 631. [Google Scholar] [CrossRef]
  44. Ramos-Fernández, L.; Gonzales-Quiquia, M.; Huanuqueño-Murillo, J.; Tito-Quispe, D.; Heros-Aguilar, E.; Flores del Pino, L.; Torres-Rua, A. Water Stress Index and Stomatal Conductance under Different Irrigation Regimes with Thermal Sensors in Rice Fields on the Northern Coast of Peru. Remote Sens. 2024, 16, 796. [Google Scholar] [CrossRef]
  45. Rana, S.; Gerbino, S.; Akbari Sekehravani, E.; Russo, M.B.; Carillo, P. Crop Growth Analysis Using Automatic Annotations and Transfer Learning in Multi-Date Aerial Images and Ortho-Mosaics. Agronomy 2024, 14, 2052. [Google Scholar] [CrossRef]
Figure 1. The contoured yellow area represents the area mapped during the performed flight mission, with the respective dimensions and geo-referencing information.
Figure 1. The contoured yellow area represents the area mapped during the performed flight mission, with the respective dimensions and geo-referencing information.
Remotesensing 17 02746 g001
Figure 2. Trajectory followed by the DJI Mavic 3T drone during the performed flight mission. The red dots represent the thermal images acquired by the DJI Mavic 3T drone.
Figure 2. Trajectory followed by the DJI Mavic 3T drone during the performed flight mission. The red dots represent the thermal images acquired by the DJI Mavic 3T drone.
Remotesensing 17 02746 g002
Figure 3. (a) Thermal orthomosaic generated by the PIX4D Mapper software; (b) reflectance map generated by the PIX4D Mapper software.
Figure 3. (a) Thermal orthomosaic generated by the PIX4D Mapper software; (b) reflectance map generated by the PIX4D Mapper software.
Remotesensing 17 02746 g003
Figure 4. Geo-localized thermal orthomosaic of the mapped area, obtained by running the implemented MATLAB® script.
Figure 4. Geo-localized thermal orthomosaic of the mapped area, obtained by running the implemented MATLAB® script.
Remotesensing 17 02746 g004
Figure 5. Geo-localized CWSI map obtained by running the implemented MATLAB® script.
Figure 5. Geo-localized CWSI map obtained by running the implemented MATLAB® script.
Remotesensing 17 02746 g005
Figure 6. (a) The blue polygon is the ROI drawn by the user. For this region, the computed metrics are displayed; (b) the user can draw more than one ROI (blue and red polygons). For each region, the computed statistics and the histograms depicting the temperature and CWSI distribution for each ROI are shown.
Figure 6. (a) The blue polygon is the ROI drawn by the user. For this region, the computed metrics are displayed; (b) the user can draw more than one ROI (blue and red polygons). For each region, the computed statistics and the histograms depicting the temperature and CWSI distribution for each ROI are shown.
Remotesensing 17 02746 g006
Figure 7. Example of the saved csv file containing the data extracted for a Selected ROI. The file contains the latitude, longitude, temperature, and CWSI value.
Figure 7. Example of the saved csv file containing the data extracted for a Selected ROI. The file contains the latitude, longitude, temperature, and CWSI value.
Remotesensing 17 02746 g007
Table 1. Main parameters of the performed flight mission.
Table 1. Main parameters of the performed flight mission.
ParameterValue
Speed of the drone [m/s]3.2 m/s
Route altitude [m]25 m
Frontal and side overlap ratio [%]80%
Ground sampling distance (GSD) [cm/pixel]3.3 cm/pixel
Mapping area [ha]1.95 ha
Acquired images3054
Course angle [°]225° to follow the
inter-row direction
Table 2. Comparison of temperature values obtained using the three employed methodologies at the three geo-referenced sampling points.
Table 2. Comparison of temperature values obtained using the three employed methodologies at the three geo-referenced sampling points.
MethodologyTemperature [°C]MAE [°C]
FLIR TG54-2 Handheld Infrared Thermometer43.5 ± 1 °C/
46.9 ± 1 °C/
50 ± 1 °C/
MATLAB® Script43.9 °C0.4
47.6 °C0.7
49.6 °C0.4
DJI Thermal Tool44 °C0.5
47.3 °C0.4
50.5 °C0.4
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Paciolla, F.; Popeo, G.; Farella, A.; Pascuzzi, S. Agronomic Information Extraction from UAV-Based Thermal Photogrammetry Using MATLAB. Remote Sens. 2025, 17, 2746. https://doi.org/10.3390/rs17152746

AMA Style

Paciolla F, Popeo G, Farella A, Pascuzzi S. Agronomic Information Extraction from UAV-Based Thermal Photogrammetry Using MATLAB. Remote Sensing. 2025; 17(15):2746. https://doi.org/10.3390/rs17152746

Chicago/Turabian Style

Paciolla, Francesco, Giovanni Popeo, Alessia Farella, and Simone Pascuzzi. 2025. "Agronomic Information Extraction from UAV-Based Thermal Photogrammetry Using MATLAB" Remote Sensing 17, no. 15: 2746. https://doi.org/10.3390/rs17152746

APA Style

Paciolla, F., Popeo, G., Farella, A., & Pascuzzi, S. (2025). Agronomic Information Extraction from UAV-Based Thermal Photogrammetry Using MATLAB. Remote Sensing, 17(15), 2746. https://doi.org/10.3390/rs17152746

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop