Method and device for measuring cattle feed intake based on three-dimensional point cloud

CN122591007APending Publication Date: 2026-08-18BEIJING RES CENT FOR INFORMATION TECH & AGRI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610575190.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-28
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0004]本发明提供一种基于三维点云的牛采食量测量方法及装置,用以解决现有技术中利用激光扫描的方式重建饲料料堆三维形貌时,容易环境噪点干扰,导致采食量估算结果精确度低的缺陷

Benefits of technology

[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the cattle feed intake measurement method based on three-dimensional point clouds as described above.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122591007A_ABST
    Figure CN122591007A_ABST
Patent Text Reader

Abstract

This invention provides a method and apparatus for measuring cattle feed intake based on three-dimensional point clouds. The method includes: acquiring three-dimensional point cloud data of cattle before and after feeding on a feed pile and performing coordinate transformation; filtering and denoising the coordinate-transformed point cloud data, fitting a ground plane model based on the denoised point cloud data, and filtering multiple ground-hugging candidate points using the vertical distance of each point to the ground plane model; calculating the total number of points in a preset horizontal neighborhood of each ground-hugging candidate point, the number of points in the preset horizontal neighborhood whose vertical distance exceeds a height threshold, and filtering the denoised point cloud data based on the ratio of the number of points to the total number of points; finally, calculating the volume of the feed pile collected in a single session based on the target point cloud data to determine the cattle's feed intake. The method and apparatus of this invention improve the accuracy of feed intake estimation and simplify the cumbersome process of cattle feed measurement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a method and apparatus for measuring cattle feed intake based on three-dimensional point clouds. Background Technology

[0002] Feed intake in cattle is an important indicator of their health and production performance, and it is also a very important phenotypic parameter for genetic evaluation.

[0003] Among the related technologies, the commonly used methods for estimating feed intake in ranches include manual weighing. This method requires manual weighing of feed before and after feeding, which is cumbersome. Furthermore, the activities of cattle during feeding may cause feed to scatter or moisture to change, thus affecting the accuracy of weighing. To address this issue, related technologies also utilize laser scanning to reconstruct the three-dimensional shape of the feed pile. However, this method has higher environmental requirements, and the actual farming environment is subject to noise interference such as dust, water vapor, and frequent disturbances by cattle, resulting in low accuracy of feed intake estimation results. Summary of the Invention

[0004] This invention provides a method and apparatus for measuring cattle feed intake based on three-dimensional point clouds, which solves the problem that environmental noise interference is easy to cause low accuracy of feed intake estimation results when reconstructing the three-dimensional shape of feed piles by laser scanning in the prior art.

[0005] This invention provides a method for measuring cattle feed intake based on three-dimensional point clouds, comprising: Three-dimensional point cloud data of cattle before and after feeding on the feed pile are obtained, and the coordinates of the three-dimensional point cloud data are transformed into world coordinates to obtain coordinate-transformed point cloud data. The point cloud data after coordinate transformation is filtered and denoised to obtain denoised point cloud data. A ground plane model is fitted based on the denoised point cloud data, and multiple ground-hugging candidate points are selected using the vertical distance from each point in the denoised point cloud data to the ground plane model. The total number of points in a preset horizontal neighborhood of each ground-hugging candidate point and the number of points whose vertical distance to each point in the preset horizontal neighborhood exceeds a height threshold are calculated. The denoised point cloud data is then filtered based on the ratio of the number of points to the total number of points to obtain the target point cloud data. The volume of the feed pile collected in a single instance is calculated based on the target point cloud data, the volume change of the feed pile before and after it is consumed is obtained, and the feed intake of the cattle is determined based on the volume change.

[0006] According to the present invention, a method for measuring cattle feed intake based on three-dimensional point cloud data includes calculating the feed pile volume collected in a single instance based on the target point cloud data, comprising: Determine the projection area of ​​the target point cloud data on the horizontal plane, and obtain the span values ​​of the projection area in the first direction and the second direction respectively; The first grid division number in the first direction is calculated based on the total number of valid points in the target point cloud data and the ratio of the span value in the first direction to the span value in the second direction; the second grid division number in the second direction is calculated based on the total number of valid points in the target point cloud data and the ratio of the span value in the second direction to the span value in the first direction. The projection area is divided into rectangular grids using the first grid division number and the second grid division number to obtain multiple grid cells; The volume of the feed pile in a single acquisition is obtained by integrating the volume information of the point cloud within the multiple grid cells.

[0007] According to the present invention, a method for measuring cattle feed intake based on three-dimensional point clouds, wherein the step of performing volume integration based on the height information of the point cloud within the plurality of grid cells to obtain the feed pile volume of a single acquisition includes: For each grid cell, the target point cloud data within the grid cell is statistically analyzed, and the average vertical distance corresponding to each target point cloud data is calculated to obtain the average height of the grid cell. Multiply the average height by the base area corresponding to the grid cell to obtain the local volume; The local volumes of all grid cells are summed to obtain the volume of the feed pile in a single acquisition.

[0008] According to the present invention, a method for measuring cattle feed intake based on three-dimensional point clouds includes acquiring three-dimensional point cloud data of cattle before and after feeding on a feed pile, and transforming the coordinates of the three-dimensional point cloud data to world coordinates to obtain coordinate-transformed point cloud data, comprising: Receives the first signal triggered when a cow enters the feeding station, detected by an infrared sensor; In response to the first signal, the depth camera is controlled to acquire three-dimensional point cloud data of the feed pile before it is fed; Receives a second signal triggered by an infrared sensor when a cow leaves its feeding station; In response to the second signal, the depth camera is controlled to acquire three-dimensional point cloud data of the feed pile after it has been fed; Using a pre-calibrated homogeneous transformation matrix, the 3D point cloud data before and after feeding are transformed from the camera coordinate system to a unified world coordinate system, respectively, to obtain the coordinate-transformed point cloud data.

[0009] According to the present invention, a method for measuring cattle feed intake based on three-dimensional point clouds is provided, wherein the depth camera is arranged above the feeding station via a three-degree-of-freedom adjustable protection mechanism; the three-degree-of-freedom adjustable protection mechanism includes an angle adjustment component and a waterproof and dustproof protective shell; The angle adjustment component is used to adjust the three-dimensional spatial acquisition posture of the depth camera; the depth camera is sealed inside the waterproof and dustproof protective shell, and the waterproof and dustproof protective shell is provided with a corrugated pipe sealing connector to achieve closed cable laying.

[0010] According to the present invention, a method for measuring cattle feed intake based on three-dimensional point clouds includes fitting a ground plane model based on the denoised point cloud data and filtering multiple ground-hugging candidate points using the vertical distance from each point in the denoised point cloud data to the ground plane model, comprising: The denoised point cloud data is iteratively sampled using a random sampling consensus algorithm to fit the model parameters of the ground reference plane. Using the ground reference plane as the zero height reference plane, the vertical distance between each point in the denoised point cloud data and the zero height reference plane is calculated according to the model parameters, and the points whose vertical distance does not exceed the height threshold are determined as the ground-hugging candidate points.

[0011] According to the present invention, a method for measuring cattle feed intake based on three-dimensional point clouds includes filtering and denoising the coordinate-transformed point cloud data to obtain denoised point cloud data, comprising: The point cloud data after coordinate transformation is filtered by passing through the three-dimensional spatial boundary range of the feed trough area corresponding to the feed pile to obtain the point cloud data within the feed trough area; Based on the local neighborhood statistical characteristics of the point cloud, the retained point cloud data is subjected to statistical filtering and / or radius filtering denoising to obtain the denoised point cloud data.

[0012] The present invention also provides a bovine feed intake measurement device based on three-dimensional point clouds, comprising: The point cloud data acquisition module is used to acquire the three-dimensional point cloud data corresponding to cattle before and after feeding on the feed pile, and to convert the coordinates of the three-dimensional point cloud data to world coordinates to obtain the coordinate-transformed point cloud data. The data preprocessing module is used to filter and denoise the point cloud data after coordinate transformation to obtain denoised point cloud data. The data filtering module is used to fit a ground plane model based on the denoised point cloud data, and to filter out multiple ground-hugging candidate points using the vertical distance from each point in the denoised point cloud data to the ground plane model; calculate the total number of points in a preset horizontal neighborhood of each ground-hugging candidate point, the number of points whose vertical distance to each point in the preset horizontal neighborhood exceeds a height threshold, and filter the denoised point cloud data according to the ratio of the number of points to the total number of points to obtain target point cloud data; The calculation module is used to calculate the volume of the feed pile collected in a single collection based on the target point cloud data, obtain the volume change of the feed pile before and after it is consumed, and determine the amount of feed consumed by the cattle based on the volume change.

[0013] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the cattle feed intake measurement method based on three-dimensional point cloud as described above.

[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the cattle feed intake measurement method based on three-dimensional point clouds as described above.

[0015] The present invention provides a method and device for measuring cattle feed intake based on three-dimensional point clouds. By acquiring three-dimensional point cloud data corresponding to cattle before and after feeding on a feed pile and transforming its coordinates, non-contact automatic data acquisition and unified data spatial reference are achieved. By filtering and denoising the point cloud data after coordinate transformation, accurate extraction of the measurement area and effective suppression of environmental interference are achieved. By fitting a ground plane model to the denoised point cloud data and calculating the number of points, the total number of points, and the ratio between the two, the denoised point cloud data is filtered. This adaptively removes ground-level residual points without weakening the true boundary of the feed pile, improving the accuracy of feed intake estimation. Finally, the volume of the feed pile collected in a single acquisition is calculated using the target point cloud data, thereby determining the cattle's feed intake. This achieves high-precision non-contact quantitative monitoring of feed intake under complex pile shapes, simplifying the cumbersome process of cattle feed intake measurement. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0017] Figure 1This is one of the flowcharts of the method for measuring cattle feed intake based on three-dimensional point clouds provided by the present invention.

[0018] Figure 2 This is one of the structural schematic diagrams of the cattle feed intake measurement device based on three-dimensional point cloud provided by the present invention.

[0019] Figure 3 This is the second flowchart of the cattle feed intake measurement method based on three-dimensional point cloud provided by the present invention.

[0020] Figure 4 This is the third flowchart of the cattle feed intake measurement method based on three-dimensional point cloud provided by the present invention.

[0021] Figure 5 This is the fourth flowchart of the cattle feed intake measurement method based on three-dimensional point cloud provided by the present invention.

[0022] Figure 6 This is the second schematic diagram of the structure of the cattle feed intake measurement device based on three-dimensional point cloud provided by the present invention.

[0023] Figure 7 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0025] The following is combined with Figures 1-6 This invention describes a method and apparatus for measuring cattle feed intake based on three-dimensional point clouds.

[0026] Figure 1 This is one of the flowcharts illustrating the method for measuring cattle feed intake based on three-dimensional point clouds provided by this invention, such as... Figure 1 As shown, the method includes the following: Step 110: Obtain the three-dimensional point cloud data of the cattle before and after feeding on the feed pile, and convert the coordinates of the three-dimensional point cloud data to world coordinates to obtain the point cloud data after coordinate conversion.

[0027] In this step, cattle feed includes dairy or beef cattle that are group-housed or fed at fixed workstations in modern large-scale ranches; feed piles are hay or mixed rations placed in open feed troughs in cattle sheds.

[0028] In this step, the 3D point cloud data can be acquired by a depth camera (such as an Intel RealSense D435) mounted above the feeding station; for example, data can be acquired when the sensor detects cattle entering and leaving the station.

[0029] In this step, a pre-calibrated n×n homogeneous transformation matrix (e.g., n=4) can be used to map points in the camera coordinate system to a unified world coordinate system based on the cattle trough ground. This can eliminate the perspective differences caused by different camera installation postures and ensure that the two point cloud data collected before and after feeding can be strictly aligned and compared in the same reference space.

[0030] For example, in a modern ranch's cattle shed feeding scenario, when the infrared diffuse reflection sensor detects that cow number 001 has entered the feeding station, the industrial control computer receives the first signal and triggers the top depth camera to scan and acquire the "pre-feeding" point cloud (camera coordinate system) of the initial feed pile; when the cow finishes eating and leaves the station, the sensor triggers the second signal, and the camera scans again to acquire the "post-feeding" point cloud; subsequently, the system calls the calibrated 4×4 transformation matrix to accurately transform these two point clouds to the world coordinate system with the ground as the XOY plane, obtaining point cloud data with unified coordinates.

[0031] Step 120: Filter and denoise the point cloud data after coordinate transformation to obtain denoised point cloud data.

[0032] It should be noted that after coordinate unification and study area clipping are completed in the point cloud of the material pile, the point cloud inevitably still contains outliers, sparse noise points, and ground-hugging residual points caused by sensor measurement errors, environmental reflection interference, boundary scattering, and local occlusion. If the original point cloud is used directly for volume calculation, it is easy to cause local height estimation bias, which in turn affects the accuracy of the overall volume integration result. Therefore, before volume reconstruction, it is necessary to filter and denoise the point cloud to preserve the main shape of the material pile and suppress the interference of invalid points on subsequent calculations. First, irrelevant points that are significantly outside the feeding station area are removed by spatial range constraints. Then, the discrete and spatially isolated outliers are suppressed by combining the statistical characteristics of the local neighborhood of the point cloud, thereby improving the uniformity of the point cloud distribution and the stability of the overall morphological representation.

[0033] In this step, the filtering operation includes, but is not limited to, pass-through filtering, which is used to remove irrelevant background point clouds such as cattle bodies and fences that are obviously outside the feeding station area at the set three-dimensional spatial boundaries (such as the length and width of the feeding trough in the X and Y directions, and the reasonable height above the ground in the Z direction).

[0034] In this step, the denoising operation refers to combining the statistical features of the local neighborhood of the point cloud (such as statistical filtering and radius filtering) to suppress discrete and spatially isolated outliers. This is used to clean up isolated noise points caused by sensor measurement errors, high dust levels in the barn, water vapor, or environmental reflections, and prevent them from interfering with subsequent height and volume calculations.

[0035] In this embodiment, in the cattle shed feeding scenario of a modern ranch, after the system (method execution subject) receives the point cloud data after coordinate transformation, it can use pass-through filtering to limit the X-axis range to 600mm to 1700mm (corresponding to the length of the feeding trough) and the Y-axis range to -1440mm to 560mm (corresponding to the width of the feeding trough), and remove the corridor and cattle pen data at the edge of the field of view; then, a statistical outlier removal algorithm is enabled, setting each point to require at least 20 neighbor points. If a point has too few neighbors (such as dust reflection points suspended in the air), it is regarded as noise and removed, and finally a clean point cloud representing the shape of the actual feed pile is output.

[0036] Step 130: Fit a ground plane model to the denoised point cloud data, and use the vertical distance from each point in the denoised point cloud data to the ground plane model to filter out multiple ground-hugging candidate points; calculate the total number of points in the preset horizontal neighborhood of each ground-hugging candidate point, the number of points whose vertical distance to each point in the preset horizontal neighborhood exceeds the height threshold, and filter the denoised point cloud data according to the ratio of the number of points to the total number of points to obtain the target point cloud data.

[0037] In this step, vertical distance refers to the actual physical height of each point relative to the fitted plane; ground-hugging candidate points refer to the bottom point cloud whose vertical distance is less than or equal to a set height threshold (this threshold can be set according to user needs, such as a height threshold of 20mm).

[0038] In this embodiment, the total number of points in the neighborhood and the number of points whose vertical distance exceeds the height threshold are used to evaluate the elevation support structure of the local area. The corresponding ratio filtering is obtained by calculating the proportion of the number of high points to the total number of points. If the proportion is too low, it indicates that the area lacks continuity with the main body of the material pile and belongs to scattered feed or ground noise points.

[0039] In one embodiment, to mitigate the impact of feed debris, edge litter, and ground reflection errors on volume estimation, this embodiment can also remove ground noise from the target point cloud data through the following process: (1) For any point Construct its horizontal neighborhood ; in, This represents the set of point clouds that has undergone conventional filtering but has not yet completed ground-following noise cleanup; further, it defines the set of points in the neighborhood that are above the ground-following discrimination threshold. Represented as: ; in, Point The height relative to the reference plane, To determine the height threshold corresponding to ground contact, the percentage of high points within the neighborhood is thus determined. Represented as: ; When a point simultaneously meets both the conditions of "low height" and "small proportion of high points in its neighborhood," it can be considered to lack local elevation support connected to the actual material pile body, and therefore is classified as a ground-level noise point. ; in, A threshold representing the proportion of high points in the neighborhood is used to determine whether there are sufficient elevation support structures around the point to be measured. Finally, these points are removed from the point cloud set to be processed, resulting in the purified effective feed point cloud, i.e., the target point cloud data. , is represented as: .

[0040] In this embodiment, the parameters of the ground noise removal module are determined through preliminary experiments.

[0041] For example, the ground-based height threshold. Set to 20mm, meaning points whose absolute height relative to the reference plane does not exceed 20mm are considered candidate placement locations; horizontal neighborhood search radius. Set to 70mm to characterize the local spatial structure around the point to be measured; threshold for the proportion of high points in the neighborhood. Set to 0.15, meaning when the absolute value of the height within the neighborhood exceeds... When the proportion of points is not less than 15%, the area is considered to still have local elevation support connected to the main body of the material pile and should be retained; otherwise, the points in the area that meet the ground-level conditions are judged as ground residual noise and removed. The above parameter settings take into account the need for ground debris suppression and material pile edge morphology maintenance, which can reduce the interference of ground-level scattered points while avoiding accidental deletion of the real feed edge structure.

[0042] This embodiment achieves adaptive identification of ground-hugging residual points by jointly utilizing the vertical position information of points and local neighborhood structural features (height gating + neighborhood connectivity discrimination). Compared with the processing method based solely on height thresholds, this method can effectively suppress ground noise while better preserving the true geometric shape of the material pile edge, thus providing a more stable and reliable point cloud foundation for subsequent unit height statistics and volume integration.

[0043] Step 140: Calculate the volume of the feed pile collected in a single collection based on the target point cloud data, obtain the volume change of the feed pile before and after it is consumed, and determine the amount of feed consumed by the cattle based on the volume change.

[0044] In this step, a rectangular grid integration method based on fixed resolution or adaptive resolution can be used to divide the horizontal region of the point cloud into multiple grid cells, and the average height of the points in the grid is calculated and multiplied by the base area to approximate the local volume. The local volume is then globally accumulated. The volume change refers to the initial volume before feeding minus the remaining volume after feeding, which can be used to obtain the volume of the feed pile before and after feeding.

[0045] In this embodiment, the volume change is calculated by subtracting the volume of the feed pile before and after feeding, which reflects the actual amount of feed consumed by the cattle during the cycle.

[0046] In this embodiment, the aforementioned volume change can be multiplied by density to convert it into weight units and output to the display storage unit or management platform for subsequent analysis and processing.

[0047] Specifically, based on obtaining the cloud volume at two time points before and after feeding, the feed intake of cattle can be further estimated by the volume difference: Let the volume of the feed pile before feeding be... The volume of the remaining feed pile after feeding is The volumetric feed intake during this feeding process is defined as: ; in, This indicates the reduction in the volume of the feed pile within a unit feeding event (i.e., the volume change mentioned above), and its physical meaning is the actual volume of feed consumed by cattle during that feeding cycle.

[0048] In this embodiment, since the point cloud data before and after feeding are obtained under a unified coordinate system, a unified reference plane, and a consistent volume calculation method, the difference between the two can more directly reflect the actual changes in the material pile during the feeding process; when When the volume of the feed pile after feeding is smaller than the volume before feeding, it indicates that effective feeding occurred during that period; when When the two measurements are basically consistent, it indicates that no significant feed consumption was detected during that feeding cycle; when In some cases, the abnormal results do not conform to the physical laws of the actual feeding process. Such situations are generally related to factors such as point cloud acquisition errors, local feed turning, short-term occlusion, surface morphology disturbances, or volume estimation errors. Therefore, in practical applications, abnormal results should be identified and corrected in combination with specific feeding scenarios to improve the reliability of feed intake estimation.

[0049] The method for measuring cattle feed intake based on three-dimensional point clouds provided in this invention acquires three-dimensional point cloud data corresponding to cattle before and after feeding on a feed pile, and transforms the coordinates to achieve non-contact automatic data acquisition and unified data spatial reference. By filtering and denoising the point cloud data after coordinate transformation, the method achieves accurate extraction of the measurement area and effective suppression of environmental interference. By fitting a ground plane model to the denoised point cloud data and calculating the number of points, the total number of points, and the ratio between the two, the method filters the denoised point cloud data. This adaptively removes ground-level residual points without weakening the true boundary of the feed pile, improving the accuracy of feed intake estimation. Finally, the method calculates the volume of the feed pile collected in a single acquisition using the target point cloud data, thereby determining the cattle's feed intake. This method achieves high-precision non-contact quantitative monitoring of feed intake under complex pile shapes, simplifying the cumbersome process of cattle feed intake measurement.

[0050] In one embodiment, calculating the feed pile volume for a single acquisition based on target point cloud data includes: determining the projection area of ​​the target point cloud data on a horizontal plane, and obtaining the span values ​​of the projection area in a first direction and a second direction, respectively; calculating the first grid division number in the first direction based on the total number of effective points in the target point cloud data and the ratio of the span value in the first direction to the span value in the second direction; calculating the second grid division number in the second direction based on the total number of effective points in the target point cloud data and the ratio of the span value in the second direction to the span value in the first direction; dividing the projection area into rectangular grids using the first grid division number and the second grid division number to obtain multiple grid cells; and performing volume integration based on the height information of the point cloud within the multiple grid cells to obtain the feed pile volume for a single acquisition.

[0051] In this embodiment, the projection area on the horizontal plane refers to the bounded rectangular area occupied by the target point cloud data on the ground reference plane (such as the XOY plane).

[0052] In this embodiment, the span values ​​in the first and second directions are the physical boundary lengths (i.e., Lx and Ly) of the corresponding projection area on the X-axis (such as the length direction of the feed trough) and Y-axis (such as the width direction of the feed trough). These span values ​​are used to define the spatial scale of the integral calculation.

[0053] In this embodiment, the ratio of the effective total number of points to the span value constitutes the joint constraint factor of the grid resolution, which is used to measure the overall density of the point cloud and the longitudinal and transverse extension ratio of the material pile in space.

[0054] In this embodiment, the first grid division number and the second grid division number refer to the number of discrete segments (i.e., Nx and Ny) adaptively calculated in two directions based on the above-mentioned constraint factors; wherein, the rectangular grid division refers to dividing the measurement area into rectangular micro-units that fit the true proportion of the feeding trough based on the calculated different division numbers.

[0055] In this embodiment, an integral method based on a fixed-resolution grid is used to calculate the feed pile volume; specifically, the ground plane is used as a reference, and the height of each feed point relative to this plane is denoted as... When calculating the volume, the horizontal area where the feed is located is divided into regular small grid cells according to a predetermined grid size.

[0056] Assuming that on the world coordinate plane, the feed point cloud has a range of [value] in the X direction. The range in the Y direction is The area is divided into Each grid (e.g.) (That is, divided into an 80×80 grid, the system can automatically adjust the grid resolution according to the number of point clouds), then the size of each cell is expressed as: , .

[0057] For each grid cell, summarize all feed points falling into that cell and calculate the average height of these points relative to the reference plane. Then multiply the average height by the horizontal area of ​​the cell. The feed volume corresponding to this grid cell is obtained as shown in the following formula: .

[0058] Finally, the total volume of the entire feed pile can be approximated by summing all the grids containing feed points using the following formula: .

[0059] In one feasible embodiment, when calculating the volume of the feed pile, the cleaned point cloud is first geometrically approximated, and then integrated; specifically, a grid integration method can be used, that is, the point cloud is divided into regular grids along the horizontal plane, and the volume is approximately calculated in each grid cell.

[0060] The process of calculating the volume of a feed pile consists of three steps: mesh generation, cell height calculation, and volume accumulation. The execution flow of each step is as follows: (1) Mesh division; In order to balance the spatial resolution and computational efficiency of the material pile volume estimation, this embodiment uses an adaptive resolution mesh division method to discretize the measurement space in the horizontal projection area of ​​the feed point cloud.

[0061] Specifically, let the feed point cloud set after coordinate unification, region clipping, filtering and noise reduction, and ground benchmark establishment be represented as: ; in, The effective feed point count; the projection area of ​​the point cloud onto the horizontal reference plane is denoted as: ; in, These represent the feed point clouds in x Minimum and maximum boundaries in the y-direction and the y-direction.

[0062] If a fixed resolution grid is used for the region Uniform meshing can lead to numerous empty meshes when point cloud density is low, thus reducing the stability of volume estimation. Conversely, when point cloud density is high, excessively low mesh resolution can mask local geometric undulations on the feed surface, resulting in a loss of spatial detail. Therefore, this paper adaptively determines the number of meshes along two coordinate directions to make the discretized units rectangular, thereby improving adaptability to non-uniform spatial scales.

[0063] Specifically, let the projection area be in and The spans in each direction are as follows: ; Based on the number of effective point clouds The aspect ratio of the region is used to determine the number of grid divisions in both directions. and .

[0064] In this embodiment, an adaptive partitioning strategy based on joint constraints of point size and region aspect ratio is adopted to maintain an approximately proportional relationship between the total number of grids and the number of point clouds, while ensuring that the aspect ratio of the grid cells is consistent with the overall scale of the measurement area; to this end, and They can be expressed as follows: ; ; in, ( The value can be set according to user needs. For example, 0.68 is a resolution adjustment coefficient used to control the growth rate of the total number of grids relative to the number of point clouds. These represent the upper and lower limits of the number of divisions in the two directions, respectively. In this embodiment, the upper and lower limits of the number of divisions are set between 30 and 200. This indicates a truncation operator, used to prevent the mesh from becoming too coarse or too dense due to too few or too many points; therefore, the total number of meshes satisfies the following formula: ; This indicates that the total number of grid cells is approximately linearly proportional to the number of point clouds, while the partition density in both directions is further affected by the region-scale ratio. Adjustment; This construction method allows more partitioning units to be automatically obtained in a certain direction when the stockpile extends more significantly in a certain direction, thereby maintaining a relatively balanced spatial discretization accuracy in the two directions.

[0065] In determining and Afterwards, the region It can be divided into There are rectangular grid cells, and the side lengths of the cells in the two directions are expressed as follows: ; Then the first A grid cell can be represented as: ; in, The area of ​​a single unit is expressed as: ; The grid division method described above is more consistent with the geometric distribution characteristics of cattle feed piles in actual scenarios, and is also more suitable for subsequent use of area weighting method to perform local height statistics and overall volume integration.

[0066] The aforementioned adaptive rectangular mesh partitioning includes two adjustment mechanisms: first, the total number of meshes. With point cloud quantity The adaptive variation allows the discretization accuracy to match the point cloud sampling density; secondly, the number of partitions in both directions is affected by the region scale. and The influence of the two axes gives the mesh different discretization capabilities in the major and minor axes. When the former plays a role, the method can maintain a relatively stable distribution of cell points under different data scales. When the former and the latter play a role together, the method can avoid mechanically mapping obviously narrow or flat material pile projection areas into uniform square meshes, thereby reducing unnecessary empty cells and scale imbalance problems.

[0067] (2) Calculation of cell height; Perform height statistics on the point cloud within each grid cell to obtain the representative height of that cell; For the first cell obtained by adaptive partitioning... grid cells The set of points it contains is defined as follows: ; Let the number of points in this unit be: .

[0068] The representative height of the aforementioned grid cell can be determined by the statistics of the heights of all effective points within the cell. Considering the continuous undulation characteristics of the material pile surface and the fact that the preceding filtering step has suppressed outliers and ground-level residual noise, this embodiment uses the mean of the effective heights within the cell as the local height representation. This mean is expressed as: ; in, Indicates the first The average height of each unit, and the effective height of the point are... .

[0069] In this embodiment, when there are no valid points within a certain unit, it indicates that the area is not covered by the feed point cloud, or that there is no obvious material accumulation in the corresponding area, so its height is recorded as 0; this definition not only conforms to the volume calculation logic of the local columnar approximation of the material pile, but also facilitates the unified handling of sparse areas and blank areas in space; from a geometric perspective, Reflects the surface of the stockpile in the unit The average uplift relative to the reference plane is essentially a continuous height function. Discrete approximation on local grid regions (3) Volume integral.

[0070] In this embodiment, the volume of the feed pile collected in a single acquisition is obtained by performing volume integration based on the height information of the point cloud within multiple grid cells. This includes: for each grid cell, statistically analyzing the target point cloud data within the grid cell and calculating the average vertical distance corresponding to each target point cloud data to obtain the average height of the grid cell; multiplying the average height by the base area corresponding to the grid cell to obtain the local volume; and summing the local volumes of all grid cells to obtain the volume of the feed pile collected in a single acquisition.

[0071] In this embodiment, the first The local shape of the stockpile within each grid cell is approximately a base area of... Height is For a tiny column, the local volume corresponding to that element can be expressed as: ; The total volume of the stockpile can be obtained by summing the local volumes of all units. , is represented as: ; The above formula shows that the total volume of the stockpile is essentially the area-weighted sum of the average heights of all grid cells, which corresponds to the continuous volume integral as follows: ; In the embodiment, with the grid scale and As the density decreases, the discrete summation result will gradually approach the true continuous volume; under finite resolution conditions, the adaptive rectangular grid integration method used in this embodiment can achieve a balance between volume estimation accuracy and computational complexity; from a numerical method perspective, the above integration process can be regarded as a discretized form of Riemann integral based on two-dimensional partitioning summation; unlike directly using the local maxima of the feed surface for volume reconstruction, this embodiment uses the average height of the cells. The height parameter, used as an integral unit, allows the volume of each unit to better reflect the overall stacking level of the material pile in that area. This approach is particularly suitable for material piles with loose surfaces, significant local undulations, and certain random disturbances. On the one hand, the above method can reduce the amplification effect of individual abnormal high points on the total volume. On the other hand, the above method can also suppress the underestimation of volume caused by local micro-dimples or sparse sampling, making the volume result more consistent with the physical meaning of "average thickness per unit area" under actual stacking conditions.

[0072] It should be noted that the accuracy of the volume integral results is affected by multiple factors, including reference plane fitting error, uneven point cloud distribution, the proportion of local empty cells, and mesh scale selection. Among these, when... and Too small, that is and When the size is too large, the local geometric details of the feed surface will be over-averaged, resulting in an underestimation of volume; when and If the mesh size is too large, or the mesh is too dense, it may lead to insufficient local points. Increased volatility reduces integral stability.

[0073] The cattle feed intake measurement method based on three-dimensional point clouds provided in this invention reduces the risk of accumulated errors by matching the control unit scale with the unit point density, thereby improving the robustness and adaptability of the volume estimation results. The rectangular grid integration method based on the average height of the units transforms the three-dimensional point cloud representation of irregular feed piles into a volume summation problem on a regular two-dimensional discrete region. This method retains the main information of the feed surface geometry and has the characteristics of clear expression, simple calculation and strong interpretability, providing a unified and stable mathematical foundation for subsequent feed pile volume comparison, feed intake estimation and the construction of online monitoring systems.

[0074] In some embodiments, according to the present invention, a method for measuring cattle feed intake based on three-dimensional point clouds acquires three-dimensional point cloud data corresponding to cattle before and after feeding on a feed pile, and transforms the coordinates of the three-dimensional point cloud data to world coordinates to obtain coordinate-transformed point cloud data. The method includes: receiving a first signal triggered by an infrared sensor when a cattle enters a feeding station; responding to the first signal, controlling a depth camera to acquire three-dimensional point cloud data of the feed pile before feeding; receiving a second signal triggered by an infrared sensor when a cattle leaves a feeding station; responding to the second signal, controlling a depth camera to acquire three-dimensional point cloud data of the feed pile after feeding; and using a pre-calibrated homogeneous transformation matrix, transforming the three-dimensional point cloud data before and after feeding from the camera coordinate system to a unified world coordinate system to obtain coordinate-transformed point cloud data.

[0075] In this embodiment, the first signal and the second signal correspond to the state pulses of the cow entering and leaving the feeding station, respectively. Their function is to act as a timestamp trigger to accurately capture the start and end times of the feeding event.

[0076] In this embodiment, the depth camera includes a feeding trigger sensor assembly and a depth camera. The trigger sensor assembly includes at least two infrared diffuse reflection sensors and their sensor adjustment mechanisms, which are used to detect when cattle enter and leave the feeding station, thereby triggering the depth camera to collect point cloud data of the feed pile before and after feeding.

[0077] In this embodiment, a depth camera is installed at a fixed position above the feeding station, and the depth camera can periodically collect three-dimensional point cloud data of the feed pile before and after the cattle eat.

[0078] In this embodiment, since there is a difference between the camera coordinate system and the world coordinate system, the acquired point cloud coordinates are first uniformly transformed to the world coordinate system using a pre-calibrated coordinate transformation matrix. This coordinate transformation matrix is ​​obtained from camera calibration and can transform the points in the camera coordinate system into points in the world coordinate system. Precisely mapped to world coordinates based on the trough. By transforming coordinates, point cloud data collected at multiple times are aligned in the same coordinate system, laying the foundation for subsequent volume comparison.

[0079] In this embodiment, the collected point cloud is initially in the camera coordinate system. In order to compare point cloud data at different times, it needs to be transformed to a unified world coordinate system (i.e., the XOY plane is the ground).

[0080] The specific approach involves using a pre-calibrated 4×4 homogeneous transformation matrix. The point cloud in the camera coordinate system is expressed by the following formula. Convert to point cloud in world coordinate system : ; After coordinate transformation, the point clouds at each acquisition time are located in the same reference frame.

[0081] The cattle feed intake measurement method based on three-dimensional point cloud provided in this invention receives the entry and exit signals detected by the infrared sensor to trigger camera acquisition, and uses a homogeneous transformation matrix to perform a unified coordinate system transformation. This achieves fully automatic non-contact data acquisition and alignment with the absolute spatial reference, avoiding manual intervention. At the same time, it eliminates the perspective distortion and spatial relative displacement error caused by the camera's top-down installation, providing a unified reference space for subsequent volume difference calculation.

[0082] In some embodiments, the depth camera is installed above the feeding station via a three-degree-of-freedom adjustable protection mechanism; the three-degree-of-freedom adjustable protection mechanism includes an angle adjustment component and a waterproof and dustproof protective shell; the angle adjustment component is used to adjust the three-dimensional spatial acquisition posture of the depth camera; the depth camera is sealed inside the waterproof and dustproof protective shell, and the waterproof and dustproof protective shell is provided with a corrugated pipe sealing connector to achieve closed cable laying.

[0083] In this embodiment, the three-degree-of-freedom adjustable protection mechanism is a composite load-bearing component that connects the camera to the top crossbeam above the feeding trough.

[0084] In this embodiment, the angle adjustment component includes a horizontal angle adjustment disk, a vertical angle adjustment disk, and a camera tilt adjustment disk, which are used for fine attitude adjustment and repeatable locking of the camera in multiple dimensions such as pitch, roll, and yaw, to ensure that the camera's field of view can accurately cover the feeding trough area below.

[0085] In this embodiment, the waterproof and dustproof protective shell is a sealed outer shell that encloses the camera to protect it from high dust and humidity in the cattle's living environment, as well as liquid splashes during feeding and rinsing.

[0086] In this embodiment, the corrugated pipe sealing connector and the enclosed cable routing provide a completely sealed physical routing channel for the camera's power line and data signal line, preventing short circuits and communication interruptions caused by external factors.

[0087] Figure 2 This is one of the structural schematic diagrams of the cattle feed intake measurement device based on three-dimensional point clouds provided by the present invention. Figure 2 In the embodiment shown, the cattle feed intake measurement device based on three-dimensional point cloud includes the following key structures: control box, camera probe bracket, and camera three-degree-of-freedom adjustment and protection mechanism.

[0088] The cattle feed intake measurement device based on 3D point clouds also includes a depth camera, a camera mounting mechanism, and a feed intake trigger sensor assembly. The depth camera is fixedly installed on the top crossbeam above the cattle trough, and its height and probe distance are adjustable via a camera probe arm bracket. A three-degree-of-freedom adjustment and protection mechanism enables attitude adjustment and repeatable locking. The control box has a waterproof and dustproof housing, a waterproof cable entry structure for RJ45 network ports, power supply, and sensor leads, and a corrugated pipe sealed connector adapted to the depth camera cable. The control box integrates an industrial computer, switching power supply, cooling fan, leakage current protector, and I / O acquisition board for point cloud data access, sensor signal acquisition, and overall power supply protection. The feed intake trigger sensor assembly includes at least two infrared diffuse reflection sensors and their adjustment mechanisms, used to detect cattle entering and leaving the feeding station, thereby triggering the depth camera to collect point cloud data of the feed pile before and after feeding. The camera probe bracket uses a tiger-mouth clamp structure to hold the top crossbeam, which can achieve a height adjustment of about 800mm and an extension distance adjustment of about 650mm to adapt to different crossbeam sizes in cattle sheds and the spacing of feeding stations; the three-degree-of-freedom adjustment and protection mechanism is equipped with a waterproof and dustproof protective shell for the camera, and supports horizontal ±150°, vertical 360° and camera tilt angle 360° adjustment, while setting an angle dial to enable repeated positioning and calibration reproduction of the camera's field of view.

[0089] In this embodiment, a stable, adjustable, and environmentally adaptable point cloud data acquisition and behavior triggering platform is constructed through the coordinated configuration of the control box structure, camera space adjustment structure, and sensor triggering structure. The hardware system provides a reliable spatial positioning foundation, electrical safety guarantee, and triggering timing control conditions for the subsequent accurate acquisition and processing of 3D point cloud data.

[0090] In this embodiment, after the system hardware installation and structural fixation are completed, it is necessary to calibrate the spatial coordinate relationship of the depth camera to establish the correspondence between the camera coordinate system and the cowshed world coordinate system, thereby ensuring that point cloud data collected at different times can be aligned and compared under a unified coordinate system. The process is as follows: Upon initial use, the transformation matrix from camera coordinates to world coordinates is obtained through calibration. For example, by measuring the positions of known-sized markers on the ground, the following 4×4 matrix is ​​calculated: ; This matrix is ​​used to transform the point cloud from the camera coordinate system to a world coordinate system in millimeters (with the origin located at a reference point on the ground of the cowshed). This matrix is ​​used for uniform coordinate transformation in all subsequent point cloud processing to ensure data alignment.

[0091] It should be noted that when feeding cattle each day, the system is triggered immediately after the feed is put into the trough to collect point cloud data before feeding and record the initial feed pile shape. After the cattle have eaten, the system is triggered again to collect point cloud data after feeding and record the remaining feed. The point cloud data files collected in the two ways are saved as FeedBefore.ply and FeedAfter.ply, respectively.

[0092] The following section describes the specific implementation of the FeedVolumeMeasurement program using the data processing procedure of this example.

[0093] (1) Load the ground point cloud data of the empty trough (without feed) as a reference. The FeedVolumeMeasurement module provides the parameter empty_ground_file to specify the path of the empty ground file.

[0094] In this embodiment, the empty trough point cloud file is "nihe.ply", which contains point clouds of the bottom of the trough and the ground, used to assist in correcting the ground plane. The program reads this file and uses the RANSAC method to fit and obtain the ground plane model parameters. It is stored in the variable ground_plane.

[0095] (2) Add FeedBefore.ply and FeedAfter.ply as input data to the program; add the point cloud files to be analyzed through the add_feed_input(file_path, barrel_count, name) interface; where the barrel_count parameter represents the number of feed barrels used for feeding, and name can be assigned an identifier name for each data collection (such as "before feeding" / "after feeding"). The program will read each input PLY point cloud file in sequence and store it in a list for processing.

[0096] The program parameters are configured as follows: Enable pass-through filtering to limit the ROI region to the cattle trough area (the boundary value is similar to that described in (2)); enable voxel downsampling as needed, but here voxelization is temporarily disabled to ensure accuracy (voxel_config['enable']=False), or you can choose to set the voxel size to 5~10mm to balance accuracy and efficiency; enable statistical outlier removal, set the minimum number of neighbors per point to 20, and the standard deviation threshold to 2.0 to filter out isolated noise points; set the RANSAC plane fitting threshold to 4.0mm and the number of iterations to 1000 to ensure a high accuracy fit to the ground plane; enable the ground noise removal module, set the height threshold to 20mm, the radius to 16mm, and the high point ratio threshold to 15% to remove a small number of residual feed points attached to the ground; the initial grid resolution is set to Meanwhile, the system automatically calculates the grid resolution based on the number of point clouds to improve the accuracy of volume calculation.

[0097] (3) After configuration, call run_analysis() to start analyzing the input point cloud data. The program first processes the "pre-feeding" point cloud: performs coordinate transformation, filtering and noise reduction, fits the ground plane with the empty trough reference, and calculates the feed pile volume. The same process was then repeated on the "post-feeding" point cloud to calculate the remaining feed volume. During each volume calculation, the program uses the grid integration method described in step (4) to accumulate the volume and prints out the grid occupancy and the calculated net volume value. After all the input point clouds have been processed, the program summarizes the results and outputs a "Feed Pile Volume Measurement Report".

[0098] Example A (Single Camera, Dual Stations, Sensor-Triggered Acquisition): A depth camera is installed on the top beam of the cattle shed. The depth camera is fixed and adjusted in orientation via a camera probe bracket and a three-degree-of-freedom adjustable protection mechanism, allowing it to cover two adjacent feeding stations from above. An infrared diffuse reflection sensor is installed near each feeding station. The installation height and trigger angle of the two sensors are set and hard-locked via a sensor adjustment mechanism to output "entry trigger signal" and "departure trigger signal" respectively. The control box is fixed to the beam with a clamp. Its internal industrial control computer and IO acquisition board are electrically connected to the depth camera and infrared diffuse reflection sensor respectively. When the entry trigger signal arrives, the industrial control computer controls the depth camera to acquire and store the "pre-feeding point cloud". When the departure trigger signal arrives, the industrial control computer controls the depth camera to acquire and store the "post-feeding point cloud". Subsequently, the industrial control computer performs coordinate transformation, filtering and noise reduction, ground benchmark establishment, and grid integral volume calculation on the two point clouds, outputting the volume difference as the feeding amount result, which can be uploaded to the management platform or local storage via an RJ45 network interface.

[0099] In summary, the cattle feed intake measurement method based on 3D point clouds in this embodiment cleverly combines depth camera 3D measurement technology with a grid volume integration algorithm to achieve automatic and accurate estimation of feed intake in cattle sheds. Those skilled in the art will understand that modifications and improvements can be made to the specific implementation of the system without departing from the principles of this invention, such as changing the type of depth sensor, optimizing algorithm parameters, or connecting the results to an IoT feeding management platform; all of these should fall within the protection scope of this invention.

[0100] Figure 3 This is the second flowchart illustrating the method for measuring cattle feed intake based on three-dimensional point clouds provided by this invention. Figure 3In the embodiment shown, the industrial control computer controls the depth camera to periodically collect point cloud data of the feed pile before and after cattle feeding, and transmits the data to the processing module (which has the functions of preprocessing, extracting the target of the feed pile, and calculating the volume); the processing module preprocesses the point cloud and calculates the volume, and finally outputs the feed volume and feed intake results (i.e., output feed intake).

[0101] In this embodiment, the cattle feed intake measurement device based on 3D point clouds also includes a display / storage unit for displaying feed intake results to feeding managers in real time or recording them in a database. The entire system is integrated via a network or wired connection to achieve automatic monitoring of feed intake.

[0102] The cattle feed intake measurement method based on three-dimensional point clouds provided in this invention uses a depth image acquisition device sealed in a waterproof and dustproof protective shell. The spatial posture is adjusted by an angle adjustment component, and the cable is laid out in a corrugated pipe. This method can solve the problems of sensor failure and cable aging that are common in ordinary vision devices in the high humidity, corrosion, and dusty environments where cattle live. It can also ensure that the device can be quickly reset and reproduced after daily maintenance, cleaning, or seasonal adjustments, thus improving the stability and data consistency of the system during long-term continuous operation in the ranch.

[0103] In some embodiments, a ground plane model is fitted based on the denoised point cloud data, and multiple ground-hugging candidate points are selected using the vertical distance from each point in the denoised point cloud data to the ground plane model. This includes: iteratively sampling the denoised point cloud data using a random sampling consensus algorithm to fit the model parameters of the ground reference plane; using the ground reference plane as the zero height reference plane, calculating the vertical distance between each point in the denoised point cloud data and the zero height reference plane based on the model parameters, and determining points whose vertical distance does not exceed a height threshold as ground-hugging candidate points.

[0104] In this embodiment, the ground plane model can be obtained by iteratively sampling the ground points in the denoised point cloud using the RANSAC (Random Sample Consensus) algorithm to establish a zero-height reference surface.

[0105] In this embodiment, after completing the ground plane fitting and benchmark establishment, in order to further suppress the influence of ground noise caused by a small amount of residual feed, reflection scattering or weak texture near the bottom of the trough on the subsequent volume estimation, this embodiment can optionally enable the ground noise removal module based on the feed point cloud preprocessing results.

[0106] Specifically, target point cloud data is obtained through the following steps: (1) Based on the fitted ground reference plane, it is expressed as follows: ; in,a b c For coefficients, x , y , z These are the three-dimensional coordinates of the spatial coordinate system.

[0107] In this embodiment, any point in the denoised point cloud data The normal distance (height) between the point and the plane is calculated using the following formula: ; Where d is a constant term, x i , y i , z i The first i The three-dimensional coordinates of the spatial coordinate system corresponding to each point.

[0108] (2) Using height threshold Filter out those that meet the requirements The set of candidate points close to the ground, then using the neighborhood radius Perform a radius neighborhood search on the candidate points and count the number of points in their local neighborhood that satisfy the following conditions: The percentage of "high points" is expressed by the following formula: ; in, Let be the index of any point within the neighborhood of candidate point 𝑖. Let be the set of neighborhood points obtained by searching with the candidate point 𝑖 as the center and according to the neighborhood radius 𝑅, and |𝑁(𝑖)| be the total number of points in this neighborhood.

[0109] (3) Compare this percentage with the high point percentage threshold. Make a judgment: when When confirming that the area close to the ground has a continuous connection with the main body of the feed pile (typically manifested as a transition zone at the edge / bottom of the feed pile), this area is retained to avoid weakening the true boundary of the feed pile; when At that time, it was confirmed that the ground-hugging area lacked high-point support and was more in line with the spatial characteristics of "a small number of residual feed points or clusters of reflective noise points attached to the ground". Therefore, only the ground-hugging candidate points in the neighborhood were removed and the filtered point cloud was output.

[0110] The method for measuring cattle feed intake based on three-dimensional point clouds provided in this invention establishes a zero-reference surface by fitting ground model parameters using a random sampling consensus algorithm and extracting ground-level candidate points based on vertical distance and height thresholds. This overcomes the systematic reference error caused by camera installation posture deviation and the physical tilt of the cattle trough on volume estimation, restores the true thickness of feed accumulation, and provides accurate data support for subsequent ground noise reduction without damaging the edge of the feed pile.

[0111] In some embodiments, filtering and denoising the coordinate-transformed point cloud data to obtain denoised point cloud data includes: performing pass-through filtering on the coordinate-transformed point cloud data according to the three-dimensional spatial boundary range of the feed trough area corresponding to the feed pile to obtain point cloud data within the feed trough area; and performing statistical filtering and / or radius filtering denoising on the retained point cloud data according to the local neighborhood statistical characteristics of the point cloud to obtain denoised point cloud data.

[0112] It should be noted that after the coordinate unification and study area clipping of the point cloud of the material pile, the point cloud inevitably still contains outliers, sparse noise points, and ground-hugging residual points caused by sensor measurement errors, environmental reflection interference, boundary scattering, and local occlusion. If the original point cloud is used directly for volume calculation, it is easy to cause local height estimation errors, which will affect the accuracy of the overall volume integration result. Therefore, this embodiment performs filtering and denoising processing on the point cloud before volume calculation to preserve the main shape of the material pile and suppress the interference of invalid points on subsequent calculations.

[0113] In this embodiment, firstly, irrelevant points that are significantly outside the feeding station area are removed by spatial range constraints. Then, the discrete and spatially isolated abnormal points are suppressed by combining the local neighborhood statistical features of the point cloud, thereby improving the uniformity of the point cloud distribution and the stability of the overall morphological expression.

[0114] Specifically, the process of filtering and denoising the converted point cloud data to remove irrelevant information and noise interference is as follows: (1) First, the point cloud data after coordinate transformation is filtered by direct filtering, that is, the spatial range boundary is set, only the point cloud data in the cattle trough area is retained, and the points outside the cattle trough and reasonable height range are removed.

[0115] For example, the boundaries in the X and Y directions correspond to the length and width of the feeding trough, while the lower limit of the Z direction (height) is slightly higher than the ground level and the upper limit is slightly higher than the maximum possible feed height. , , (The specific range can be adjusted according to the installation height and feed trough size).

[0116] (2) Next, voxel downsampling is performed on the point cloud as needed.

[0117] In this embodiment, voxel downsampling divides the point cloud into grid voxels (cubic units), replacing a large number of neighboring points with representative points within each voxel, thereby reducing the size of the point cloud and improving processing speed. It should be noted that oversampling may affect volumetric accuracy, so whether to enable voxelization can be selected based on system performance.

[0118] (3) Subsequently, an outlier removal algorithm is applied to clean up isolated noise points. In this embodiment, a combination of statistical filtering and radius filtering is preferred, including: statistical filtering calculates the number of points in a certain neighborhood of each point and removes points with too few neighbors as noise; radius filtering removes discrete points with low local density. Through the above filtering and denoising process, clean point cloud data representing the actual shape of the feed pile is obtained, i.e., the denoised point cloud data.

[0119] The method for measuring cattle feed intake based on three-dimensional point clouds provided in this invention defines the feed trough area by using a direct-pass filter within the three-dimensional spatial boundary range, and performs statistical filtering or radius filtering to denoise the feed trough by combining local neighborhood statistical features. This method can adapt to uncontrollable background debris and high dust interference in the open environment of the cattle shed, reduce the scale of point cloud data processing, and improve the spatial distribution uniformity and real morphological expression ability of the retained point cloud.

[0120] Figure 4 This is the third flowchart of the cattle feed intake measurement method based on three-dimensional point clouds provided by the present invention. Figure 4 In the illustrated embodiment, a camera is installed above the cattle's feeding station (including a haystack, corresponding to the feed pile mentioned above) to scan the haystack before and after feeding, and extract the corresponding haystack point cloud. Target extraction is performed on the haystack point cloud, including coordinate transformation, point cloud denoising, ground fitting, and ground noise removal operations, to obtain target point cloud data. The target point cloud data is then used for volume calculation, including grid division, extraction of grid point cloud height, volume calculation, and output volume, ultimately obtaining the volume of the haystack before and after feeding.

[0121] Figure 5 This is the fourth flowchart of the method for measuring cattle feed intake based on three-dimensional point clouds provided by this invention. Figure 5In the illustrated embodiment, in the data initialization layer, the point cloud sequence before and after feeding and the empty slot reference data are input; the empty slot reference data is automatically identified by multi-slot partitioning, and the identified slots are globally transformed and aligned with the point cloud sequence before and after feeding. Then, the aligned data is fitted with RANSAC ground plane to obtain a ground plane model; in the core algorithm execution layer, the distance between each point in the processed point cloud sequence before and after feeding and the vertical plane of the ground plane model is calculated, and it is determined whether there is a partition to be processed. If so, the core algorithm is executed: ground noise removal (height gating + neighborhood discrimination) to filter and obtain clean point cloud data. The volume of the clean point cloud data is calculated using the grid integration method to determine the difference in feeding amount, and finally a feeding amount report (such as an Excel report) is generated; finally, the volume calculation results and the Excel report are sent to the user interface (GUI).

[0122] The following describes the cattle feed intake measurement device based on three-dimensional point clouds provided by the present invention. The cattle feed intake measurement device based on three-dimensional point clouds described below can be referred to in correspondence with the cattle feed intake measurement method based on three-dimensional point clouds described above.

[0123] Figure 6 This is the second schematic diagram of the structure of the cattle feed intake measurement device based on three-dimensional point clouds provided by the present invention, as shown below. Figure 6 As shown, the device includes: a point cloud data acquisition module 610, a data preprocessing module 620, a data filtering module 630, and a calculation module 640.

[0124] The point cloud data acquisition module 610 is used to acquire the three-dimensional point cloud data corresponding to cattle before and after feeding on the feed pile, and to convert the coordinates of the three-dimensional point cloud data to world coordinates to obtain the point cloud data after coordinate conversion. The data preprocessing module 620 is used to filter and denoise the point cloud data after coordinate transformation to obtain denoised point cloud data. The data filtering module 630 is used to fit a ground plane model based on the denoised point cloud data, and to filter out multiple ground-hugging candidate points using the vertical distance from each point in the denoised point cloud data to the ground plane model; calculate the total number of points in the preset horizontal neighborhood of each ground-hugging candidate point, the number of points whose vertical distance to each point in the preset horizontal neighborhood exceeds the height threshold, and filter the denoised point cloud data according to the ratio of the number of points to the total number of points to obtain the target point cloud data; The calculation module 640 is used to calculate the volume of the feed pile collected in a single collection based on the target point cloud data, obtain the volume change of the feed pile before and after it is consumed, and determine the amount of feed consumed by the cattle based on the volume change.

[0125] The present invention provides a cattle feed intake measurement device based on three-dimensional point clouds. By acquiring three-dimensional point cloud data corresponding to cattle before and after feeding on a feed pile and transforming its coordinates, it achieves non-contact automatic acquisition and unified data spatial reference. By filtering and denoising the point cloud data after coordinate transformation, it achieves accurate extraction of the measurement area and effective suppression of environmental interference. By fitting a ground plane model to the denoised point cloud data and calculating the number of points, the total number of points, and the ratio between the two, it is used to filter the denoised point cloud data. This adaptively removes ground-level residual points without weakening the true boundary of the feed pile, improving the accuracy of feed intake estimation. Finally, the volume of the feed pile collected in a single acquisition is calculated through the target point cloud data, thereby determining the cattle's feed intake. This achieves high-precision non-contact quantitative monitoring of feed intake under complex pile shapes, simplifying the cumbersome process of cattle feed intake measurement.

[0126] Figure 7 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 7 As shown, the electronic device may include: a processor 710, a communications interface 720, a memory 730, and a communications bus 740, wherein the processor 710, the communications interface 720, and the memory 730 communicate with each other through the communications bus 740. The processor 710 can call logic instructions in the memory 730 to execute a method for measuring cattle feed intake based on three-dimensional point clouds. This method includes: acquiring three-dimensional point cloud data corresponding to cattle before and after consuming feed piles, and transforming the coordinates of the three-dimensional point cloud data to world coordinates to obtain coordinate-transformed point cloud data; filtering and denoising the coordinate-transformed point cloud data to obtain denoised point cloud data; fitting a ground plane model based on the denoised point cloud data, and using the vertical distance from each point in the denoised point cloud data to the ground plane model to select multiple ground-hugging candidate points; calculating the total number of points in a preset horizontal neighborhood of each ground-hugging candidate point, and the number of points in the preset horizontal neighborhood whose vertical distance exceeds a height threshold, and filtering the denoised point cloud data based on the ratio of the number of points to the total number of points to obtain target point cloud data; calculating the volume of the feed pile collected in a single instance based on the target point cloud data, obtaining the volume change of the feed pile before and after consumption, and determining the cattle's feed intake based on the volume change.

[0127] Furthermore, the logical instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0128] On the other hand, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program performs the above-described method for measuring cattle feed intake based on three-dimensional point clouds. The method includes: acquiring three-dimensional point cloud data corresponding to cattle before and after feeding on a feed pile, and converting the coordinates of the three-dimensional point cloud data to world coordinates to obtain coordinate-converted point cloud data; filtering and denoising the coordinate-converted point cloud data to obtain denoised point cloud data; fitting a ground plane model based on the denoised point cloud data, and filtering multiple ground-hugging candidate points using the vertical distance from each point in the denoised point cloud data to the ground plane model; calculating the total number of points in a preset horizontal neighborhood of each ground-hugging candidate point, the number of points in the preset horizontal neighborhood whose vertical distance exceeds a height threshold, and filtering the denoised point cloud data according to the ratio of the number of points to the total number of points to obtain target point cloud data; calculating the volume of the feed pile collected in a single session based on the target point cloud data, obtaining the volume change of the feed pile before and after feeding, and determining the cattle feed intake based on the volume change.

[0129] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0130] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0131] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for measuring feed intake in cattle based on three-dimensional point clouds, characterized in that, include: Three-dimensional point cloud data of cattle before and after feeding on the feed pile are obtained, and the coordinates of the three-dimensional point cloud data are transformed into world coordinates to obtain coordinate-transformed point cloud data. The point cloud data after coordinate transformation is filtered and denoised to obtain denoised point cloud data. A ground plane model is fitted based on the denoised point cloud data, and multiple ground-hugging candidate points are selected using the vertical distance from each point in the denoised point cloud data to the ground plane model. The total number of points in a preset horizontal neighborhood of each ground-hugging candidate point and the number of points whose vertical distance to each point in the preset horizontal neighborhood exceeds a height threshold are calculated. The denoised point cloud data is then filtered based on the ratio of the number of points to the total number of points to obtain the target point cloud data. The volume of the feed pile collected in a single instance is calculated based on the target point cloud data, the volume change of the feed pile before and after it is consumed is obtained, and the feed intake of the cattle is determined based on the volume change.

