An intelligent animal temperature detection system for animal husbandry and veterinary medicine

By using grayscale images and edge detection algorithms to segment animal outlines in an intelligent animal body temperature detection system for livestock and veterinary medicine, the accuracy problem of animal body temperature detection under infrared thermal imaging technology is solved and higher detection accuracy and reliability are achieved. .

CN118537896BActive Publication Date: 2024-09-17QINGDAO HUANMU BIOTECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411018325.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2024-09-17
Estimated Expiration
2044-07-29

AI Technical Summary

Technical Problem

Existing infrared thermal imaging technology is difficult to accurately segment the outline of a single animal in animal body temperature detection, resulting in errors in body temperature measurement. In addition, the spots, texture and hair of animal skin lead to inaccurate edge detection, affecting detection accuracy.

Method used

The data acquisition module is used to obtain animal grayscale images. The image segmentation module uses features such as gradient direction, curvature, and interference performance to segment the animal edges and remove the background area. The Otsu threshold method and edge detection operator are used for edge processing to ensure accurate segmentation. animal silhouettes.

Benefits of technology

It improves the accuracy of animal body temperature detection, reduces the amount of calculation, makes the segmentation results closer to the actual situation, reduces errors, and improves the reliability of the detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118537896B
    Figure CN118537896B
Patent Text Reader

Abstract

The present invention relates to the field of image processing technology, and specifically to an intelligent animal body temperature detection system for animal husbandry and veterinary medicine, comprising: obtaining an animal image to obtain a number of edges; obtaining the edge direction of each pixel in each edge according to the gradient direction and normal of each pixel in each edge, and then obtaining the interference expression degree of each edge; combining the number of pixels contained in each edge and the difference in grayscale values ​​on the left and right sides of each edge, obtaining the contour expression degree of each edge, and then obtaining the animal edge and the suspected animal edge; obtaining the animal edge in the suspected animal edge according to the change direction of the grayscale values ​​on both sides of the suspected animal edge, segmenting the animal image, obtaining the animal body temperature, and performing body temperature detection. The present invention aims to solve the problem that the edge detection result of the animal infrared image has an edge located within the contour, which makes it impossible to directly segment the image through the edge detection result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of image processing, and in particular to an intelligent animal body temperature detection system for animal husbandry and veterinary medicine. Background Art

[0002] The body temperature of animals can reflect their health status, allowing breeders to detect possible health problems of animals based on their body temperature. Infrared thermal imaging technology allows people to measure body temperature without contacting the animals, reducing interference and potential harm to the animals. It can provide real-time temperature data, which helps to detect abnormal animal body temperature in a timely manner, so that corresponding measures can be taken quickly. It is also suitable for group detection in large-scale farms.

[0003] When using infrared thermal imaging technology to detect the body temperature of animal groups, the animals in the infrared images obtained are clustered and have similar temperatures. It may not be possible to accurately segment the outline of a single animal from the infrared image. When obtaining the body temperature of each animal, the measured body temperature may be inaccurate due to the inaccurate segmentation of the individual animal outlines. At the same time, the surface of animal skin contains spots, textures, and hair, which causes the temperature of some areas on an animal's skin to be different from that of other areas, resulting in the edge of the animal obtained by the edge detection algorithm containing edges that do not belong to the animal outline, which in turn affects the animal division based on the animal outline, thereby reducing the accuracy of animal temperature monitoring. Summary of the invention

[0004] The invention provides an intelligent animal body temperature detection system for animal husbandry and veterinary medicine to solve the existing problems.

[0005] The animal body temperature intelligent detection system for animal husbandry and veterinary medicine of the present invention adopts the following technical scheme:

[0006] The present invention proposes an intelligent animal body temperature detection system for animal husbandry and veterinary medicine, which includes the following modules:

[0007] Data acquisition module: used to obtain grayscale images of animals;

