Get 20M+ Full-Text Papers For Less Than $1.50/day. Start a 14-Day Trial for You or Your Team.

Learn More →

An Infrared Temperature Correction Method for the Skin Temperature of Pigs in Infrared Images

An Infrared Temperature Correction Method for the Skin Temperature of Pigs in Infrared Images agriculture Article An Infrared Temperature Correction Method for the Skin Temperature of Pigs in Infrared Images Xiaoshuai Wang, Feiyue Hu, Ruimin Yang and Kaiying Wang * College of Biosystems Engineering and Food Science, Zhejiang University, Hangzhou 310058, China * Correspondence: zjuwky@zju.edu.cn Abstract: Accurately measuring the skin temperature of pigs is essential to large-scale pig farming for health monitoring, as well as disease detection and prevention. Infrared thermography (IRT) is a promising technology for the non-invasive measuring of pig skin temperature. However, the distance and angle of view of measurement greatly affect the accuracy of IRT-measured temperature. To improve the accuracy of the measurement, this study starts with evaluating the effects of four parameters on the measurement of skin temperature: horizontal distance, camera height, pig height, and angle of view between the object and the IRT camera. It follows by proposing a mathematical model describing the relationship between the real skin temperature and the four parameters through means of response surface methodology. A correction algorithm is then developed based on the mathematical model to improve the measuring accuracy. In order to evaluate the performance of the correction algorithm, the measured skin temperatures before and after correction are compared with the actual ones. The comparison was carried out in an experimental pig farm with 25 randomly selected pigs. The results show that the mean relative error before the correction was 4.64% and the mean relative error after the correction was 0.70%. This study demonstrates that the new infrared temperature correction method is effective and can benefit skin temperature monitoring for commercial pig farms. Keywords: correction algorithm; infrared thermography; monocular ranging; skin temperature sensing; response surface methodology Citation: Wang, X.; Hu, F.; Yang, R.; Wang, K. An Infrared Temperature Correction Method for the Skin 1. Introduction Temperature of Pigs in Infrared Images. Agriculture 2023, 13, 520. China has developed a large pig industry to meet the demand of the large population [1]. https://doi.org/10.3390/ Since the first detection of African Swine Fever (ASF) in China in August 2018, multiple agriculture13030520 outbreaks of ASF have been reported across China [2]. The ASF became a serious threat, not only to individual pig farms, but also to the entire pig industry in China. Many pig Academic Editor: Claudia farms experienced tremendous losses these years due to their failure to prevent ASF [3]. Arcidiacono Since there is no ASF vaccine available, the most common method to prevent the spreading Received: 1 February 2023 of ASF in China is to eliminate the source of infection by culling and isolating infected Revised: 18 February 2023 pigs [4]. Though this method can reduce the likelihood of ASF spreading to healthy pigs, Accepted: 19 February 2023 the effectiveness of this treatment depends on how quickly infected pigs can be detected Published: 21 February 2023 and isolated. Any delay will result in the death of a large number of pigs and enormous economic losses to affected pig farms [5]. Therefore, the timely detection of infected pigs plays an extremely important role in disease prevention and damage control. Body temperature is an important indicator of pigs’ health status [6]. Monitoring pigs’ Copyright: © 2023 by the authors. body temperature can effectively identify infected pigs and prevent the spread of diseases Licensee MDPI, Basel, Switzerland. by isolating the infected pigs. Most diseases cause the body temperature of pigs to rise This article is an open access article prior to other symptoms, especially some infectious diseases [7]. For example, high fever is distributed under the terms and one of the most reliable indications of ASF infection [8]. Thus, measuring the pigs’ skin conditions of the Creative Commons temperature could be an important method for ASF prevention. Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ Infrared thermography (IRT) is a promising technology, not only for the automatic 4.0/). monitoring of pigs’ skin temperature [9,10], but also for extracting pig-body shape based Agriculture 2023, 13, 520. https://doi.org/10.3390/agriculture13030520 https://www.mdpi.com/journal/agriculture Agriculture 2023, 13, 520 2 of 16 on shape segmentation [11,12] and evaluating stress conditions in pigs [13,14], although it has drawbacks in providing sufficient information to determine what causes the changes in skin temperature of animals [10,15]. Compared with other temperature measuring technologies, such as rectal and contact skin thermometers or implanted thermal sensors, IRT is a non-contact measure for the surface temperature, which has a distinctive advantage in pig skin temperature sensing in the perspective of reducing the risk of viral infection [16]. However, the accuracy of the IRT measurement can be affected by many factors. The distance between the measured object and the IRT camera, for instance, is one of the most influencing factors in surface temperature sensing [17,18], as the measured temperature decreases with increasing distance between the IRT camera and the target object [19]. Given that the distance between the thermal camera and each pig in the pen is different, each pig’s skin temperature, measured by the IRT camera, could be different from its actual skin temperature [20]. In other words, a pig with a high temperature, far away from the IRT camera, could have the same or even lower measured temperature as one with a normal temperature, close to the camera [21]. This phenomenon could result in a delay in sick pig detection. Note that the emissivity of pig skin is also an influencing factor in surface temperature sensing, which describes a material’s ability to emit energy by radiation [22]. In some previous studies, the skin emissivity of pigs was set as a constant value of 0.98 in pig health screening and fever detection [23,24]. The infrared emissivity was determined by the skin surface condition and the viewing angle [25]. For a commercial pig barn, most of the pigs (particularly the skin surface condition) in a raising unit were the same, which means the viewing angle could be the most affecting parameter for the emissivity in the pig skin temperature measurement using IRT camera. Therefore, in order to accurately obtain pigs’ skin temperature using IRT, it is critical to systematically investigate the effects of the key influencing parameters, such as the distance and the angle of view between pigs and the IRT camera. Furthermore, a correction method for determining the effect of distance and the angle of view is needed for the application of infrared thermography. Therefore, the objectives of this study are (1) to evaluate the effect of the distance and the angle of view between the pigs and the IRT camera on the accuracy of IRT-measured skin temperature; and (2) to develop a new methodology to correct the skin measurement made by IRT cameras. The results of this study could benefit the health monitoring of pigs by using an IRT camera for commercial pig farms. 2. Methodology and Materials 2.1. The Affecting Parameters Identification The observation distance, the distance between the pig and the IRT camera, was determined by the height of the pig and the camera, as well as the horizontal distance between them. The observation distance affected the transmittance of infrared radiation in the atmosphere, resulting in the measurement error [26]. According to the Pythagorean theorem, the observation distance could be further measured using the horizontal distance between the camera and the pig, camera height, and pig height. Additionally, since the emissivity depends on the angle of radiation, the angle of view is also an important affecting factor [27]. Therefore, horizontal distance, camera height, pig height, and the angle of view are the factors selected for this study. 2.2. Response Surface Methodology Modelling The response surface methodology (RSM), a combination of mathematical and statisti- cal techniques, was selected to investigate the effects of the five parameters on the accuracy of skin temperature measurement using infrared thermography. RSM provides the framework to explore the relationship between explanatory variables and response variables, and to obtain the optimal combination for desired responses [28]. RSM is widely applied during both the model development phase and the model improvement and optimization phase. Agriculture 2023, 13, 520 3 of 16 2.2.1. Experimental Variables and Response The five factors—horizontal distance, camera height, the angle of view between the camera and target pig, the skin temperature of the pig, and target pig height—were set as the input variables in the RSM model (Table 1). Given the difficulties in using pigs in the laboratory experiment (e.g., keeping them still and controlling the surface temperature), we used a black body cavity (HT-C50, temperature range: 5 to 50 C, effective emissivity: 0.98  0.02, resolution: 0.01 C, accuracy: 0.15 C) to represent the pigs, as an alternative. The ranges of horizontal distance (D), camera height (H ), and the angle of view between the camera and black body cavity (q) were determined based on the size of the pens (4.8  3.75 m in length  width) and the height of the thermal imaging camera installed. In this study, the range of horizontal distance between the camera and the black body cavity was set at 2 to 6 m and the range of camera height was set at 1.7 to 2.3 m, and the angle between the camera and the black body cavity was set at 0 to 50 C. The black body cavity temperature (T ) was determined by refereeing the skin temperature of healthy and thermal comfortable pigs and sick pigs, such as ASF-infected pigs. The rectal temperature of a healthy and thermal comfortable pig (6 weeks of age) stayed at 39.1  0.68 C [29], when the temperature-humidity index (THI) was around 70. According to the relationship between the rectal temperature and central dorsal surface temperature of pigs [30], the normal dorsal surface temperature of pigs would be around 34 C. A study shows that the rectal temperature of ASF-infected pigs could rise from 39.5 C (0 day) to a maximum of 41.7 C (7th day), while the skin temperature could rise from 36.7 C (0 day) to 40.1 C (8th day), based on the progression of the infection [31]. Therefore, the range of black body cavity temperature was set at 32 to 42 C. In addition, the range of the black cavity body height was determined according to the height of the pigs, using the relationship between 0.33 pig weight and its body height [32], expressed as Height = (Body Weight) . Therefore, the range of the black body cavity height (H ) was set at 0 to 0.6 m. Table 1 lists the three levels of each parameter in this study. Table 1. Levels of investigated parameters for the RSM modeling. D, H , q, T , and H represent the b b horizontal distance, the camera height, the angle of view between the camera and black body cavity, the black body cavity temperature, and the black body cavity height, respectively. Parameter Unit Low Level Medium Level High Level D m 2 4 6 H m 1.7 2 2.3 q 0 25 50 T C 32 37 42 H m 0 0.3 0.6 2.2.2. Setup of the Laboratory Experiment To investigate the effects of the identified parameters on the surface temperature sensing by IRT camera, a laboratory experiment was conducted. Figure 1 illustrates the scheme of the experiment, along with a photo of the setup. As it shows, a black body cavity (HT-C50, temperature range: 5 to 50 C, effective emissivity: 0.96  0.02, resolution: 0.01 C, accuracy: 0.15 C) was used to characterize the skin temperature of pigs, and a thermal imaging camera (Hikvision TB-1217A-3’PA, field angle: 50  37.2 , temperature measurement range: 30–45 C, temperature measurement accuracy: 0.5 C, emissivity of pig skin: 0.98) was used to measure the temperature area of the black body cavity. The horizontal distance from the thermal imaging camera to the black body cavity was controlled by a flexible ruler. The angle of view between the black body cavity and the optical center of the thermal imaging camera was controlled by the horizontal distance because of the geometric relationship between the horizontal distance and the angle of view, given a particular camera height. The ambient temperature was recorded every 1 min by portable, hot-wire anemometers (VelociCalc Multi-Function Ventilation Meter 9565-A, TSI, Shoreview, MN, USA, temperature measurement range: 10 to 60 C, resolution: 0.1 C, Agriculture 2023, 13, x FOR PEER REVIEW 4 of 17 horizontal distance from the thermal imaging camera to the black body cavity was con- trolled by a flexible ruler. The angle of view between the black body cavity and the optical center of the thermal imaging camera was controlled by the horizontal distance because Agriculture 2023, 13, 520 4 of 16 of the geometric relationship between the horizontal distance and the angle of view, given a particular camera height. The ambient temperature was recorded every 1 min by porta- ble, hot-wire anemometers (VelociCalc Multi-Function Ventilation Meter 9565-A, TSI, Shoreview, Minnesota, USA, temperature measurement range: −10 to 60 °C, resolution: accuracy: 0.3 C). Undoubtedly, the condition of the lights and materials surrounding 0.1 °C, accuracy: ±0.3 °C). Undoubtedly, the condition of the lights and materials sur- the artificial pig (black body cavity) in the experiment could also potentially affect the rounding the artificial pig (black body cavity) in the experiment could also potentially temperature sensing; the interferences associated with the lights and materials were omitted affect the temperature sensing; the interferences associated with the lights and materials in this modeling procedure because the condition was comparable, and it was difficult to were omitted in this modeling procedure because the condition was comparable, and it build the same condition for the modeling. was difficult to build the same condition for the modeling. Figure 1. The setup and the schematic graph of the laboratory experiment. Figure 1. The setup and the schematic graph of the laboratory experiment. 2.2.3. Establishment of RSM Model 2.2.3. Establishment of RSM Model There are different approaches to designing an RSM modelling. In this study, the There are different approaches to designing an RSM modelling. In this study, the Box-Behnken design (BBD), a rotatable or nearly rotatable design based on three levels of Box-Behnken design (BBD), a rotatable or nearly rotatable design based on three levels of incomplete factors [33], was used in order to reduce the number of tests. The number of incomplete factors [33], was used in order to reduce the number of tests. The number of tests (N) required in BBD was calculated according to Equation (1) [34]: tests (N) required in BBD was calculated according to Equation (1) [34]: ( ) 𝑁= 2𝑘 𝑘− 1 +𝑐 (1) N = 2k(k 1) + c (1) where k is the number of experimental variables; c is the specified number of replicated where k is the number of experimental variables; c is the specified number of replicated central points. In this study, we set 6 replicates for the central point. The resulting N be- central points. In this study, we set 6 replicates for the central point. The resulting N be- comes 46 for k = 5 and c = 6. All 46 cases listed in Table 2 served as the training dataset for comes 46 for k = 5 and c = 6. All 46 cases listed in Table 2 served as the training dataset for the RSM model development. the RSM model development. The final second-order RSM model can be written as: Table 2. BBD with the values of each variable and the corresponding values of the response (served as the training dataset). D, Hc, θ, Τb, and Hb represent the horizontal distance, the camera height, the 5 5 5 5 angle of view between the camera and black body cavity, 2 the black body cavity temperature, and y = b + b x + b x + b x x (2) 0 å i i å ii i å å i j i j the black body cavity height, respectively. i=1 i=1 i=1 j>i Experimental Variables Response where y is the predicted response; b is the model constant; b are linear coefficients; Case D Hc θ Τb Hb Tm ∆T b are the quadratic coefficients; b are the coefficients of the cross products; x and x are ii ij i j (m) (m) (°) (°C) (m) (°C) (°C) independent variables. 1 4 2.3 25 37 0.3 26.22 −10.78 The statistical significance (p-value) of each term in Equation (2) was determined 2 4 2 12.5 37 0.3 27.89 −9.11 by the multiple analysis of variance (MANOVA). The smaller p-value meant a higher 3 4 1.7 12.5 32 0.3 26.04 −5.96 statistical significance of the corresponding term. Only the terms that corresponded with 4 4 1.7 12.5 42 0.3 30.55 −11.45 p-values [35] lower than 0.1 were kept in the final RSM model. Both the experimental design 5 4 2.3 12.5 37 0 27.22 −9.78 and data analysis for the RSM modeling were conducted in Design Experts Version 8.0 6 2 2 0 37 0.3 30.36 −6.64 (Stat-Ease, Inc., Minneapolis, MN, USA). 2.2.4. RSM Model Verification RSM, coupled with BBD, can effectively reduce the number of tests compared with the one using a full factorial design; however, model uncertainty might be introduced [36]. To avoid overfitting, the RSM model was verified using 9 separate cases (served as the testing dataset, as shown in Table 3) in which all the values of the experimental variables were selected randomly within the experimental domain. The relative difference was calculated between the experimental results and predicted results, also shown in Table 3. Agriculture 2023, 13, 520 5 of 16 Table 2. BBD with the values of each variable and the corresponding values of the response (served as the training dataset). D, H , q, T , and H represent the horizontal distance, the camera height, the c b b angle of view between the camera and black body cavity, the black body cavity temperature, and the black body cavity height, respectively. Experimental Variables Response Case D H q T H T DT c m b b (m) (m) ( ) ( C) (m) ( C) ( C) 1 4 2.3 25 37 0.3 26.22 10.78 2 4 2 12.5 37 0.3 27.89 9.11 3 4 1.7 12.5 32 0.3 26.04 5.96 4 4 1.7 12.5 42 0.3 30.55 11.45 5 4 2.3 12.5 37 0 27.22 9.78 6 2 2 0 37 0.3 30.36 6.64 7 4 2 12.5 32 0.6 26.22 5.78 8 2 2 25 37 0.3 30.14 6.86 9 6 2 25 37 0.3 25.99 11.01 10 4 1.7 25 37 0.3 28.28 8.72 11 4 2 12.5 37 0.3 27.84 9.16 12 4 2 25 42 0.3 28.61 13.39 13 4 2 25 37 0 27.03 9.97 14 2 2 12.5 37 0 30.41 6.59 15 4 2 0 37 0.6 28.23 8.77 16 6 2 12.5 37 0 25.11 11.89 17 4 2 25 37 0.6 27.92 9.08 18 6 1.7 12.5 37 0.3 25.63 11.37 19 4 2 12.5 37 0.3 28.07 8.93 20 2 1.7 12.5 37 0.3 31.07 5.93 21 4 2 0 32 0.3 25.91 6.09 22 6 2 12.5 42 0.3 27.69 14.31 23 4 2 12.5 42 0 30.56 11.44 24 4 2 12.5 42 0.6 31.07 10.93 25 4 2 0 37 0 27.23 9.77 26 4 2 25 32 0.3 26.2 5.8 27 6 2 12.5 37 0.6 25.55 11.45 28 2 2 12.5 37 0.6 30.96 6.04 29 4 2 0 42 0.3 30.84 11.16 30 4 2.3 0 37 0.3 27.07 9.93 31 2 2.3 12.5 37 0.3 29.62 7.38 32 4 2 12.5 37 0.3 27.46 9.54 33 4 2.3 12.5 37 0.6 27.71 9.29 34 4 2 12.5 37 0.3 27.68 9.32 35 6 2.3 12.5 37 0.3 25.42 11.58 36 2 2 12.5 42 0.3 34.1 7.9 37 4 2 12.5 32 0 25.98 6.02 38 4 2.3 12.5 42 0.3 28.6 13.4 39 4 1.7 12.5 37 0 27.91 9.09 40 4 2.3 12.5 32 0.3 24.85 7.15 41 4 1.7 12.5 37 0.6 28.48 8.52 42 6 2 0 37 0.3 25.98 11.02 43 6 2 12.5 32 0.3 24.48 7.52 44 4 2 12.5 37 0.3 27.43 9.57 45 4 1.7 0 37 0.3 28.21 8.79 46 2 2 12.5 32 0.3 27.12 4.88 Agriculture 2023, 13, 520 6 of 16 Table 3. Levels of investigated parameters in the cases for testing the RSM model. Experimental Variables Response Case No. D (m) H (m) q ( ) T ( C) H (m) T ( C) DT ( C) c b b m 1 2.32 1.72 5.3 41.8 0.16 40.26 1.54 2 3.56 1.76 8.7 39.6 0.34 37.41 2.19 3 3.72 1.87 10.2 38.9 0.19 36.44 2.46 4 4.22 1.81 12.1 38.2 0.41 35.64 2.56 5 4.36 1.92 16.5 35.1 0.06 33.07 2.03 6 5.18 1.97 15.2 36.7 0.46 33.61 3.09 7 5.32 1.79 13.6 41.6 0.1 37 4.6 8 5.61 2.16 18.6 35.4 0.51 32.25 3.15 9 5.86 2.24 24.6 33.1 0.56 30.45 2.65 2.3. Correction Algorithm 2.3.1. Distance Determination Vision-based target ranging can be divided into two types: monocular ranging and binocular ranging [37]. Monocular ranging is the most common way to measure the distance between the IRT camera and the object in the view. For monocular ranging technique, the models can be further divided into geometric imaging-based methods [38], perspective transformation-based methods [39], and data fitting-based methods [40]. In this study, the imaging-based geometric method model was adopted for monocular ranging. According to the IRT system in the pig barn, as described previously, the geometric relationship between the camera and the object is illustrated in Figure 2a. If point E was the optical center of the camera and point P was the location of the object, the line EP would be the distance between the camera and the object (pig in this study). Let trapezoid ABCD be the field of view for the camera mounted on the inspection robot and point F be the center of that view. Select X-G-Y as the coordinate system with point G, the midpoint of line CD, as the origin. One would notice that line EF denoted the optical axis of the camera and point O was the projection of point E onto plane ABN. Figure 2b shows the side view of Agriculture 2023, 13, x FOR PEER REVIEW 7 of 17 the geometric relationship between the camera and the object. Let 2 denote the vertical, angular field of view. Figure 2. Diagram illustrating the camera’s field of view. (a) Object plane coordinate view; Figure 2. Diagram illustrating the camera’s field of view. (a) Object plane coordinate view; (b) pro- jected (b) pr view ojected alo view ng the X-axis d along the X-axis irection; ( direction; c) top view (c) top of the view im ofage plane. the image plane. Figure 2c illustrates the relationship between the points on the object plane and those on the image plane, where L and W were the length and width of the image plane, respec- tively. On the image plane, X’-G’-Y’ was the coordinate system with point G’, the mid- point of C’D’, as the origin. Points in the object plane coordinate system can be mapped one-on-one to points in the image plane coordinate system. Let P (xP, yP) be a point in the object plane and P’ (xP’, yP’) be the corresponding point in the image plane. Given the camera height, h, and the elevation angle, μ, the distance between the IRT camera and the object could be obtained through the following steps: 1. Determine yP of point P. As shown in Figure 2b, yP can be calculated as follows: 𝑦 =𝑂𝐾 −𝑂𝐺 =ℎ × 𝑡𝑎𝑛 (𝜇+ 𝛾 ) −ℎ ×𝑡𝑎𝑛 (𝜇− 𝛼 ), for GK > GF (3) ( ) ( ) 𝑦 =𝑂𝐾 −𝑂𝐺 =ℎ × 𝑡𝑎𝑛 𝜇− 𝛾 −ℎ ×𝑡𝑎𝑛 𝜇− 𝛼 , for GK < GF (4) 𝑦 − 𝛾 = arctan( ) (5) 𝑓 = 2tan 𝛼 where h is the camera height, m; α is half of the vertical field of view, ; μ is the elevation o o angle of the camera, ; γ is the angle of view in the y-axis direction, ; which could be determined using Equation (4), L is the height of the image plane, pixel; and f is the focal length of the camera, pixel, derived from the Equation (5). 2. Determine xP of point P. Triangle similarity was used to determine xp. Since ∆KPN~∆GIN, xp could be derived using: ×(𝐺𝑁 +𝑦 ) (6) 𝑥 = where 𝑁𝐺 𝐺𝐼 Agriculture 2023, 13, 520 7 of 16 Figure 2c illustrates the relationship between the points on the object plane and those on the image plane, where L and W were the length and width of the image plane, respectively. On the image plane, X’-G’-Y’ was the coordinate system with point G’, the midpoint of C’D’, as the origin. Points in the object plane coordinate system can be mapped one-on-one to points in the image plane coordinate system. Let P (x , y ) be a point in the object plane and P’ (x , y ) be the corresponding point P P P’ P’ in the image plane. Given the camera height, h, and the elevation angle, m, the distance between the IRT camera and the object could be obtained through the following steps: 1. Determine y of point P. As shown in Figure 2b, y can be calculated as follows: y = OK OG = h tan(m + g) h tan(m a), for GK > GF (3) y = OK OG = h tan m g h tan m a , for GK < GF ( ) ( ) y 0 g = arctan (4) f = (5) 2tana where h is the camera height, m; a is half of the vertical field of view, ; m is the elevation o o angle of the camera, ; g is the angle of view in the y-axis direction, ; which could be determined using Equation (4), L is the height of the image plane, pixel; and f is the focal length of the camera, pixel, derived from the Equation (5). 2. Determine x of point P. Triangle similarity was used to determine x . Since DKPN~DGIN, x could be de- p p rived using: G I  N G + y x = (6) N G where 0 0 x 0  h cosa G I  EG G I = = (7) f  cos(m a) EG Since DNGC~DNFJ, we could find a relationship among N G, GF, GC, and F J, as shown in Equation (8): N G N G GC = = (8) N F N G + GF F J where GF = OF OG = h tanm h tan(m a) (9) EG W h W GC = = (10) 2 f 2 f  cos(m a) EF W h W F J = = (11) 2 f 2 f  cosm Using results from Equations (8), (10) and (11), N G becomes: h [tanm tan(m a)] N G = (12) cos(ma) cosm where h is the camera height, m; a is half of the vertical field of view, ; m is the elevation angle of the camera, ; W is the width of the image plane, pixel; and f is the focal length of the camera, pixel. Agriculture 2023, 13, 520 8 of 16 3. Determine the horizontal distance between camera and object. The length of OP can then be determined by the following equation: q q 2 2 2 2 OP = x + (y + l ) = x + (y + h tan(m a)) (13) P P OG P P where h is the camera height, m; a is half of the vertical field of view, ; m is the elevation angle of the camera, . 2.3.2. Determination of the Angle of View The \PEF, q, was the angle of view between the object and IRT camera, which could be calculated using the following equation: 0 1 0 1 ! ! B C EFEP h tanm [y + h tan(m a)] + h B C @ A q = arccos = arccos q q (14) @ A ! ! 2 2 2 2 2 (h tanm) + h  x + (y + h tan(m a)) + h EF  EP P P 2.3.3. Correction Algorithm Development The IRT camera used in this study could measure the temperature for each pixel of the image. Using the temperature data above, a temperature distribution map could be created. To develop the correction algorithm, the mathematical model from RSM, the observation distance (Equation (13)), and the angle of view (Equation (14)) were all compiled into the correction algorithm, together with the data from the IRT camera in Python 3.8. Thus, the temperature information associated with each pixel could be corrected accordingly, and a new infrared image could be generated. 2.4. Case Study 2.4.1. Experimental Barn and Animal Agriculture 2023, 13, x FOR PEER REVIEW 9 of 17 In order to evaluate the performance of the correction method, a field experiment was carried out in a commercial pig farm located in Huzhou, Zhejiang Province, China on 30 August 2022. The layout of the experimental barn was illustrated in Figure 3. Its 30 August 2022. The layout of the experimental barn was illustrated in Figure 3. Its di- dimensions were 31 m in length, 8.5 m in width, and 2.85 m in height. As shown in Figure 3, mensions were 31 m in length, 8.5 m in width, and 2.85 m in height. As shown in Figure there were two rows of pig pens. Each row had 6 identical pens (4.8  3.75 m). A total of 3, there were two rows of pig pens. Each row had 6 identical pens (4.8 × 3.75 m). A total 330 pigs (Yorkshire  Landrace  Duroc, aged 67 days) were raised in the barn. Pigs were of 330 pigs (Yorkshire × Landrace × Duroc, aged 67 days) were raised in the barn. Pigs fed by an automatic feeder and water was provided. Standard cleaning and maintenance were fed by an automatic feeder and water was provided. Standard cleaning and mainte- procedures for the pig room were followed. nance procedures for the pig room were followed. Figure 3. Infrared thermography system in pig building. Geometry of the system (a) and a photo Figure 3. Infrared thermography system in pig building. Geometry of the system (a) and a photo of of the inspection robot (b). the inspection robot (b). 2.4.2. Infrared Thermography System in Pig Building Figure 3 shows the infrared thermography system used in a commercial pig barn in Changxing, Zhejiang, China. The system consists of two parts: the IRT camera and the overhead rail. To automatically take infrared thermal photos for all the pens, the IRT cam- era (Hikvision TB-1217A-3’PA, angular field of view: 50° × 37.2°, temperature measure- ment accuracy: ±0.5 °C) rode the overhead rail and scanned all the pens. The inspection time and the interval could be determined by the farm managers. In this study, each in- spection lasted 10 min and the interval between two inspections was 4 h. In order to take the ideal picture of pigs, the elevation angle of the IRT camera was set to 55°. 2.4.3. Setup of the Field Experiment To test the correction model, a comparison between the skin surface temperature be- fore correction (TBC) and the corresponding actual skin surface temperature (TA) of pigs, and a comparison between the skin surface temperature after correction (TAC) and the cor- responding actual skin surface temperature (TA) of pigs, were evaluated. During the ex- periment, the inspection robot stayed in front of each pen for 5 min. Within each 5 min stay, the IRT camera took a thermal image of the pigs. Meanwhile, the central inguinal or hip of 1 to 3 pigs was selected for the skin temperature measurement, using a portable infrared thermometer (Raytek MX4, Fluke Corp., Everett, Wash.) with an accuracy of ±0.1 °C. In total, 25 pigs were randomly selected from different pens for the experiment. Note that, in order to ensure the accuracy of the measured skin surface temperature of pigs, the measuring distances of the Raytek MX4 to the skin surface were maintained around 10 cm. The corresponding skin surface temperatures, after correction (TAC), were then calcu- lated using the correction algorithm. In addition, the indoor air temperature and relative humidity were recorded continuously during the experiment by portable hot-wire ane- mometers (VelociCalc Multi-Function Ventilation Meter9565-A, TSI, Shoreview, Minne- sota, MN, USA). Agriculture 2023, 13, 520 9 of 16 2.4.2. Infrared Thermography System in Pig Building Figure 3 shows the infrared thermography system used in a commercial pig barn in Changxing, Zhejiang, China. The system consists of two parts: the IRT camera and the overhead rail. To automatically take infrared thermal photos for all the pens, the IRT camera (Hikvision TB-1217A-3’PA, angular field of view: 50  37.2 , temperature measurement accuracy: 0.5 C) rode the overhead rail and scanned all the pens. The inspection time and the interval could be determined by the farm managers. In this study, each inspection lasted 10 min and the interval between two inspections was 4 h. In order to take the ideal picture of pigs, the elevation angle of the IRT camera was set to 55 . 2.4.3. Setup of the Field Experiment To test the correction model, a comparison between the skin surface temperature before correction (T ) and the corresponding actual skin surface temperature (T ) of BC A pigs, and a comparison between the skin surface temperature after correction (T ) and AC the corresponding actual skin surface temperature (T ) of pigs, were evaluated. During the experiment, the inspection robot stayed in front of each pen for 5 min. Within each 5 min stay, the IRT camera took a thermal image of the pigs. Meanwhile, the central inguinal or hip of 1 to 3 pigs was selected for the skin temperature measurement, using a portable infrared thermometer (Raytek MX4, Fluke Corp., Everett, Wash.) with an accuracy of 0.1 C. In total, 25 pigs were randomly selected from different pens for the experiment. Note that, in order to ensure the accuracy of the measured skin surface temperature of pigs, the measuring distances of the Raytek MX4 to the skin surface were maintained around 10 cm. The corresponding skin surface temperatures, after correction (T ), were AC then calculated using the correction algorithm. In addition, the indoor air temperature and relative humidity were recorded continuously during the experiment by portable hot- wire anemometers (VelociCalc Multi-Function Ventilation Meter9565-A, TSI, Shoreview, Minnesota, MN, USA). 2.4.4. Comparison Criteria The accuracy of the correction method was evaluated using relative error (E ): T T BC a E =  100% (15) rBC T T AC E =  100% (16) r AC where E is the relative error of temperature before correction; E is the relative error r-BC r-AC of correction temperature after correction; T is the temperature before correction, C; BC T is the temperature after correction, C; T is the actual temperature, C. AC A 3. Results and Discussion 3.1. RSM Model 3.1.1. RSM Model Development According to the MANOVA result from the original RSM model, based on Equation (2), the p-value of the model was <0.0001, which means the regression model is highly 2 2 2 significant. However, only 8 terms, i.e., A, B, C, D, E, AD, A , C , D , were significant (p-values < 0.05), and the remaining terms were not significant. Therefore, the terms with a p-value > 0.05 were removed from the RSM model. Table 4 lists the MANOVA results of the modified RSM model. The modified RSM model was significant (p-value < 0.0001) and the p-values of all the examined terms were less than 0.05, indicating that the terms 2 2 could significantly affect the response. Based on the R at 0.9970, adjusted R at 0.9962, and predicted R at 0.9954, the modified RSM model was therefore deemed suitable to predict surface temperature. Agriculture 2023, 13, 520 10 of 16 Table 4. MANOVA for RSM model. Source SS df MS F-Value p-Value Model 184.14 20 9.21 49.65 <0.0001 Model 308.29 9 34.25 1321.89 <0.0001 A-horizontal distance 33.58 1 33.58 1295.93 <0.0001 B-camera height 1.16 1 1.16 44.80 <0.0001 C-angle 0.5852 1 0.5852 22.58 <0.0001 D-temperature 269.45 1 269.45 10,398.19 <0.0001 E-black body height 0.2093 1 0.2093 8.08 0.0073 AD 1.56 1 1.56 60.30 <0.0001 A 0.3527 1 0.3527 13.61 0.0007 0.5104 1 0.5104 19.70 <0.0001 D 0.6065 1 0.6065 23.41 <0.0001 Residual 0.9329 36 0.0259 Lack of Fit 0.8309 31 0.0268 1.31 0.4149 Pure Error 0.1019 5 0.0204 Cor Total 309.23 45 2 2 2 R = 0.9970; R -adj = 0.9962; R -pred = 0.9954. SS: sum of squares, df: degree of freedom, MS: mean square. The coefficient of each term listed in Table 4 was estimated using regression analy- sis. Thus, the mathematical model for predicting the measured surface temperature was established as: T = 12.41943 + 1.96598D 0.897917H + 0.021062q + 0.337445T + 0.38125H 0.0625 D T m c b b b (17) 2 2 2 0.047232D 0.001454q + 0.00991T Accordingly, the body temperature of the black body cavity can then be calculated as follows: T = 3.153380424D +50.45408678 0.00005763656q 0.000834898q 0.01511275H (18) 0.5 +0.03559343H + 0.03964T 0.120112072D + 0.005778526D 0.378437077 c m 17.02547931 where T is the actual surface temperature of the black body cavity, C; T is the average surface temperature of the black body cavity measured by the IRT camera, C; D is the horizontal distance between the black body cavity and the camera, m; H is the height of the camera, m; H is the height of the black body cavity from the ground, m; q is the angle of view between the black body cavity and the camera, . 3.1.2. RSM Model Verification Figure 4 shows the comparison of the predicted values by the RSM model and the measured values. Theoretically, the data points should be split evenly by the 45 degree line. The closer they are to the solid line, the better the prediction model. From Figure 4, the data points were very close to the 45 degree solid line, which indicated that the mathematical model could predict the relation between the investigated variables and the response well. 3.2. Effect of the Parameters on Surface Temperature Detection Based on T calculation from the RSM model, the effect of camera height (H ), horizon- tal distance (D), pig height (H ), and angle of view between the IRT camera and pigs (q) on the skin temperature difference (DT) between T and T were analyzed using Origin Pro b m (OriginLab, Northampton, MA, USA). Figure 5 illustrates the perturbation of the relative significance of each factor. Agriculture 2023, 13, x FOR PEER REVIEW 11 of 17 Accordingly, the body temperature of the black body cavity can then be calculated as fol- lows: 𝑇 = 3.153380424𝐷 (18) + 50.45408678 × (0.00005763656𝜃 − 0.000834898𝜃 − 0.01511275𝐻 + 0.03559343𝐻 + 0.03964𝑇 − 0.120112072𝐷 + 0.005778526𝐷 − 0.378437077) − 17.02547931 where Tb is the actual surface temperature of the black body cavity, °C; Tm is the average surface temperature of the black body cavity measured by the IRT camera, °C; D is the horizontal distance between the black body cavity and the camera, m; Hc is the height of the camera, m; Hb is the height of the black body cavity from the ground, m; θ is the angle of view between the black body cavity and the camera, . 3.1.2. RSM Model Verification Figure 4 shows the comparison of the predicted values by the RSM model and the measured values. Theoretically, the data points should be split evenly by the 45 degree line. The closer they are to the solid line, the better the prediction model. From Figure 4, the data points were very close to the 45 degree solid line, which indicated that the math- Agriculture 2023, 13, 520 11 of 16 ematical model could predict the relation between the investigated variables and the re- sponse well. Agriculture 2023, 13, x FOR PEER REVIEW 12 of 17 Figure 4. Predicted values versus the experimental data values. Training data and testing data were Figure 4. Predicted values versus the experimental data values. Training data and testing data were listed in Tables 2 and 3, respectively. listed in Tables 2 and 3, respectively. 3.2. Effect of the Parameters on Surface Temperature Detection Based on Tb calculation from the RSM model, the effect of camera height (Hc), hori- zontal distance (D), pig height (Hb), and angle of view between the IRT camera and pigs (θ) on the skin temperature difference (ΔT) between Tb and Tm were analyzed using Origin Pro (OriginLab, Northampton, MA, USA). Figure 5 illustrates the perturbation of the rel- ative significance of each factor. Figure 5. Perturbation of the relative significance of factors, including the camera height (a), hori- Figure 5. Perturbation of the relative significance of factors, including the camera height (a), horizon- zontal distance (b), object height (c), and angle of view (d), on response. tal distance (b), object height (c), and angle of view (d), on response. According to Figure 5, as H increased from 1.7 to 2.3 m, DT increased linearly from According to Figure 5, as Hc increased from 1.7 to 2.3 m, ΔT increased linearly from 0. 0.45 45 to to11.22 .22 °C,C, wi with th TmT , D,, Dθ, and H , q, and b hel H d held at 30 at °C 30 , 4 m C,, 25 4 m, °, and 0 25 , and .3 m,0.3 resp m, ecr ti espectively vely. Sim- . Similarly, as horizontal distance (D) increased from 2 to 6 m, the DT increased non-linearly ilarly, as horizontal distance (D) increased from 2 to 6 m, the ΔT increased non-linearly from 0.24 to 2.31 C, with T , H , q, and H at 30 C, 2 m, 25 , and 0.3 m, respectively. from 0.24 to 2.31 °C, with Tm, mHc, θ c , and Hb at 30 °C, 2 m, 25°, and 0.3 m, respectively. In In addition, as the height (H ) of the object increased from 0 to 0.6 m, the DT decreased addition, as the height (Hb) of the ob b ject increased from 0 to 0.6 m, the ΔT decreased line- linearly from 1 to 0.67 C when T , D, q, and H were at 30 C, 4 m, 25 , and 2 m, m c arly from 1 to 0.67 °C when Tm, D, θ, and Hc were at 30 °C, 4 m, 25°, and 2 m, respectively. respectively. According to the Pythagorean theorem, the observation distance between the According to the Pythagorean theorem, the observation distance between the IRT camera IRT camera and the object was determined by the three parameters, i.e., the camera height, and the object was determined by the three parameters, i.e., the camera height, the hori- the horizontal distance, and the object height. Therefore, the observation distance negatively zontal distance, and the object height. Therefore, the observation distance negatively af- affects the accuracy of the surface temperature measurement in the application of infrared fects the accuracy of the surface temperature measurement in the application of infrared thermography. Zhou, Wei, Xie, Tang and Cui [26] reported that the phenomenon could be attributed to the decrease in the transmittance of infrared radiation in the atmosphere, with increasing observation distances. Among these three parameters, the variation of horizontal distance had the most impact because the horizontal distance was much larger than the height difference between the camera and the object. Thus, it had the greatest impact on the temperature difference. Since the ranges of the other factors were fixed ac- cording to the situation in practice, the horizontal distance between pigs and the IRT cam- era became the most impacting factor. Regarding the effect of the angle of view θ (Figure 5), as the angle of view increased from 0° to 25°, the temperature difference, ΔT, initially decreased from 0.89 to 0.78 °C but then increased from 0.78 to 1.43 °C, with Tm, Hc, D, and Hb at 30 °C, 2 m, 4 m, and 0.3 m, respectively. However, some research found that the measurement could be deemed reli- able as long as the angle of view is less than 45° [27,41]. The slight decline of temperature difference, ΔT, in this study has not been reported in the literature. The decline could be attributed to the removal of some terms in the process of RSM modeling. Generally, the effect of Hb variation between 0 to 0.6 m on ΔT was less than 0.5 °C. Therefore, the height of the pig was fixed at 0.3 m in the correction algorithm development and the height of the IRT camera was fixed at 2 m, according to the situation in the experimental barn. Agriculture 2023, 13, 520 12 of 16 thermography. Zhou, Wei, Xie, Tang and Cui [26] reported that the phenomenon could be attributed to the decrease in the transmittance of infrared radiation in the atmosphere, with increasing observation distances. Among these three parameters, the variation of horizontal distance had the most impact because the horizontal distance was much larger than the height difference between the camera and the object. Thus, it had the greatest impact on the temperature difference. Since the ranges of the other factors were fixed according to the situation in practice, the horizontal distance between pigs and the IRT camera became the most impacting factor. Regarding the effect of the angle of view q (Figure 5), as the angle of view increased from 0 to 25 , the temperature difference, DT, initially decreased from 0.89 to 0.78 C but then increased from 0.78 to 1.43 C, with T , H , D, and H at 30 C, 2 m, 4 m, and m c 0.3 m, respectively. However, some research found that the measurement could be deemed reliable as long as the angle of view is less than 45 [27,41]. The slight decline of temperature difference, DT, in this study has not been reported in the literature. The decline could be Agriculture 2023, 13, x FOR PEER REVIEW 13 of 17 attributed to the removal of some terms in the process of RSM modeling. Generally, the effect of H variation between 0 to 0.6 m on DT was less than 0.5 C. Therefore, the height of the pig was fixed at 0.3 m in the correction algorithm development and the height of the IRT camera was fixed at 2 m, according to the situation in the experimental barn. 3.3. Performance of the Correction Method 3.3.1. Comparison Between Skin Temperature Before and After Correction 3.3. Performance of the Correction Method 3.3.1. Comparison between Skin Temperature before and after Correction Figure 6 is a boxplot illustrating the difference in relative error before correction (Er- BC) and after correction (Er-AC) of all 25 samples. It shows that the relative error before cor- Figure 6 is a boxplot illustrating the difference in relative error before correction (rection h E ) and ad after a median v correction alue of (E − ) 4.73%, of all 25while samples. the me It shows dian value o that thefr relative elative err erro or befor r after e the r-BC r-AC correction had a median value of 4.73%, while the median value of relative error after the correction improved to −0.60%. The mean relative error before and after the correction correction improved to0.60%. The mean relative error before and after the correction was was −4.64% and −0.70%, respectively. In addition, the maximum and the minimum of Er- 4.64% and 0.70%, respectively. In addition, the maximum and the minimum of E r-BC BC were −1.51% and −7%, respectively. After correction, the maximum and minimum of Er- were1.51% and7%, respectively. After correction, the maximum and minimum of E r-AC AC improved to 1.47% and −2.98%, respectively. Although the maximum relative error af- improved to 1.47% and 2.98%, respectively. Although the maximum relative error after ter correction increased (above 0), the absolute value of the maximum and the minimum correction increased (above 0), the absolute value of the maximum and the minimum still still improved from 6.98% to 2.98%. Fixing the pig’s height at 0.3 m in the correction algo- improved from 6.98% to 2.98%. Fixing the pig’s height at 0.3 m in the correction algorithm rithm may have caused the Er-AC > 0. Additionally, the interquartile range (IQR) of the may have caused the Er- > 0. Additionally, the interquartile range (IQR) of the boxplot AC boxplot associated with BC was 2.52, while the IQR of the boxplot associated with AC was associated with BC was 2.52, while the IQR of the boxplot associated with AC was 1.19. 1.19. Note that IQR is a measure that describes the dispersion of each variable in the sta- Note that IQR is a measure that describes the dispersion of each variable in the statistical tistical data. The larger the IQR is, the greater the discrete degree is. The decline of IQR data. The larger the IQR is, the greater the discrete degree is. The decline of IQR indicated indicated that the discrete degree of relative error was improved after correction. Based that the discrete degree of relative error was improved after correction. Based on the above on the above analysis, the accuracy of IRT temperature measurement can be improved by analysis, the accuracy of IRT temperature measurement can be improved by using the using the correction method proposed in this research. correction method proposed in this research. Figure 6. Box plot of the relative error for the measured skin temperature before correction (BC) and Figure 6. Box plot of the relative error for the measured skin temperature before correction (BC) and after correction (AC). after correction (AC). 3.3.2. Comparison Between IRT Images Figure 7a shows the temperature distribution images in a pig pen before and after correction, which was obtained at a thermal comfort condition (THI = 70.54). The skin temperature of each pig was similar under normal circumstances. The temperature distri- bution image before correction showed that the skin temperatures of pigs close to the camera appeared higher than the skin temperatures of pigs further away from the camera. This was in line with the known limitation of the IRT camera. Comparatively, the skin temperatures of pigs in the temperature distribution image, after correction, became closer to each other and stayed in the range of 36 to 37 °C. This demonstrates the good perfor- mance of the correction model. Particularly, a piglet with a low skin temperature area on its neck was detected in the infrared image, as shown in the red box. Referring to the corresponding visible image (Figure 7b), the area of skin with the lower temperature piglet was dirty in the scale-up image. Many studies have reported that the clearness of skin is very important to surface temperature sensing [42] because the dirty stuff not only blocks the heat transfer from the pig body to the ambient air, but also impacts the emissivity level of the target surface [43]. In this case, the dried feces stuck on the skin surface could be the potential reason for the dirty skin. Therefore, in order to ensure the accuracy of the measurement result, pigs in pig pens should have a sufficient area of clean skin. Agriculture 2023, 13, 520 13 of 16 3.3.2. Comparison between IRT Images Figure 7a shows the temperature distribution images in a pig pen before and after correction, which was obtained at a thermal comfort condition (THI = 70.54). The skin tem- perature of each pig was similar under normal circumstances. The temperature distribution image before correction showed that the skin temperatures of pigs close to the camera appeared higher than the skin temperatures of pigs further away from the camera. This was in line with the known limitation of the IRT camera. Comparatively, the skin temperatures of pigs in the temperature distribution image, after correction, became closer to each other Agriculture 2023, 13, x FOR PEER REVIEW 14 of 17 and stayed in the range of 36 to 37 C. This demonstrates the good performance of the correction model. Figure 7. Infrared images (a) and visible image (b) of a pig pen. Figure 7. Infrared images (a) and visible image (b) of a pig pen. Additionally, it could be found that the temperatures of the pigs in the right zone Particularly, a piglet with a low skin temperature area on its neck was detected in were around 0.3 °C higher than those in the other area, according to Figure 7a. This phe- the infrared image, as shown in the red box. Referring to the corresponding visible image nomenon could be attributed to the difference in the density of pigs. As can be seen, more (Figure 7b), the area of skin with the lower temperature piglet was dirty in the scale-up pigs stayed in the right zone of the pen. A similar result was reported by Abudabos, et al. image. Many studies have reported that the clearness of skin is very important to surface [44], who, in a comparison of the skin temperatures of birds under different stocking den- temperature sensing [42] because the dirty stuff not only blocks the heat transfer from the sities, found that the skin temperatures of birds increased as the stocking density in- pig body to the ambient air, but also impacts the emissivity level of the target surface [43]. creased. Therefore, to better assess the health of group pigs by skin temperature, the den- In this case, the dried feces stuck on the skin surface could be the potential reason for the sity of the area where pigs are located should also be considered. Overall, the IRT camera, dirty skin. Therefore, in order to ensure the accuracy of the measurement result, pigs in pig compiled with the correction algorithm, has a good measuring performance for clean pigs, pens should have a sufficient area of clean skin. although it has limitations for dirty pigs and the density of pigs. Additionally, it could be found that the temperatures of the pigs in the right zone were around 0.3 C higher than those in the other area, according to Figure 7a. This phenomenon 3.4. Limitations and Perspectives could be attributed to the difference in the density of pigs. As can be seen, more pigs stayed in the right zone of the pen. A similar result was reported by Abudabos, et al. [44], who, in Since the tested IRT camera only has a single lens, monocular ranging was adopted a comparison of the skin temperatures of birds under different stocking densities, found to detect the distance between the objects in the picture and the IRT camera. However, the that the skin temperatures of birds increased as the stocking density increased. Therefore, monocular ranging model can only detect the horizontal distance and angle of view be- to better assess the health of group pigs by skin temperature, the density of the area where tween the camera and the pig, but not the pig’s height. Therefore, there is an error between pigs are located should also be considered. Overall, the IRT camera, compiled with the the measured distance and the actual observation distance. To improve the accuracy of correction algorithm, has a good measuring performance for clean pigs, although it has the correction method and make it more robust, how to detect pig height remains an area limitations for dirty pigs and the density of pigs. of future work. Additionally, since different IRT cameras consist of different hardware, the correction algorithm is just reliable for the tested IRT camera (Hikvision TB-1217A- 3’PA). Even so, the outcome of this study is still meaningful because (1) the producer of the tested IRT camera was a world-famous producer, which means that the proposed cor- rection algorithm could be potentially embedded into their further products and more animal farms would benefit from these; (2) the test IRT camera has already been widely applied in many livestock farms in Zhejiang Province. Thus, direct application of the cor- rection algorithm could also be acceptable; (3) this study provides a potential method to better monitor the animals’ skin surface temperature using IRT camera. A further modifi- cation is, perhaps, required when adapted to other IRT cameras. Even so, the proposed correction method for IRT cameras can benefit from a better skin temperature measure- ment of pigs in the future. 4. Conclusions Agriculture 2023, 13, 520 14 of 16 3.4. Limitations and Perspectives Since the tested IRT camera only has a single lens, monocular ranging was adopted to detect the distance between the objects in the picture and the IRT camera. However, the monocular ranging model can only detect the horizontal distance and angle of view between the camera and the pig, but not the pig’s height. Therefore, there is an error between the measured distance and the actual observation distance. To improve the accuracy of the correction method and make it more robust, how to detect pig height remains an area of future work. Additionally, since different IRT cameras consist of different hardware, the correction algorithm is just reliable for the tested IRT camera (Hikvision TB-1217A-3’PA). Even so, the outcome of this study is still meaningful because (1) the producer of the tested IRT camera was a world-famous producer, which means that the proposed correction algorithm could be potentially embedded into their further products and more animal farms would benefit from these; (2) the test IRT camera has already been widely applied in many livestock farms in Zhejiang Province. Thus, direct application of the correction algorithm could also be acceptable; (3) this study provides a potential method to better monitor the animals’ skin surface temperature using IRT camera. A further modification is, perhaps, required when adapted to other IRT cameras. Even so, the proposed correction method for IRT cameras can benefit from a better skin temperature measurement of pigs in the future. 4. Conclusions The study investigated the effects of the observation distance and the angle of view on the surface temperature sensing, and then proposed an infrared temperature correction method for processing the skin temperatures of pigs in infrared image. Based on the results, the following conclusions can be drawn: 1. Response surface methodology can be applied in the modeling of the relationship between the actual skin temperature and the affecting parameters, along with the monocular ranging being applied in the determination of the observation distance. 2. The observation distance significantly affects the accuracy of the skin temperature measurement. The horizontal distance, the camera height, and the angle of view between the camera and the object positively affect the accuracy between the measure- ments and the actual skin temperatures, while the heights of pigs negatively affect the accuracy between the measurements and the actual skin temperatures. 3. A skin temperature correction algorithm was developed and evaluated using field- measured data. The average relative error of measured skin temperatures before the correction was4.63%, and the corresponding mean relative error after the correction was reduced to 0.25%. Author Contributions: Conceptualization, X.W.; methodology, X.W. and F.H.; software, F.H.; formal analysis, F.H.; investigation, X.W., R.Y. and K.W.; writing—original draft preparation, F.H.; writing— review and editing, X.W. and K.W.; visualization, X.W. and K.W.; data curation, R.Y.; validation, F.H. and R.Y.; supervision, K.W.; project administration, K.W.; funding acquisition, K.W. All authors have read and agreed to the published version of the manuscript. Funding: This work was supported by grants from the Key R & D Projects of Zhejiang Province (2022C02050). The authors appreciated the employees in the experimental pig farm for help during field experiments. Institutional Review Board Statement: Not applicable. Data Availability Statement: Not applicable. Conflicts of Interest: The authors declare no conflict of interest. Agriculture 2023, 13, 520 15 of 16 References 1. Rae, A.N.; Ma, H.; Huang, J.; Rozelle, S. Livestock in China: Commodity-Specific Total Factor Productivity Decomposition Using New Panel Data. Am. J. Agric. Econ. 2006, 88, 680–695. [CrossRef] 2. Wang, Y.; Gao, L.; Li, Y.; Xu, Q.; Yang, H.; Shen, C.; Huang, B. African swine fever in China: Emergence and control. J. Biosaf. Biosecurity 2019, 1, 7–8. [CrossRef] 3. Gao, L.; Sun, X.; Yang, H.; Xu, Q.; Li, J.; Kang, J.; Liu, P.; Zhang, Y.; Wang, Y.; Huang, B. Epidemic situation and control measures of African Swine Fever Outbreaks in China 2018–2020. Transbound. Emerg. Dis. 2021, 68, 2676–2686. [CrossRef] [PubMed] 4. Wang, T.; Luo, R.; Sun, Y.; Qiu, H.-J. Current efforts towards safe and effective live attenuated vaccines against African swine fever: Challenges and prospects. Infect. Dis. Poverty 2021, 10, 137. [CrossRef] [PubMed] 5. Tao, D.; Sun, D.; Liu, Y.; Wei, S.; Yang, Z.; An, T.; Shan, F.; Chen, Z.; Liu, J. One year of African swine fever outbreak in China. Acta Trop. 2020, 211, 105602. [CrossRef] 6. Pusnik, I.; Stukelj, M. Usefulness of thermovision for pig welfare. Elektrotehniski Vestn. 2019, 86, 77–82. 7. Jorquera-Chavez, M.; Fuentes, S.; Dunshea, F.R.; Warner, R.D.; Poblete, T.; Morrison, R.S.; Jongman, E.C. Remotely Sensed Imagery for Early Detection of Respiratory Disease in Pigs: A Pilot Study. Animals 2020, 10, 451. [CrossRef] 8. Hwang, S.W.; Choi, Y.S.; Lee, S.J.; Yang, S.H. An Analysis on ASF Variations and Temperature. In Proceedings of the IEEE/ION Position, Location and Navigation Symposium (PLANS), Monterey, CA, USA, 5–8 May 2014; pp. 882–885. 9. Escuredo, J.A.M.; Carr, J.; Dizon, R.; Howells, M. Using infrared thermography to help maintain pig health. Practice 2021, 43, 388–396. [CrossRef] 10. Soerensen, D.D.; Pedersen, L.J. Infrared skin temperature measurements for monitoring health in pigs: A review. Acta Vet. Scand. 2015, 57, 5. [CrossRef] 11. Zhong, Z. A novel visible and infrared image fusion method based on convolutional neural network for pig-body feature detection. Multimed. Tools Appl. 2021, 81, 2757–2775. [CrossRef] 12. Sa, J.; Choi, Y.; Lee, H.; Chung, Y.; Park, D.; Cho, J. Fast Pig Detection with a Top-View Camera under Various Illumination Conditions. Symmetry 2019, 11, 266. [CrossRef] 13. Shirley, L.K.; Field, T.; Schinckel, A.P.; Johnson, J.S.; Stwalley, R.; Stewart, K.R. 80 Use of an Electronically-controlled Floor Cooling Pad During Heat Stress on Thermoregulatory and Reproductive Performance in Boars. J. Anim. Sci. 2021, 99, 107. [CrossRef] 14. Da Fonseca, F.N.; Abe, J.M.; Nääs, I.D.A.; Cordeiro, A.F.D.S.; Amaral, F.V.D.; Ungaro, H.C. Automatic prediction of stress in piglets (Sus Scrofa) using infrared skin temperature. Comput. Electron. Agric. 2019, 168, 105148. [CrossRef] 15. Choudhury, M.; Saikia, T.; Banik, S.; Patil, G.; Pegu, S.R.; Rajkhowa, S.; Sen, A.; Das, P.J. Infrared imaging a new non-invasive machine learning technology for animal husbandry. Imaging Sci. J. 2020, 68, 240–249. [CrossRef] 16. Tattersall, G.J. Infrared thermography: A non-invasive window into thermal physiology. Comp. Biochem. Physiol. Part A Mol. Integr. Physiol. 2016, 202, 78–98. [CrossRef] 17. Playa-Montmany, N.; Tattersall, G.J. Spot size, distance and emissivity errors in field applications of infrared thermography. Methods Ecol. Evol. 2021, 12, 828–840. [CrossRef] 18. Faye, E.; Dangles, O.; Pincebourde, S. Distance makes the difference in thermography for ecological studies. J. Therm. Biol. 2016, 56, 1–9. [CrossRef] 19. Arenas, A.J.; Gómez, F.; Salas, R.; Carrasco, P.; Borge, C.; Maldonado, A.; O’Brien, D.J.; Martínez-Moreno, F. An evaluation of the application of infrared thermal imaging to the tele-diagnosis of sarcoptic mange in the Spanish ibex (Capra pyrenaica). Vet. Parasitol. 2002, 109, 111–117. [CrossRef] 20. Zhang, C.; Xiao, D.; Yang, Q.; Wen, Z.; Lv, L. Review: Application of Infrared Thermography in Livestock Monitoring. Trans. ASABE 2020, 63, 389–399. [CrossRef] 21. Church, J.; Hegadoren, P.; Paetkau, M.; Miller, C.; Regev-Shoshani, G.; Schaefer, A.; Schwartzkopf-Genswein, K. Influence of environmental factors on infrared eye temperature measurements in cattle. Res. Vet. Sci. 2014, 96, 220–226. [CrossRef] 22. Harrap, M.J.M.; de Ibarra, N.H.; Whitney, H.M.; Rands, S.A. Reporting of thermography parameters in biology: A systematic review of thermal imaging literature. R. Soc. Open Sci. 2018, 5, 181281. [CrossRef] [PubMed] 23. Soerensen, D.D.; Clausen, S.; Mercer, J.B.; Pedersen, L.J. Determining the emissivity of pig skin for accurate infrared ther-mography. Comput. Electron. Agric. 2014, 109, 52–58. [CrossRef] 24. Zhang, K.; Jiao, L.; Zhao, X.; Dong, D. An instantaneous approach for determining the infrared emissivity of swine surface and the influencing factors. J. Therm. Biol. 2016, 57, 78–83. [CrossRef] 25. Muniz, P.R.; Magalhães, R.D.S.; Cani, S.P.N.; Donadel, C.B. Non-contact measurement of angle of view between the inspected surface and the thermal imager. Infrared Phys. Technol. 2015, 72, 77–83. [CrossRef] 26. Zhou, Z.; Wei, X.; Xie, T.; Tang, Z.; Cui, H. Influence of Observation Distance and Angle of View on the Detection Accuracy of Infrared Thermal Radiation. Infrared Technol. 2017, 39, 86–90. 27. Muniz, P.R.; Cani, S.P.N.; Magalhaes, R.D.S. Influence of Field of View of Thermal Imagers and Angle of View on Temperature Measurements by Infrared Thermovision. IEEE Sens. J. 2013, 14, 729–733. [CrossRef] 28. Bas, ¸ D.; Boyacı, I.H. Modeling and optimization I: Usability of response surface methodology. J. Food Eng. 2007, 78, 836–845. [CrossRef] 29. Madzimure, J.; Chimonyo, M.; Zander, K.; Dzama, K. Diurnal heat-related physiological and behavioural responses in South African indigenous gilts. J. Arid. Environ. 2012, 87, 29–34. [CrossRef] Agriculture 2023, 13, 520 16 of 16 30. Chung, T.-H.; Jung, W.-S.; Nam, E.-H.; Kim, J.-H.; Park, S.-H.; Hwang, C.-Y. Comparison of Rectal and Infrared Thermometry for Obtaining Body Temperature of Gnotobiotic Piglets in Conventional Portable Germ Free Facility. Asian-Australas. J. Anim. Sci. 2010, 23, 1364–1368. [CrossRef] 31. Oh, S.-I.; Lee, H.S.; Bui, V.N.; Dao, D.T.; Bui, N.A.; Le, T.D.; Kieu, M.A.; Nguyen, Q.H.; Tran, L.H.; So, K.-M.; et al. Dynamic Variations in Infrared Skin Temperature of Weaned Pigs Experimentally Inoculated with the African Swine Fever Virus: A Pilot Study. Vet. Sci. 2021, 8, 223. [CrossRef] 32. Baxter, S.H. Intensive Pig Production: Environmental Management and Design; Granada Publishing Ltd.: London, UK, 1984; p. 588. 33. Ferreira, S.L.C.; Bruns, R.E.; Ferreira, H.S.; Matos, G.D.; David, J.M.; Brandão, G.C.; da Silva, E.G.P.; Portugal, L.A.; dos Reis, P.S.; Souza, A.S.; et al. Box-Behnken design: An alternative for the optimization of analytical methods. Anal. Chim. Acta 2007, 597, 179–186. [CrossRef] 34. Myers, R.H.; Montgomery, D.C.; Anderson-Cook, C. Response Surface Methodology: Process and Product Optimization Using Designed Experiments; John Wiley & Sons: Hoboken, NJ, USA, 2016. 35. Box, G.E.; Cox, D.R. An analysis of transformations. J. R. Stat. Soc. Ser. B (Methodol.) 1964, 26, 211–252. [CrossRef] 36. Shen, X.; Zhang, G.; Bjerg, B. Investigation of response surface methodology for modelling ventilation rate of a naturally ven-tilated building. Build. Environ. 2012, 54, 174–185. [CrossRef] 37. Cheng, Y.H.; Wang, S.N.; Yu, D.H. Optimal Design of Monocular Stereo Vision System. In Proceedings of the 16th IEEE International Conference on Mechatronics and Automation (IEEE ICMA), Tianjin, China, 4–7 August 2019; pp. 1022–1027. 38. Rezaei, M.; Terauchi, M.; Klette, R. Robust Vehicle Detection and Distance Estimation Under Challenging Lighting Conditions. IEEE Trans. Intell. Transp. Syst. 2015, 16, 2723–2743. [CrossRef] 39. Kim, J.B. Efficient Vehicle Detection and Distance Estimation Based on Aggregated Channel Features and Inverse Perspective Mapping from a Single Camera. Symmetry 2019, 11, 1205. [CrossRef] 40. Shen, C.; Zhao, X.; Liu, Z.; Gao, T.; Xu, J. Joint vehicle detection and distance prediction via monocular depth estimation. IET Intell. Transp. Syst. 2020, 14, 753–763. [CrossRef] 41. Litwa, M. Influence of Angle of View on Temperature Measurements Using Thermovision Camera. IEEE Sens. J. 2010, 10, 1552–1554. [CrossRef] 42. LokeshBabu, L.; Jeyakumar, S.; Vasant, P.J.; Sathiyabarathi, M.; Manimaran, A.; Kumaresan, A.; Pushpadass, H.A.; Sivaram, M.; Ramesha, K.; Kataktalware, M.A.; et al. Monitoring foot surface temperature using infrared thermal imaging for assessment of hoof health status in cattle: A review. J. Therm. Biol. 2018, 78, 10–21. [CrossRef] 43. Stokes, J.; Leach, K.; Main, D.; Whay, H. An investigation into the use of infrared thermography (IRT) as a rapid diagnostic tool for foot lesions in dairy cattle. Vet. J. 2012, 193, 674–678. [CrossRef] 44. Abudabos, A.M.; Samara, E.M.; Hussein, E.O.S.; Al-Ghadi, M.Q.; Al-Atiyat, R.M. Impacts of Stocking Density on the Per-formance and Welfare of Broiler Chickens. Ital. J. Anim. Sci. 2013, 12, e11. [CrossRef] 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. http://www.deepdyve.com/assets/images/DeepDyve-Logo-lg.png Agriculture Multidisciplinary Digital Publishing Institute