2. The method for measuring cattle feed intake based on three-dimensional point clouds according to claim 1, characterized in that, The calculation of the feed pile volume collected in a single instance based on the target point cloud data includes: Determine the projection area of ​​the target point cloud data on the horizontal plane, and obtain the span values ​​of the projection area in the first direction and the second direction respectively; The first grid division number in the first direction is calculated based on the total number of valid points in the target point cloud data and the ratio of the span value in the first direction to the span value in the second direction; the second grid division number in the second direction is calculated based on the total number of valid points in the target point cloud data and the ratio of the span value in the second direction to the span value in the first direction. The projection area is divided into rectangular grids using the first grid division number and the second grid division number to obtain multiple grid cells; The volume of the feed pile in a single acquisition is obtained by integrating the volume information of the point cloud within the multiple grid cells.

3. The method for measuring cattle feed intake based on three-dimensional point clouds according to claim 2, characterized in that, The step of integrating the volume based on the height information of the point cloud within the multiple grid cells to obtain the volume of the feed pile collected in a single instance includes: For each grid cell, the target point cloud data within the grid cell is statistically analyzed, and the average vertical distance corresponding to each target point cloud data is calculated to obtain the average height of the grid cell. Multiply the average height by the base area corresponding to the grid cell to obtain the local volume; The local volumes of all grid cells are summed to obtain the volume of the feed pile in a single acquisition.