[0008] Image segmentation module: used to obtain the animal image according to the gray value of each pixel in the animal gray image, and then obtain several edges in the animal image; obtain the edge direction of each pixel in each edge according to the gradient direction and normal of each pixel in each edge; obtain the chain code of each edge and the curvature of all pixels in each edge, and obtain the interference performance degree of each edge according to the chain code of each edge, the change of the gradient direction of the pixels in each edge and the variance of the curvature of all pixels; obtain the pixels on both sides of each edge according to the gradient direction of each pixel in each edge; obtain the contour performance degree of each edge according to the interference performance degree of each edge, the number of pixels contained and the gray difference of the pixels on both sides of each edge, and then obtain the animal edge and the suspected animal edge; obtain the gray change direction on both sides of each suspected animal edge according to the edge direction of each pixel in the suspected animal edge; obtain the occlusion performance characteristics of each suspected animal edge according to the difference in the gray change direction on both sides of each suspected animal edge, and then obtain the animal edge in the suspected animal edge, and divide the animal image into several animal areas through the animal edge;

[0009] Body temperature detection module: used to obtain the animal's body temperature and perform body temperature detection based on the segmented animal area.

[0010] Furthermore, obtaining the animal image according to the grayscale value of each pixel in the animal grayscale image includes:

[0011] The animal grayscale image was divided into two regions using the Otsu threshold method; the region with the largest average grayscale value was recorded as the animal region; the region with the smallest average grayscale value was recorded as the background region;

[0012] In the animal grayscale image, the grayscale value of the pixel in the background area is set to 0 to obtain the corrected animal grayscale image;

[0013] The corrected animal grayscale image is recorded as the animal image.

[0014] Furthermore, obtaining the edge direction of each pixel in each edge according to the gradient direction and the normal of each pixel in each edge includes:

[0015] In animal images, The first edge of the pixels, do the The normal of the edge, the two directions of the normal are recorded as The edge of the strip The suspected direction of the pixel;

[0016] Will be with The edge of the strip The suspected direction with the smallest angle between the gradient directions of the pixels is recorded as The edge of the strip The edge direction of each pixel.

[0017] Furthermore, the interference performance degree of each edge is obtained according to the chain code of each edge, the change of the gradient direction of the pixels in each edge, and the variance of the curvature of all pixels, including:

[0018]

[0019] In the formula, Indicates The degree of interference performance of the strip edge, Indicates The number of pixels contained in the edge of the strip, Indicates The edge of the strip The edge direction of the pixel, Indicates The edge of the strip The edge direction of the pixel, Indicates The minimum chain code value among the chain codes of the edge, Indicates The maximum chain code value among the chain codes of the edge, represents the absolute value function, Indicates The variance of the curvature of all pixels along the edge of the strip.

[0020] Further, the obtaining of pixel points on both sides of each edge includes:

[0021] In animal images, The first edge of the The pixel point is the center, The first edge of the The gradient direction of the pixel point and the opposite direction of the gradient are two extension directions, and each of the extension directions is taken pixels; among them, Indicates the number of preset selection points;

[0022] The first The first edge of the The gradient direction of the pixel pixel point, denoted as The edge of the strip The left pixel of the pixel; The first edge of the The gradient of the pixel point is in the opposite direction pixel point, denoted as The edge of the strip The pixel on the right side of the pixel;

[0023] The first The left pixel of all pixels on the edge of the strip is recorded as The left pixel of the edge of the strip; The right pixel of all pixels on the edge of the strip is recorded as The right pixel of the bar edge.

[0024] Furthermore, the contour expression degree of each edge is obtained according to the interference expression degree of each edge, the number of pixels contained therein, and the grayscale difference of pixels on both sides of each edge, including:

[0025]

[0026] In the formula, Indicates The degree of contour expression of the edge of the strip, Indicates The grayscale mean of all left pixels at the edge of the strip, Indicates The grayscale mean of all pixels on the right side of the edge of the strip, Indicates The number of pixels contained in the edge of the strip, Indicates The degree of interference performance of the strip edge, represents the absolute value function, is the sigmoid function, is an exponential function with a natural constant as its base.

[0027] Further, obtaining the animal edge and the suspected animal edge includes:

[0028] Preset performance thresholds , the contour expression degree is greater than The edge is recorded as the animal edge, and the contour expression degree is less than or equal to The edge is recorded as a suspected animal edge.

