Animal body temperature recognition system for animal husbandry and veterinary medicine
The infrared image is denoised through a bilateral filtering algorithm, combined with space and grayscale information, and the noise and edge blur problems in infrared thermal imaging technology are solved, improving the image quality and temperature recognition accuracy of animal body temperature detection for animal husbandry and veterinary medicine.
Patent Information
- Application Number
- CN202411354380.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-09-27
AI Technical Summary
Infrared thermal imaging technology in animal temperature detection for animal husbandry and veterinary medicine affects the identification and detection of high temperature sensitivity due to noise and edge blur, especially during image acquisition and transmission, which is greatly affected by the external environment and equipment.
Bilateral filtering algorithm is used to denoise the infrared image of pigs, combining spatial information and grayscale information, and weighting through adaptive grayscale domain coefficients, edge information is retained and detail sensitivity is improved. Specific steps include pre-processing of grayscale images, sliding window traversal, temperature similarity calculation, clustering, edge confidence evaluation and bilateral filter coefficient correction, and finally obtain the denoised image.
Effective denoising treatment improves image quality, retains edge details information, enhances the accuracy of identifying the ear root position of pigs, and improves the sensitivity and accuracy of body temperature detection.
Smart Images

Figure CN118864305B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image data processing, and in particular to an animal body temperature recognition system for animal husbandry and veterinary medicine. Background Art
[0002] In the animal temperature detection scenario for animal husbandry and veterinary use, infrared thermal imaging temperature detection technology has been widely promoted and implemented due to its advantages such as non-contact temperature measurement, short temperature measurement time, wide temperature measurement range and digital display. However, due to the influence of the external environment and infrared detection equipment during image acquisition and transmission, the quality of infrared images is low, and there are problems of noise and blurred edges in the images; when there are problems of noise and blurred edges in the images, it will affect the subsequent recognition and detection of the ear root position which is highly sensitive to body temperature, and the acquired infrared images of pigs need to be denoised first.
[0003] Since the area of interest for target detection is the ear root area of the pig, it is based on the clear edge contour and the structural similarity inside the ear root area. Compared with other denoising algorithms that only consider spatial information or neighborhood grayscale information, bilateral filtering is a nonlinear filtering algorithm that combines image spatial information and content information. While denoising, it retains edge information to the greatest extent. Therefore, bilateral filtering can be used to denoise pig infrared images.
[0004] In the process of denoising the infrared images of live pigs using bilateral filtering, since bilateral filtering considers both spatial distance and grayscale value differences at the same time, it regards smooth areas and more concerned edge and detail areas as equivalent, and the grayscale domain coefficient has no detail sensitivity. Therefore, it is necessary to perform adaptive grayscale domain coefficient weighting of bilateral filtering on different areas to obtain the best detail area filtering effect. Summary of the invention
[0005] The invention provides an animal body temperature recognition system for animal husbandry and veterinary medicine to solve the existing problems.
[0006] The animal body temperature recognition system for animal husbandry and veterinary medicine of the present invention adopts the following technical scheme:
[0007] An embodiment of the present invention provides an animal body temperature recognition system for animal husbandry and veterinary medicine, the system comprising the following modules:
[0008] A data acquisition module collects infrared images of pigs to obtain grayscale images;
[0009] The image denoising module presets a grayscale threshold, and divides the grayscale level of the grayscale histogram of the grayscale image evenly according to the grayscale threshold to obtain a new grayscale image;
[0010] A sliding window is preset, and the new grayscale image is traversed according to the sliding window to obtain the difference sequence of each pixel;
[0011] The temperature similarity of any two pixels is obtained according to the difference sequence of any two pixels;
[0012] Clustering the pixels in the new grayscale image according to the temperature similarity of any two pixels to obtain a clustering result, recorded as a first clustering result; obtaining an animal body structure set of each first clustering result;
[0013] Record any set of animal body structures as the target set, and record any edge in the target set as the possible distribution edge of the animal's body temperature;
[0014] The confidence of the possible distribution edge of animal body temperature is obtained according to the number of elements in the target set, the number of elements on the possible distribution edge of animal body temperature, and the distance between the possible distribution edge of animal body temperature and the similar edge in the non-target set;
[0015] The gray domain coefficient is weightedly corrected according to the confidence of the possible distribution edge of the animal body temperature to obtain the corrected gray domain coefficient; a new bilateral filter coefficient is obtained according to the corrected gray domain coefficient, and the gray image is denoised according to the new bilateral filter coefficient to obtain a denoised gray image;
[0016] The body temperature detection module obtains the pig's body temperature based on the denoised grayscale image.
[0017] Furthermore, the grayscale histogram of the grayscale image is averagely divided into grayscale levels according to the grayscale threshold to obtain a new grayscale image, which includes the following specific steps:
[0018] The grayscale histogram is evenly divided into G grayscale levels using the set number of grayscale levels G to obtain a new grayscale image.
[0019] Furthermore, the specific steps of obtaining the difference sequence are as follows:
[0020] For the preset sliding window, the step size is 1, and the new grayscale image is traversed from left to right and from top to bottom; the sliding window is used as the pixel area, the central pixel of the window is used as the center point of the area, and then the window is traversed to obtain the grayscale levels of the 8-neighborhood pixels in each window area after traversal, and the grayscale values of the 8-neighborhood pixels in the area are subtracted from the minimum value in the area, and all the differences are arranged in order from small to large to obtain the difference sequence corresponding to each central pixel.
[0021] Furthermore, the specific steps for obtaining the temperature similarity of any two pixels are as follows:
[0022] The formula for the similarity between any two pixels is:
[0023]
[0024] In the formula, Indicates the temperature similarity between the i-th pixel and the j-th pixel, Represents the number of elements in the pixel difference sequence, Indicates the number of identical elements between the ith pixel difference sequence and the jth pixel difference sequence. It represents the Euclidean distance between the i-th pixel and the j-th pixel, and Exp is an exponential function with natural numbers as the base.
[0025] Furthermore, the specific steps of obtaining the animal body structure set are as follows:
[0026] The central pixel in each first clustering result is recorded as the target pixel, and then each target pixel in each first clustering result is traversed. If there is a target pixel in the same cluster within the 8-neighborhood of the target pixel, it is added to the animal body structure set. The traversal is continued until there is no target pixel of the same type in the 8-neighborhood of the last target pixel, and finally all animal body structure sets of each first clustering result are obtained.
[0027] Furthermore, the specific steps for obtaining the distance between the edge of the possible distribution of the animal body temperature and the similar edge in the non-target set are as follows:
[0028] Calculate the distance between any pixel point in the edge of the possible distribution of animal body temperature and any pixel point in the non-target set, and take the distance between the two pixels with the smallest distance as the distance of the corresponding edge;
[0029] The method for obtaining similar edges is as follows: when the distance between the edge of the possible distribution of animal body temperature and the edge in the set of different animal body structures is less than or equal to a preset distance threshold W, the two edges are recorded as similar edges.
[0030] Furthermore, the specific steps for obtaining the confidence of the possible distribution edge of the animal body temperature are as follows:
[0031] Confidence of the possible edge of the distribution of animal body temperature The formula is
[0032]
[0033] In the formula, L represents the number of pixels in the target set, Represents the number of pixels in the edge of the possible distribution of animal body temperature in the target set, It represents the distance between the edge of the possible distribution of animal body temperature and the jth edge in the set of animal body structures of different categories, and m represents the number of edges close to the edge of the possible distribution of animal body temperature.
[0034] Furthermore, the specific steps of obtaining the gray domain coefficient after correction are as follows:
[0035] Confidence of the possible distribution edge based on animal body temperature Multiply it by the original grayscale domain coefficient to make correction and obtain the corrected grayscale domain coefficient.
[0036] Furthermore, the specific steps of obtaining the new bilateral filter coefficients are as follows:
[0037] New bilateral filter coefficients The formula is:
[0038]
[0039] In the formula, It is expressed as the spatial domain coefficient of the jth pixel in the window centered at the i-th pixel. It is expressed as the gray domain coefficient of the jth pixel in the window centered at the i-th pixel. It is expressed as the confidence of the j-th pixel in the window centered at the i-th pixel, where the confidence of the j-th pixel is equal to the confidence of the edge where the j-th pixel is located. It is represented as the new bilateral filter coefficient of the j-th pixel in the window centered at the i-th pixel.
[0040] Furthermore, the method of obtaining the pig's body temperature according to the denoised grayscale image includes the following specific steps:
[0041] The category labels are annotated according to the denoised grayscale image, with the background pixel category marked as 0, the pig outline as 1, the pig left ear as 2, the pig right ear as 3, the left ear base as 4, and the right ear base as 5. The labels are then trained through a neural network to obtain the pig ear base location target. After identifying the location of the pig ear base, the average detection temperature of the area is calculated based on the brightness information of the highlighted part of the ear base, and the result is finally used as the pig's body temperature.
[0042] The beneficial effects of the technical solution of the present invention are: being able to divide the trusted detail area according to the similarity of the focus set of edge pixels, improving the sensitivity of the bilateral filtering gray domain coefficient to the detail edge, and retaining the edge detail information to a greater extent. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0044] Figure 1 The present invention is a module flow chart of an animal body temperature recognition system for animal husbandry and veterinary medicine. DETAILED DESCRIPTION
[0045] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation, structure, features and effects of an animal temperature recognition system for animal husbandry and veterinary medicine proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0046] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0047] The specific scheme of the animal body temperature recognition system for animal husbandry and veterinary medicine provided by the present invention is described in detail below with reference to the accompanying drawings.
[0048] See also Figure 1 , which shows a flow chart of the steps of a system for identifying animal body temperature for animal husbandry and veterinary medicine provided by one embodiment of the present invention, the system includes the following modules:
[0049] Module 101: Data acquisition module.
[0050] Place the infrared camera above the fence of an empty site or at a higher place to capture color infrared images of the front side of the pigs to be tested standing or lying down.
[0051] The collected infrared image is grayed to obtain a processed grayscale image. The grayscale value of each pixel on the grayscale image represents the temperature at each position. Therefore, in this embodiment, the animal body temperature can be obtained by analyzing and processing the grayscale value of each pixel on the grayscale image. In this embodiment, the body temperature detection of a pig is used as an example for description.
[0052] When obtaining the body temperature of a pig based on a grayscale image, it is first necessary to monitor the pig's outline, left ear, right ear, left ear root, and right ear root. However, since the measured temperature not only contains the pig's temperature information, but also includes the interfering temperature information of the environment, these interfering temperature information are presented as noise on the grayscale image, and the temperature information on the pig's outline, left ear, right ear, left ear root, and right ear root are presented as continuous edges and areas on the grayscale image. Therefore, this embodiment needs to obtain accurate pig temperature information through the grayscale differences of edges and areas on the grayscale image to avoid interference from ambient temperature.
[0053] Module 102: Image denoising module.
[0054] It should be noted that in order to obtain the edge information of the pig's outline, left ear, right ear, left ear root, and right ear root, the edge information needs to be filtered and denoised; but since it considers both spatial distance and grayscale value differences and considers the two to be equivalent, the same processing is taken in the detail area and the smooth area, and the edge information is inevitably reduced. Therefore, it is necessary to use the regional attention sequence to quantify the edge temperature similarity, use the edge confidence to distinguish between credible edges and unreliable high-frequency noise, divide the detail area and smooth area of interest, and use the confident edge temperature similarity to weight the bilateral filtering grayscale domain coefficients to complete edge adaptive bilateral filtering denoising.
[0055] For the grayscale images of live pigs to be processed, it is mainly necessary to remove noise while retaining the outer contour edge information, internal structure information and edge information of the highlighted part. Except for the edge information related to the ear base position and the ear base highlight area positioning, all other edge information can be regarded as high-frequency noise. Therefore, the edge area attention sequence is obtained, and the regional temperature similarity judgment is performed to obtain multiple sets of similar edge coordinate sequences, which is convenient for the subsequent division of the region of interest.
[0056] Specifically, a grayscale number G is preset, wherein this embodiment is described by taking G=32 as an example, and this embodiment is not specifically limited, wherein G can be determined according to the specific implementation situation. The grayscale histogram is evenly divided into G grayscale levels using the set grayscale number G. At this time, the corresponding grayscale image should also be changed to obtain a new grayscale image, which is recorded as the adjusted grayscale image. The grayscale image will be analyzed and described below. A sliding window with a window size of 3×3 is set again, and then the adjusted grayscale image is traversed from left to right and from top to bottom with a step size of 1. The sliding window is used as the pixel area, and the center pixel of the window is used as the center point of the area. Then the window is traversed to obtain the grayscale of the 8 neighboring pixels in each window area after traversal, and the grayscale values of the 8 neighboring pixels in the area are subtracted from the minimum value in the area, and all the differences are arranged in order from small to large to obtain the regional difference sequence corresponding to each center pixel.
[0057] The more consistent the regional difference sequence of the central pixel is, the closer the distance is, and the higher the edge temperature similarity is. Therefore, the temperature similarity calculation formula of any two pixels is:
[0058]
[0059] In the formula, Indicates the temperature similarity between the i-th pixel and the j-th pixel, The number of elements representing the pixel area difference sequence is fixed at 8. Indicates the number of identical elements between the ith pixel point regional difference sequence and the jth pixel point regional difference sequence, It represents the Euclidean distance between the i-th pixel and the j-th pixel, and Exp is an exponential function with natural numbers as the base.
[0060] Specifically, the temperature similarity of the two pixels calculated above is used to replace the distance feature of the two pixels, the number of clustering categories is preset to H, and then the clustering result is obtained by the mean shift clustering algorithm. It is hereby noted that the clusters in the mean shift algorithm are mobile, that is, the central pixel is always changing. The central pixel in each category is recorded as the target pixel, and then each target pixel in each category is traversed. If there is a target pixel in the same cluster in the 8 neighborhood of the target pixel, it is added to the animal body structure set, and the traversal is continued until there is no target pixel of the same type in the 8 neighborhood of the last target pixel, and finally all animal body structure sets of each category are obtained. The animal body structure set contains many possible edges.
[0061] At this point, we have obtained an animal body structure set for each class. The animal body structure set represents the temperature distribution of various parts of the pig's body, including the pig's outline, the pig's left ear, the pig's right ear, the left ear root, and the right ear root. The temperature distribution represented by the animal body structure set includes not only the pig's body temperature data but also environmental interference temperature information. The pig's body temperature data presents a continuous texture edge, and the environmental interference temperature information is some high-frequency noise pixels discretely distributed on the edge.
[0062] It should be noted that the animal body structure set is calculated using the temperature similarity between pixels to obtain the possible edge of the image. Since the animal body structure set contains edge pixels, texture pixels and high-frequency noise pixels, the regional distribution of different types of animal body structure sets is certain. In order to have an accurate method for the edge of the image, it is necessary to judge the edge confidence.
[0063] Any edge is recorded as the possible distribution edge of animal body temperature, and the possible distribution edge of animal body temperature and the corresponding animal body structure set are recorded as the target set.
[0064] Then the confidence level of the possible edge of the animal's body temperature distribution is It can be expressed as:
[0065]
[0066] In the formula, L represents the number of pixels in the target set, Represents the number of elements in the possible distribution edge of animal body temperature in the target set, It represents the distance between the edge of the possible distribution of animal body temperature and the jth edge in the set of animal body structures of different categories. The distance between the two edges is represented by the distance between the nearest pixels on the edge. m represents the number of edges close to the edge of the possible distribution of animal body temperature.
[0067] Among them, when the confidence of the edge of the possible distribution of animal body temperature The higher it is, the more it is considered that this area should be retained in the bilateral filtering denoising process; It indicates the ratio of the number of elements in the possible distribution edge of animal body temperature to the number of elements in the target set. The larger its value, the higher the confidence of the possible distribution edge of animal body temperature. The smaller the value, the closer the local area is, and the higher the confidence of the possible distribution edge of the animal body temperature. Among them, the determination of the possible distribution edge of the animal body temperature and the similar edges in the set of different animal body structures is determined by setting a threshold. This implementation presets a distance threshold W, wherein this embodiment is described by taking W=15 as an example, and this embodiment is not specifically limited, wherein W can be determined according to the specific implementation situation. When the distance between the possible distribution edge of the animal body temperature and the edge in the set of different animal body structures is less than or equal to the distance threshold W, the two edges are considered to be similar, and when the distance between the possible distribution edge of the animal body temperature and the edge in the set of different animal body structures is greater than the distance threshold W, the two edges are considered to be not similar.
[0068] At this point, the confidence of each edge in the animal body structure set is obtained. In the animal body structure set, the confidence of each pixel on each edge is equal to the confidence of each edge, and the confidence of other pixels outside the edge is set to 1.
[0069] Specifically, in this embodiment, bilateral filtering is used to perform denoising on the grayscale image. The bilateral filtering here considers the spatial distance and grayscale value difference, and grayscale is used for analysis, so the grayscale value difference of the bilateral filtering is weighted to perform the final denoising operation.
[0070] The calculation formula of bilateral filtering is as follows:
[0071]
[0072] In the formula, Represents the grayscale value of the i-th pixel in the grayscale image. Represents the grayscale value of the i-th pixel in the grayscale image after filtering, represents the window centered at the i-th pixel, Represents a window centered on the i-th pixel The filter coefficient of the j-th pixel in Represents the filter coefficient of the i-th pixel.
[0073] in, Represents the coefficients of bilateral filtering, which are composed of spatial domain coefficients Grayscale domain coefficient constitute:
[0074]
[0075] in, Expressed as spatial domain coefficients, Represents the gray domain coefficient. The spatial domain coefficient and the gray domain coefficient are parameters in the bilateral filtering algorithm, and the specific acquisition method thereof will not be described in detail in this embodiment.
[0076] By correcting the grayscale domain coefficient, a new grayscale domain coefficient is obtained, and then a new bilateral filtering coefficient is obtained. At this point, the grayscale image is corrected again to obtain a denoised image.
[0077] Then the formula for the new bilateral filter coefficient is:
[0078]
[0079] In the formula, It is expressed as the spatial domain coefficient of the jth pixel in the window centered at the i-th pixel. It is expressed as the gray domain coefficient of the jth pixel in the window centered at the i-th pixel. It is expressed as the confidence of the j-th pixel in the window centered at the i-th pixel, and the confidence of the j-th pixel is equal to the confidence of the edge where the j-th pixel is located.
[0080] At this point, by obtaining the animal body structure set and regional edge confidence of the pig grayscale image, as well as the bilateral filtering grayscale domain weight coefficient weighted by the regional edge confidence, the collected pig infrared grayscale image is finally subjected to bilateral filtering denoising.
[0081] By obtaining the regional edge confidence, the absolute smoothing effect of the bilateral filtering denoising technology on the edge is improved, the equal status of the spatial domain coefficient and the grayscale domain coefficient is changed, and the required confidence edge information is further retained, which is convenient for the subsequent steps of neural network target recognition and body temperature detection.
[0082] Module 103: Body temperature detection module.
[0083] In the body temperature detection system, the image denoised by bilateral filtering can be used by a neural network to identify the ear base of the pig.
[0084] That is, through the semantic segmentation neural network, the location of the pig's ear root in the image is identified. The specific content of the target recognition neural network used is:
[0085] (1) Use the semantic segmentation Unet network to extract the image data and output the corresponding semantic segmentation result. First, extract the image features through convolution and pooling, and then use deconvolution and depooling operations to reconstruct the image to obtain the semantic segmentation image corresponding to the input image.
[0086] (2) Collect a large number of pig images taken in corresponding scenarios as a data set to train the neural network.
[0087] (3) The category information in the image is manually annotated to obtain the semantic segmentation image label information corresponding to each image, where the annotated background pixel category is 0, the pig outline is 1, the pig's left ear is 2, the pig's right ear is 3, the left ear root is 4, and the right ear root is 5.
[0088] (4) Since it is a classification task, the network uses the cross entropy loss function to supervise training.
[0089] After the neural network training is completed, the real-time collected images can be sent to the network, and the corresponding semantic segmentation image can be obtained by network reasoning. Then, the target of the pig ear base area can be obtained through the pixel category label.
[0090] After identifying the location of the ear base of the newborn pig, the average detection temperature of the area is calculated based on the brightness information of the highlighted part of the ear base. The infrared image temperature calculation is a conventional method and will not be repeated here. The calculation results are visualized on the corresponding display so that users can more intuitively view the body temperature status of the livestock to be tested.
[0091] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. An animal temperature recognition system for animal husbandry and veterinary medicine, It is characterized in that The system includes the following modules: A data acquisition module collects infrared images of pigs to obtain grayscale images; The image denoising module presets a grayscale threshold, and divides the grayscale level of the grayscale histogram of the grayscale image evenly according to the grayscale threshold to obtain a new grayscale image; A sliding window is preset, and the new grayscale image is traversed according to the sliding window to obtain the difference sequence of each pixel; The temperature similarity of any two pixels is obtained according to the difference sequence of any two pixels; Clustering the pixels in the new grayscale image according to the temperature similarity of any two pixels to obtain a clustering result, recorded as a first clustering result; obtaining an animal body structure set of each first clustering result; Record any set of animal body structures as the target set, and record any edge in the target set as the possible distribution edge of the animal's body temperature; The confidence of the possible distribution edge of the animal body temperature is obtained according to the number of pixels in the target set, the number of pixels on the possible distribution edge of the animal body temperature, and the distance between the possible distribution edge of the animal body temperature and the similar edge in the non-target set; Among them, the confidence level of the possible distribution edge of animal body temperature The formula is: In the formula, L represents the number of pixels in the target set, Represents the number of pixels in the target set that may be distributed at the edge of the animal’s body temperature. represents the distance from the edge of the possible distribution of animal body temperature to the jth edge in the set of animal body structures of different categories, and m represents the number of edges close to the edge of the possible distribution of animal body temperature; The gray domain coefficient is weightedly corrected according to the confidence of the possible distribution edge of the animal body temperature to obtain the corrected gray domain coefficient; a new bilateral filter coefficient is obtained according to the corrected gray domain coefficient, and the gray image is denoised according to the new bilateral filter coefficient to obtain a denoised gray image; Among them, the specific steps for obtaining the grayscale domain coefficient are: according to the confidence of the possible distribution edge of the animal body temperature Multiply by the original gray domain coefficient to make correction, and obtain the gray domain coefficient after correction; The body temperature detection module obtains the pig's body temperature based on the denoised grayscale image.
2. According to claim 1, an animal body temperature recognition system for animal husbandry and veterinary medicine, It is characterized in that The grayscale histogram of the grayscale image is averagely divided into grayscale levels according to the grayscale threshold to obtain a new grayscale image, and the specific steps include the following: The grayscale histogram is evenly divided into G grayscale levels using the set number of grayscale levels G to obtain a new grayscale image.
3. According to claim 1, an animal body temperature recognition system for animal husbandry and veterinary medicine, It is characterized in that The specific steps of obtaining the difference sequence are as follows: For the preset sliding window, the step size is 1, and the new grayscale image is traversed from left to right and from top to bottom; the sliding window is used as the pixel area, the central pixel of the window is used as the center point of the area, and then the window is traversed to obtain the grayscale values of the 8-neighborhood pixels in each window area after traversal, and the grayscale values of the 8-neighborhood pixels in the area are subtracted from the minimum value in the area, and all the differences are arranged in ascending order to obtain the difference sequence corresponding to each central pixel.
4. The animal body temperature recognition system for animal husbandry and veterinary medicine according to claim 1, It is characterized in that The specific steps for obtaining the temperature similarity of any two pixels are as follows: The formula for the similarity between any two pixels is: In the formula, Indicates the temperature similarity between the i-th pixel and the j-th pixel, Represents the number of elements in the pixel difference sequence, Indicates the number of identical elements between the ith pixel difference sequence and the jth pixel difference sequence. It represents the Euclidean distance between the i-th pixel and the j-th pixel, and Exp is an exponential function with natural numbers as the base.
5. The animal body temperature recognition system for animal husbandry and veterinary medicine according to claim 1, It is characterized in that The specific steps for obtaining the animal body structure set are as follows: The central pixel in each first clustering result is recorded as the target pixel, and then each target pixel in each first clustering result is traversed. If there is a target pixel in the same cluster within the 8-neighborhood of the target pixel, it is added to the animal body structure set. The traversal is continued until there is no target pixel of the same type in the 8-neighborhood of the last target pixel, and finally all animal body structure sets of each first clustering result are obtained.
6. The animal body temperature recognition system for animal husbandry and veterinary medicine according to claim 1, It is characterized in that The specific steps for obtaining the distance between the edge of the possible distribution of the animal body temperature and the close edge in the non-target set are as follows: Calculate the distance between any pixel point in the edge of the possible distribution of animal body temperature and any pixel point in the non-target set, and take the distance between the two pixels with the smallest distance as the distance of the corresponding edge; The method for obtaining similar edges is as follows: when the distance between the edge of the possible distribution of animal body temperature and the edge in the set of different animal body structures is less than or equal to a preset distance threshold W, the two edges are recorded as similar edges.
7. The animal body temperature recognition system for animal husbandry and veterinary medicine according to claim 1, It is characterized in that The specific steps of obtaining the new bilateral filter coefficients are as follows: New bilateral filter coefficients The formula is: In the formula, It is expressed as the spatial domain coefficient of the jth pixel in the window centered at the i-th pixel. It is expressed as the gray domain coefficient of the jth pixel in the window centered at the i-th pixel. It is expressed as the confidence of the j-th pixel in the window centered at the i-th pixel, where the confidence of the j-th pixel is equal to the confidence of the edge where the j-th pixel is located. It is represented as the new bilateral filter coefficient of the j-th pixel in the window centered at the i-th pixel.
8. The animal body temperature recognition system for animal husbandry and veterinary medicine according to claim 1, It is characterized in that The method of obtaining the pig's body temperature according to the denoised grayscale image includes the following specific steps: The category labels are annotated according to the denoised grayscale image, with the background pixel category marked as 0, the pig outline as 1, the pig left ear as 2, the pig right ear as 3, the left ear base as 4, and the right ear base as 5. The labels are then trained through a neural network to obtain the pig ear base location target. After identifying the location of the pig ear base, the average detection temperature of the area is calculated based on the brightness information of the highlighted part of the ear base, and the result is finally used as the pig's body temperature.