4. The method for measuring cattle feed intake based on three-dimensional point clouds according to claim 1, characterized in that, The process of acquiring three-dimensional point cloud data of cattle before and after consuming the feed pile, and transforming the coordinates of the three-dimensional point cloud data to world coordinates to obtain coordinate-transformed point cloud data, includes: Receives the first signal triggered when a cow enters the feeding station, detected by an infrared sensor; In response to the first signal, the depth camera is controlled to acquire three-dimensional point cloud data of the feed pile before it is fed; Receives a second signal triggered by an infrared sensor when a cow leaves its feeding station; In response to the second signal, the depth camera is controlled to acquire three-dimensional point cloud data of the feed pile after it has been fed; Using a pre-calibrated homogeneous transformation matrix, the 3D point cloud data before and after feeding are transformed from the camera coordinate system to a unified world coordinate system, respectively, to obtain the coordinate-transformed point cloud data.

5. The method for measuring cattle feed intake based on three-dimensional point clouds according to claim 4, characterized in that, The depth camera is mounted above the feeding station via a three-degree-of-freedom adjustable protection mechanism; the three-degree-of-freedom adjustable protection mechanism includes an angle adjustment component and a waterproof and dustproof protective shell; The angle adjustment component is used to adjust the three-dimensional spatial acquisition posture of the depth camera; the depth camera is sealed inside the waterproof and dustproof protective shell, and the waterproof and dustproof protective shell is provided with a corrugated pipe sealing connector to achieve closed cable laying.

