Automatic measurement method of cattle body size based on key point detection and unilateral depth imaging
Through a method based on key point detection and unilateral depth imaging, combined with YOLOv8-pose network and other mathematical methods, the automated and precise measurement of the cattle body ruler is realized, solving the time-consuming, labor-intensive, high cost and complex operation in the existing technology. The problem of improving measurement efficiency and animal welfare.
Patent Information
- Application Number
- CN202411135208.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-08-19
AI Technical Summary
In the prior art, manual measurement methods are time-consuming and laborious and subjective, contactless sensing technology is costly and has poor flexibility, and requires manual marking of key points or relying on complex algorithms, which are complex and error-prone.
The automatic measurement method of cattle body ruler based on key point detection and unilateral depth imaging is adopted. The depth camera is used to obtain the unilateral bovine depth image and fuse it with RGB image. The YOLOv8-pose network is used to detect the key points of cattle body, combined with Euclidean distance, The moving least squares method, radial basis function and cubic B-spline interpolation method calculates the cattle body ruler parameters.
The automation and accuracy of cattle body ruler measurement is achieved, which reduces costs, improves operational convenience and contactlessness, reduces the impact on animal welfare, and improves the reliability and accuracy of measurement results.
Smart Images

Figure CN118865451B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cattle body size measurement, and more particularly to an automatic cattle body size measurement method based on key point detection and unilateral depth imaging. Background Art
[0002] In modern animal husbandry management, the body size measurement of cattle is a key production indicator. The body size of cattle not only has a significant impact on their market value, genetic improvement and feeding management strategies, but is also directly related to health status, meat quality and reproductive performance. In traditional breeding production, direct contact tools are often used to detect body size. However, manual measurement methods require experienced workers, which is not only time-consuming and labor-intensive, but also subjective and easily affected by external environment and experience. It may also damage animal welfare during measurement. With the development of technology, non-contact sensing technology provides a new measurement method. Non-contact sensing technology can monitor cattle body size in real time, greatly improving the management accuracy and efficiency of animal husbandry. Non-contact cattle body measurement is of great significance to the intensive and sustainable production of animal husbandry. Existing non-contact sensing technologies mainly use two-dimensional image analysis and three-dimensional reconstruction technology to measure body size. Although two-dimensional image analysis is easy to operate, its accuracy is often challenged due to image quality and resolution limitations. Although three-dimensional reconstruction technology can provide more comprehensive depth information, reduce dependence on lighting conditions, and improve measurement accuracy, it usually requires the configuration of multiple cameras and complex equipment, which is expensive and has poor flexibility in complex farm environments. In addition, both two-dimensional images and three-dimensional reconstruction technology often require manual marking of key points or reliance on complex algorithms to extract features, which is not only complicated to operate, but also prone to errors in resource-limited environments, increasing the difficulty of practical application. Therefore, how to provide a method for automatic measurement of cattle body size based on key point detection and unilateral depth imaging is a problem that technicians in this field urgently need to solve. Summary of the invention
[0003] In view of this, the present invention provides an automatic measurement method for cattle body size based on key point detection and unilateral depth imaging. A depth camera is used to obtain a unilateral depth image of the cattle body, combined with a synchronously captured RGB image, and the key points of the cattle body are accurately located through image fusion technology. The key points of the cattle body are combined with Euclidean distance, moving least squares method, radial basis function and cubic B-spline interpolation method to calculate the body size parameters of the cattle.
[0004] In order to achieve the above object, the present invention provides the following technical solutions:
[0005] A method for automatically measuring the body size of cattle based on key point detection and unilateral depth imaging, comprising the following steps:
[0006] S1, collecting cattle image data and obtaining the target cattle RGB image and depth image based on the target recognition algorithm and target tracking algorithm;
[0007] S2, improve the YOLOv8-pose network based on the content-aware feature reconstruction module and the simplified spatial pyramid pooling fast module to detect the key points of the cow body in the RGB image;
[0008] S3, using the fusion of the depth image and the RGB image to determine the precise position of the key points of the cow in the three-dimensional space;
[0009] S4, calculating the Euclidean distance between the precise positions of the key points of the cow's body in the three-dimensional space, and obtaining the body height, oblique length and cross height of the cow;
[0010] S5. Between the rear edge of the withers and the vertical point of the chest base of the cattle in the three-dimensional space, generate several middle points along the line connecting the rear edge of the withers and the vertical point of the chest base to form a continuous curve segment in the three-dimensional space, and perform symmetrical transformation along the Y axis on the middle points of the upper part to generate mirror image points of the upper part on the other side of the chest circumference;
[0011] S6. Using the moving least square method and radial basis function to adjust the point set, after obtaining the data point curve of the upper part, using the cubic B-spline interpolation method to predict and complete the lower part of the chest circumference curve;
[0012] S7. The chest circumference of the cow is obtained by calculating the distances between adjacent points on the ring and accumulating the sum, wherein each distance is calculated using the Euclidean distance formula.
[0013] Optionally, S1 specifically includes: collecting cattle image data, using data enhancement technology to increase the robustness of the model, and then inputting the image into a pre-trained CNN model, and mapping the deep features to the cattle's identity label by adding a fully connected layer to the top layer of the CNN model to achieve accurate individual identification; after the cattle are initially identified, the target tracking algorithm DeepSORT is used for target tracking, and after locking the target cattle, the RGB image and depth image of the target cattle are obtained through an edge device equipped with a depth camera.
[0014] Optionally, S2 specifically comprises: replacing a standard upsampling module and a spatial pyramid pooling fast module in the YOLOv8-pose network with a content-aware feature reconstruction module and a simplified spatial pyramid pooling fast module, and detecting cow body key points in the RGB image based on the optimized YOLOv8-pose network.
[0015] Optionally, S3 is specifically: converting the depth image stored in the 16-bit unsigned integer format into a single-channel image, calculating the average depth D of the 3x3 pixel area around the midpoint between the shoulder and the ischial end avg :
[0016]
[0017] In the formula, (x mid ,y mid ) is the pixel coordinate of the midpoint between the shoulder and the ischial end, I depth (x,y) is the depth value at position x,y;
[0018] Within the set search radius max_radius, find the value with the average depth D avg The nearest effective depth D within 500 mm of the difference nearest :
[0019]
[0020] In the formula, It is to minimize the search of all depth values within a given search radius. depth (z mid +dx,y mid +dy) represents the depth value of the specified offset position around the midpoint;
[0021] Using the camera's intrinsic parameter matrix K, the image coordinates [x, y, 1] are transformed by inverse projection. T and the nearest effective depth D nearest Combined and converted into three-dimensional world coordinates P world :
[0022] P world =K -1 [x,y,1] T ·D nearest .
[0023] Optionally, S4 specifically includes: calculating the Euclidean distance from the highest point of the withers to the bottom of the hoof as the body height of the cow, calculating the Euclidean distance from the end point of the shoulder to the outer edge point of the ischium as the oblique length of the cow, obtaining the hoof point as the key mark of contact with the ground, combining the horizontal coordinate of the cross point with the longitudinal coordinate of the hoof point, using the depth value of the hoof point to construct a new three-dimensional space point, and calculating the Euclidean distance between the cross point and the new three-dimensional space point as the cross height.
[0024] Optionally, S6 specifically includes: using a moving least squares method and a radial basis function to adjust the point set:
[0025]
[0026] In the formula, is the weight obtained based on the moving least squares method, φ is the radial basis function, and t is the point set;
[0027] Use the cubic B-spline interpolation method to predict and complete the lower half of the chest curve S(t):
[0028]
[0029] In the formula, B i (t) is the basis spline function, P i For the control point.
[0030] Optionally, S7 is:
[0031]
[0032] Where Circumference is the chest circumference of the cow.
[0033] It can be seen from the above technical solutions that, compared with the prior art, the present invention provides a method for automatically measuring the body size of cattle based on key point detection and unilateral depth imaging, which has the following beneficial effects:
[0034] 1. The present invention combines the depth image with the RGB image in a non-contact manner, which not only ensures the comprehensive advantages of non-contact measurement, but also distinguishes it from the point cloud or three-dimensional reconstruction methods that are more complex, less flexible and more expensive. It not only significantly improves the automation and accuracy of cattle body size measurement, but also optimizes the convenience and non-contact nature of the operation, greatly reduces costs and improves animal welfare;
[0035] 2. The present invention selects the YOLOv8-pose key point detection model, and optimizes the spatial pyramid pooling by replacing the original spatial pyramid pooling fast module with a simplified spatial pyramid pooling fast module in the backbone network, and introduces a content-aware feature reorganization module in the neck to replace the standard upsampling module. The improved key point detection model can have a better perception of the key points on the edge of the cattle body, and the key points of the cattle body are identified by the key point detection model, which is different from the previous image segmentation, point cloud, etc., which require manual marking of key points or rely on complex algorithms to extract features. It is more applicable in actual farm breeding environments;
[0036] 3. The present invention adopts the moving least square method and radial basis function to further accurately adjust the key point positions to compensate for the position deviation caused by the natural movement of the cattle or environmental factors, and ensure the spatial accuracy of the key points. Then, the cubic B-spline interpolation technology is used to generate a coherent body size measurement curve to ensure the continuity and accuracy of the measurement results, which significantly improves the reliability and accuracy of the cattle body size data, provides an efficient, low-cost and non-invasive measurement solution for pasture management and animal husbandry research, and greatly optimizes the flexibility and efficiency of field operations. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] 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 embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0038] Figure 1 This is a flow chart of the method for automatically measuring the body size of cattle of the present invention;
[0039] Figure 2 Schematic diagram of body height and oblique length calculation in an embodiment of the present invention;
[0040] Figure 3 A schematic diagram of calculating the cross length in an embodiment of the present invention;
[0041] Figure 4 Schematic diagram of chest circumference calculation curve in an embodiment of the present invention. DETAILED DESCRIPTION
[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] The embodiment of the present invention discloses a method for automatically measuring the body size of cattle based on key point detection and unilateral depth imaging, such as Figure 1 As shown, the following steps are included:
[0044] S1, collecting cattle image data and obtaining the target cattle RGB image and depth image based on the target recognition algorithm and target tracking algorithm;
[0045] S2, improve the YOLOv8-pose network based on the content-aware feature reconstruction module and the simplified spatial pyramid pooling fast module to detect the key points of the cow body in the RGB image;
[0046] S3, using the fusion of the depth image and the RGB image to determine the precise position of the key points of the cow in the three-dimensional space;
[0047] S4, calculating the Euclidean distance between the precise positions of the key points of the cow's body in the three-dimensional space, and obtaining the body height, oblique length and cross height of the cow;
[0048] S5. Between the rear edge of the withers and the vertical point of the chest base of the cattle in the three-dimensional space, generate several middle points along the line connecting the rear edge of the withers and the vertical point of the chest base to form a continuous curve segment in the three-dimensional space, and perform symmetrical transformation along the Y axis on the middle points of the upper part to generate mirror image points of the upper part on the other side of the chest circumference;
[0049] S6. Using the moving least square method and radial basis function to adjust the point set, after obtaining the data point curve of the upper part, using the cubic B-spline interpolation method to predict and complete the lower part of the chest circumference curve;
[0050] S7. The chest circumference of the cow is obtained by calculating the distances between adjacent points on the ring and accumulating the sum, wherein each distance is calculated using the Euclidean distance formula.
[0051] Furthermore, S1 is specifically as follows: collecting cattle image data, using data enhancement technology to increase the robustness of the model, and then inputting the image into the pre-trained CNN model, and mapping the deep features to the cattle's identity label by adding a fully connected layer at the top level of the CNN model to achieve accurate individual identification; after the cattle are initially identified, the target tracking algorithm DeepSORT is used for target tracking. After locking the target cattle, the RGB image and depth image of the target cattle are obtained through the edge device equipped with a depth camera.
[0052] Convolutional neural network (CNN) is a deep learning algorithm that is very suitable for image processing tasks, especially in the fields of facial recognition and pattern recognition. In an embodiment of the present invention, CNN automatically learns and recognizes specific biological features of cattle, such as facial structure, skin texture and unique spot pattern, through multi-layer filters. First, data enhancement techniques (such as rotation, scaling and color adjustment) are used to increase the robustness of the model. Then, the image is input into a pre-trained CNN model, which has been trained on a large amount of image data and can effectively extract complex visual features. Finally, a fully connected layer is added to the top layer of the CNN model to map the deep features to the identity label of the cattle, thereby achieving accurate individual recognition. After the cattle are initially identified, in order to achieve continuous monitoring and tracking of them, in an embodiment of the present invention, a target tracking algorithm DeepSORT is used. DeepSORT is an algorithm that combines deep learning and traditional tracking technology, and is specially designed to handle the movement of targets in video sequences. In the application of cattle monitoring, DeepSORT first uses a CNN model to extract the visual appearance features of cattle. These features help distinguish different individuals, and can maintain the accuracy of recognition even in complex scenes or when the cattle are partially occluded. The DeepSORT algorithm effectively solves the identity switching and occlusion problems by combining motion information and appearance information, and improves the stability of tracking. The core of the DeepSORT algorithm is a Kalman filter, which predicts the position of cattle and corrects any errors caused by sudden movement or camera angle changes. In addition, DeepSORT introduces an efficient matching strategy. By calculating the similarity between the detected cattle and the existing trajectory, this matching process takes into account the integration of appearance and motion information, ensuring that the tracking continuity can be maintained even when the cattle move quickly or pass through each other. After locking the target cattle, the RGB image and depth image of the target cattle are obtained through the edge device equipped with a depth camera.
[0053] Furthermore, S2 is specifically as follows: replacing the standard upsampling module and the spatial pyramid pooling fast module in the YOLOv8-pose network with the content-aware feature reconstruction module and the simplified spatial pyramid pooling fast module, and detecting the key points of the cow body in the RGB image based on the optimized YOLOv8-pose network.
[0054] YOLOv8-pose is an advanced computer vision model designed for real-time pose estimation. It is based on the popular YOLO target detection framework and integrates the human key point detection function, so that it can not only identify objects in images, but also accurately locate the key points of objects. In the original YOLOv8-pose network, standard upsampling (Upsample) and spatial pyramid pooling fast (SPPF) modules are used for feature processing. In order to improve the efficiency and accuracy of the model in complex environments, especially on resource-constrained edge devices, key optimization adjustments are made in the embodiments of the present invention, replacing the original upsampling method and introducing the content-aware feature reorganization (CARAFE) module, which can reorganize and generate feature maps more finely by predicting the upsampling kernel at each position, enhancing the content perception ability of the model and improving the accuracy of key point detection. At the same time, the SPPF module is replaced by a simplified spatial pyramid pooling fast (SimSPPF) module to reduce the computational complexity and reduce the model burden, and maintain the effective capture of multi-scale information. Through these improvements, the YOLOv8-pose network is not only enhanced in identifying the key features of cattle in complex environments, but also optimizes computing efficiency, making the model more suitable for running on edge computing devices, providing strong technical support for real-time cattle monitoring and key point measurement of body size. Among them, the content-aware feature reconstruction module and the simplified spatial pyramid pooling fast module are both existing technologies.
[0055] Further, S3 is specifically as follows: converting the depth image stored in the 16-bit unsigned integer format into a single-channel image, calculating the average depth D of the 3x3 pixel area around the midpoint between the shoulder and the ischial end avg :
[0056]
[0057] In the formula, (x mid ,y mid ) is the pixel coordinate of the midpoint between the shoulder and the ischial end, I depth (x,y) is the depth value at the x,y position; this baseline depth is used to evaluate the effectiveness of the depth value in subsequent steps in order to reduce the impact of single pixel noise on the overall depth estimation and improve the stability and accuracy of the depth measurement;
[0058] Within the set search radius max_radius, find the value with the average depth D avg The nearest effective depth D within 500 mm of the difference nearest :
[0059]
[0060] In the formula, It is to minimize the search of all depth values within a given search radius. depth (z mid +dx,y mid +dy) represents the depth value of the specified offset position around the midpoint; this process ensures that the selected depth value is close to the reference depth of the midpoint and within the set error range, which enhances the reliability of the depth value and lays a solid foundation for accurate 3D position estimation;
[0061] Using the camera's intrinsic parameter matrix K, the image coordinates [x, y, 1] are transformed by inverse projection. T and the nearest effective depth D nearest Combined and converted into three-dimensional world coordinates P world :
[0062] P world =K -1 [x,y,1] T ·D nearest .
[0063] The image coordinates and optimized depth values are combined through inverse projection transformation and converted into 3D world coordinates using the camera's intrinsic parameter matrix, ensuring accurate mapping from 2D image key points to 3D space.
[0064] In the embodiment of the present invention, after many experiments and combining the method of collecting data by aligning a depth camera parallel to the cow's abdomen, it is determined that the midpoint proximity value between the cow's shoulder and the ischial end can be used as a valid key point depth value.
[0065] Furthermore, S4 is specifically as follows: calculating the Euclidean distance from the highest point of the withers to the bottom of the hoof as the body height of the cow, calculating the Euclidean distance from the end point of the shoulder to the outer edge point of the ischium as the oblique length of the cow, obtaining the hoof point as the key mark of contact with the ground, combining the horizontal coordinate of the cross point with the longitudinal coordinate of the hoof point, using the depth value of the hoof point to construct a new three-dimensional space point, and calculating the Euclidean distance between the cross point and the new three-dimensional space point as the cross height.
[0066] In the field of animal husbandry and animal science, professionals often use a measuring stick and a measuring tape to measure the height and oblique length of a cow. The height is measured by placing the measuring stick vertically on the ground and aligning it with the highest point of the cow's withers to read the scale value. The oblique length is measured by using a measuring tape. The measuring tape is stretched along the side of the cow from the shoulder to the hip, and the distance between the two key points is recorded. In the embodiment of the present invention, Figure 2 As shown, the body height and body oblique length are measured by calculating the Euclidean distance between three-dimensional space points:
[0067]
[0068] like Figure 3 As shown, the depth value of the sole point reflects the distance from the depth camera to the ground. The new three-dimensional space point is located on the ground plane, just directly below the cross point. Finally, the Euclidean distance between the cross point (Crucifixion) and the new three-dimensional space point is used to calculate the cross height.
[0069] The existing chest circumference measurement method is: a professional measurement personnel stands on the side of the cow, and wraps the tape measure around the cow's chest from the rear edge of the withers (Chest1) to the vertical point of the chest base (Chest2), ensuring that the tape measure is horizontal and close to the cow's skin, and records the value on the tape measure as the chest circumference length. Most of the previous studies on the chest circumference measurement of cattle require the use of two or more depth cameras to obtain the depth image for three-dimensional reconstruction or point cloud to obtain chest circumference slices. Such methods are often costly and difficult to maintain. Point cloud generation and processing are generally slower than simple two-dimensional image processing, especially when the amount of data is large, which may affect the ability of real-time analysis and processing.
[0070] In the embodiment of the present invention, a continuous curve segment in three dimensions is formed by generating a number of middle points along the line connecting Chest1 and Chest2 between the key points of Chest1 and Chest2 determined in three-dimensional space, and the middle points of the upper half are symmetrically transformed along the Y axis to generate the mirror image points of the upper half of the other side of the bust:
[0071] P(t)=Chest 1+t·(Chest 2-Chest 1)
[0072] Among them, t is uniformly distributed in the range of [0,1];
[0073] Furthermore, S6 is specifically: using the moving least square method and radial basis function to adjust the point set:
[0074]
[0075] In the formula, is the weight obtained based on the moving least squares method, φ is the radial basis function, and t is the point set; this method not only fine-tunes the coordinates of each point based on the position of each point, but also refers to the distribution of neighboring points, effectively solving the local anomalies caused by the intermediate abnormal points and ensuring the overall consistency of the curve. Through RBF processing, the coordinates of each interpolation point are recalculated, which not only enhances the overall structural stability of the point set, but also maintains the continuity of the curve;
[0076] Use the cubic B-spline interpolation method to predict and complete the lower half of the chest curve S(t):
[0077]
[0078] In the formula, B i (t) is the basis spline function, P i For the control point.
[0079] Optional, such as Figure 4 As shown, S7 is specifically:
[0080]
[0081] Where Circumference is the chest circumference of the cow.
[0082] Furthermore, in an embodiment of the present invention, the object keypoint similarity OKS (Object KeypointSimilarity) is used to quantify the degree of match between the predicted keypoints and the real keypoints. OKS is an evaluation index widely used in human posture estimation tasks and is suitable for evaluating the keypoint detection performance of any type, including animals. The OKS calculation formula is as follows:
[0083]
[0084] Where, d pi represents the Euclidean distance between the predicted position and the true position of the i-th key point, p and i represent the ID of the target cow and the key point respectively, S p represents the object scale of p, σ i represents the normalization factor of the i-th key point, v i Indicates the visibility of the i-th key point, 0 means unlabeled, 1 means the label is occluded, and 2 means the label is visible.
[0085] Furthermore, in the embodiments of the present invention, the use of mean absolute error (MAE) and mean relative error (MRE) as evaluation indicators of the measurement accuracy of the true value and measured value parameters of body size has significant advantages. First, as a basic regression evaluation indicator, the mean absolute error can intuitively reflect the average difference between the predicted value and the true value, quantify the accuracy of the body size detection model, and provide a clear error margin. This is crucial for evaluating the applicability of the algorithm in different scenarios.
[0086]
[0087] In the formula, is the true value, x i is the predicted value.
[0088] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0089] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for automatic measurement of cattle body size based on key point detection and unilateral depth imaging, characterized in that: The following steps are involved: S1, collecting cattle image data and obtaining the target cattle RGB image and depth image based on the target recognition algorithm and target tracking algorithm; S2, improve the YOLOv8-pose network based on the content-aware feature reconstruction module and the simplified spatial pyramid pooling fast module to detect the key points of the cow body in the RGB image; S3, using the fusion of the depth image and the RGB image to determine the precise position of the key points of the cow body in the three-dimensional space; S4, calculating the Euclidean distance between the precise positions of the key points of the cow's body in the three-dimensional space, and obtaining the body height, oblique length and cross height of the cow; S5. Between the rear edge of the withers and the vertical point of the chest base of the cattle in the three-dimensional space, generate several middle points along the line connecting the rear edge of the withers and the vertical point of the chest base to form a continuous curve segment in the three-dimensional space, and perform symmetrical transformation along the Y axis on the middle points of the upper half to generate mirror image points of the upper half on the other side of the chest circumference; S6. Use the moving least square method and radial basis function to adjust the withers posterior edge point, the chest base vertical point, the middle point of the upper part and the mirror point of the upper part. After obtaining the data point curve of the upper part, use the cubic B-spline interpolation method to predict and complete the lower part of the chest circumference curve. S7. The chest circumference of the cow is obtained by calculating the distances between adjacent points on the ring and accumulating the sum, wherein each distance is calculated using the Euclidean distance formula.
2. The method for automatic measurement of cattle body size based on key point detection and unilateral depth imaging according to claim 1, characterized in that: S1 specifically includes: collecting cattle image data, using data augmentation technology to increase the robustness of the model, and then inputting the image into a pre-trained CNN model. By adding a fully connected layer at the top of the CNN model, the deep features are mapped to the cattle's identity labels to achieve accurate individual identification; After the cow was initially identified, the target tracking algorithm DeepSORT was used to track the target cow. After locking the target cow, the RGB image and depth image of the target cow were obtained through the edge device equipped with a depth camera.
3. The method for automatic measurement of cattle body size based on key point detection and unilateral depth imaging according to claim 1, characterized in that: Specifically, S2 replaces the standard upsampling module and the spatial pyramid pooling fast module in the YOLOv8-pose network with the content-aware feature reconstruction module and the simplified spatial pyramid pooling fast module, and detects the key points of the cow body in the RGB image based on the optimized YOLOv8-pose network.
4. The method for automatic measurement of cattle body size based on key point detection and unilateral depth imaging according to claim 1, characterized in that: S3 is as follows: the depth image stored in 16-bit unsigned integer format is converted into a single-channel image, and the average depth D of the 3x3 pixel area around the midpoint between the shoulder and the ischial end is calculated. avg : In the formula, (x mid ,y mid ) is the pixel coordinate of the midpoint between the shoulder and the ischial end, I depth (x, y) is the depth value at position x, y: Within the set search radius max_radius, find the value with the average depth D avg The nearest effective depth D within 500 mm of the difference nearest : In the formula, Indicates that within the search radius max_radius, all depth values are searched to minimize the search. depth (z mid +dx,y mid +dy) represents the depth value of the specified offset position around the midpoint; Using the camera's intrinsic parameter matrix K, the image coordinates [x, y, 1] are transformed by inverse projection. T and the nearest effective depth D nearest Combined and converted into three-dimensional world coordinates P world : P world =K -1 ·[x,y,1] T ·D nearest 。 5. The method for automatic measurement of cattle body size based on key point detection and unilateral depth imaging according to claim 1, characterized in that: S4 is specifically as follows: calculating the Euclidean distance from the highest point of the withers to the bottom of the hoof as the body height of the cow, calculating the Euclidean distance from the end point of the cow's shoulder to the outer edge point of the ischium as the oblique length of the cow's body, obtaining the hoof point as the key mark of contact with the ground, combining the horizontal coordinate of the cross point with the longitudinal coordinate of the hoof point, using the depth value of the hoof point to construct a new three-dimensional space point, and calculating the Euclidean distance between the cross point and the new three-dimensional space point as the cross height.
6. The method for automatic measurement of cattle body size based on key point detection and unilateral depth imaging according to claim 1, characterized in that: S6 is specifically: using the moving least squares method and radial basis function to adjust the rear edge point of the withers, the vertical point of the chest base, the middle point of the upper part and the mirror point of the upper part: In the formula, is the weight obtained based on the moving least squares method, φ is the radial basis function, t is the posterior edge point of the withers, the vertical point of the thorax base, the middle point of the upper part and the mirror point of the upper part; Use the cubic B-spline interpolation method to predict and complete the lower half of the chest curve s(t): In the formula, B i (t) is the basis spline function, P i For the control point.
7. The method for automatic measurement of cattle body size based on key point detection and unilateral depth imaging according to claim 1, characterized in that: S7 is specifically: Where Circumference is the chest circumference of the cow.
Citation Information
Patent Citations
Multi-dimensional information sensing cow body size parameter measurement method and system
CN116071517A
Pig body size measurement method based on deep learning multi-parameter fusion
CN116295022A