[0029] Furthermore, the grayscale change directions on both sides of each suspected animal edge are obtained according to the edge direction of each pixel point in the suspected animal edge, including:

[0030] First The first suspected animal on the edge The pixel point is the center, The first suspected animal on the edge The edge direction and the reverse direction of the edge of the pixel point are taken as two extension directions, and each pixel point is selected in each extension direction. pixels, the selected pixel point, denoted as The first suspected animal on the edge The left pixel of the pixel point; the pixel point selected in the opposite direction of the edge pixel point, denoted as The first suspected animal on the edge The pixel on the right side of the pixel; among them, Indicates the preset number of selected pixels;

[0031] The first The right pixel of all pixels on the edge of the suspected animal is taken as the The elements in the right area of ​​the suspected animal edge are obtained. The right area of ​​the suspected animal edge; The left pixel of all pixels on the edge of the suspected animal is taken as the first The elements in the left area of ​​the suspected animal edge are obtained. The area to the left of the suspected animal edge;

[0032] In the The direction from the maximum grayscale value to the minimum grayscale value in the left area of ​​the suspected animal edge is recorded as The grayscale change direction on the left side of the suspected animal edge; The direction from the maximum grayscale value to the minimum grayscale value in the right area of ​​the suspected animal edge is obtained and recorded as The grayscale change direction on the right side of a suspected animal edge.

[0033] Furthermore, the occlusion performance characteristics of each suspected animal edge are obtained according to the difference in grayscale change directions on both sides of each suspected animal edge, including:

[0034]

[0035] In the formula, Indicates The occlusion characteristics of the suspected animal edge, Indicates The minimum angle between the grayscale change direction on the right side and the grayscale change direction on the left side of a suspected animal edge, Represents the sigmoid function.

[0036] Further, obtaining the animal edge in the suspected animal edge includes:

[0037] Preset occlusion threshold , the occlusion performance feature is greater than The suspected animal edge is recorded as the animal edge.

[0038] The technical solution of the present invention has the following beneficial effects: when segmenting animals in an animal grayscale image, the image is divided into an animal area and a background area according to the feature that the grayscale values ​​of the pixels in the animal area and the grayscale values ​​of the pixels in the background area in the animal grayscale image are greatly different, and the grayscale values ​​of the pixels in the background area are set to 0, so that there is no edge in the background area, thereby reducing the amount of calculation when obtaining the animal edge; according to the feature that the edge in the animal contour is relatively curved, the interference expression degree of the edge in the animal contour is greater than the interference expression degree of the edge on the animal contour; according to the feature that the temperature difference between different areas on the body surface of the same animal is less than the temperature difference between different animals and the temperature difference between the animal and the background, the contour expression degree of the edge on the animal contour is greater than the contour expression degree of the edge in the animal contour; according to the feature that the temperature reduction direction of each animal is from the inside of the animal contour to the outside of the contour, the occlusion expression feature of the suspected animal edge on the contour is greater than the suspected animal edge in the contour, thereby obtaining all the edges on the animal contour, so that the animal contour obtained based on the animal contour edge is more accurate, the segmentation result is closer to the actual situation, and the accuracy of the detection result is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] 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.

[0040] Figure 1 This is a module flow chart of an intelligent animal body temperature detection system for animal husbandry and veterinary medicine of the present invention;

[0041] Figure 2 Animal temperature detection images. DETAILED DESCRIPTION

[0042] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation method, structure, characteristics and effects of an intelligent animal temperature detection system for animal husbandry and veterinary medicine proposed by the present invention are described in detail below 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.

[0043] 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.

[0044] The specific scheme of the intelligent animal body temperature detection system for animal husbandry and veterinary medicine provided by the present invention is described in detail below with reference to the accompanying drawings.

[0045] See also Figure 1 , which shows a module flow chart of an intelligent animal temperature detection system for animal husbandry and veterinary medicine provided by an embodiment of the present invention, the system includes the following modules:

[0046] Module 101: Data acquisition module, acquiring grayscale images of animals.

[0047] In this embodiment, the temperature of the animal is detected by infrared thermal imaging technology, thereby obtaining an infrared image.

