Livestock farm safety management method and system based on video monitoring
By analyzing salient pixels and texture complexity in livestock farm monitoring videos, calculating the static and dynamic saliency of CTU blocks, and assigning an appropriate bitrate to each CTU block, the problem of foreground blurring in the HEVC method is solved, achieving efficient and accurate video compression and real-time security management.
Patent Information
- Application Number
- CN202511532210.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-24
- Publication Date
- 2026-01-23
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing HEVC video compression methods fail to effectively incorporate human eye characteristics, resulting in blurred outlines and loss of head features in foreground areas (such as livestock) in livestock farm monitoring videos, affecting the accuracy and real-time performance of intelligent analysis.
By analyzing salient pixels and texture complexity in video images, the static and dynamic salientity of each CTU block is calculated. Different bitrates are assigned to each CTU block, and combined with centroid coordinates and motion displacement, efficient encoding and compression of video images is achieved.
It improves video compression efficiency, retains high-quality data in key areas, reduces bandwidth consumption, ensures the real-time performance and accuracy of livestock farm video monitoring, and promptly detects potential safety hazards.
Smart Images

Figure CN121397264A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of video monitoring, in particular to a livestock farm safety management method and system based on video monitoring. BACKGROUND
[0002] With the transformation of the livestock industry to intensive and large-scale, the breeding scale of large-scale pig farms, cattle farms and other livestock farms is rapidly expanding. The safety management according to the small-scale inspection method cannot meet the requirements. The intelligent management based on video monitoring has become the mainstream solution. Through the deployment of high-definition cameras, the livestock farm environment, animal behavior, and personnel operation are monitored in real time. The safety management functions such as abnormal behavior recognition and disease warning provide technical support for efficient safety management of livestock farms.
[0003] However, the livestock farm video monitoring has the characteristics of wide coverage, long duration, and multi-device concurrency. The massive high-definition video needs to occupy a large amount of storage resources. High storage video also causes transmission delay, affecting the real-time performance of video monitoring intelligent analysis. An efficient video compression method is of great significance to reduce the storage cost of livestock farm video and ensure the accuracy and real-time performance of intelligent safety analysis.
[0004] At present, a relatively efficient high-definition video compression method is the HEVC method. However, in the monitoring video, the human eye will focus on the foreground area, and the perception of the background area is not obvious. For example, in the livestock farm, livestock animals belong to the foreground area, which represents the key attention area of the human eye, while the wall and the ground belong to the background area. The HEVC coding standard does not combine the human eye characteristics for coding. If uniform coding parameters are set, the livestock animal contour may be blurred, and the key area such as the head feature may be lost, which affects the accuracy of subsequent intelligent analysis of the monitoring video and makes the safety management effect of the livestock farm less than ideal. SUMMARY
[0005] In order to solve the above technical problems, the purpose of the present application is to provide a livestock farm safety management method and system based on video monitoring. The technical solution adopted is as follows: In the first aspect, the embodiments of the present application provide a livestock farm safety management method based on video monitoring, which comprises the following steps: Collecting the monitoring video of the livestock farm, and dividing each frame of video image into each CTU block; Marking the pixel points corresponding to the target objects in each frame of video image as significant pixel points; analyzing the edge texture features of the pixel points in each CTU block and the degree of confusion of the pixel value distribution in the CTU block to determine the static significance of each CTU block; determining a gray scale variation degree of each pixel point in each frame of video image and its adjacent frame of video image; analyzing the gray scale variation degree and local density of each coordinate point in each frame of video image and its adjacent coordinate point, and combining the distance between coordinate points to obtain a motion pixel aggregation degree of each coordinate point in each frame of video image; determining a center of mass coordinate of the target object in each frame of video image and a motion displacement thereof, and obtaining a dynamic saliency degree of each CTU block by combining a motion displacement difference of the center of mass coordinate of the target object in each CTU block and the center of mass coordinates of the remaining target objects in the same video image, and combining the motion pixel aggregation degree of the position corresponding to the salient pixel point in each CTU block; combining the static saliency degree and the dynamic saliency degree to determine a saliency weight of each CTU block, allocating a code rate to each CTU block, and encoding and compressing the video image for safe management of the livestock farm.
[0006] In one embodiment, the determination of the static saliency degree of each CTU block comprises: performing edge detection on each frame of video image to determine a fusion result of the modulus of the horizontal direction gradient and the vertical direction gradient of all edge pixel points in each CTU block, and counting a quantity proportion of salient pixel points in each CTU block; combining the fusion result, the quantity proportion, and the confusion degree to obtain the static saliency degree of each CTU block.
[0007] In one embodiment, the static saliency degree is positively correlated with the fusion result, the quantity proportion, and the confusion degree.
[0008] In one embodiment, the static saliency degree is a multiplication result of the fusion result, the quantity proportion, and the confusion degree.
[0009] In one embodiment, the determination of the motion pixel aggregation degree of each coordinate point in each frame of video image comprises: calculating a product of the gray scale variation degree and the local density of each coordinate point in each frame of video image, summing the product of each coordinate point and the coordinate points in its neighborhood, and counting a metric distance of each coordinate point and the coordinate points in its neighborhood. The motion pixel aggregation degree of each coordinate point is positively correlated with the summing result and negatively correlated with the metric distance.
[0010] In one embodiment, the further determination of the motion pixel aggregation degree comprises: calculating a ratio of the summing result and the metric distance, fusing the ratio of each coordinate point and all coordinate points in its neighborhood to obtain the motion pixel aggregation degree.
[0011] In one embodiment, the dynamic saliency of each CTU block is obtained by: The motion displacement is the displacement of the centroid coordinates of the target object in each frame of video image relative to the centroid coordinates of the target object in the previous frame of video image. The similarity is the similarity between the direction of the motion displacement of the centroid coordinates of the target object to which the CTU block belongs and the direction of the motion displacement of the centroid coordinates of the remaining target objects in the same frame of video image. The difference is the difference between the natural number 1 and the similarity, and the fusion value of the difference between the target object to which the CTU block belongs and all the remaining target objects in the same frame of video image is determined, and the motion displacement of the centroid coordinates of the target object to which the CTU block belongs is normalized. The mean value of the motion pixel aggregation degree of all the pixel points in each CTU block is calculated, and the dynamic saliency of each CTU block is determined by using the mean value, the fusion value and the normalized result.
[0012] In one embodiment, the dynamic saliency is the product of the mean value, the fusion value and the normalized result of each CTU block.
[0013] In one embodiment, the saliency weight of each CTU block is determined by the following expression: In the expression, the saliency weight of the i-th CTU block is the preset weight coefficient of the i-th CTU block, the static saliency of the i-th CTU block, the dynamic saliency of the i-th CTU block, and the dynamic saliency of the i-th CTU block, wherein .
[0014] In a second aspect, the embodiments of the present application further provide a livestock farm safety management system based on video monitoring, which comprises a memory, a processor and a computer program stored in the memory and running on the processor, and the processor implements the steps of the method described in any one of the above aspects when executing the computer program.
[0015] The present application has at least the following beneficial effects: The application calculates the static saliency of each CTU block by analyzing the salient pixel points and texture complexity in the video image, accurately identifies the key area in the image, especially the static features of the target object, and the static saliency reflects the information importance of each CTU block in the frame video image, which provides a reliable basis for subsequent video image compression code rate allocation. The area with higher information importance in the single frame video image obtains greater code rate allocation weight, which guarantees efficient compression while ensuring the quality of the video image, so that the key scene in the livestock farm can be better focused in the monitoring process. Further, when analyzing each frame of video image, the motion information of the dynamic target can be accurately captured by comparing the gray scale change degree and local density of adjacent frame pixel points, and the motion aggregation degree of the target can be judged by combining the distance between coordinate points, which provides a reliable basis for real-time tracking of activities in the livestock farm, helps to timely discover abnormal motion behaviors and warn potential safety hazards. By calculating the centroid coordinates and motion displacement of the target object, the dynamic change of the target object can be tracked more accurately, and the dynamic saliency analysis of the target object is further improved by combining the position of the salient pixel points in the CTU block and the motion pixel aggregation degree, which helps to understand the motion trajectory of the target object in the livestock farm in real time, so as to make more timely safety decisions; by allocating different code rates to each CTU block, the video image can effectively retain high-quality data in the key area during compression, while reducing the data transmission amount of the unimportant part, which significantly improves the video compression efficiency, not only reduces the bandwidth consumption, but also ensures that the livestock farm video monitoring can still run efficiently under the limited storage and transmission bandwidth, avoiding the storage pressure caused by data redundancy in traditional video monitoring, so that the safety management of the livestock farm is more efficient. BRIEF DESCRIPTION OF DRAWINGS
[0016] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present application or the prior art, the drawings needed in the following embodiment or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.
[0017] Figure 1 The step flow chart of the livestock farm safety management method based on video monitoring provided by an embodiment of the present application is shown in the figure. Figure 2 The salient weight determination flow chart for the CTU block is shown in the figure. DETAILED DESCRIPTION
[0018] In order to further illustrate the technical means and effects taken by the present application to achieve the predetermined object, the specific implementation, structure, features and effects of the video monitoring based livestock farm safety management method and system according to the present application are described in detail below in combination with the drawings and preferred embodiments. 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.
[0019] Unless otherwise defined, 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 application belongs.
[0020] The specific scheme of the video monitoring based livestock farm safety management method and system provided by the present application is described below in combination with the drawings.
[0021] Please refer to Figure 1 which shows the step flowchart of the video monitoring based livestock farm safety management method provided by one embodiment of the present application, which includes the following steps: S1, collecting the monitoring video of the livestock farm, and dividing each frame video image into CTU blocks after pre-processing each frame monitoring video.
[0022] For the safety management of the livestock farm, the present embodiment takes a pig farm as an example for analysis. Specifically, one panoramic high-definition camera is arranged in each pig house to collect pig video data, and the frame rate is 25 FPS, which can be set by the implementer according to the actual situation. The arrangement position and angle of the high-definition camera can be adjusted according to the pig house situation to ensure that each corner of the pig house can be completely and clearly monitored.
[0023] When compressing the video image, the YUV format of the video image is mainly processed, and the original video collected by the camera in RGB format needs to be converted into YUV format. Dust may appear in the air in the actual pig farm, which may cause the collected video image to contain salt and pepper noise. In the present embodiment, an adaptive median filter method is used to remove the salt and pepper noise of the YUV format video image, wherein the filter window is set to 3x3, and the size of the filter window can be set by the implementer according to the actual situation. Uneven illumination in the pig house may cause the details of the collected video image to be blurred, so in the present embodiment, the denoised video image is used as input, and a limited contrast adaptive histogram equalization method is used to eliminate the influence of uneven illumination, and an evenly illuminated video image is output. The video YUV format conversion, adaptive median filter method and limited contrast adaptive histogram equalization method are all known technologies, and the specific process will not be described again. The implementer can pre-process the collected video image according to the actual situation.
[0024] Each frame of video image is equally divided into CTU blocks, i.e. tree coding units, wherein the size of each CTU block is 16x16, and the implementer can set it according to the actual situation, which is not limited in the embodiment.
[0025] S2, mark the pixel points corresponding to the target objects in each frame of video image as significant pixel points; analyze the edge texture features of the pixel points in each CTU block and the confusion degree of the pixel value distribution in the CTU block to determine the static saliency of each CTU block.
[0026] Video images contain a large amount of information, and the data volume is also huge. If the video images are not compressed, the video images will consume more time and resources in the process of transmission, storage and processing. The HEVC method is a relatively efficient video image compression method, which can significantly reduce the bit rate under the same video quality. However, the code rate control algorithm of the method does not consider the viewing experience of the human eye on the salient region, resulting in that the attention of the human eye on the saliency region cannot be effectively utilized in the video compression process, and the requirement of focusing on the saliency region and the background region with unobvious perception cannot be met. For example, the pigs in the pig farm belong to the foreground saliency region, and the pig house wall and the ground belong to the background non-saliency region. If a uniform code rate is set, the pig outline may be blurred, and the key region such as the head feature may be lost. Therefore, the pig with higher saliency in the video image needs to have a larger code rate allocation weight during compression to avoid distortion of the saliency region in the compressed video. The saliency region can be divided into intra-frame static saliency region and inter-frame dynamic saliency region. A larger code rate allocation weight is allocated to each pixel in the saliency region to ensure the quality of the pig video image after compression.
[0027] The intra-frame static saliency region is mainly the region where the pigs are located. Intelligent analysis of the disease condition of the pigs requires capturing subtle abnormalities of the pigs, including whether the eyes are swollen, facial state, whether there are spots on the skin, skin state, and the like. These subtle features require the video to be compressed clearly and retained. The pig facial state usually has complex texture, and the skin state also increases the texture complexity when the disease occurs. The texture complex region contains more information, so the code rate allocation weight of the pixels in the texture complex region in the saliency region should be larger to ensure that the video image is compressed to retain clearer disease features.
[0028] Specifically, each pre-processed frame of video image is taken as input, and an instance segmentation technique is used to segment each pig in the video image. In this embodiment, the instance segmentation technique adopts Mask R-CNN, and implementers can select other existing instance segmentation techniques such as SegFormer method. Each pixel point corresponding to each pig segmented in each frame of video image is marked as a significant pixel point. The number of significant pixel points contained in each CTU block is analyzed. The more the number of significant pixel points, the greater the CTU block rate allocation weight should be. The more complex the texture features in the CTU block, the more detailed feature information it contains. The higher the degree of pixel value confusion in the CTU block, and the greater the gradient of texture pixel points in each direction.
[0029] Based on the above analysis, the Canny edge detection algorithm is used to perform edge detection on each frame of video image to obtain each edge pixel point in each frame of video image. Then, the Sobel operator is used to calculate the gradient of each edge pixel point in the horizontal direction and the vertical direction. The Canny edge detection algorithm and the Sobel operator are both known techniques, and the specific process will not be described again.
[0030] First, the static significance of each CTU block is calculated to represent the significance of the region of interest, specifically: The fusion result of the modulus of the horizontal direction gradient and the vertical direction gradient of all edge pixel points in each CTU block is determined, and the proportion of the number of significant pixel points in each CTU block is counted. The static significance of each CTU block is positively correlated with the fusion result, the number proportion, and the confusion degree.
[0031] It should be noted that fusion means combining multiple variables, which can be calculated by addition, multiplication, addition-multiplication mixing, mean value calculation, etc. The confusion degree can be calculated by information entropy, variance, standard deviation, etc.
[0032] In this embodiment, the expression of the static significance of each CTU block is: In the formula, represents the static significance of the i-th CTU block, represents the number of significant pixel points contained in the i-th CTU block, represents the total number of pixel points in the i-th CTU block, represents the proportion of the number of significant pixel points in the i-th CTU block, represents the total number of edge pixel points in the i-th CTU block, represents the proportion of the number of significant pixel points in the i-th CTU block, represents the total number of edge pixel points in the i-th CTU block, represents the proportion of the number of significant pixel points in the i-th CTU block, represents the total number of edge pixel points in the i-th CTU block, represents the proportion of the number of significant pixel points in the i-th CTU block, represents the total number of edge pixel points in the i-th CTU block, information entropy of all pixel gray values in the CTU block, represent the first edge pixel, , represent the first edge pixel gradient along the horizontal direction and along the vertical direction respectively, represent the modulo operation, the more the significant pixels in the CTU block, the more complex the texture features, the greater the average gradient of the edge pixels, and the more the detail information, the greater the value, that is, the higher the static saliency of the first CTU block.
[0033] S3, determining the gray scale change degree of the same position pixel points in each frame of video image and its adjacent frame of video image; analyzing the gray scale change degree and the local density of each coordinate point and its adjacent coordinate point in each frame of video image, and combining the distance between the coordinate points to obtain the motion pixel aggregation degree of each coordinate point in each frame of video image.
[0034] Further analyze the saliency of the moving pigs. The human eye has the characteristics of being highly sensitive to moving objects. The more intense the movement, the higher the attention. In the pig house, the moving target usually has a higher saliency. By capturing the motion characteristics of the pigs, the health status of the pigs can be analyzed. For example, when the pigs are anxious in the heart or infected with arthritis, they often isolate themselves from other pigs, which may be due to the avoidance behavior caused by pain.
[0035] Analyze the motion of the pigs in the monitoring video image. Specifically, each frame of video image is taken as input, and the frame difference method is used to calculate the pixel value difference between the same position in the current frame of video image and the previous frame of video image. If the pixel value in the region does not change, that is, in the static state, the difference is 0. If the pixel value in the region changes, that is, the pig moves, the difference is not equal to 0. The matrix composed of the pixel value differences corresponding to all pixel point positions in the current frame of video image is denoted as the change degree matrix. Each pixel point in the video image corresponds to a position coordinate. If the motion state of the pig in a certain region of the video image changes, there are more non-zero values in the change degree matrix position corresponding to the region, that is, the pixel value difference density is higher. Taking the absolute value of each value in the change degree matrix reflects the change degree of the pixel value of the corresponding coordinate point, and the positive change degree matrix is denoted as the positive change degree matrix. The value corresponding to each coordinate point in the positive change degree matrix is denoted as the gray scale change degree. The positive change degree matrix is taken as the input of the density peak clustering algorithm, the absolute value of the difference between the values corresponding to each coordinate point in the positive change degree matrix is taken as the distance between the coordinate points in the density peak clustering algorithm, and the local density of each coordinate point in the positive change degree matrix is output. The density peak clustering algorithm is a known technology, and the specific process is not described here.
[0036] Based on the above analysis, the embodiment calculates the motion pixel aggregation degree of each coordinate point in each frame of video image, which is used to represent the pixel change degree of the motion target region in the video image, and the specific expression is as follows: ; in the formula, motion pixel aggregation degree of the i-th coordinate point in each frame of video image, motion pixel aggregation degree of the i-th coordinate point in each frame of video image, number of coordinate points adjacent to the i-th coordinate point in each frame of video image, in the embodiment, , , local density of the i-th coordinate point, the i-th coordinate point adjacent to the i-th coordinate point in the corresponding positive change degree matrix in each frame of video image, , , , corresponding gray change degree of the i-th coordinate point, the i-th coordinate point adjacent to the i-th coordinate point in each frame of video image, , , calculation of metric distance, , position coordinates of the i-th coordinate point, the i-th coordinate point adjacent to the i-th coordinate point in each frame of video image, the greater the target motion degree in the video image, the more the non-zero coordinate points in the positive change degree matrix, the higher the coordinate point density, and the greater the corresponding gray change degree, , , the greater the value, the higher the motion pixel aggregation degree in the video image. In the embodiment, the metric distance is calculated by using the Euclidean distance, and the implementer can select other feasible calculation methods of metric distance, which is not limited in the embodiment.
[0037] S4, determine the center of mass coordinates of the target object in each frame of video image and the motion displacement, obtain the dynamic saliency of each CTU block by the motion displacement difference of the center of mass coordinates of each CTU block belonging to the target object and the center of mass coordinates of the remaining target objects in the same video image, and the motion pixel aggregation degree of the corresponding position of the significant pixel points in each CTU block.
[0038] In addition, the motion state of the center of mass can reflect the motion state of the whole target, and the displacement of the center of mass of the pig can approximately describe the motion trend of the pig. In the embodiment, the position coordinates of the center of mass of the pig in each frame of video image are obtained, the motion distance and direction of the pig are determined according to the position coordinates of the center of mass of the pig in the current frame and the previous frame of video image, and the motion displacement of the position coordinates of the center of mass of each pig in the current frame of video image is formed. The farther the motion distance of the pig in unit time, the greater the motion amplitude of the pig, and the more abnormal the behavior, such as the motion direction deviating from the group. According to the human eye characteristics, such targets should be more easily paid attention to, that is, the saliency is higher. The acquisition of the position coordinates of the center of mass is a known technology, and the specific process is not described herein.
[0039] In combination with the above analysis, in the embodiment, the motion state of the center of mass is used to represent the motion state of the salient pixel points in the region where the pig is located, that is, the difference degree of each center of mass and the offset distance and direction of all other centers of mass is calculated, and the difference degree of the center of mass is used to represent the difference degree of each salient pixel point in the whole pig region. The dynamic saliency of each CTU block is further calculated to represent the saliency of the moving target in the video image, and the specific process is as follows: The similarity of the direction of the motion displacement of the center of mass coordinates of each CTU block belonging to the target object and the direction of the motion displacement of the center of mass coordinates of the remaining target objects in the same frame of video image is calculated. In the embodiment, the target object is a pig, and the similarity is calculated by using the cosine similarity in the embodiment. The implementer can select other feasible similarity calculation methods, and the embodiment does not limit this.
[0040] The expression of the dynamic saliency of each CTU block in the embodiment is as follows: In the formula, S (i) represents the dynamic saliency of the i-th CTU block, S (i) represents the dynamic saliency of the i-th CTU block, S (i) represents the dynamic saliency of the i-th CTU block, S (i) represents the dynamic saliency of the i-th CTU block, S (i) represents the dynamic saliency of the i-th CTU block, S (i) represents the dynamic saliency of the i-th CTU block, S (i) represents the dynamic saliency of the i-th CTU block, S (i) represents the dynamic saliency of the i-th CTU block, S (i) represents the dynamic saliency of the i-th CTU block, S (i) represents the dynamic saliency of the i-th CTU block, S (i) represents the dynamic saliency of the i-th CTU block, S (i) represents the dynamic saliency of the i-th CTU block, S (i) represents the dynamic saliency of the i-th CTU block, S (i) represents the dynamic saliency of the i-th CTU block, When the value is 0, a preset value greater than 0 is added to the denominator to avoid the denominator being 0. In this embodiment, the preset value greater than 0 is set to 0.01. , They represent the first The direction of the motion displacement of the centroid of the pig region to which each CTU block belongs, the first The remaining CTU block in the video image The direction of displacement of the center of mass This indicates the calculation of cosine similarity. Indicates the first The difference between the centroid of the pig region containing the salient pixels in a CTU block and the centroids of other pixels in the video image. The greater the pig's movement displacement and the more abnormal the displacement direction, the greater the difference of the salient pixels and the greater the concentration of moving pixels. The greater the dynamic salience of the CTU block, the more attention should be paid to this region, and the higher the salience.
[0041] It should be noted that if the first The CTU block does not belong to any pig's area, that is, the first CTU block. If the first CTU block is the background area, then the first... If the dynamic saliency of the CTU block is set to 0, then the... If multiple CTU blocks intersect in a multi-pig area, then the pig with the largest pig area contained in the i-th CTU block is determined to be the pig area to which the i-th CTU block belongs.
[0042] S5. Combining the static saliency and the dynamic saliency, determine the saliency weight of each CTU block, allocate a bitrate to each CTU block, and encode and compress the video image for use in livestock farm safety management.
[0043] Based on the above analysis of the static and dynamic saliency of each CTU block, regions with higher saliency should have greater resource allocation weights and be allocated more bit resources to avoid image distortion and loss of key pig features after video compression. Therefore, the saliency weight of each CTU block is calculated using the following expression: In the formula, The significance weight of the i-th CTU block is... The preset weighting coefficients for the i-th CTU block are: Let be the static significance of the i-th CTU block. Let be the dynamic significance of the i-th CTU block, where Based on the characteristics of the human eye, which is more sensitive to moving targets than to static targets, this embodiment preferably sets... The value is 0.4, which implementers can set according to their actual situation. Higher saliency in the CTU block results in higher resource allocation weight, preventing the loss of important features. The flowchart for determining the saliency weight of the CTU block is as follows: Figure 2 As shown.
[0044] Significant weights for each CTU block As input, the Lagrange multipliers of each CTU block are solved using a saliency-based rate control algorithm. ,Sure Subsequently, the compression quantization coefficients of each CTU were calculated using the original HEVC algorithm's bitrate allocation method. This was then used to allocate bitrates based on salient features, with higher salient values allocated more bitrate. Finally, video image compression was completed using HEVC technology. The bitrate control algorithm based on salient values solves for the Lagrange multipliers. The HEVC algorithm bitrate allocation method and video image compression based on HEVC technology are both existing well-known technologies, and the specific process will not be described in detail.
[0045] The safety management backend of the livestock farm receives the compressed video image bitstream and decodes it into original video frames. The decoded video frames are used as input, and a pre-trained pig behavior state recognition algorithm is used to identify the behavioral characteristics of the pigs, such as YOLOV8, 3D-CNN, etc. In this embodiment, YOLOV8 is used to identify abnormal pig behavior and trigger an early warning, notifying the management personnel to check the health status of the pigs in a timely manner. The decoded compressed video image bitstream and the behavior state recognition algorithm are existing known technologies, and the specific implementation process will not be described in detail.
[0046] Based on the same inventive concept as the above methods, this application also provides a livestock farm safety management system based on video surveillance, 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-described livestock farm safety management methods based on video surveillance.
[0047] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, specific embodiments of this specification have been described above. Additionally, the processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired results. In some implementations, multitasking and parallel processing are possible or may be advantageous.
[0048] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
[0049] The above description is only the preferred embodiment of the present application, and is not used to limit the present application, any modification, equivalent replacement, improvement, etc. made within the principle of the present application should be included in the protection scope of the present application.
Claims
1. A livestock farm safety management method based on video surveillance, characterized in that, The method includes the following steps: Collect surveillance video from the livestock farm and divide each frame of video image into CTU blocks; The pixels corresponding to the target objects in each frame of video image are marked as salient pixels; the edge texture features of pixels in each CTU block and the degree of disorder in the distribution of pixel values in the CTU block are analyzed to determine the static saliency of each CTU block. Determine the grayscale variation of pixels at the same position in each frame of video image and its adjacent frames; analyze the grayscale variation and local density of each coordinate point in each frame of video image and its adjacent coordinate points, and combine the distance between coordinate points to obtain the motion pixel aggregation degree of each coordinate point in each frame of video image. Determine the centroid coordinates and motion displacement of the target objects in each frame of video image. By comparing the motion displacement difference between the centroid coordinates of the target objects in each CTU block and the centroid coordinates of other target objects in the same video image, and combining the motion pixel clustering degree of the corresponding positions of the salient pixels in each CTU block, obtain the dynamic saliency of each CTU block. By combining the static saliency and the dynamic saliency, the saliency weight of each CTU block is determined, the bitrate is assigned to each CTU block, and the video image is encoded and compressed for use in livestock farm safety management.
2. The livestock farm safety management method based on video surveillance as described in claim 1, characterized in that, Determining the static saliency of each CTU block includes: Edge detection is performed on each frame of video image to determine the fusion result of the magnitudes of the horizontal and vertical gradients of all edge pixels in each CTU block, and the proportion of significant pixels in each CTU block is counted. By combining the fusion results, the quantity ratio, and the degree of disorder, the static saliency of each CTU block is obtained.
3. The livestock farm safety management method based on video surveillance as described in claim 2, characterized in that, The static saliency is positively correlated with the fusion result, the quantity ratio, and the degree of disorder.
4. The livestock farm safety management method based on video surveillance as described in claim 3, characterized in that, The static saliency is the product of the fusion result, the quantity ratio, and the degree of disorder.
5. The livestock farm safety management method based on video surveillance as described in claim 1, characterized in that, The process of obtaining the motion pixel clustering degree of each coordinate point in each frame of video image includes: Calculate the product of the grayscale change and the local density of each coordinate point in each frame of video image, sum the products of each coordinate point and its neighboring coordinate points, and calculate the metric distance between each coordinate point and its neighboring coordinate points. The degree of motion pixel clustering at each coordinate point is positively correlated with the summation result and negatively correlated with the distance metric.
6. The livestock farm safety management method based on video surveillance as described in claim 5, characterized in that, Further determination of the motion pixel clustering includes: The ratio of the summation result to the metric distance is calculated, and the ratios of each coordinate point to all coordinate points in its neighborhood are fused to obtain the motion pixel clustering degree.
7. The livestock farm safety management method based on video surveillance as described in claim 1, characterized in that, The acquisition of the dynamic saliency of each CTU block includes: The motion displacement is the displacement of the target object relative to the centroid coordinates of the previous video frame in each frame. Calculate the similarity between the direction of motion displacement of the centroid coordinates of the target object to which each CTU block belongs and the direction of motion displacement of the centroid coordinates of other target objects in the same frame of video image; Calculate the difference between the natural number 1 and the similarity, determine the fusion value of the difference between the target object to which each CTU block belongs and all other target objects in the same frame of video image, and normalize the magnitude of the motion displacement of the centroid coordinates of the target object to which each CTU block belongs; Calculate the mean of the motion pixel clustering degree at the corresponding positions of all pixels in each CTU block, and use the mean, the fusion value, and the normalization result to determine the dynamic saliency of each CTU block.
8. The livestock farm safety management method based on video surveillance as described in claim 7, characterized in that, The dynamic significance is the product of the mean, the fusion value, and the normalization result of each CTU block.
9. The livestock farm safety management method based on video surveillance as described in claim 1, characterized in that, The expression for determining the significant weight of each CTU block is as follows: In the formula, Let be the significance weight of the i-th CTU block. The preset weighting coefficients for the i-th CTU block are: Let be the static significance of the i-th CTU block. Let be the dynamic significance of the i-th CTU block, where .
10. A livestock farm safety management system based on video surveillance, 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, it implements the steps of the method as described in any one of claims 1-9.
Citation Information
Cited By
Large-area pasture livestock activity behavior tracking and monitoring system
CN121842406A
A large-area pasture livestock activity behavior tracking and monitoring system
CN121842406B