An Infrared Temperature Correction Method for the Skin Temperature of Pigs in Infrared Images

Agriculture , Volume 13 (3) – Feb 21, 2023

Loading next page...
 
/lp/multidisciplinary-digital-publishing-institute/an-infrared-temperature-correction-method-for-the-skin-temperature-of-U7yhCXkR8Y

References (39)

Publisher
Multidisciplinary Digital Publishing Institute
Copyright
© 1996-2023 MDPI (Basel, Switzerland) unless otherwise stated Disclaimer 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. Terms and Conditions Privacy Policy
ISSN
2077-0472
DOI
10.3390/agriculture13030520
Publisher site
See Article on Publisher Site

Abstract

agriculture Article An Infrared Temperature Correction Method for the Skin Temperature of Pigs in Infrared Images Xiaoshuai Wang, Feiyue Hu, Ruimin Yang and Kaiying Wang * College of Biosystems Engineering and Food Science, Zhejiang University, Hangzhou 310058, China * Correspondence: zjuwky@zju.edu.cn Abstract: Accurately measuring the skin temperature of pigs is essential to large-scale pig farming for health monitoring, as well as disease detection and prevention. Infrared thermography (IRT) is a promising technology for the non-invasive measuring of pig skin temperature. However, the distance and angle of view of measurement greatly affect the accuracy of IRT-measured temperature. To improve the accuracy of the measurement, this study starts with evaluating the effects of four parameters on the measurement of skin temperature: horizontal distance, camera height, pig height, and angle of view between the object and the IRT camera. It follows by proposing a mathematical model describing the relationship between the real skin temperature and the four parameters through means of response surface methodology. A correction algorithm is then developed based on the mathematical model to improve the measuring accuracy. In order to evaluate the performance of the correction algorithm, the measured skin temperatures before and after correction are compared with the actual ones. The comparison was carried out in an experimental pig farm with 25 randomly selected pigs. The results show that the mean relative error before the correction was 4.64% and the mean relative error after the correction was 0.70%. This study demonstrates that the new infrared temperature correction method is effective and can benefit skin temperature monitoring for commercial pig farms. Keywords: correction algorithm; infrared thermography; monocular ranging; skin temperature sensing; response surface methodology Citation: Wang, X.; Hu, F.; Yang, R.; Wang, K. An Infrared Temperature Correction Method for the Skin 1. Introduction Temperature of Pigs in Infrared Images. Agriculture 2023, 13, 520. China has developed a large pig industry to meet the demand of the large population [1]. https://doi.org/10.3390/ Since the first detection of African Swine Fever (ASF) in China in August 2018, multiple agriculture13030520 outbreaks of ASF have been reported across China [2]. The ASF became a serious threat, not only to individual pig farms, but also to the entire pig industry in China. Many pig Academic Editor: Claudia farms experienced tremendous losses these years due to their failure to prevent ASF [3]. Arcidiacono Since there is no ASF vaccine available, the most common method to prevent the spreading Received: 1 February 2023 of ASF in China is to eliminate the source of infection by culling and isolating infected Revised: 18 February 2023 pigs [4]. Though this method can reduce the likelihood of ASF spreading to healthy pigs, Accepted: 19 February 2023 the effectiveness of this treatment depends on how quickly infected pigs can be detected Published: 21 February 2023 and isolated. Any delay will result in the death of a large number of pigs and enormous economic losses to affected pig farms [5]. Therefore, the timely detection of infected pigs plays an extremely important role in disease prevention and damage control. Body temperature is an important indicator of pigs’ health status [6]. Monitoring pigs’ Copyright: © 2023 by the authors. body temperature can effectively identify infected pigs and prevent the spread of diseases Licensee MDPI, Basel, Switzerland. by isolating the infected pigs. Most diseases cause the body temperature of pigs to rise This article is an open access article prior to other symptoms, especially some infectious diseases [7]. For example, high fever is distributed under the terms and one of the most reliable indications of ASF infection [8]. Thus, measuring the pigs’ skin conditions of the Creative Commons temperature could be an important method for ASF prevention. Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ Infrared thermography (IRT) is a promising technology, not only for the automatic 4.0/). monitoring of pigs’ skin temperature [9,10], but also for extracting pig-body shape based Agriculture 2023, 13, 520. https://doi.org/10.3390/agriculture13030520 https://www.mdpi.com/journal/agriculture Agriculture 2023, 13, 520 2 of 16 on shape segmentation [11,12] and evaluating stress conditions in pigs [13,14], although it has drawbacks in providing sufficient information to determine what causes the changes in skin temperature of animals [10,15]. Compared with other temperature measuring technologies, such as rectal and contact skin thermometers or implanted thermal sensors, IRT is a non-contact measure for the surface temperature, which has a distinctive advantage in pig skin temperature sensing in the perspective of reducing the risk of viral infection [16]. However, the accuracy of the IRT measurement can be affected by many factors. The distance between the measured object and the IRT camera, for instance, is one of the most influencing factors in surface temperature sensing [17,18], as the measured temperature decreases with increasing distance between the IRT camera and the target object [19]. Given that the distance between the thermal camera and each pig in the pen is different, each pig’s skin temperature, measured by the IRT camera, could be different from its actual skin temperature [20]. In other words, a pig with a high temperature, far away from the IRT camera, could have the same or even lower measured temperature as one with a normal temperature, close to the camera [21]. This phenomenon could result in a delay in sick pig detection. Note that the emissivity of pig skin is also an influencing factor in surface temperature sensing, which describes a material’s ability to emit energy by radiation [22]. In some previous studies, the skin emissivity of pigs was set as a constant value of 0.98 in pig health screening and fever detection [23,24]. The infrared emissivity was determined by the skin surface condition and the viewing angle [25]. For a commercial pig barn, most of the pigs (particularly the skin surface condition) in a raising unit were the same, which means the viewing angle could be the most affecting parameter for the emissivity in the pig skin temperature measurement using IRT camera. Therefore, in order to accurately obtain pigs’ skin temperature using IRT, it is critical to systematically investigate the effects of the key influencing parameters, such as the distance and the angle of view between pigs and the IRT camera. Furthermore, a correction method for determining the effect of distance and the angle of view is needed for the application of infrared thermography. Therefore, the objectives of this study are (1) to evaluate the effect of the distance and the angle of view between the pigs and the IRT camera on the accuracy of IRT-measured skin temperature; and (2) to develop a new methodology to correct the skin measurement made by IRT cameras. The results of this study could benefit the health monitoring of pigs by using an IRT camera for commercial pig farms. 2. Methodology and Materials 2.1. The Affecting Parameters Identification The observation distance, the distance between the pig and the IRT camera, was determined by the height of the pig and the camera, as well as the horizontal distance between them. The observation distance affected the transmittance of infrared radiation in the atmosphere, resulting in the measurement error [26]. According to the Pythagorean theorem, the observation distance could be further measured using the horizontal distance between the camera and the pig, camera height, and pig height. Additionally, since the emissivity depends on the angle of radiation, the angle of view is also an important affecting factor [27]. Therefore, horizontal distance, camera height, pig height, and the angle of view are the factors selected for this study. 2.2. Response Surface Methodology Modelling The response surface methodology (RSM), a combination of mathematical and statisti- cal techniques, was selected to investigate the effects of the five parameters on the accuracy of skin temperature measurement using infrared thermography. RSM provides the framework to explore the relationship between explanatory variables and response variables, and to obtain the optimal combination for desired responses [28]. RSM is widely applied during both the model development phase and the model improvement and optimization phase. Agriculture 2023, 13, 520 3 of 16 2.2.1. Experimental Variables and Response The five factors—horizontal distance, camera height, the angle of view between the camera and target pig, the skin temperature of the pig, and target pig height—were set as the input variables in the RSM model (Table 1). Given the difficulties in using pigs in the laboratory experiment (e.g., keeping them still and controlling the surface temperature), we used a black body cavity (HT-C50, temperature range: 5 to 50 C, effective emissivity: 0.98  0.02, resolution: 0.01 C, accuracy: 0.15 C) to represent the pigs, as an alternative. The ranges of horizontal distance (D), camera height (H ), and the angle of view between the camera and black body cavity (q) were determined based on the size of the pens (4.8  3.75 m in length  width) and the height of the thermal imaging camera installed. In this study, the range of horizontal distance between the camera and the black body cavity was set at 2 to 6 m and the range of camera height was set at 1.7 to 2.3 m, and the angle between the camera and the black body cavity was set at 0 to 50 C. The black body cavity temperature (T ) was determined by refereeing the skin temperature of healthy and thermal comfortable pigs and sick pigs, such as ASF-infected pigs. The rectal temperature of a healthy and thermal comfortable pig (6 weeks of age) stayed at 39.1  0.68 C [29], when the temperature-humidity index (THI) was around 70. According to the relationship between the rectal temperature and central dorsal surface temperature of pigs [30], the normal dorsal surface temperature of pigs would be around 34 C. A study shows that the rectal temperature of ASF-infected pigs could rise from 39.5 C (0 day) to a maximum of 41.7 C (7th day), while the skin temperature could rise from 36.7 C (0 day) to 40.1 C (8th day), based on the progression of the infection [31]. Therefore, the range of black body cavity temperature was set at 32 to 42 C. In addition, the range of the black cavity body height was determined according to the height of the pigs, using the relationship between 0.33 pig weight and its body height [32], expressed as Height = (Body Weight) . Therefore, the range of the black body cavity height (H ) was set at 0 to 0.6 m. Table 1 lists the three levels of each parameter in this study. Table 1. Levels of investigated parameters for the RSM modeling. D, H , q, T , and H represent the b b horizontal distance, the camera height, the angle of view between the camera and black body cavity, the black body cavity temperature, and the black body cavity height, respectively. Parameter Unit Low Level Medium Level High Level D m 2 4 6 H m 1.7 2 2.3 q 0 25 50 T C 32 37 42 H m 0 0.3 0.6 2.2.2. Setup of the Laboratory Experiment To investigate the effects of the identified parameters on the surface temperature sensing by IRT camera, a laboratory experiment was conducted. Figure 1 illustrates the scheme of the experiment, along with a photo of the setup. As it shows, a black body cavity (HT-C50, temperature range: 5 to 50 C, effective emissivity: 0.96  0.02, resolution: 0.01 C, accuracy: 0.15 C) was used to characterize the skin temperature of pigs, and a thermal imaging camera (Hikvision TB-1217A-3’PA, field angle: 50  37.2 , temperature measurement range: 30–45 C, temperature measurement accuracy: 0.5 C, emissivity of pig skin: 0.98) was used to measure the temperature area of the black body cavity. The horizontal distance from the thermal imaging camera to the black body cavity was controlled by a flexible ruler. The angle of view between the black body cavity and the optical center of the thermal imaging camera was controlled by the horizontal distance because of the geometric relationship between the horizontal distance and the angle of view, given a particular camera height. The ambient temperature was recorded every 1 min by portable, hot-wire anemometers (VelociCalc Multi-Function Ventilation Meter 9565-A, TSI, Shoreview, MN, USA, temperature measurement range: 10 to 60 C, resolution: 0.1 C, Agriculture 2023, 13, x FOR PEER REVIEW 4 of 17 horizontal distance from the thermal imaging camera to the black body cavity was con- trolled by a flexible ruler. The angle of view between the black body cavity and the optical center of the thermal imaging camera was controlled by the horizontal distance because Agriculture 2023, 13, 520 4 of 16 of the geometric relationship between the horizontal distance and the angle of view, given a particular camera height. The ambient temperature was recorded every 1 min by porta- ble, hot-wire anemometers (VelociCalc Multi-Function Ventilation Meter 9565-A, TSI, Shoreview, Minnesota, USA, temperature measurement range: −10 to 60 °C, resolution: accuracy: 0.3 C). Undoubtedly, the condition of the lights and materials surrounding 0.1 °C, accuracy: ±0.3 °C). Undoubtedly, the condition of the lights and materials sur- the artificial pig (black body cavity) in the experiment could also potentially affect the rounding the artificial pig (black body cavity) in the experiment could also potentially temperature sensing; the interferences associated with the lights and materials were omitted affect the temperature sensing; the interferences associated with the lights and materials in this modeling procedure because the condition was comparable, and it was difficult to were omitted in this modeling procedure because the condition was comparable, and it build the same condition for the modeling. was difficult to build the same condition for the modeling. Figure 1. The setup and the schematic graph of the laboratory experiment. Figure 1. The setup and the schematic graph of the laboratory experiment. 2.2.3. Establishment of RSM Model 2.2.3. Establishment of RSM Model There are different approaches to designing an RSM modelling. In this study, the There are different approaches to designing an RSM modelling. In this study, the Box-Behnken design (BBD), a rotatable or nearly rotatable design based on three levels of Box-Behnken design (BBD), a rotatable or nearly rotatable design based on three levels of incomplete factors [33], was used in order to reduce the number of tests. The number of incomplete factors [33], was used in order to reduce the number of tests. The number of tests (N) required in BBD was calculated according to Equation (1) [34]: tests (N) required in BBD was calculated according to Equation (1) [34]: ( ) 𝑁= 2𝑘 𝑘− 1 +𝑐 (1) N = 2k(k 1) + c (1) where k is the number of experimental variables; c is the specified number of replicated where k is the number of experimental variables; c is the specified number of replicated central points. In this study, we set 6 replicates for the central point. The resulting N be- central points. In this study, we set 6 replicates for the central point. The resulting N be- comes 46 for k = 5 and c = 6. All 46 cases listed in Table 2 served as the training dataset for comes 46 for k = 5 and c = 6. All 46 cases listed in Table 2 served as the training dataset for the RSM model development. the RSM model development. The final second-order RSM model can be written as: Table 2. BBD with the values of each variable and the corresponding values of the response (served as the training dataset). D, Hc, θ, Τb, and Hb represent the horizontal distance, the camera height, the 5 5 5 5 angle of view between the camera and black body cavity, 2 the black body cavity temperature, and y = b + b x + b x + b x x (2) 0 å i i å ii i å å i j i j the black body cavity height, respectively. i=1 i=1 i=1 j>i Experimental Variables Response where y is the predicted response; b is the model constant; b are linear coefficients; Case D Hc θ Τb Hb Tm ∆T b are the quadratic coefficients; b are the coefficients of the cross products; x and x are ii ij i j (m) (m) (°) (°C) (m) (°C) (°C) independent variables. 1 4 2.3 25 37 0.3 26.22 −10.78 The statistical significance (p-value) of each term in Equation (2) was determined 2 4 2 12.5 37 0.3 27.89 −9.11 by the multiple analysis of variance (MANOVA). The smaller p-value meant a higher 3 4 1.7 12.5 32 0.3 26.04 −5.96 statistical significance of the corresponding term. Only the terms that corresponded with 4 4 1.7 12.5 42 0.3 30.55 −11.45 p-values [35] lower than 0.1 were kept in the final RSM model. Both the experimental design 5 4 2.3 12.5 37 0 27.22 −9.78 and data analysis for the RSM modeling were conducted in Design Experts Version 8.0 6 2 2 0 37 0.3 30.36 −6.64 (Stat-Ease, Inc., Minneapolis, MN, USA). 2.2.4. RSM Model Verification RSM, coupled with BBD, can effectively reduce the number of tests compared with the one using a full factorial design; however, model uncertainty might be introduced [36]. To avoid overfitting, the RSM model was verified using 9 separate cases (served as the testing dataset, as shown in Table 3) in which all the values of the experimental variables were selected randomly within the experimental domain. The relative difference was calculated between the experimental results and predicted results, also shown in Table 3. Agriculture 2023, 13, 520 5 of 16 Table 2. BBD with the values of each variable and the corresponding values of the response (served as the training dataset). D, H , q, T , and H represent the horizontal distance, the camera height, the c b b angle of view between the camera and black body cavity, the black body cavity temperature, and the black body cavity height, respectively. Experimental Variables Response Case D H q T H T DT c m b b (m) (m) ( ) ( C) (m) ( C) ( C) 1 4 2.3 25 37 0.3 26.22 10.78 2 4 2 12.5 37 0.3 27.89 9.11 3 4 1.7 12.5 32 0.3 26.04 5.96 4 4 1.7 12.5 42 0.3 30.55 11.45 5 4 2.3 12.5 37 0 27.22 9.78 6 2 2 0 37 0.3 30.36 6.64 7 4 2 12.5 32 0.6 26.22 5.78 8 2 2 25 37 0.3 30.14 6.86 9 6 2 25 37 0.3 25.99 11.01 10 4 1.7 25 37 0.3 28.28 8.72 11 4 2 12.5 37 0.3 27.84 9.16 12 4 2 25 42 0.3 28.61 13.39 13 4 2 25 37 0 27.03 9.97 14 2 2 12.5 37 0 30.41 6.59 15 4 2 0 37 0.6 28.23 8.77 16 6 2 12.5 37 0 25.11 11.89 17 4 2 25 37 0.6 27.92 9.08 18 6 1.7 12.5 37 0.3 25.63 11.37 19 4 2 12.5 37 0.3 28.07 8.93 20 2 1.7 12.5 37 0.3 31.07 5.93 21 4 2 0 32 0.3 25.91 6.09 22 6 2 12.5 42 0.3 27.69 14.31 23 4 2 12.5 42 0 30.56 11.44 24 4 2 12.5 42 0.6 31.07 10.93 25 4 2 0 37 0 27.23 9.77 26 4 2 25 32 0.3 26.2 5.8 27 6 2 12.5 37 0.6 25.55 11.45 28 2 2 12.5 37 0.6 30.96 6.04 29 4 2 0 42 0.3 30.84 11.16 30 4 2.3 0 37 0.3 27.07 9.93 31 2 2.3 12.5 37 0.3 29.62 7.38 32 4 2 12.5 37 0.3 27.46 9.54 33 4 2.3 12.5 37 0.6 27.71 9.29 34 4 2 12.5 37 0.3 27.68 9.32 35 6 2.3 12.5 37 0.3 25.42 11.58 36 2 2 12.5 42 0.3 34.1 7.9 37 4 2 12.5 32 0 25.98 6.02 38 4 2.3 12.5 42 0.3 28.6 13.4 39 4 1.7 12.5 37 0 27.91 9.09 40 4 2.3 12.5 32 0.3 24.85 7.15 41 4 1.7 12.5 37 0.6 28.48 8.52 42 6 2 0 37 0.3 25.98 11.02 43 6 2 12.5 32 0.3 24.48 7.52 44 4 2 12.5 37 0.3 27.43 9.57 45 4 1.7 0 37 0.3 28.21 8.79 46 2 2 12.5 32 0.3 27.12 4.88 Agriculture 2023, 13, 520 6 of 16 Table 3. Levels of investigated parameters in the cases for testing the RSM model. Experimental Variables Response Case No. D (m) H (m) q ( ) T ( C) H (m) T ( C) DT ( C) c b b m 1 2.32 1.72 5.3 41.8 0.16 40.26 1.54 2 3.56 1.76 8.7 39.6 0.34 37.41 2.19 3 3.72 1.87 10.2 38.9 0.19 36.44 2.46 4 4.22 1.81 12.1 38.2 0.41 35.64 2.56 5 4.36 1.92 16.5 35.1 0.06 33.07 2.03 6 5.18 1.97 15.2 36.7 0.46 33.61 3.09 7 5.32 1.79 13.6 41.6 0.1 37 4.6 8 5.61 2.16 18.6 35.4 0.51 32.25 3.15 9 5.86 2.24 24.6 33.1 0.56 30.45 2.65 2.3. Correction Algorithm 2.3.1. Distance Determination Vision-based target ranging can be divided into two types: monocular ranging and binocular ranging [37]. Monocular ranging is the most common way to measure the distance between the IRT camera and the object in the view. For monocular ranging technique, the models can be further divided into geometric imaging-based methods [38], perspective transformation-based methods [39], and data fitting-based methods [40]. In this study, the imaging-based geometric method model was adopted for monocular ranging. According to the IRT system in the pig barn, as described previously, the geometric relationship between the camera and the object is illustrated in Figure 2a. If point E was the optical center of the camera and point P was the location of the object, the line EP would be the distance between the camera and the object (pig in this study). Let trapezoid ABCD be the field of view for the camera mounted on the inspection robot and point F be the center of that view. Select X-G-Y as the coordinate system with point G, the midpoint of line CD, as the origin. One would notice that line EF denoted the optical axis of the camera and point O was the projection of point E onto plane ABN. Figure 2b shows the side view of Agriculture 2023, 13, x FOR PEER REVIEW 7 of 17 the geometric relationship between the camera and the object. Let 2 denote the vertical, angular field of view. Figure 2. Diagram illustrating the camera’s field of view. (a) Object plane coordinate view; Figure 2. Diagram illustrating the camera’s field of view. (a) Object plane coordinate view; (b) pro- jected (b) pr view ojected alo view ng the X-axis d along the X-axis irection; ( direction; c) top view (c) top of the view im ofage plane. the image plane. Figure 2c illustrates the relationship between the points on the object plane and those on the image plane, where L and W were the length and width of the image plane, respec- tively. On the image plane, X’-G’-Y’ was the coordinate system with point G’, the mid- point of C’D’, as the origin. Points in the object plane coordinate system can be mapped one-on-one to points in the image plane coordinate system. Let P (xP, yP) be a point in the object plane and P’ (xP’, yP’) be the corresponding point in the image plane. Given the camera height, h, and the elevation angle, μ, the distance between the IRT camera and the object could be obtained through the following steps: 1. Determine yP of point P. As shown in Figure 2b, yP can be calculated as follows: 𝑦 =𝑂𝐾 −𝑂𝐺 =ℎ × 𝑡𝑎𝑛 (𝜇+ 𝛾 ) −ℎ ×𝑡𝑎𝑛 (𝜇− 𝛼 ), for GK > GF (3) ( ) ( ) 𝑦 =𝑂𝐾 −𝑂𝐺 =ℎ × 𝑡𝑎𝑛 𝜇− 𝛾 −ℎ ×𝑡𝑎𝑛 𝜇− 𝛼 , for GK < GF (4) 𝑦 − 𝛾 = arctan( ) (5) 𝑓 = 2tan 𝛼 where h is the camera height, m; α is half of the vertical field of view, ; μ is the elevation o o angle of the camera, ; γ is the angle of view in the y-axis direction, ; which could be determined using Equation (4), L is the height of the image plane, pixel; and f is the focal length of the camera, pixel, derived from the Equation (5). 2. Determine xP of point P. Triangle similarity was used to determine xp. Since ∆KPN~∆GIN, xp could be derived using: ×(𝐺𝑁 +𝑦 ) (6) 𝑥 = where 𝑁𝐺 𝐺𝐼 Agriculture 2023, 13, 520 7 of 16 Figure 2c illustrates the relationship between the points on the object plane and those on the image plane, where L and W were the length and width of the image plane, respectively. On the image plane, X’-G’-Y’ was the coordinate system with point G’, the midpoint of C’D’, as the origin. Points in the object plane coordinate system can be mapped one-on-one to points in the image plane coordinate system. Let P (x , y ) be a point in the object plane and P’ (x , y ) be the corresponding point P P P’ P’ in the image plane. Given the camera height, h, and the elevation angle, m, the distance between the IRT camera and the object could be obtained through the following steps: 1. Determine y of point P. As shown in Figure 2b, y can be calculated as follows: y = OK OG = h tan(m + g) h tan(m a), for GK > GF (3) y = OK OG = h tan m g h tan m a , for GK < GF ( ) ( ) y 0 g = arctan (4) f = (5) 2tana where h is the camera height, m; a is half of the vertical field of view, ; m is the elevation o o angle of the camera, ; g is the angle of view in the y-axis direction, ; which could be determined using Equation (4), L is the height of the image plane, pixel; and f is the focal length of the camera, pixel, derived from the Equation (5). 2. Determine x of point P. Triangle similarity was used to determine x . Since DKPN~DGIN, x could be de- p p rived using: G I  N G + y x = (6) N G where 0 0 x 0  h cosa G I  EG G I = = (7) f  cos(m a) EG Since DNGC~DNFJ, we could find a relationship among N G, GF, GC, and F J, as shown in Equation (8): N G N G GC = = (8) N F N G + GF F J where GF = OF OG = h tanm h tan(m a) (9) EG W h W GC = = (10) 2 f 2 f  cos(m a) EF W h W F J = = (11) 2 f 2 f  cosm Using results from Equations (8), (10) and (11), N G becomes: h [tanm tan(m a)] N G = (12) cos(ma) cosm where h is the camera height, m; a is half of the vertical field of view, ; m is the elevation angle of the camera, ; W is the width of the image plane, pixel; and f is the focal length of the camera, pixel. Agriculture 2023, 13, 520 8 of 16 3. Determine the horizontal distance between camera and object. The length of OP can then be determined by the following equation: q q 2 2 2 2 OP = x + (y + l ) = x + (y + h tan(m a)) (13) P P OG P P where h is the camera height, m; a is half of the vertical field of view, ; m is the elevation angle of the camera, . 2.3.2. Determination of the Angle of View The \PEF, q, was the angle of view between the object and IRT camera, which could be calculated using the following equation: 0 1 0 1 ! ! B C EFEP h tanm [y + h tan(m a)] + h B C @ A q = arccos = arccos q q (14) @ A ! ! 2 2 2 2 2 (h tanm) + h  x + (y + h tan(m a)) + h EF  EP P P 2.3.3. Correction Algorithm Development The IRT camera used in this study could measure the temperature for each pixel of the image. Using the temperature data above, a temperature distribution map could be created. To develop the correction algorithm, the mathematical model from RSM, the observation distance (Equation (13)), and the angle of view (Equation (14)) were all compiled into the correction algorithm, together with the data from the IRT camera in Python 3.8. Thus, the temperature information associated with each pixel could be corrected accordingly, and a new infrared image could be generated. 2.4. Case Study 2.4.1. Experimental Barn and Animal Agriculture 2023, 13, x FOR PEER REVIEW 9 of 17 In order to evaluate the performance of the correction method, a field experiment was carried out in a commercial pig farm located in Huzhou, Zhejiang Province, China on 30 August 2022. The layout of the experimental barn was illustrated in Figure 3. Its 30 August 2022. The layout of the experimental barn was illustrated in Figure 3. Its di- dimensions were 31 m in length, 8.5 m in width, and 2.85 m in height. As shown in Figure 3, mensions were 31 m in length, 8.5 m in width, and 2.85 m in height. As shown in Figure there were two rows of pig pens. Each row had 6 identical pens (4.8  3.75 m). A total of 3, there were two rows of pig pens. Each row had 6 identical pens (4.8 × 3.75 m). A total 330 pigs (Yorkshire  Landrace  Duroc, aged 67 days) were raised in the barn. Pigs were of 330 pigs (Yorkshire × Landrace × Duroc, aged 67 days) were raised in the barn. Pigs fed by an automatic feeder and water was provided. Standard cleaning and maintenance were fed by an automatic feeder and water was provided. Standard cleaning and mainte- procedures for the pig room were followed. nance procedures for the pig room were followed. Figure 3. Infrared thermography system in pig building. Geometry of the system (a) and a photo Figure 3. Infrared thermography system in pig building. Geometry of the system (a) and a photo of of the inspection robot (b). the inspection robot (b). 2.4.2. Infrared Thermography System in Pig Building Figure 3 shows the infrared thermography system used in a commercial pig barn in Changxing, Zhejiang, China. The system consists of two parts: the IRT camera and the overhead rail. To automatically take infrared thermal photos for all the pens, the IRT cam- era (Hikvision TB-1217A-3’PA, angular field of view: 50° × 37.2°, temperature measure- ment accuracy: ±0.5 °C) rode the overhead rail and scanned all the pens. The inspection time and the interval could be determined by the farm managers. In this study, each in- spection lasted 10 min and the interval between two inspections was 4 h. In order to take the ideal picture of pigs, the elevation angle of the IRT camera was set to 55°. 2.4.3. Setup of the Field Experiment To test the correction model, a comparison between the skin surface temperature be- fore correction (TBC) and the corresponding actual skin surface temperature (TA) of pigs, and a comparison between the skin surface temperature after correction (TAC) and the cor- responding actual skin surface temperature (TA) of pigs, were evaluated. During the ex- periment, the inspection robot stayed in front of each pen for 5 min. Within each 5 min stay, the IRT camera took a thermal image of the pigs. Meanwhile, the central inguinal or hip of 1 to 3 pigs was selected for the skin temperature measurement, using a portable infrared thermometer (Raytek MX4, Fluke Corp., Everett, Wash.) with an accuracy of ±0.1 °C. In total, 25 pigs were randomly selected from different pens for the experiment. Note that, in order to ensure the accuracy of the measured skin surface temperature of pigs, the measuring distances of the Raytek MX4 to the skin surface were maintained around 10 cm. The corresponding skin surface temperatures, after correction (TAC), were then calcu- lated using the correction algorithm. In addition, the indoor air temperature and relative humidity were recorded continuously during the experiment by portable hot-wire ane- mometers (VelociCalc Multi-Function Ventilation Meter9565-A, TSI, Shoreview, Minne- sota, MN, USA). Agriculture 2023, 13, 520 9 of 16 2.4.2. Infrared Thermography System in Pig Building Figure 3 shows the infrared thermography system used in a commercial pig barn in Changxing, Zhejiang, China. The system consists of two parts: the IRT camera and the overhead rail. To automatically take infrared thermal photos for all the pens, the IRT camera (Hikvision TB-1217A-3’PA, angular field of view: 50  37.2 , temperature measurement accuracy: 0.5 C) rode the overhead rail and scanned all the pens. The inspection time and the interval could be determined by the farm managers. In this study, each inspection lasted 10 min and the interval between two inspections was 4 h. In order to take the ideal picture of pigs, the elevation angle of the IRT camera was set to 55 . 2.4.3. Setup of the Field Experiment To test the correction model, a comparison between the skin surface temperature before correction (T ) and the corresponding actual skin surface temperature (T ) of BC A pigs, and a comparison between the skin surface temperature after correction (T ) and AC the corresponding actual skin surface temperature (T ) of pigs, were evaluated. During the experiment, the inspection robot stayed in front of each pen for 5 min. Within each 5 min stay, the IRT camera took a thermal image of the pigs. Meanwhile, the central inguinal or hip of 1 to 3 pigs was selected for the skin temperature measurement, using a portable infrared thermometer (Raytek MX4, Fluke Corp., Everett, Wash.) with an accuracy of 0.1 C. In total, 25 pigs were randomly selected from different pens for the experiment. Note that, in order to ensure the accuracy of the measured skin surface temperature of pigs, the measuring distances of the Raytek MX4 to the skin surface were maintained around 10 cm. The corresponding skin surface temperatures, after correction (T ), were AC then calculated using the correction algorithm. In addition, the indoor air temperature and relative humidity were recorded continuously during the experiment by portable hot- wire anemometers (VelociCalc Multi-Function Ventilation Meter9565-A, TSI, Shoreview, Minnesota, MN, USA). 2.4.4. Comparison Criteria The accuracy of the correction method was evaluated using relative error (E ): T T BC a E =  100% (15) rBC T T AC E =  100% (16) r AC where E is the relative error of temperature before correction; E is the relative error r-BC r-AC of correction temperature after correction; T is the temperature before correction, C; BC T is the temperature after correction, C; T is the actual temperature, C. AC A 3. Results and Discussion 3.1. RSM Model 3.1.1. RSM Model Development According to the MANOVA result from the original RSM model, based on Equation (2), the p-value of the model was <0.0001, which means the regression model is highly 2 2 2 significant. However, only 8 terms, i.e., A, B, C, D, E, AD, A , C , D , were significant (p-values < 0.05), and the remaining terms were not significant. Therefore, the terms with a p-value > 0.05 were removed from the RSM model. Table 4 lists the MANOVA results of the modified RSM model. The modified RSM model was significant (p-value < 0.0001) and the p-values of all the examined terms were less than 0.05, indicating that the terms 2 2 could significantly affect the response. Based on the R at 0.9970, adjusted R at 0.9962, and predicted R at 0.9954, the modified RSM model was therefore deemed suitable to predict surface temperature. Agriculture 2023, 13, 520 10 of 16 Table 4. MANOVA for RSM model. Source SS df MS F-Value p-Value Model 184.14 20 9.21 49.65 <0.0001 Model 308.29 9 34.25 1321.89 <0.0001 A-horizontal distance 33.58 1 33.58 1295.93 <0.0001 B-camera height 1.16 1 1.16 44.80 <0.0001 C-angle 0.5852 1 0.5852 22.58 <0.0001 D-temperature 269.45 1 269.45 10,398.19 <0.0001 E-black body height 0.2093 1 0.2093 8.08 0.0073 AD 1.56 1 1.56 60.30 <0.0001 A 0.3527 1 0.3527 13.61 0.0007 0.5104 1 0.5104 19.70 <0.0001 D 0.6065 1 0.6065 23.41 <0.0001 Residual 0.9329 36 0.0259 Lack of Fit 0.8309 31 0.0268 1.31 0.4149 Pure Error 0.1019 5 0.0204 Cor Total 309.23 45 2 2 2 R = 0.9970; R -adj = 0.9962; R -pred = 0.9954. SS: sum of squares, df: degree of freedom, MS: mean square. The coefficient of each term listed in Table 4 was estimated using regression analy- sis. Thus, the mathematical model for predicting the measured surface temperature was established as: T = 12.41943 + 1.96598D 0.897917H + 0.021062q + 0.337445T + 0.38125H 0.0625 D T m c b b b (17) 2 2 2 0.047232D 0.001454q + 0.00991T Accordingly, the body temperature of the black body cavity can then be calculated as follows: T = 3.153380424D +50.45408678 0.00005763656q 0.000834898q 0.01511275H (18) 0.5 +0.03559343H + 0.03964T 0.120112072D + 0.005778526D 0.378437077 c m 17.02547931 where T is the actual surface temperature of the black body cavity, C; T is the average surface temperature of the black body cavity measured by the IRT camera, C; D is the horizontal distance between the black body cavity and the camera, m; H is the height of the camera, m; H is the height of the black body cavity from the ground, m; q is the angle of view between the black body cavity and the camera, . 3.1.2. RSM Model Verification Figure 4 shows the comparison of the predicted values by the RSM model and the measured values. Theoretically, the data points should be split evenly by the 45 degree line. The closer they are to the solid line, the better the prediction model. From Figure 4, the data points were very close to the 45 degree solid line, which indicated that the mathematical model could predict the relation between the investigated variables and the response well. 3.2. Effect of the Parameters on Surface Temperature Detection Based on T calculation from the RSM model, the effect of camera height (H ), horizon- tal distance (D), pig height (H ), and angle of view between the IRT camera and pigs (q) on the skin temperature difference (DT) between T and T were analyzed using Origin Pro b m (OriginLab, Northampton, MA, USA). Figure 5 illustrates the perturbation of the relative significance of each factor. Agriculture 2023, 13, x FOR PEER REVIEW 11 of 17 Accordingly, the body temperature of the black body cavity can then be calculated as fol- lows: 𝑇 = 3.153380424𝐷 (18) + 50.45408678 × (0.00005763656𝜃 − 0.000834898𝜃 − 0.01511275𝐻 + 0.03559343𝐻 + 0.03964𝑇 − 0.120112072𝐷 + 0.005778526𝐷 − 0.378437077) − 17.02547931 where Tb is the actual surface temperature of the black body cavity, °C; Tm is the average surface temperature of the black body cavity measured by the IRT camera, °C; D is the horizontal distance between the black body cavity and the camera, m; Hc is the height of the camera, m; Hb is the height of the black body cavity from the ground, m; θ is the angle of view between the black body cavity and the camera, . 3.1.2. RSM Model Verification Figure 4 shows the comparison of the predicted values by the RSM model and the measured values. Theoretically, the data points should be split evenly by the 45 degree line. The closer they are to the solid line, the better the prediction model. From Figure 4, the data points were very close to the 45 degree solid line, which indicated that the math- Agriculture 2023, 13, 520 11 of 16 ematical model could predict the relation between the investigated variables and the re- sponse well. Agriculture 2023, 13, x FOR PEER REVIEW 12 of 17 Figure 4. Predicted values versus the experimental data values. Training data and testing data were Figure 4. Predicted values versus the experimental data values. Training data and testing data were listed in Tables 2 and 3, respectively. listed in Tables 2 and 3, respectively. 3.2. Effect of the Parameters on Surface Temperature Detection Based on Tb calculation from the RSM model, the effect of camera height (Hc), hori- zontal distance (D), pig height (Hb), and angle of view between the IRT camera and pigs (θ) on the skin temperature difference (ΔT) between Tb and Tm were analyzed using Origin Pro (OriginLab, Northampton, MA, USA). Figure 5 illustrates the perturbation of the rel- ative significance of each factor. Figure 5. Perturbation of the relative significance of factors, including the camera height (a), hori- Figure 5. Perturbation of the relative significance of factors, including the camera height (a), horizon- zontal distance (b), object height (c), and angle of view (d), on response. tal distance (b), object height (c), and angle of view (d), on response. According to Figure 5, as H increased from 1.7 to 2.3 m, DT increased linearly from According to Figure 5, as Hc increased from 1.7 to 2.3 m, ΔT increased linearly from 0. 0.45 45 to to11.22 .22 °C,C, wi with th TmT , D,, Dθ, and H , q, and b hel H d held at 30 at °C 30 , 4 m C,, 25 4 m, °, and 0 25 , and .3 m,0.3 resp m, ecr ti espectively vely. Sim- . Similarly, as horizontal distance (D) increased from 2 to 6 m, the DT increased non-linearly ilarly, as horizontal distance (D) increased from 2 to 6 m, the ΔT increased non-linearly from 0.24 to 2.31 C, with T , H , q, and H at 30 C, 2 m, 25 , and 0.3 m, respectively. from 0.24 to 2.31 °C, with Tm, mHc, θ c , and Hb at 30 °C, 2 m, 25°, and 0.3 m, respectively. In In addition, as the height (H ) of the object increased from 0 to 0.6 m, the DT decreased addition, as the height (Hb) of the ob b ject increased from 0 to 0.6 m, the ΔT decreased line- linearly from 1 to 0.67 C when T , D, q, and H were at 30 C, 4 m, 25 , and 2 m, m c arly from 1 to 0.67 °C when Tm, D, θ, and Hc were at 30 °C, 4 m, 25°, and 2 m, respectively. respectively. According to the Pythagorean theorem, the observation distance between the According to the Pythagorean theorem, the observation distance between the IRT camera IRT camera and the object was determined by the three parameters, i.e., the camera height, and the object was determined by the three parameters, i.e., the camera height, the hori- the horizontal distance, and the object height. Therefore, the observation distance negatively zontal distance, and the object height. Therefore, the observation distance negatively af- affects the accuracy of the surface temperature measurement in the application of infrared fects the accuracy of the surface temperature measurement in the application of infrared thermography. Zhou, Wei, Xie, Tang and Cui [26] reported that the phenomenon could be attributed to the decrease in the transmittance of infrared radiation in the atmosphere, with increasing observation distances. Among these three parameters, the variation of horizontal distance had the most impact because the horizontal distance was much larger than the height difference between the camera and the object. Thus, it had the greatest impact on the temperature difference. Since the ranges of the other factors were fixed ac- cording to the situation in practice, the horizontal distance between pigs and the IRT cam- era became the most impacting factor. Regarding the effect of the angle of view θ (Figure 5), as the angle of view increased from 0° to 25°, the temperature difference, ΔT, initially decreased from 0.89 to 0.78 °C but then increased from 0.78 to 1.43 °C, with Tm, Hc, D, and Hb at 30 °C, 2 m, 4 m, and 0.3 m, respectively. However, some research found that the measurement could be deemed reli- able as long as the angle of view is less than 45° [27,41]. The slight decline of temperature difference, ΔT, in this study has not been reported in the literature. The decline could be attributed to the removal of some terms in the process of RSM modeling. Generally, the effect of Hb variation between 0 to 0.6 m on ΔT was less than 0.5 °C. Therefore, the height of the pig was fixed at 0.3 m in the correction algorithm development and the height of the IRT camera was fixed at 2 m, according to the situation in the experimental barn. Agriculture 2023, 13, 520 12 of 16 thermography. Zhou, Wei, Xie, Tang and Cui [26] reported that the phenomenon could be attributed to the decrease in the transmittance of infrared radiation in the atmosphere, with increasing observation distances. Among these three parameters, the variation of horizontal distance had the most impact because the horizontal distance was much larger than the height difference between the camera and the object. Thus, it had the greatest impact on the temperature difference. Since the ranges of the other factors were fixed according to the situation in practice, the horizontal distance between pigs and the IRT camera became the most impacting factor. Regarding the effect of the angle of view q (Figure 5), as the angle of view increased from 0 to 25 , the temperature difference, DT, initially decreased from 0.89 to 0.78 C but then increased from 0.78 to 1.43 C, with T , H , D, and H at 30 C, 2 m, 4 m, and m c 0.3 m, respectively. However, some research found that the measurement could be deemed reliable as long as the angle of view is less than 45 [27,41]. The slight decline of temperature difference, DT, in this study has not been reported in the literature. The decline could be Agriculture 2023, 13, x FOR PEER REVIEW 13 of 17 attributed to the removal of some terms in the process of RSM modeling. Generally, the effect of H variation between 0 to 0.6 m on DT was less than 0.5 C. Therefore, the height of the pig was fixed at 0.3 m in the correction algorithm development and the height of the IRT camera was fixed at 2 m, according to the situation in the experimental barn. 3.3. Performance of the Correction Method 3.3.1. Comparison Between Skin Temperature Before and After Correction 3.3. Performance of the Correction Method 3.3.1. Comparison between Skin Temperature before and after Correction Figure 6 is a boxplot illustrating the difference in relative error before correction (Er- BC) and after correction (Er-AC) of all 25 samples. It shows that the relative error before cor- Figure 6 is a boxplot illustrating the difference in relative error before correction (rection h E ) and ad after a median v correction alue of (E − ) 4.73%, of all 25while samples. the me It shows dian value o that thefr relative elative err erro or befor r after e the r-BC r-AC correction had a median value of 4.73%, while the median value of relative error after the correction improved to −0.60%. The mean relative error before and after the correction correction improved to0.60%. The mean relative error before and after the correction was was −4.64% and −0.70%, respectively. In addition, the maximum and the minimum of Er- 4.64% and 0.70%, respectively. In addition, the maximum and the minimum of E r-BC BC were −1.51% and −7%, respectively. After correction, the maximum and minimum of Er- were1.51% and7%, respectively. After correction, the maximum and minimum of E r-AC AC improved to 1.47% and −2.98%, respectively. Although the maximum relative error af- improved to 1.47% and 2.98%, respectively. Although the maximum relative error after ter correction increased (above 0), the absolute value of the maximum and the minimum correction increased (above 0), the absolute value of the maximum and the minimum still still improved from 6.98% to 2.98%. Fixing the pig’s height at 0.3 m in the correction algo- improved from 6.98% to 2.98%. Fixing the pig’s height at 0.3 m in the correction algorithm rithm may have caused the Er-AC > 0. Additionally, the interquartile range (IQR) of the may have caused the Er- > 0. Additionally, the interquartile range (IQR) of the boxplot AC boxplot associated with BC was 2.52, while the IQR of the boxplot associated with AC was associated with BC was 2.52, while the IQR of the boxplot associated with AC was 1.19. 1.19. Note that IQR is a measure that describes the dispersion of each variable in the sta- Note that IQR is a measure that describes the dispersion of each variable in the statistical tistical data. The larger the IQR is, the greater the discrete degree is. The decline of IQR data. The larger the IQR is, the greater the discrete degree is. The decline of IQR indicated indicated that the discrete degree of relative error was improved after correction. Based that the discrete degree of relative error was improved after correction. Based on the above on the above analysis, the accuracy of IRT temperature measurement can be improved by analysis, the accuracy of IRT temperature measurement can be improved by using the using the correction method proposed in this research. correction method proposed in this research. Figure 6. Box plot of the relative error for the measured skin temperature before correction (BC) and Figure 6. Box plot of the relative error for the measured skin temperature before correction (BC) and after correction (AC). after correction (AC). 3.3.2. Comparison Between IRT Images Figure 7a shows the temperature distribution images in a pig pen before and after correction, which was obtained at a thermal comfort condition (THI = 70.54). The skin temperature of each pig was similar under normal circumstances. The temperature distri- bution image before correction showed that the skin temperatures of pigs close to the camera appeared higher than the skin temperatures of pigs further away from the camera. This was in line with the known limitation of the IRT camera. Comparatively, the skin temperatures of pigs in the temperature distribution image, after correction, became closer to each other and stayed in the range of 36 to 37 °C. This demonstrates the good perfor- mance of the correction model. Particularly, a piglet with a low skin temperature area on its neck was detected in the infrared image, as shown in the red box. Referring to the corresponding visible image (Figure 7b), the area of skin with the lower temperature piglet was dirty in the scale-up image. Many studies have reported that the clearness of skin is very important to surface temperature sensing [42] because the dirty stuff not only blocks the heat transfer from the pig body to the ambient air, but also impacts the emissivity level of the target surface [43]. In this case, the dried feces stuck on the skin surface could be the potential reason for the dirty skin. Therefore, in order to ensure the accuracy of the measurement result, pigs in pig pens should have a sufficient area of clean skin. Agriculture 2023, 13, 520 13 of 16 3.3.2. Comparison between IRT Images Figure 7a shows the temperature distribution images in a pig pen before and after correction, which was obtained at a thermal comfort condition (THI = 70.54). The skin tem- perature of each pig was similar under normal circumstances. The temperature distribution image before correction showed that the skin temperatures of pigs close to the camera appeared higher than the skin temperatures of pigs further away from the camera. This was in line with the known limitation of the IRT camera. Comparatively, the skin temperatures of pigs in the temperature distribution image, after correction, became closer to each other Agriculture 2023, 13, x FOR PEER REVIEW 14 of 17 and stayed in the range of 36 to 37 C. This demonstrates the good performance of the correction model. Figure 7. Infrared images (a) and visible image (b) of a pig pen. Figure 7. Infrared images (a) and visible image (b) of a pig pen. Additionally, it could be found that the temperatures of the pigs in the right zone Particularly, a piglet with a low skin temperature area on its neck was detected in were around 0.3 °C higher than those in the other area, according to Figure 7a. This phe- the infrared image, as shown in the red box. Referring to the corresponding visible image nomenon could be attributed to the difference in the density of pigs. As can be seen, more (Figure 7b), the area of skin with the lower temperature piglet was dirty in the scale-up pigs stayed in the right zone of the pen. A similar result was reported by Abudabos, et al. image. Many studies have reported that the clearness of skin is very important to surface [44], who, in a comparison of the skin temperatures of birds under different stocking den- temperature sensing [42] because the dirty stuff not only blocks the heat transfer from the sities, found that the skin temperatures of birds increased as the stocking density in- pig body to the ambient air, but also impacts the emissivity level of the target surface [43]. creased. Therefore, to better assess the health of group pigs by skin temperature, the den- In this case, the dried feces stuck on the skin surface could be the potential reason for the sity of the area where pigs are located should also be considered. Overall, the IRT camera, dirty skin. Therefore, in order to ensure the accuracy of the measurement result, pigs in pig compiled with the correction algorithm, has a good measuring performance for clean pigs, pens should have a sufficient area of clean skin. although it has limitations for dirty pigs and the density of pigs. Additionally, it could be found that the temperatures of the pigs in the right zone were around 0.3 C higher than those in the other area, according to Figure 7a. This phenomenon 3.4. Limitations and Perspectives could be attributed to the difference in the density of pigs. As can be seen, more pigs stayed in the right zone of the pen. A similar result was reported by Abudabos, et al. [44], who, in Since the tested IRT camera only has a single lens, monocular ranging was adopted a comparison of the skin temperatures of birds under different stocking densities, found to detect the distance between the objects in the picture and the IRT camera. However, the that the skin temperatures of birds increased as the stocking density increased. Therefore, monocular ranging model can only detect the horizontal distance and angle of view be- to better assess the health of group pigs by skin temperature, the density of the area where tween the camera and the pig, but not the pig’s height. Therefore, there is an error between pigs are located should also be considered. Overall, the IRT camera, compiled with the the measured distance and the actual observation distance. To improve the accuracy of correction algorithm, has a good measuring performance for clean pigs, although it has the correction method and make it more robust, how to detect pig height remains an area limitations for dirty pigs and the density of pigs. of future work. Additionally, since different IRT cameras consist of different hardware, the correction algorithm is just reliable for the tested IRT camera (Hikvision TB-1217A- 3’PA). Even so, the outcome of this study is still meaningful because (1) the producer of the tested IRT camera was a world-famous producer, which means that the proposed cor- rection algorithm could be potentially embedded into their further products and more animal farms would benefit from these; (2) the test IRT camera has already been widely applied in many livestock farms in Zhejiang Province. Thus, direct application of the cor- rection algorithm could also be acceptable; (3) this study provides a potential method to better monitor the animals’ skin surface temperature using IRT camera. A further modifi- cation is, perhaps, required when adapted to other IRT cameras. Even so, the proposed correction method for IRT cameras can benefit from a better skin temperature measure- ment of pigs in the future. 4. Conclusions Agriculture 2023, 13, 520 14 of 16 3.4. Limitations and Perspectives Since the tested IRT camera only has a single lens, monocular ranging was adopted to detect the distance between the objects in the picture and the IRT camera. However, the monocular ranging model can only detect the horizontal distance and angle of view between the camera and the pig, but not the pig’s height. Therefore, there is an error between the measured distance and the actual observation distance. To improve the accuracy of the correction method and make it more robust, how to detect pig height remains an area of future work. Additionally, since different IRT cameras consist of different hardware, the correction algorithm is just reliable for the tested IRT camera (Hikvision TB-1217A-3’PA). Even so, the outcome of this study is still meaningful because (1) the producer of the tested IRT camera was a world-famous producer, which means that the proposed correction algorithm could be potentially embedded into their further products and more animal farms would benefit from these; (2) the test IRT camera has already been widely applied in many livestock farms in Zhejiang Province. Thus, direct application of the correction algorithm could also be acceptable; (3) this study provides a potential method to better monitor the animals’ skin surface temperature using IRT camera. A further modification is, perhaps, required when adapted to other IRT cameras. Even so, the proposed correction method for IRT cameras can benefit from a better skin temperature measurement of pigs in the future. 4. Conclusions The study investigated the effects of the observation distance and the angle of view on the surface temperature sensing, and then proposed an infrared temperature correction method for processing the skin temperatures of pigs in infrared image. Based on the results, the following conclusions can be drawn: 1. Response surface methodology can be applied in the modeling of the relationship between the actual skin temperature and the affecting parameters, along with the monocular ranging being applied in the determination of the observation distance. 2. The observation distance significantly affects the accuracy of the skin temperature measurement. The horizontal distance, the camera height, and the angle of view between the camera and the object positively affect the accuracy between the measure- ments and the actual skin temperatures, while the heights of pigs negatively affect the accuracy between the measurements and the actual skin temperatures. 3. A skin temperature correction algorithm was developed and evaluated using field- measured data. The average relative error of measured skin temperatures before the correction was4.63%, and the corresponding mean relative error after the correction was reduced to 0.25%. Author Contributions: Conceptualization, X.W.; methodology, X.W. and F.H.; software, F.H.; formal analysis, F.H.; investigation, X.W., R.Y. and K.W.; writing—original draft preparation, F.H.; writing— review and editing, X.W. and K.W.; visualization, X.W. and K.W.; data curation, R.Y.; validation, F.H. and R.Y.; supervision, K.W.; project administration, K.W.; funding acquisition, K.W. All authors have read and agreed to the published version of the manuscript. Funding: This work was supported by grants from the Key R & D Projects of Zhejiang Province (2022C02050). The authors appreciated the employees in the experimental pig farm for help during field experiments. Institutional Review Board Statement: Not applicable. Data Availability Statement: Not applicable. Conflicts of Interest: The authors declare no conflict of interest. Agriculture 2023, 13, 520 15 of 16 References 1. Rae, A.N.; Ma, H.; Huang, J.; Rozelle, S. Livestock in China: Commodity-Specific Total Factor Productivity Decomposition Using New Panel Data. Am. J. Agric. Econ. 2006, 88, 680–695. [CrossRef] 2. Wang, Y.; Gao, L.; Li, Y.; Xu, Q.; Yang, H.; Shen, C.; Huang, B. African swine fever in China: Emergence and control. J. Biosaf. Biosecurity 2019, 1, 7–8. [CrossRef] 3. Gao, L.; Sun, X.; Yang, H.; Xu, Q.; Li, J.; Kang, J.; Liu, P.; Zhang, Y.; Wang, Y.; Huang, B. Epidemic situation and control measures of African Swine Fever Outbreaks in China 2018–2020. Transbound. Emerg. Dis. 2021, 68, 2676–2686. [CrossRef] [PubMed] 4. Wang, T.; Luo, R.; Sun, Y.; Qiu, H.-J. Current efforts towards safe and effective live attenuated vaccines against African swine fever: Challenges and prospects. Infect. Dis. Poverty 2021, 10, 137. [CrossRef] [PubMed] 5. Tao, D.; Sun, D.; Liu, Y.; Wei, S.; Yang, Z.; An, T.; Shan, F.; Chen, Z.; Liu, J. One year of African swine fever outbreak in China. Acta Trop. 2020, 211, 105602. [CrossRef] 6. Pusnik, I.; Stukelj, M. Usefulness of thermovision for pig welfare. Elektrotehniski Vestn. 2019, 86, 77–82. 7. Jorquera-Chavez, M.; Fuentes, S.; Dunshea, F.R.; Warner, R.D.; Poblete, T.; Morrison, R.S.; Jongman, E.C. Remotely Sensed Imagery for Early Detection of Respiratory Disease in Pigs: A Pilot Study. Animals 2020, 10, 451. [CrossRef] 8. Hwang, S.W.; Choi, Y.S.; Lee, S.J.; Yang, S.H. An Analysis on ASF Variations and Temperature. In Proceedings of the IEEE/ION Position, Location and Navigation Symposium (PLANS), Monterey, CA, USA, 5–8 May 2014; pp. 882–885. 9. Escuredo, J.A.M.; Carr, J.; Dizon, R.; Howells, M. Using infrared thermography to help maintain pig health. Practice 2021, 43, 388–396. [CrossRef] 10. Soerensen, D.D.; Pedersen, L.J. Infrared skin temperature measurements for monitoring health in pigs: A review. Acta Vet. Scand. 2015, 57, 5. [CrossRef] 11. Zhong, Z. A novel visible and infrared image fusion method based on convolutional neural network for pig-body feature detection. Multimed. Tools Appl. 2021, 81, 2757–2775. [CrossRef] 12. Sa, J.; Choi, Y.; Lee, H.; Chung, Y.; Park, D.; Cho, J. Fast Pig Detection with a Top-View Camera under Various Illumination Conditions. Symmetry 2019, 11, 266. [CrossRef] 13. Shirley, L.K.; Field, T.; Schinckel, A.P.; Johnson, J.S.; Stwalley, R.; Stewart, K.R. 80 Use of an Electronically-controlled Floor Cooling Pad During Heat Stress on Thermoregulatory and Reproductive Performance in Boars. J. Anim. Sci. 2021, 99, 107. [CrossRef] 14. Da Fonseca, F.N.; Abe, J.M.; Nääs, I.D.A.; Cordeiro, A.F.D.S.; Amaral, F.V.D.; Ungaro, H.C. Automatic prediction of stress in piglets (Sus Scrofa) using infrared skin temperature. Comput. Electron. Agric. 2019, 168, 105148. [CrossRef] 15. Choudhury, M.; Saikia, T.; Banik, S.; Patil, G.; Pegu, S.R.; Rajkhowa, S.; Sen, A.; Das, P.J. Infrared imaging a new non-invasive machine learning technology for animal husbandry. Imaging Sci. J. 2020, 68, 240–249. [CrossRef] 16. Tattersall, G.J. Infrared thermography: A non-invasive window into thermal physiology. Comp. Biochem. Physiol. Part A Mol. Integr. Physiol. 2016, 202, 78–98. [CrossRef] 17. Playa-Montmany, N.; Tattersall, G.J. Spot size, distance and emissivity errors in field applications of infrared thermography. Methods Ecol. Evol. 2021, 12, 828–840. [CrossRef] 18. Faye, E.; Dangles, O.; Pincebourde, S. Distance makes the difference in thermography for ecological studies. J. Therm. Biol. 2016, 56, 1–9. [CrossRef] 19. Arenas, A.J.; Gómez, F.; Salas, R.; Carrasco, P.; Borge, C.; Maldonado, A.; O’Brien, D.J.; Martínez-Moreno, F. An evaluation of the application of infrared thermal imaging to the tele-diagnosis of sarcoptic mange in the Spanish ibex (Capra pyrenaica). Vet. Parasitol. 2002, 109, 111–117. [CrossRef] 20. Zhang, C.; Xiao, D.; Yang, Q.; Wen, Z.; Lv, L. Review: Application of Infrared Thermography in Livestock Monitoring. Trans. ASABE 2020, 63, 389–399. [CrossRef] 21. Church, J.; Hegadoren, P.; Paetkau, M.; Miller, C.; Regev-Shoshani, G.; Schaefer, A.; Schwartzkopf-Genswein, K. Influence of environmental factors on infrared eye temperature measurements in cattle. Res. Vet. Sci. 2014, 96, 220–226. [CrossRef] 22. Harrap, M.J.M.; de Ibarra, N.H.; Whitney, H.M.; Rands, S.A. Reporting of thermography parameters in biology: A systematic review of thermal imaging literature. R. Soc. Open Sci. 2018, 5, 181281. [CrossRef] [PubMed] 23. Soerensen, D.D.; Clausen, S.; Mercer, J.B.; Pedersen, L.J. Determining the emissivity of pig skin for accurate infrared ther-mography. Comput. Electron. Agric. 2014, 109, 52–58. [CrossRef] 24. Zhang, K.; Jiao, L.; Zhao, X.; Dong, D. An instantaneous approach for determining the infrared emissivity of swine surface and the influencing factors. J. Therm. Biol. 2016, 57, 78–83. [CrossRef] 25. Muniz, P.R.; Magalhães, R.D.S.; Cani, S.P.N.; Donadel, C.B. Non-contact measurement of angle of view between the inspected surface and the thermal imager. Infrared Phys. Technol. 2015, 72, 77–83. [CrossRef] 26. Zhou, Z.; Wei, X.; Xie, T.; Tang, Z.; Cui, H. Influence of Observation Distance and Angle of View on the Detection Accuracy of Infrared Thermal Radiation. Infrared Technol. 2017, 39, 86–90. 27. Muniz, P.R.; Cani, S.P.N.; Magalhaes, R.D.S. Influence of Field of View of Thermal Imagers and Angle of View on Temperature Measurements by Infrared Thermovision. IEEE Sens. J. 2013, 14, 729–733. [CrossRef] 28. Bas, ¸ D.; Boyacı, I.H. Modeling and optimization I: Usability of response surface methodology. J. Food Eng. 2007, 78, 836–845. [CrossRef] 29. Madzimure, J.; Chimonyo, M.; Zander, K.; Dzama, K. Diurnal heat-related physiological and behavioural responses in South African indigenous gilts. J. Arid. Environ. 2012, 87, 29–34. [CrossRef] Agriculture 2023, 13, 520 16 of 16 30. Chung, T.-H.; Jung, W.-S.; Nam, E.-H.; Kim, J.-H.; Park, S.-H.; Hwang, C.-Y. Comparison of Rectal and Infrared Thermometry for Obtaining Body Temperature of Gnotobiotic Piglets in Conventional Portable Germ Free Facility. Asian-Australas. J. Anim. Sci. 2010, 23, 1364–1368. [CrossRef] 31. Oh, S.-I.; Lee, H.S.; Bui, V.N.; Dao, D.T.; Bui, N.A.; Le, T.D.; Kieu, M.A.; Nguyen, Q.H.; Tran, L.H.; So, K.-M.; et al. Dynamic Variations in Infrared Skin Temperature of Weaned Pigs Experimentally Inoculated with the African Swine Fever Virus: A Pilot Study. Vet. Sci. 2021, 8, 223. [CrossRef] 32. Baxter, S.H. Intensive Pig Production: Environmental Management and Design; Granada Publishing Ltd.: London, UK, 1984; p. 588. 33. Ferreira, S.L.C.; Bruns, R.E.; Ferreira, H.S.; Matos, G.D.; David, J.M.; Brandão, G.C.; da Silva, E.G.P.; Portugal, L.A.; dos Reis, P.S.; Souza, A.S.; et al. Box-Behnken design: An alternative for the optimization of analytical methods. Anal. Chim. Acta 2007, 597, 179–186. [CrossRef] 34. Myers, R.H.; Montgomery, D.C.; Anderson-Cook, C. Response Surface Methodology: Process and Product Optimization Using Designed Experiments; John Wiley & Sons: Hoboken, NJ, USA, 2016. 35. Box, G.E.; Cox, D.R. An analysis of transformations. J. R. Stat. Soc. Ser. B (Methodol.) 1964, 26, 211–252. [CrossRef] 36. Shen, X.; Zhang, G.; Bjerg, B. Investigation of response surface methodology for modelling ventilation rate of a naturally ven-tilated building. Build. Environ. 2012, 54, 174–185. [CrossRef] 37. Cheng, Y.H.; Wang, S.N.; Yu, D.H. Optimal Design of Monocular Stereo Vision System. In Proceedings of the 16th IEEE International Conference on Mechatronics and Automation (IEEE ICMA), Tianjin, China, 4–7 August 2019; pp. 1022–1027. 38. Rezaei, M.; Terauchi, M.; Klette, R. Robust Vehicle Detection and Distance Estimation Under Challenging Lighting Conditions. IEEE Trans. Intell. Transp. Syst. 2015, 16, 2723–2743. [CrossRef] 39. Kim, J.B. Efficient Vehicle Detection and Distance Estimation Based on Aggregated Channel Features and Inverse Perspective Mapping from a Single Camera. Symmetry 2019, 11, 1205. [CrossRef] 40. Shen, C.; Zhao, X.; Liu, Z.; Gao, T.; Xu, J. Joint vehicle detection and distance prediction via monocular depth estimation. IET Intell. Transp. Syst. 2020, 14, 753–763. [CrossRef] 41. Litwa, M. Influence of Angle of View on Temperature Measurements Using Thermovision Camera. IEEE Sens. J. 2010, 10, 1552–1554. [CrossRef] 42. LokeshBabu, L.; Jeyakumar, S.; Vasant, P.J.; Sathiyabarathi, M.; Manimaran, A.; Kumaresan, A.; Pushpadass, H.A.; Sivaram, M.; Ramesha, K.; Kataktalware, M.A.; et al. Monitoring foot surface temperature using infrared thermal imaging for assessment of hoof health status in cattle: A review. J. Therm. Biol. 2018, 78, 10–21. [CrossRef] 43. Stokes, J.; Leach, K.; Main, D.; Whay, H. An investigation into the use of infrared thermography (IRT) as a rapid diagnostic tool for foot lesions in dairy cattle. Vet. J. 2012, 193, 674–678. [CrossRef] 44. Abudabos, A.M.; Samara, E.M.; Hussein, E.O.S.; Al-Ghadi, M.Q.; Al-Atiyat, R.M. Impacts of Stocking Density on the Per-formance and Welfare of Broiler Chickens. Ital. J. Anim. Sci. 2013, 12, e11. [CrossRef] 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.

Journal

AgricultureMultidisciplinary Digital Publishing Institute

Published: Feb 21, 2023

Keywords: correction algorithm; infrared thermography; monocular ranging; skin temperature sensing; response surface methodology

There are no references for this article.