[0048] Specifically, an infrared image of the animal is obtained by using an infrared camera; the infrared image of the animal is gray-scaled to obtain a gray-scale image of the animal.

[0049] Module 102: Image segmentation module: According to the grayscale value of each pixel in the animal grayscale image, the animal image is obtained, and then several edges in the animal image are obtained; according to the gradient direction and normal of each pixel in each edge, the edge direction of each pixel in each edge is obtained; the chain code of each edge and the curvature of all pixels in each edge are obtained, and the interference expression degree of each edge is obtained according to the chain code of each edge, the change of the gradient direction of the pixels in each edge and the variance of the curvature of all pixels; according to the gradient direction of each pixel in each edge, the pixels on both sides of each edge are obtained; according to the interference expression degree of each edge, the number of pixels contained and the grayscale difference of the pixels on both sides of each edge, the contour expression degree of each edge is obtained, and then the animal edge and the suspected animal edge are obtained; according to the edge direction of each pixel in the suspected animal edge, the grayscale change direction on both sides of each suspected animal edge is obtained; according to the difference in the grayscale change direction on both sides of each suspected animal edge, the occlusion expression characteristics of each suspected animal edge are obtained, and then the animal edge in the suspected animal edge is obtained, and the animal image is segmented into several animal areas through the animal edge.

[0050] It should be noted that, since the animal grayscale image contains an animal region and a background region, and only the animal in the image needs to be segmented, the background region in the animal grayscale image is removed to obtain an animal grayscale image that does not contain the background.

[0051] It should be further explained that when removing the background area in the animal grayscale image, due to the obvious temperature difference between the animal area and the background area in the infrared image, the grayscale value of the pixel point in the background area in the animal grayscale image is significantly different from the grayscale value of the pixel point in the animal area. Therefore, the Otsu threshold method is used to obtain the animal grayscale image without the background.

[0052] Specifically, the animal grayscale image is divided into two regions using the Otsu threshold method. The region with the largest average grayscale value is recorded as the animal region; the region with the smallest average grayscale value is recorded as the background region. In the animal grayscale image, the grayscale value of the pixels in the background region is set to 0 to obtain a corrected animal grayscale image. The corrected animal grayscale image is recorded as the animal image. Among them, the Otsu threshold method is a well-known technology and will not be described in detail in this embodiment.

[0053] It should be further explained that, since the present invention processes the edge detection result to segment the animals in the animal infrared image, edge detection is performed on the animal image to obtain a number of edges in the animal image.

[0054] It should be further explained that, since the animal skin surface contains spots, textures, hair and other areas, the temperature of some skin areas on the animal skin surface is different from that of the surrounding skin areas, which makes the grayscale values ​​of the pixels inside and outside some areas of an animal in the animal image different; when edge detection is performed on the image, the edges obtained include not only the edges on the animal outline, but also the edges inside the animal outline. Since only the edges on the animal outline are needed when segmenting the animal in the image, the edges inside the animal outline are removed.

[0055] It should be further explained that when removing the edges within the animal outline, since the edges within the animal outline are relatively curved, while the edges on the animal outline are relatively smooth, the curvature of each edge is calculated, and the degree of interference performance of each edge is quantified through the curvature of each edge.

[0056] It should be further explained that when calculating the interference expression degree of each edge, the change in the curvature of the pixel points on each edge reflects the curvature of each edge. Therefore, the curvature of all the pixel points on each edge is used as a parameter to calculate the interference expression degree of each edge. Since the chain code value of a pixel point on the edge represents the positional relationship between the pixel point and the next pixel point, the difference between the maximum chain code value and the minimum chain code value in an edge chain code reflects the curvature of the edge corresponding to the edge chain code. Therefore, the difference between the maximum chain code value and the minimum chain code value of all the pixel points on each edge is used as a parameter to calculate the interference expression degree of each edge. Since the angle between the normal of each pixel point on each edge and the surrounding pixel points reflects the curvature of each edge. Therefore, the interference expression degree of each edge is calculated based on the normal of each pixel point on each edge.

[0057] Specifically, edge detection is performed on the animal image using the Sobel operator to obtain a number of edges. The gradient direction of each pixel in the animal image is obtained using the Canny operator. The Sobel operator and the Canny operator are both well-known technologies and will not be described in detail in this embodiment.

