CN-122024290-A - Live pig body surface point cloud extraction method and device oriented to breeding environment and readable storage medium thereof
Abstract
The invention provides a live pig body surface point cloud extraction method and device oriented to a breeding environment and a readable storage medium thereof. The method mainly comprises the steps of performing primary plane detection, determining a ground plane normal vector and removing ground point clouds in a cultivation scene, performing clustering on the rest point clouds, performing secondary plane detection on candidate clusters, removing interference clusters with an excessively high proportion of the ground point clouds, preferably selecting target clusters, performing tertiary plane detection inside the target clusters, identifying suspected background planes, obtaining an orthographic projection vector of the ground plane normal vector on the suspected background planes or obtaining a normal vector of the suspected background planes, calculating a first included angle of the orthographic projection vector and the ground plane normal vector or calculating a second included angle of the suspected background plane normal vector and the ground plane normal vector, and logically and intelligently stripping the background facility point clouds adhered to live pigs based on the plane detection state and the included angle. The method can effectively cope with complex scenes such as wall sticking and fence sticking of the live pigs, and high-precision extraction of the body surface data of the live pigs is realized.
Inventors
- WANG KE
- ZOU WENZHI
- Yang wangshan
- Tang Zhengxue
- SUN JIAXIN
- FU CHUNYAN
Assignees
- 中国计量大学
Dates
- Publication Date
- 20260512
- Application Date
- 20260408
Claims (10)
- 1. The live pig body surface point cloud extraction method facing the breeding environment is characterized by comprising the following steps of: acquiring farm scene point cloud data comprising livestock body surface point cloud and ground point cloud; Performing ground detection, namely performing plane fitting on the farm scene point cloud data, determining a ground plane normal vector, and removing the ground point cloud in the farm scene point cloud data to obtain scene residual point cloud; A cluster screening step is executed, wherein the scene residual point cloud is subjected to cluster processing, and target clusters containing livestock are selected according to cluster characteristics; performing plane detection on the target cluster to try to identify a suspected background plane existing in the target cluster, and acquiring an orthographic projection vector of the normal vector of the ground plane on the suspected background plane or acquiring the normal vector of the suspected background plane; the separation and extraction step is carried out, namely a first included angle between the orthographic projection vector and the normal vector of the ground plane is calculated, or a second included angle between the normal vector of the suspected background plane and the normal vector of the ground plane is calculated; And judging whether the suspected background plane is required to be removed from the target cluster according to the first included angle or the second included angle and the plane detection result, so as to extract the final live pig body surface point cloud.
- 2. The method for extracting live pig body surface point cloud as claimed in claim 1, wherein the step of performing ground detection specifically comprises: Carrying out plane detection on the scene point cloud data of the farm by adopting a random sampling consistency algorithm and a Hough transform algorithm respectively to obtain a first detection point cloud and a second detection point cloud respectively; Taking the intersection of the first detection point cloud and the second detection point cloud as a ground Ping Miandian cloud; and carrying out principal component analysis on the ground plane point cloud, and extracting a feature vector corresponding to the minimum feature value as the ground plane normal vector.
- 3. The method for extracting live pig body surface point cloud as claimed in claim 1, further comprising the step of correcting the direction of the normal vector after determining the normal vector of the ground plane: Intercepting a point cloud subset in a preset height interval along the direction of the ground plane normal vector; And judging whether the point cloud subset is empty or not, if so, turning over the direction of the normal vector of the ground plane to enable the point cloud subset to point to one side of the livestock body, and if not, keeping the current normal vector direction.
- 4. The method for extracting live pig body surface point cloud as claimed in claim 1, wherein the step of performing cluster screening specifically comprises: performing European cluster segmentation on the scene residual point cloud to obtain a plurality of candidate clusters; Performing plane feature detection on each candidate cluster, calculating the proportion of plane point clouds, and eliminating interference clusters with the proportion of the plane point clouds smaller than a preset proportion threshold; And sorting the clusters remaining after the elimination according to the number of the contained point clouds, and selecting the cluster with the largest number of the point clouds as the target cluster.
- 5. The method of claim 1, wherein in the step of performing separation and extraction, specific logic for determining whether the suspected background plane needs to be removed from the target cluster according to the first included angle and the plane detection result is as follows: if no effective suspected background plane is detected in the target cluster, or if the suspected background plane is detected but the first included angle is larger than or equal to a preset angle threshold, judging that the target cluster is a pig body surface point cloud and reserving the pig body surface point cloud; If an effective suspected background plane is detected in the target cluster and the first included angle is smaller than a preset angle threshold, judging that the suspected background plane is a breeding environment facility, deleting the suspected background plane from the target cluster, and taking the rest point cloud as live pig body surface point cloud.
- 6. The method for extracting live pig body surface point cloud according to claim 1, wherein the specific logic for judging whether the suspected background plane needs to be removed from the target cluster according to the second included angle and the plane detection result is as follows: If no effective suspected background plane is detected in the target cluster, or if the suspected background plane is detected but the second included angle is outside a preset angle range, judging that the target cluster is a pig body surface point cloud and reserving the pig body surface point cloud; If an effective suspected background plane is detected in the target cluster and the second included angle is in a preset angle range, judging that the suspected background plane is a breeding environment facility, deleting the suspected background plane from the target cluster, and taking the rest point cloud as live pig body surface point cloud.
- 7. The live pig body surface point cloud extraction method of claim 1, wherein the farm scene point cloud data is obtained by tracking livestock through a movable three-dimensional point cloud acquisition device, and the target clusters are point cloud sets of single livestock and breeding environment facilities which are adhered or not adhered.
- 8. Pig body surface point cloud extraction element towards breeding environment, its characterized in that includes: The data acquisition module is used for acquiring farm scene point cloud data comprising livestock body surface point clouds and ground point clouds; the ground processing module is used for carrying out plane fitting on the farm scene point cloud data, determining a ground plane normal vector, and removing the ground point cloud in the farm scene point cloud data to obtain a scene residual point cloud; the clustering optimization module is used for clustering the residual point clouds after the ground is removed and screening out target clusters; The background detection module is used for carrying out plane detection on the target clusters so as to try to identify suspected background planes existing in the target clusters, and acquiring orthographic projection vectors of the normal vectors of the ground planes on the suspected background planes or acquiring normal vectors of the suspected background planes; The separation and extraction module is used for calculating a first included angle between the orthographic projection vector and the normal vector of the ground plane or calculating a second included angle between the normal vector of the suspected background plane and the normal vector of the ground plane, and judging whether the suspected background plane needs to be removed from the target cluster according to the first included angle or the second included angle and the plane detection result, so that the final live pig body surface point cloud is extracted.
- 9. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, the processor being arranged to run the computer program to perform the live pig body surface point cloud extraction method of any of claims 1 to 7.
- 10. A readable storage medium, characterized in that the readable storage medium has stored therein a computer program comprising program code for controlling a process to execute a process comprising the live pig body surface point cloud extraction method according to any one of claims 1 to 7.
Description
Live pig body surface point cloud extraction method and device oriented to breeding environment and readable storage medium thereof Technical Field The invention relates to the technical field of agricultural informatization and computer vision intersection, in particular to a three-dimensional point cloud data processing technology, and particularly relates to a live pig body surface point cloud extraction method and device facing a breeding environment and a readable storage medium thereof. Background With the development of intelligent agriculture, non-contact livestock body ruler measurement and behavior analysis technologies are increasingly paid attention to. In general, by using a movable three-dimensional point cloud acquisition device such as a laser radar or a depth camera, it is possible to acquire livestock body surface point cloud data containing depth information. By analyzing the point cloud data, the automatic monitoring of the growth state of the livestock can be realized. However, in practical farming scenarios, the environment is complex and space is limited. When using a mobile device to track and collect live pig data, live pigs tend to move or stand against the pens, fences or walls of a farm. In the original point cloud data acquired under the condition, the body surface point cloud of the live pigs can be spatially adhered or overlapped with the point cloud of the background facilities (wall bodies and fences). Existing conventional segmentation algorithms have difficulty in accurately and completely separating live pig targets from complex background facilities under such adhesion conditions. If pure live pig body surface point cloud cannot be obtained, the subsequent body ruler measurement accuracy is directly reduced, even the behavior recognition algorithm is invalid, and the requirement of accurate cultivation cannot be met. Disclosure of Invention The embodiment of the invention provides a live pig body surface point cloud extraction method and device facing a breeding environment and a readable storage medium thereof, which aim at solving the problems that in the prior art, when movably acquired breeding environment point cloud data are processed, spatial adhesion between live pig body surface point cloud and breeding facilities (such as walls and fences) is difficult to effectively solve, so that a live pig target cannot be accurately extracted, and further the accuracy of subsequent body ruler measurement and behavior analysis is affected. The core technology of the invention mainly provides a point cloud extraction strategy combining multistage plane detection and cluster segmentation, ground interference is gradually removed through three-time plane detection, and vertical background facilities (walls or fences) adhered to live pigs are adaptively identified and removed by utilizing normal vectors of suspected background planes or included angle logic of orthographic projection vectors on the suspected background planes and the normal vectors of the ground, so that the accurate extraction of live pig body surface point cloud is realized. In a first aspect, the invention provides a live pig body surface point cloud extraction method facing to a breeding environment, which comprises the following steps: acquiring farm scene point cloud data comprising livestock body surface point cloud and ground point cloud; performing ground detection, namely performing plane fitting on the scene point cloud data of the farm, determining a ground plane normal vector, and removing the ground point cloud in the scene point cloud data of the farm to obtain scene residual point cloud; a cluster screening step is executed, wherein the cluster processing is carried out on the scene residual point cloud, and target clusters containing livestock are selected according to the cluster characteristics; performing a background separation step, namely performing plane detection on the target cluster to try to identify a suspected background plane existing in the target cluster, and acquiring an orthographic projection vector of a normal vector of a ground plane on the suspected background plane or acquiring the normal vector of the suspected background plane; the separation and extraction step is carried out, namely a first included angle between the projection vector and the normal vector of the ground plane is calculated, or a second included angle between the normal vector of the suspected background plane and the normal vector of the ground plane is calculated; and judging whether a suspected background plane needs to be removed from the target cluster according to the first included angle or the second included angle and the plane detection result, thereby extracting the final live pig body surface point cloud. Further, the step of performing ground detection specifically includes: carrying out plane detection on the scene point cloud data of the farm by adopting a random sampling consistency algo