A method and device for monitoring the external temperature of animals for veterinary use in animal husbandry
By analyzing the temperature noise interference of superpixel blocks in infrared thermal images, dynamically adjusting the filter window size, and optimizing the denoising processing, the problem of different noise interference levels of different pixel points in traditional methods is solved, and the accuracy of temperature monitoring is improved.
Patent Information
- Application Number
- CN202510353909.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2045-03-25
AI Technical Summary
In infrared thermal image denoising processing, traditional bilateral filtering algorithms cannot effectively deal with the problem of different degrees of noise interference from different pixel points, resulting in some data noise being unable to be effectively filtered out or the data being overly smoothed, affecting the accuracy of temperature monitoring.
By analyzing the temperature noise interference of each superpixel block in the current infrared thermal image, dynamically adjusting the filter window size of each pixel point, using the sharp change in the temperature distribution and the relative temperature distribution mutation for forward fusion, constructing the temperature distribution anomaly, and combining the ambient temperature fluctuation coefficient, the temperature noise interference is determined, thereby optimizing the denoising processing.
It improves the denoising effect of temperature data in infrared thermal images, reduces the possibility that data is overly smoothed, and thus improves the accuracy of temperature monitoring of animal husbandry animals.
Smart Images

Figure CN119887752B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of animal external temperature monitoring, and specifically relates to a method and device for monitoring the external temperature of animals for veterinary use in animal husbandry. Background Art
[0002] The body temperature of livestock animals is an important physiological indicator to measure their health status. By monitoring the body temperature of livestock animals, the potential diseases of livestock animals can be monitored and diagnosed. The external temperature monitoring method based on infrared thermography (IRT) technology has the advantages of non-contact, non-destructive, convenient, fast, etc., and can realize real-time and comprehensive monitoring of the body temperature of livestock animals, and reduce the interference and potential harm to livestock animals, thereby helping veterinarians in animal husbandry evaluate the disease state, onset site and pathological stage of animals.
[0003] During the process of using an infrared thermal imaging device for temperature monitoring, the randomness of photons absorbed by the infrared detector and the random thermal motion of charge carriers in the conductor usually cause the collected infrared thermal image to be affected by photon noise and thermal noise, and the infrared thermal imager may also be affected by environmental electromagnetic interference. Therefore, a denoising algorithm is usually used to denoise the collected infrared thermal image, such as the bilateral filtering algorithm, to reduce the interference of noise on the data in the infrared thermal image.
[0004] However, the denoising effect of the bilateral filtering algorithm depends on the setting of the filtering window size. When the traditional bilateral filtering algorithm is used to denoise the infrared thermal image, the same filtering window size is usually set for all pixel points in the infrared thermal image. However, in fact, the degree of noise interference on each pixel point in the infrared thermal image is different, which will cause the noise of some data in the infrared thermal image not to be effectively filtered or the data to be over-smoothed, affecting the denoising effect of the final infrared thermal image, and thus affecting the temperature monitoring of livestock animals. Summary of the Invention
[0005] In order to solve the above technical problems, this application provides a method and device for monitoring the external temperature of animals for veterinary use in animal husbandry. The specific technical solutions adopted are as follows:
[0006] In the first aspect, an embodiment of this application provides a method for monitoring the external temperature of animals for veterinary use in animal husbandry. The method includes the following steps:
[0007] Step 1: Continuously collect a preset number of frames of infrared thermal images of the target livestock animal;
[0008] Step 2: Analyze the temperature noise interference degree of each superpixel block in the foreground image of the current frame infrared thermal image; specifically:
[0009] S1: Perform superpixel block segmentation on the foreground image of the infrared thermal image of the current frame;
[0010] S2: Obtain the same - part superpixel blocks of any superpixel block according to the distance between the central pixel points of the superpixel blocks; Determine the sharp change degree of the temperature distribution of any superpixel block by using the temperature difference between any superpixel block in the current frame and its same - part superpixel block in the adjacent previous frame, and the average difference level between this temperature difference and the temperature differences of the same - part superpixel blocks in all adjacent frames before the current frame;
[0011] S3: Based on the difference in the average temperature between any superpixel block in the infrared thermal image of the current frame and its adjacent superpixel blocks, construct the adjacent - part temperature sequence of any superpixel block; Analyze the overall difference between the adjacent - part temperature sequence of any superpixel block and the adjacent - part temperature sequences of all its same - part superpixel blocks, and determine the relative distribution mutation degree of the temperature of any superpixel block;
[0012] S4: Positively fuse the sharp change degree of the temperature distribution and the relative distribution mutation degree of the temperature to construct the abnormal degree of the temperature distribution of any superpixel block;
[0013] S5: Determine the environmental temperature fluctuation coefficient of the infrared thermal image of the current frame by using the chaotic distribution of the temperature means in the background images of all frames of infrared thermal images; Combine the environmental temperature fluctuation coefficient and the abnormal degree of the temperature distribution of any superpixel block to determine the temperature noise interference degree of any superpixel block;
[0014] Step 3: Analyze the filter window size of each pixel point in the infrared thermal image of the current frame by using the temperature noise interference degree, and use it to filter the infrared thermal image of the target livestock animal.
[0015] Preferably, the foreground image is the image of the body surface temperature part of the livestock animal obtained after Otsu threshold segmentation of the infrared thermal image of the current frame.
[0016] Preferably, the method for obtaining the same - part superpixel blocks of any superpixel block is: In all frames of infrared thermal images, take all the superpixel blocks where the other central pixel points closest to the central pixel point of any superpixel block are located as the same - part superpixel blocks of any superpixel block.
[0017] Preferably, the sharp change degree of the temperature distribution of any superpixel block is determined by the product result of the temperature difference and the average difference level.
[0018] Preferably, the temperature difference is further determined as the Bhattacharyya distance between the temperature histograms of the superpixel blocks.
[0019] Preferably, the construction process of the adjacent - part temperature sequence of any superpixel block includes:
[0020] In the infrared thermal image of the current frame, a preset number of superpixel blocks with the smallest positional distance from the central pixel point of any one of the superpixel blocks are used as the neighboring superpixel blocks of any one of the superpixel blocks;
[0021] The average temperatures of the neighboring superpixel blocks of any one of the superpixel blocks are arranged in a sequence in ascending order of positional distance;
[0022] The values in the sequence greater than the average temperature of any one of the superpixel blocks are marked as 1, and vice versa as 0, and the marked sequence is denoted as the neighboring part temperature sequence of any one of the superpixel blocks.
[0023] Preferably, the temperature distribution abnormality degree of any one of the superpixel blocks is determined by the product result of the temperature distribution sharp change degree and the temperature relative distribution mutation degree of any one of the superpixel blocks.
[0024] Preferably, the temperature noise interference degree of any one of the superpixel blocks is obtained by reverse fusion of the temperature distribution abnormality degree of any one of the superpixel blocks and the environmental temperature fluctuation coefficient.
[0025] Preferably, the analysis process of the filtering window size of each pixel point is as follows:
[0026] The filtering window size of the i-th pixel point d(N, i) in the infrared thermal image A(N) is denoted as R(N, i);
[0027] ; where d(N, i) represents the i-th pixel point in the infrared thermal image A(N); A(N, m) represents the m-th superpixel block in the infrared thermal image A(N); G(N, m) represents the temperature noise interference degree of the superpixel block A(N, m); norm[] represents the Min-Max normalization function; round{} represents the rounding function; r1 and r2 both represent the adjustment parameters of the filtering window size.
[0028] In a second aspect, an embodiment of the present application further provides an animal external temperature monitoring device for veterinary medicine for livestock, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, the steps of the above-mentioned animal external temperature monitoring method for veterinary medicine for livestock are implemented.
[0029] The present application has at least the following beneficial effects:
[0030] This application obtains the same - part super - pixel blocks of any super - pixel block according to the distance between the central pixel points of the super - pixel blocks; uses the temperature difference between any super - pixel block in the current frame and its same - part super - pixel block in the adjacent previous frame, as well as the average difference level between this temperature difference and the temperature differences of the same - part super - pixel blocks in all adjacent frames before the current frame, to determine the sharp change degree of the temperature distribution of any super - pixel block, and more accurately evaluates the degree of sharp change in the temperature distribution of each part of the livestock animal; based on the temperature distribution feature difference between any super - pixel block in the infrared thermal image of the current frame and its adjacent super - pixel blocks, constructs the adjacent - part temperature sequence of any super - pixel block; analyzes the overall difference between the adjacent - part temperature sequence of any super - pixel block and the adjacent - part temperature sequences of all its same - part super - pixel blocks, and determines the relative distribution mutation degree of the temperature of any super - pixel block, which can more accurately evaluate the degree when the relative distribution feature of the body surface temperature between the same part and its adjacent part of the livestock animal is abnormal; positively fuses the sharp change degree of the temperature distribution and the relative distribution mutation degree of the temperature to construct the temperature distribution abnormality degree of any super - pixel block; uses the chaotic distribution of the temperature mean value in the background image of all frames of infrared thermal images to determine the environmental temperature fluctuation coefficient of the infrared thermal image of the current frame; combines the environmental temperature fluctuation coefficient and the temperature distribution abnormality degree of any super - pixel block to determine the temperature noise interference degree of any super - pixel block, reduces the influence of the environmental temperature on the degree of noise interference of the pixel points in the livestock animal area in the infrared thermal image, and thus can more accurately evaluate the degree of noise interference of the pixel points; uses the temperature noise interference degree to analyze the filter window size of each pixel point in the infrared thermal image of the current frame for filtering the infrared thermal image of the target livestock animal. Compared with directly using the same filter window size in the traditional bilateral filtering algorithm to denoise the infrared thermal image of the livestock animal, it can improve the denoising effect of the temperature data in the infrared thermal image of the livestock animal, reduce the possibility of over - smoothing of the temperature data, and thus improve the temperature monitoring result of the livestock animal. Description of the Drawings
[0031] To more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following - described drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0032] Figure 1 It is a flowchart of a method for monitoring the external temperature of livestock animals provided by the present application;
[0033] Figure 2Flowchart for determining the temperature noise interference degree of each superpixel block provided by this application. Detailed implementation manners
[0034] In order to further elaborate on the technical means and effects adopted by this application to achieve the intended invention purpose, the following will, in conjunction with the accompanying drawings and preferred embodiments, elaborate in detail on a method and device for monitoring the external temperature of animals for veterinary use in animal husbandry, including its specific implementation manners, structures, features, and effects. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0035] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which this application belongs.
[0036] The following will specifically describe the specific solutions of a method and device for monitoring the external temperature of animals for veterinary use in animal husbandry provided by this application with reference to the accompanying drawings.
[0037] A method and device for monitoring the external temperature of animals for veterinary use in animal husbandry provided by an embodiment of this application.
[0038] Specifically, the following is provided a method for monitoring the external temperature of animals for veterinary use in animal husbandry. Please refer to Figure 1 , and this method includes the following steps:
[0039] Step 1: Continuously collect a preset number of frames of infrared thermal images of the target livestock animal.
[0040] In this embodiment, an infrared thermal imager is used to collect infrared thermal images of the target livestock animal (such as cows, pigs) to achieve temperature monitoring of the target livestock animal. The value of each pixel point in the infrared thermal image represents the temperature value of the object surface corresponding to that pixel point. Among them, the data sampling frequency of the infrared thermal imager is 10 Hz, which can be set by the implementer himself.
[0041] Taking the t-th temperature detection moment t of the target livestock animal as an example, N frames of infrared thermal images are continuously obtained. Among them, with the temperature detection moment t as the end moment, N is taken as 30, which can be set by the implementer himself. That is, the N-th frame of infrared thermal image is the last frame of the collected infrared thermal image, that is, the current frame of infrared thermal image.
[0042] So far, a continuous preset number of frames of infrared thermal images of the target livestock animal can be collected.
[0043] Step 2: Analyze the temperature noise interference degree of each superpixel block in the foreground image of the current frame of infrared thermal image.
[0044] In this application, the flowchart of the method for determining the temperature noise interference degree of each superpixel block is as shown in the appendix Figure 2 as follows:
[0045] S1: Segment the foreground image of the infrared thermal image of the current frame into superpixel blocks.
[0046] The collected infrared thermal image usually includes the temperature information of livestock and the temperature information of the environment. Since livestock are living organisms, heat is generated during their body's metabolism process, and this heat is dissipated to the environment through the body surface. The environment does not have a continuous heat source like the animal's body surface, making the body surface of livestock in the infrared thermal image have a higher temperature distribution compared to the environment.
[0047] Therefore, taking the Nth infrared thermal image A(N) obtained as an example, the Otsu threshold segmentation algorithm is used to segment the foreground image B1(N) and the background image B2(N) of the infrared thermal image A(N). The foreground image B1(N) is used to represent the temperature distribution of the body surface of livestock in the infrared thermal image A(N), and the background image B2(N) is used to represent the temperature distribution of the environment in the infrared thermal image A(N). The Otsu threshold segmentation algorithm is a well-known technology, and the specific process will not be elaborated here.
[0048] Due to the different physiological structures and functions of different parts of livestock, different parts of livestock usually have different body surface temperatures. For example, exposed parts (nose, feet) have lower temperatures compared to parts covered with hair, and core organ areas such as the heart and lungs have higher temperatures due to faster blood circulation compared to other parts.
[0049] Accordingly, in this embodiment, the SLIC (Simple Linear Iterative Clustering) superpixel segmentation algorithm is used to segment the foreground image B1(N) into M superpixel blocks, obtaining M superpixel blocks of the infrared thermal image A(N). Each superpixel block represents the image area where a part area of livestock is located in the infrared thermal image A(N), where M takes the value of 16. The STL superpixel segmentation algorithm is a well-known technology, and the specific process will not be elaborated here.
[0050] S2: Obtain the same-part superpixel blocks of any superpixel block according to the distance between the central pixel points of the superpixel blocks; use the temperature difference between any superpixel block in the current frame and the same-part superpixel block in the previous adjacent frame, and the average difference level between this temperature difference and the temperature differences of the same-part superpixel blocks in all adjacent frames before the current frame to determine the sharp change degree of the temperature distribution of any superpixel block.
[0051] Under normal circumstances, the change in the body surface temperature of a living being is a continuous and gradual process because the physiological processes and metabolic activities within the living being are continuous. These activities cause a slow change in body temperature, and as a result, the body surface temperature of the same part of a livestock animal in adjacent frame infrared thermal images usually does not exhibit a large mutation, unless there is interference from external factors, such as a sudden change in environmental temperature or noise interference during the data acquisition of the infrared thermal image. Otherwise, it will not cause a sharp change in the body surface temperature.
[0052] Based on the above analysis, taking the m-th superpixel block A(N,m) in the infrared thermal image A(N) as an example, a temperature histogram of the temperature values of all pixel points in the superpixel block A(N,m) is extracted to characterize the distribution of the body surface temperature of the livestock animal part corresponding to the superpixel block A(N,m) during the acquisition of the N-th frame infrared thermal image. And the mean value of the coordinates of all pixel points in the superpixel block A(N,m) is denoted as the coordinates of the central pixel point of the superpixel block A(N,m).
[0053] The central pixel points of the superpixel blocks with the smallest distance from the coordinates of the central pixel point of the superpixel block A(N,m) in each frame of the infrared thermal image are respectively obtained and denoted as the same-part superpixel blocks of the superpixel block A(N,m). The set composed of all the obtained same-part superpixel blocks is denoted as the same-part set C1(N,m) of the superpixel block A(N,m), which is used to characterize the set of superpixel blocks corresponding to the livestock animal part corresponding to the superpixel block A(N,m) in all frames of the infrared thermal image. Among them, in this embodiment, the Euclidean distance is used to calculate the distance between coordinates, and the Manhattan distance can also be used in other embodiments.
[0054] Furthermore, the sharp change degree of the temperature distribution of any superpixel block is determined by using the temperature difference between any superpixel block in the current frame and its same-part superpixel block in the previous adjacent frame, as well as the average difference level between this temperature difference and the temperature differences of the same-part superpixel blocks in all adjacent frames before the current frame.
[0055] Taking the superpixel block A(N,m) as an example, the sharp change degree S1(N,m) of the temperature distribution of the superpixel block A(N,m) is used to characterize the degree of sharp change in the body surface temperature distribution of the livestock animal part corresponding to the superpixel block A(N,m) during the acquisition of the N-th frame infrared thermal image. The expression is:
[0056] S1(N,m)=p(N,N - 1)* ; where p(n,n - 1) represents the Bhattacharyya distance between the temperature histograms of the corresponding superpixel block of the superpixel block A(N,m) in the infrared thermal image of the nth frame and the corresponding superpixel block of the superpixel block A(N,m) in the infrared thermal image of the (n - 1)th frame; p(N,N - 1) represents the Bhattacharyya distance between the temperature histograms of the superpixel block A(N,m) in the infrared thermal image of the Nth frame and the corresponding superpixel block of the superpixel block A(N,m) in the infrared thermal image of the (N - 1)th frame; N represents the total number of frames of the collected infrared thermal images. Among them, the calculation of the Bhattacharyya distance is a well-known technology and will not be elaborated here.
[0057] It should be noted that the greater the temperature distribution difference between the temperature of the corresponding area of the livestock animal part corresponding to the superpixel block A(N,m) in the infrared thermal image A(N) and the temperature of the corresponding area of the livestock animal part in the previous frame of infrared thermal image, that is, the greater p(N,N - 1), and the greater the difference between the temperature distribution difference and the temperature distribution differences that appear in the remaining adjacent frames of infrared thermal images of the livestock animal part, that is the greater, the more likely it is that the body surface temperature distribution of the livestock animal part will change sharply when the Nth frame of infrared thermal image is collected, and the greater the degree of sharp change, that is, the greater the temperature distribution sharp change degree S1(N,m).
[0058] S3: Based on the temperature distribution feature difference between any superpixel block in the infrared thermal image of the current frame and its adjacent superpixel blocks, construct the adjacent part temperature sequence of any superpixel block; analyze the overall difference between the adjacent part temperature sequence of any superpixel block and the adjacent part temperature sequences of all its corresponding superpixel blocks, and determine the relative distribution mutation degree of the temperature of any superpixel block.
[0059] Secondly, since livestock animals are usually homeothermic animals, and homeothermic animals can maintain a relatively stable body temperature through their own physiological mechanisms. When livestock animals are in a quiet state, the heat production of internal organs is greater than that of skeletal muscles, which is greater than that of the brain, which is greater than that of other organs. When livestock animals are in a labor or exercise state, the heat production of skeletal muscles is greater than that of internal organs, which is greater than that of the brain, which is greater than that of other organs. This body temperature regulation mechanism and heat production mode help to maintain the stability of the relative magnitude of the body surface temperature of a certain part of the livestock animal and the body surface temperature of its adjacent parts in a short period of time and will not change significantly over time unless there are external factors such as sudden changes in environmental temperature or noise interference during the data collection process of infrared thermal images, otherwise it will not damage the relative distribution characteristics of the body surface temperature of a certain part of the livestock animal and the body surface temperature of its adjacent parts.
[0060] Based on the above analysis, taking the superpixel block A(N,m) as an example, calculate the mean value of the temperature values of all pixel points in the superpixel block A(N,m), which is denoted as the average temperature a(N,m) of the superpixel block A(N,m).
[0061] Select k superpixel blocks with the smallest Euclidean distance from the coordinates of the central pixel point of the superpixel block A(N,m) from all the superpixel blocks of the infrared thermal image A(N), and denote them as the neighboring superpixel blocks of the superpixel block A(N,m). In this embodiment, k is taken as 4. Arrange the average temperature values of all the selected superpixel blocks in ascending order according to the Euclidean distance, and set the amplitude of the data points with an average temperature greater than the average temperature a(N,m) in the obtained sequence to 1, and the amplitude of the remaining data points to 0. Denote the re-assigned sequence as the neighboring part temperature sequence C2(N,m) of the superpixel block A(N,m) at the Nth frame, which is used to characterize the distribution of the relative temperature magnitude between the body surface temperature of the corresponding part of the superpixel block A(N,m) in the livestock animal and the body surface temperatures of its multiple neighboring parts when the infrared thermal image is collected at the Nth frame. A value of 1 for a data point in the neighboring part temperature sequence C2(N,m) means that the body surface temperature of the corresponding part in the livestock animal is greater than the body surface temperature of the corresponding part of the superpixel block A(N,m), and vice versa.
[0062] Use the same method as the neighboring part temperature sequence C2(N,m), and for each co-location superpixel block in the co-location set C1(N,m) of the superpixel block A(N,m), calculate its corresponding neighboring part temperature sequence, which is used to characterize the distribution of the relative temperature magnitude between the body surface temperature of the corresponding part of the superpixel block A(N,m) in the livestock animal and the body surface temperatures of its multiple neighboring parts when the infrared thermal image is collected at the corresponding frame of each superpixel block.
[0063] Denote the mean value of the Euclidean distances between the neighboring part temperature sequence C2(N,m) and the neighboring part temperature sequences of all the co-location superpixel blocks in the co-location set C1(N,m) as the temperature relative distribution mutation degree S2(N,m) of the superpixel block A(N,m), which is used to characterize the degree of mutation of the relative distribution characteristics of the body surface temperature of the livestock animal part corresponding to the superpixel block A(N,m) and the body surface temperatures of its neighboring parts when the infrared thermal image is collected at the Nth frame. The greater the Euclidean distance, the greater the difference between the relative distribution characteristics and the relative distribution characteristics during the collection of infrared thermal images in other frames, and the greater the degree of mutation, that is, the greater the temperature relative distribution mutation degree S2(N,m).
[0064] S4: Positively fuse the temperature distribution sharp change degree and the temperature relative distribution mutation degree to construct the temperature distribution abnormality degree of any superpixel block.
[0065] It can be understood that the forward fusion is a fusion method such as addition and multiplication between data. The specific forward fusion method is determined by the implementer according to the actual situation to select a suitable fusion method, and this application does not impose special restrictions.
[0066] Furthermore, the product result of the temperature distribution sharp change degree S1(N, m) and the temperature relative distribution mutation degree S2(N, m) is denoted as the temperature distribution abnormality degree S(N, m) of the superpixel block A(N, m), which is used to characterize the degree of abnormality in the data distribution of the body surface temperature of the livestock animal part corresponding to the superpixel block A(N, m) when the Nth frame of infrared thermal image is collected. The larger the product, the greater the degree of abnormality, that is, the larger the temperature distribution abnormality degree S(N, m).
[0067] S5: Using the chaotic distribution of the temperature means in the background images of all frames of infrared thermal images, determine the environmental temperature fluctuation coefficient of the current frame of infrared thermal image; combining the environmental temperature fluctuation coefficient and the temperature distribution abnormality degree of any superpixel block, determine the temperature noise interference degree of any superpixel block.
[0068] To reduce the influence of the environmental temperature on the degree of noise interference of the temperature data of each part of the target livestock animal in the image area corresponding to the infrared thermal image A(N), the following processing is performed:
[0069] Furthermore, taking the Nth frame of infrared thermal image A(N) as an example, the mean value of the temperature values of all pixel points in the background image B2(N) is used as the environmental temperature of the infrared thermal image A(N). The chaotic distribution of the environmental temperatures in all frames of infrared thermal images is used as the environmental temperature fluctuation coefficient of the current frame of infrared thermal image.
[0070] Specifically, the standard deviation of the environmental temperatures of all frames of infrared thermal images is denoted as the environmental temperature fluctuation coefficient H(N) of the infrared thermal image A(N), which is used to characterize the degree of drastic fluctuation of the temperature in the environment where the target livestock animal is located during the data collection of the Nth frame of infrared thermal image. The larger the standard deviation, the greater the degree of fluctuation, that is, the larger the environmental temperature fluctuation coefficient H(N).
[0071] Furthermore, using the combination of the environmental temperature fluctuation coefficient and the temperature distribution abnormality degree of any superpixel block, determine the temperature noise interference degree of any superpixel block.
[0072] Among them, the temperature noise interference degree of any superpixel block is obtained by performing reverse fusion of the temperature distribution abnormality degree of any superpixel block and the environmental temperature fluctuation coefficient.
[0073] Specifically, taking the superpixel block A(N,m) as an example, the temperature noise interference degree G(N,m) of the superpixel block A(N,m) is obtained, which is used to characterize the degree of noise interference on the temperature data of the corresponding livestock animal part in the corresponding image area of the Nth-frame infrared thermal image. The calculation method of the temperature noise interference degree G(N,m) of the superpixel block A(N,m) is as follows:
[0074] G(N,m)= , where S(N,m) represents the temperature distribution abnormality degree of the superpixel block A(N,m); H(N) represents the environmental temperature fluctuation coefficient of the infrared thermal image A(N); represents the tuning parameter constant. To prevent the denominator from being zero, where takes a value of 0.01 and can be set by the implementer himself.
[0075] It should be understood that when collecting the Nth-frame infrared thermal image, the greater the degree of abnormality in the data distribution of the body surface temperature of the livestock animal part corresponding to the superpixel block A(N,m), that is, the greater S(N,m), which means that the temperature values of the pixel points in the superpixel block A(N,m) are more affected by the sudden change of the environmental temperature or the noise interference during the data collection process of the infrared thermal image. And during the data collection period of the Nth-frame infrared thermal image, the smaller the degree of drastic fluctuation of the temperature of the environment where the target livestock animal is located, that is, the smaller H(N), the more likely the reason for the abnormal temperature values of the pixel points in the superpixel block A(N,m) is caused by noise interference, and the greater the degree of noise interference on the temperature values of the pixel points in the superpixel block A(N,m), that is, the greater the temperature noise interference degree G(N,m).
[0076] Step 3: Use the temperature noise interference degree to analyze the filter window size of each pixel point in the current-frame infrared thermal image for filtering the infrared thermal image of the target livestock animal.
[0077] Taking the ith pixel point d(N,i) in the infrared thermal image A(N) as an example, calculate the filter window size R(N,i) of the pixel point d(N,i), which is used to characterize when using the bilateral filtering algorithm to denoise the infrared thermal image A(N). Among them, when using the filter window to denoise the infrared thermal image, Gaussian filtering, median filtering, etc. can also be used.
[0078] Among them, the calculation method of the filter window size R(N,i) of the ith pixel point d(N,i) in the infrared thermal image A(N) is as follows:
[0079] ; where d(N,i) represents the i-th pixel point in the infrared thermal image A(N); A(N,m) represents the m-th superpixel block in the infrared thermal image A(N); G(N,m) represents the temperature noise interference degree of the superpixel block A(N,m); norm[] represents the Min-Max normalization function; round{} represents the rounding function; r1 and r2 are both adjustment parameters for the size of the filtering window, used to adjust the specific filtering window when using the filtering algorithm, where r1 and r2 are respectively set to 3 and 6, and can be specifically set by the implementer himself.
[0080] It should be understood that the pixel point d(N,i) belongs to the pixel point corresponding to the body surface of the target livestock animal in the infrared thermal image A(N), that is , and if the degree of noise interference on the temperature data of the image area corresponding to the livestock animal part where the pixel point d(N,i) is located in the infrared thermal image A(N) is greater, that is, the greater G(N,m) is, then in order to effectively reduce the influence of noise on the temperature data, the filtering window of the pixel point d(N,i) in the bilateral filtering algorithm should be larger, that is, R(N,i) should be larger. If G(N,m) is smaller, then in order to avoid over-smoothing of the temperature data, R(N,i) should be smaller; and if the pixel point d(N,i) belongs to the pixel point corresponding to the environmental area where the target livestock animal is located in the infrared thermal image A(N), that is , then in order to enhance the recognizability of the temperature data of the target livestock animal in the infrared thermal image A(N), the filtering window of the pixel point d(N,i) in the bilateral filtering algorithm is set to r1 + r2.
[0081] Using the same method as the filtering window size R(N,i), calculate the filtering window size of each pixel point in the infrared thermal image A(N) respectively, and use the bilateral filtering algorithm to perform denoising processing on the infrared thermal image A(N), where the filtering window size of each pixel point is used as the size of the filtering window of the pixel point in the bilateral filtering algorithm, and the denoised infrared thermal image A1(N) is obtained. The bilateral filtering algorithm is a well-known technology, and the specific process will not be elaborated here.
[0082] And take the infrared thermal image A1(N) as the in-vitro temperature monitoring result of the target livestock animal at the t-th temperature detection moment, and complete the in-vitro temperature monitoring of the target livestock animal.
[0083] Based on the same inventive concept as the above method, the embodiment of the present application also provides a livestock veterinary in-vitro temperature monitoring device, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of any one of the above methods of a livestock veterinary in-vitro temperature monitoring method.
[0084] Each embodiment in this application is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other, and the differences between each embodiment and other embodiments are emphasized.
[0085] It should be noted that, unless otherwise specified and limited, terms such as "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a circuit structure, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another identical element in the article or device including the said element. In addition, the term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0086] Those skilled in the art will readily conceive of other embodiments of this application after considering the specification and practicing the invention herein. This application is intended to cover any variations, uses or adaptations of this application, which follow the general principles of this application and include common general knowledge or conventional technical means in the technical field not invented by this application.
[0087] It should be understood that this application is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope.
Claims
1. A method for monitoring the external temperature of animals for animal husbandry and veterinary medicine, characterized in that: The method comprises the following steps: Step 1: continuously collecting a preset number of frames of infrared thermal images of the target livestock; Step 2: Analyze the temperature noise interference of each super pixel block in the foreground image of the current frame infrared thermal image; specifically: S1: Perform super-pixel block segmentation on the foreground image of the infrared thermal image of the current frame; S2: Obtain the superpixel block at the same position of any superpixel block according to the distance between the central pixel points of the superpixel block; determine the sharp change degree of temperature distribution of any superpixel block by using the temperature difference between any superpixel block in the current frame and the superpixel block at the same position in the previous adjacent frame, and the average difference level between the temperature difference and the superpixel blocks at the same position in all adjacent frames before the current frame; S3: Based on the difference in average temperature between any super-pixel block and its neighboring super-pixel blocks in the infrared thermal image of the current frame, a temperature sequence of the neighboring parts of any super-pixel block is constructed; the overall difference between the temperature sequence of the neighboring parts of any super-pixel block and the temperature sequences of the neighboring parts of all super-pixel blocks in the same position is analyzed to determine the relative temperature distribution mutation degree of any super-pixel block; S4: taking the product of the temperature distribution sharp change degree and the temperature relative distribution mutation degree as the temperature distribution abnormality degree of any super pixel block; S5: using the chaotic distribution of the temperature mean in the background image of all frames of infrared thermal images, determining the ambient temperature fluctuation coefficient of the current frame of infrared thermal image; combining the ambient temperature fluctuation coefficient and the temperature distribution abnormality of any super pixel block, determining the temperature noise interference degree of any super pixel block; Step 3: Analyze the filter window size of each pixel in the infrared thermal image of the current frame using the temperature noise interference degree, and use it to filter the infrared thermal image of the target livestock.
2. A method for monitoring the external temperature of animals for animal husbandry and veterinary medicine according to claim 1, characterized in that: The foreground image is an image of the livestock animal's body surface temperature portion obtained by performing Otsu threshold segmentation on the infrared thermal image of the current frame.
3. A method for monitoring the external temperature of animals for animal husbandry and veterinary medicine according to claim 1, characterized in that: The method for obtaining the superpixel block in the same position as any superpixel block is as follows: in all frames of infrared thermal images, all superpixel blocks where other central pixels are closest to the central pixel of any superpixel block are taken as the superpixel blocks in the same position as any superpixel block.
4. A method for monitoring the external temperature of animals for animal husbandry and veterinary medicine according to claim 1, characterized in that: The degree of rapid change in the temperature distribution of any superpixel block is determined by the product of the temperature difference and the average difference level.
5. A method for monitoring the external temperature of animals for animal husbandry and veterinary use as claimed in claim 4, characterized in that: The temperature difference is further determined as the Bhattacharyya distance between the temperature histograms of the superpixel blocks.
6. A method for monitoring the external temperature of animals for animal husbandry and veterinary medicine according to claim 1, characterized in that: The process of constructing the temperature sequence of the neighboring parts of any super pixel block includes: In the infrared thermal image of the current frame, a preset number of super-pixel blocks having the smallest position distances to the central pixel point of any super-pixel block are used as neighboring super-pixel blocks of any super-pixel block; The average temperatures of the neighboring superpixel blocks of any superpixel block are arranged into a sequence from small to large according to the position distance; The values of the sequence that are greater than the average temperature of any super pixel block are marked as 1, otherwise they are marked as 0, and the marked sequence is recorded as the temperature sequence of the adjacent parts of any super pixel block.
7. A method for monitoring the external temperature of animals for animal husbandry and veterinary medicine according to claim 1, characterized in that: The abnormality of the temperature distribution of any super pixel block is determined by the product of the rapid change degree of the temperature distribution of any super pixel block and the sudden change degree of the relative temperature distribution.
8. A method for monitoring the external temperature of animals for animal husbandry and veterinary medicine according to claim 1, characterized in that: The method for determining the temperature noise interference degree of any super-pixel block is: calculating the sum of the ambient temperature fluctuation coefficient and a preset parameter adjustment constant; taking the ratio of the temperature distribution anomaly of any super-pixel block to the sum as the temperature noise interference degree of any super-pixel block; wherein, the preset parameter adjustment constant is used to prevent the denominator from being 0.
9. A method for monitoring the external temperature of animals for animal husbandry and veterinary use according to claim 1, characterized in that: The analysis process of the filter window size of each pixel is as follows: The filter window size of the i-th pixel d(N,i) in the infrared thermal image A(N) is recorded as R(N,i); ; In the formula, d(N,i) represents the i-th pixel in the infrared thermal image A(N); A(N,m) represents the m-th superpixel block in the infrared thermal image A(N); G(N,m) represents the temperature noise interference of the superpixel block A(N,m); norm[] represents the Min-Max normalization function; round{} represents the rounding function; r1 and r2 both represent the adjustment parameters of the filter window size.
10. An animal external temperature monitoring device for animal husbandry and veterinary medicine, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of a method for monitoring the external temperature of animals for animal husbandry and veterinary use as described in any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Superpixel-based electric transmission and transformation equipment infrared fault image segmentation method
CN104217425A
Animal body temperature intelligent monitoring system for animal husbandry and veterinary medicine based on data enhancement
CN117237244A