[0058] Furthermore, in animal images, The first edge of the pixels, do the The normal of the edge, the two directions of the normal are recorded as The edge of the strip The suspected direction of the pixel. The edge of the strip The suspected direction with the smallest angle between the gradient directions of the pixels is recorded as The edge of the strip Get the edge direction of the pixel. Get the chain code of the edge. The curvature of each pixel in the edge of the strip is obtained The variance of the curvature of all pixel points in the edge of the strip. Wherein, obtaining the chain code and the curvature are both well-known technologies, which will not be described in detail in this embodiment.

[0059] Furthermore, according to The edge direction of each pixel in the edge, The chain code of the edge The variance of the curvature of all pixels on the edge of the strip is obtained. The specific calculation formula for the interference performance degree of the strip edge is as follows:

[0060]

[0061] In the formula, Indicates The degree of interference performance of the strip edge, Indicates The number of pixels contained in the edge of the strip, Indicates The edge of the strip The edge direction of the pixel, Indicates The edge of the strip The edge direction of the pixel, Indicates The minimum chain code value among the chain codes of the edge, Indicates The maximum chain code value among the chain codes of the edge, represents the absolute value function, Indicates The variance of the curvature of all pixels along the edge of the strip.

[0062] It should be noted that The larger the value, the The greater the curvature of the edge of the strip, the The greater the degree of interference performance of the strip edge; The larger the value, the The positional relationship between some pixels and the next pixel in the edge of the stripe is greatly different from the positional relationship between other pixels and the next pixel, which further explains the The greater the curvature of the edge of the strip, the The greater the degree of interference performance of the strip edge; The larger the value, the The curvature of the pixels at the edge of the strip changes greatly, which further explains the The greater the curvature of the edge of the strip, the The greater the interference performance of the strip edge.

[0063] It should be further explained that, since the temperature difference between different areas on the surface of the same animal is smaller than the temperature difference between different animals and the temperature difference between the animal and the background. Therefore, when removing the edges within the contour, the difference in the grayscale values ​​of the pixels on both sides of each edge is used as a parameter to calculate the contour expression degree of each edge. Since the interference expression degree of each edge reflects the curvature of each edge, and the edges within the animal contour are relatively curved, the interference expression degree of each edge is used as a parameter to calculate the contour expression degree of each edge. Since the area of ​​the area on the animal skin that is different in temperature from the surrounding area is smaller, the edge within the contour is shorter. Therefore, the number of pixels contained in each edge is used as a parameter to calculate the contour expression degree of each edge.

[0064] Specifically, in animal images, The first edge of the The pixel point is the center, The first edge of the The gradient direction of the pixel point and the opposite direction of the gradient are two extension directions, and each of the extension directions is taken pixels. The first edge of the The gradient direction of the pixel pixel point, denoted as The edge of the strip The left pixel of the pixel; The first edge of the The gradient of the pixel point is in the opposite direction pixel point, denoted as The edge of the strip The pixel to the right of the pixel. The left pixel of all pixels on the edge of the strip is recorded as The left pixel of the edge of the strip; The right pixel of all pixels on the edge of the strip is recorded as The number of selected points preset in this embodiment is , this is used as an example for description, and other implementations may be set to other values. pixels, subject to actual conditions.

[0065] Furthermore, according to The interference performance of the edge of the strip, the number of pixels contained, and the The grayscale difference of the pixels on both sides of the edge of the strip is obtained. The specific calculation formula for the contour expression degree of the edge of the strip is:

[0066]

[0067] In the formula, Indicates The degree of contour expression of the edge of the strip, Indicates The grayscale mean of all left pixels at the edge of the strip, Indicates The grayscale mean of all pixels on the right side of the edge of the strip, Indicates The number of pixels contained in the edge of the strip, Indicates The degree of interference performance of the strip edge, represents the absolute value function, is an exponential function with a natural constant as the base. The model shows an inverse proportional relationship. As the input of the model, the implementer can set the inverse proportional function according to the actual situation. represents a sigmoid function, which is used for normalization processing in this embodiment.