6. The method for measuring cattle feed intake based on three-dimensional point clouds according to claim 1, characterized in that, The step of fitting a ground plane model based on the denoised point cloud data and filtering out multiple ground-hugging candidate points using the vertical distance from each point in the denoised point cloud data to the ground plane model includes: The denoised point cloud data is iteratively sampled using a random sampling consensus algorithm to fit the model parameters of the ground reference plane. Using the ground reference plane as the zero height reference plane, the vertical distance between each point in the denoised point cloud data and the zero height reference plane is calculated according to the model parameters, and the points whose vertical distance does not exceed the height threshold are determined as the ground-hugging candidate points.

7. The method for measuring cattle feed intake based on three-dimensional point clouds according to claim 1, characterized in that, The step of filtering and denoising the point cloud data after coordinate transformation to obtain denoised point cloud data includes: The point cloud data after coordinate transformation is filtered by passing through the three-dimensional spatial boundary range of the feed trough area corresponding to the feed pile to obtain the point cloud data within the feed trough area; Based on the local neighborhood statistical characteristics of the point cloud, the retained point cloud data is subjected to statistical filtering and / or radius filtering denoising to obtain the denoised point cloud data.

8. A device for measuring cattle feed intake based on three-dimensional point clouds, characterized in that, include: The point cloud data acquisition module is used to acquire the three-dimensional point cloud data corresponding to cattle before and after feeding on the feed pile, and to convert the coordinates of the three-dimensional point cloud data to world coordinates to obtain the coordinate-transformed point cloud data. The data preprocessing module is used to filter and denoise the point cloud data after coordinate transformation to obtain denoised point cloud data. The data filtering module is used to fit a ground plane model based on the denoised point cloud data, and to filter out multiple ground-hugging candidate points using the vertical distance from each point in the denoised point cloud data to the ground plane model; calculate the total number of points in a preset horizontal neighborhood of each ground-hugging candidate point, the number of points whose vertical distance to each point in the preset horizontal neighborhood exceeds a height threshold, and filter the denoised point cloud data according to the ratio of the number of points to the total number of points to obtain target point cloud data; The calculation module is used to calculate the volume of the feed pile collected in a single collection based on the target point cloud data, obtain the volume change of the feed pile before and after it is consumed, and determine the amount of feed consumed by the cattle based on the volume change.

9. An electronic device 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 method for measuring cattle feed intake based on three-dimensional point clouds as described in any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the method for measuring cattle feed intake based on three-dimensional point clouds as described in any one of claims 1 to 7.