[0068] It should be noted that The smaller the value, the The greater the possibility that the edge is within the contour, the more likely it is that the The smaller the degree of contour expression of the strip edge; The larger the value, the The greater the difference in the grayscale values ​​of the pixels on both sides of the edge of the strip, the greater the difference in the grayscale values ​​of the pixels on both sides of the strip. The less likely the edge of the strip is to be an edge inside the contour; The smaller the value, the The smaller the probability that the edge is within the contour, the smaller the probability that the edge is within the contour. The greater the degree of contour expression of the strip edge.

[0069] Furthermore, a preset performance threshold , the contour expression degree is greater than The edge is recorded as the animal edge, and the contour expression degree is less than or equal to The edge is recorded as a suspected animal edge. The performance threshold preset in this embodiment , this is used as an example for description, and other values ​​may be set in other implementation modes.

[0070] It should be further explained that, due to the dense distribution of animals in the farm, occlusion and overlap between individuals in the infrared image are very common. In addition, since the temperature difference between some animals and overlapping animals may be close to the temperature difference between different areas on the skin of an animal, the contour expression of some edges on the contour is smaller than that of other edges on the contour. As a result, if the expression threshold is set too high, some edges on the contour may be regarded as suspected animal edges. Therefore, the animal edge is obtained from the suspected animal edge.

[0071] It should be further explained that due to the occlusion of the animal, some edges on the contour are regarded as suspected animal edges. Therefore, the occlusion performance feature of each suspected animal edge is calculated, and the animal edge in the suspected animal edge is obtained according to the occlusion performance feature of each suspected animal edge.

[0072] It should be further explained that when obtaining the occlusion performance characteristics of the edge of a suspected animal, the temperature of an area on the animal's skin has a strong relationship with the distance between the area and the animal's outline, that is, the direction of temperature reduction of each animal is from the inside of the animal's outline to the outside of the animal's outline. This makes the difference in the direction of change of the grayscale value of the pixels on both sides of the edge on the outline different from the difference in the direction of change of the grayscale value of the pixels on both sides of the edge inside the outline. Therefore, the occlusion performance characteristics of each suspected animal edge are calculated based on the change in the grayscale value of the pixels on both sides of each suspected animal edge.

[0073] Specifically, The first suspected animal on the edge The pixel point is the center, The first suspected animal on the edge The edge direction and the reverse direction of the edge of the pixel point are taken as two extension directions, and each pixel point is selected in each extension direction. pixels, the selected pixel point, denoted as The first suspected animal on the edge The left pixel of the pixel point; the pixel point selected in the opposite direction of the edge pixel point, denoted as The first suspected animal on the edge The number of selected pixels preset in this embodiment is , this is used as an example for description, and other implementations may be set to other values. pixels, subject to actual conditions.

[0074] Furthermore, The right pixel of all pixels on the edge of the suspected animal is taken as the The elements in the right area of ​​the suspected animal edge are obtained. The right area of ​​the suspected animal edge; The left pixel of all pixels on the edge of the suspected animal is taken as the first The elements in the left area of ​​the suspected animal edge are obtained. The area to the left of the suspected animal edge. The direction from the maximum grayscale value to the minimum grayscale value in the left area of ​​the suspected animal edge is recorded as The grayscale change direction on the left side of the suspected animal edge; The direction from the maximum grayscale value to the minimum grayscale value in the right area of ​​the suspected animal edge is obtained and recorded as The grayscale change direction on the right side of a suspected animal edge.

[0075] Furthermore, according to The right grayscale change direction and the left grayscale change direction of the suspected animal edge are obtained. The specific calculation formula for the occlusion performance characteristics of a suspected animal edge is as follows:

[0076]

[0077] In the formula, Indicates The occlusion characteristics of the suspected animal edge, Indicates The minimum angle between the grayscale change direction on the right side and the grayscale change direction on the left side of a suspected animal edge, represents a sigmoid function, which is used for normalization processing in this embodiment.

[0078] It should be noted that The smaller the value, the The smaller the difference in temperature change direction on both sides of the edge of the suspected animal, the smaller the difference in temperature change direction on both sides of the edge of the suspected animal, which further indicates that The greater the possibility that the two sides of the suspected animal edge are different areas on the skin of the same animal, the greater the possibility that the The stronger the occlusion characteristics of the suspected animal edge.

[0079] Furthermore, the occlusion threshold is preset , the occlusion performance feature is greater than The suspected animal edge is recorded as the animal edge. The occlusion threshold preset in this embodiment is , this is used as an example for description, and other values ​​may be set in other implementation modes.

[0080] Further, all contours in the animal image are obtained according to all animal edges in the animal image. According to the contours in the animal image, the animals in the animal infrared image are segmented. Among them, obtaining the animal contours according to the edges in the animal image is not the focus of this embodiment and will not be described in detail in this embodiment.

[0081] Module 103: Body temperature detection module: obtains the animal's body temperature and performs body temperature detection according to the segmented animal area.

[0082] Specifically, the body temperature of each animal region is calculated based on the temperature distribution within each contour, and the body temperature of the animal is tested based on the body temperature of each animal region. The test results are as follows: Figure 2 As shown. According to the temperature distribution in the contour, obtaining the body temperature of the animal area is a well-known technology, which will not be described in detail in this embodiment. According to the body temperature of the animal area, the temperature of the animal is detected, which is not the focus of this embodiment, and will not be described in detail in this embodiment.

[0083] At this point, this embodiment is completed.

[0084] To sum up, in the embodiments of the present invention, 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 principles of the present invention should be included in the protection scope of the present invention.

Claims

1. An intelligent animal temperature detection system for animal husbandry and veterinary medicine, characterized in that: The system includes the following modules: Data acquisition module: used to obtain grayscale images of animals; Image segmentation module: used to obtain the animal image according to the gray value of each pixel in the animal gray image, and then obtain several edges in the animal image; obtain the edge direction of each pixel in each edge according to the gradient direction and normal of each pixel in each edge; obtain the chain code of each edge and the curvature of all pixels in each edge, and obtain the interference performance degree of each edge according to the chain code of each edge, the change of the gradient direction of the pixels in each edge and the variance of the curvature of all pixels; obtain the pixels on both sides of each edge according to the gradient direction of each pixel in each edge; obtain the contour performance degree of each edge according to the interference performance degree of each edge, the number of pixels contained and the gray difference of the pixels on both sides of each edge, and then obtain the animal edge and the suspected animal edge; obtain the gray change direction on both sides of each suspected animal edge according to the edge direction of each pixel in the suspected animal edge; obtain the occlusion performance characteristics of each suspected animal edge according to the difference in the gray change direction on both sides of each suspected animal edge, and then obtain the animal edge in the suspected animal edge, and divide the animal image into several animal areas through the animal edge; Body temperature detection module: used to obtain the animal's body temperature and perform body temperature detection according to the segmented animal area; The interference performance degree of each edge is obtained according to the chain code of each edge, the change of the gradient direction of the pixel points in each edge, and the variance of the curvature of all the pixel points, including: In the formula, Indicates The degree of interference performance of the strip edge, Indicates The number of pixels contained in the edge of the strip, Indicates The edge of the strip The edge direction of the pixel, Indicates The edge of the strip The edge direction of the pixel, Indicates The minimum chain code value among the chain codes of the edge, Indicates The maximum chain code value among the chain codes of the edge, represents the absolute value function, Indicates The variance of the curvature of all pixels on the edge of the strip; The step of obtaining pixel points on both sides of each edge includes: In animal images, The first edge of the The pixel point is the center, The first edge of the The gradient direction of the pixel point and the opposite direction of the gradient are two extension directions, and each of the extension directions is taken pixels; among them, Indicates the number of preset selection points; The first The first edge of the The gradient direction of the pixel pixel point, denoted as The edge of the strip The left pixel of the pixel; The first edge of the The gradient of the pixel point is in the opposite direction pixel point, denoted as The edge of the strip The pixel on the right side of the pixel; The first The left pixel of all pixels on the edge of the strip is recorded as The left pixel of the edge of the strip; The right pixel of all pixels on the edge of the strip is recorded as The right pixel of the strip edge; The contour expression degree of each edge is obtained according to the interference expression degree of each edge, the number of pixels contained therein, and the grayscale difference of pixels on both sides of each edge, including: In the formula, Indicates The degree of contour expression of the edge of the strip, Indicates The grayscale mean of all left pixels at the edge of the strip, Indicates The grayscale mean of all pixels on the right side of the edge of the strip, Indicates The number of pixels contained in the edge of the strip, Indicates The degree of interference performance of the strip edge, represents the absolute value function, is the sigmoid function, is an exponential function with a natural constant as its base.

2. The animal body temperature intelligent detection system for animal husbandry and veterinary medicine according to claim 1 is characterized in that: The step of obtaining the animal image according to the grayscale value of each pixel in the animal grayscale image comprises: The animal grayscale image was divided into two regions using the Otsu threshold method; the region with the largest average grayscale value was recorded as the animal region; the region with the smallest average grayscale value was recorded as the background region; In the animal grayscale image, the grayscale value of the pixel in the background area is set to 0 to obtain the corrected animal grayscale image; The corrected animal grayscale image is recorded as the animal image.

3. The animal body temperature intelligent detection system for animal husbandry and veterinary medicine according to claim 1 is characterized in that: The step of obtaining the edge direction of each pixel point in each edge according to the gradient direction and the normal of each pixel point in each edge includes: In animal images, The first edge of the pixels, do the The normal of the edge, the two directions of the normal are recorded as The edge of the strip The suspected direction of the pixel; Will be with The edge of the strip The suspected direction with the smallest angle between the gradient directions of the pixels is recorded as The edge of the strip The edge direction of each pixel.

4. The animal body temperature intelligent detection system for animal husbandry and veterinary medicine according to claim 1 is characterized in that: The obtaining of animal edges and suspected animal edges comprises: Preset performance thresholds , the contour expression degree is greater than The edge is recorded as the animal edge, and the contour expression degree is less than or equal to The edge is recorded as a suspected animal edge.

5. The animal body temperature intelligent detection system for animal husbandry and veterinary medicine according to claim 1 is characterized in that: The method of obtaining the grayscale change directions on both sides of each suspected animal edge according to the edge direction of each pixel point in the suspected animal edge includes: First The first suspected animal on the edge The pixel point is the center, The first suspected animal on the edge The edge direction and the reverse direction of the edge of the pixel point are taken as two extension directions, and each pixel point is selected in each extension direction. pixels, the selected pixel point, denoted as The first suspected animal on the edge The left pixel of the pixel point; the pixel point selected in the opposite direction of the edge pixel point, denoted as The first suspected animal on the edge The pixel on the right side of the pixel; among them, Indicates the preset number of selected pixels; The first The right pixel of all pixels on the edge of the suspected animal is taken as the The elements in the right area of ​​the suspected animal edge are obtained. The right area of ​​the suspected animal edge; The left pixel of all pixels on the edge of the suspected animal is taken as the The elements in the left area of ​​the suspected animal edge are obtained. The area to the left of the suspected animal edge; In the The direction from the maximum grayscale value to the minimum grayscale value in the left area of ​​the suspected animal edge is recorded as The grayscale change direction on the left side of the suspected animal edge; The direction from the maximum grayscale value to the minimum grayscale value in the right area of ​​the suspected animal edge is obtained and recorded as The grayscale change direction on the right side of a suspected animal edge.

6. The animal body temperature intelligent detection system for animal husbandry and veterinary medicine according to claim 5, characterized in that: The occlusion performance characteristics of each suspected animal edge are obtained according to the difference in the grayscale change direction on both sides of each suspected animal edge, including: In the formula, Indicates The occlusion characteristics of the suspected animal edge, Indicates The minimum angle between the grayscale change direction on the right side and the grayscale change direction on the left side of a suspected animal edge, Represents the sigmoid function.

7. The animal body temperature intelligent detection system for animal husbandry and veterinary medicine according to claim 1 is characterized in that: The step of obtaining the animal edge in the suspected animal edge comprises: Preset occlusion threshold , the occlusion performance feature is greater than The suspected animal edge is recorded as the animal edge.