Pig body surface point cloud extraction method and device for breeding environment and readable storage medium thereof

By combining multi-level planar detection and clustering segmentation, the problem of adhesion between pig surface point clouds and background facilities was solved, enabling accurate extraction of pig surface point clouds and improving the accuracy of measurement and analysis.

CN122024290BActive Publication Date: 2026-06-26CHINA JILIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA JILIANG UNIV
Filing Date
2026-04-08
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

In the breeding environment, the point cloud of the pig's body surface is spatially adhered to the background facilities (such as walls and fences), making it difficult for existing segmentation algorithms to separate them accurately, which leads to a decrease in the accuracy of body size measurement and behavior analysis.

Method used

A method combining multi-level planar detection and clustering segmentation is adopted. Ground interference is gradually eliminated through three-stage planar detection, and vertical background facilities are identified and eliminated by using the logical identification of the angle between normal vectors or orthographic projection vectors, so as to achieve accurate extraction of point clouds on the surface of pigs.

Benefits of technology

This effectively solved the problem of point cloud adhesion between the pig body surface and background facilities, improved the accuracy and robustness of point cloud extraction, and provided a high-quality data foundation for subsequent body size measurement and behavior analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122024290B_ABST
    Figure CN122024290B_ABST
Patent Text Reader

Abstract

The application provides a pig body surface point cloud extraction method and device for a breeding environment and a readable storage medium thereof. The method mainly comprises the following steps: performing first plane detection, determining a ground plane normal vector, and removing ground point clouds in a breeding scene; clustering the remaining point clouds and performing second plane detection on the candidate clusters to remove interference clusters with a high proportion of plane point clouds and to optimize target clusters; performing third plane detection inside the target clusters to identify suspected background planes; obtaining a normal 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 between the normal projection vector and the ground plane normal vector or a second included angle between the normal vector of the suspected background planes and the ground plane normal vector; and based on the plane detection state and the included angle logic, intelligently stripping the background facility point clouds adhered to the pigs. The application can effectively deal with complex scenes such as pig wall sticking and column sticking, and realize high-precision extraction of pig body surface data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of interdisciplinary technology of agricultural informatization and computer vision, specifically to a three-dimensional point cloud data processing technology, and particularly to a method, device and readable storage medium for extracting point clouds from the body surface of pigs for breeding environments. Background Technology

[0002] With the development of smart agriculture, non-contact livestock body size measurement and behavior analysis technologies are receiving increasing attention. Typically, mobile 3D point cloud acquisition devices such as lidar or depth cameras can be used to acquire point cloud data of the livestock body surface, containing depth information. Analysis of this point cloud data enables automated monitoring of livestock growth status.

[0003] However, in actual farming scenarios, the environment is complex and space is limited. When using mobile devices to track and collect data on pigs, the pigs often move or stand close to the fences, barriers, or walls of the farm. In this situation, the raw point cloud data collected will show that the pig's body surface point cloud is spatially "stuck" or overlaps with the point cloud of the background facilities (walls, fences). Existing conventional segmentation algorithms struggle to accurately and completely separate the pig target from the complex background facilities under such conditions. If a clean pig body surface point cloud cannot be obtained, it will directly lead to a decrease in the accuracy of subsequent body size measurements, and may even cause behavior recognition algorithms to fail, thus failing to meet the needs of precision farming. Summary of the Invention

[0004] This invention provides a method, apparatus, and readable storage medium for extracting point clouds from the body surface of pigs in a breeding environment. It addresses the problem that existing technologies struggle to effectively solve the spatial adhesion issue between the point cloud data of pigs and breeding facilities (such as walls and fences) when processing point cloud data from mobile-collected breeding environments. This leads to the inability to accurately extract the pig target, which in turn affects the accuracy of subsequent body size measurements and behavioral analysis.

[0005] The core technology of this invention is to propose a point cloud extraction strategy that combines multi-level plane detection and clustering segmentation. By performing three plane detections to gradually eliminate ground interference, and by using the angle logic between the normal vector of the suspected background plane or the orthographic projection vector on the suspected background plane and the ground normal vector, vertical background facilities (walls or fences) that are attached to the pigs are adaptively identified and eliminated, thereby achieving accurate extraction of point clouds from the surface of the pigs.

[0006] In a first aspect, the present invention provides a method for extracting point clouds from the body surface of pigs for use in a breeding environment, the method comprising the following steps:

[0007] Acquire point cloud data of a livestock farming scene, including point clouds of livestock body surfaces and ground points;

[0008] Perform ground detection steps: perform plane fitting on the point cloud data of the aquaculture scene, determine the ground plane normal vector, and remove the ground point cloud from the aquaculture scene point cloud data to obtain the remaining point cloud of the scene;

[0009] Perform clustering and filtering steps: perform clustering processing on the remaining point cloud of the scene, and select the target cluster containing livestock based on the clustering features;

[0010] Perform background separation steps: Perform plane detection on the target cluster to attempt to identify suspected background planes and obtain the orthogonal projection vector of the ground plane normal vector onto the suspected background plane, or obtain the normal vector of the suspected background plane;

[0011] Perform the separation and extraction steps: calculate the first angle between the projection vector and the ground plane normal vector, or calculate the second angle between the normal vector of the suspected background plane and the ground plane normal vector;

[0012] Based on the results of the first or second included angle and plane detection, it is determined whether suspected background planes need to be removed from the target cluster, thereby extracting the final point cloud of the pig body surface.

[0013] Furthermore, the specific steps for performing ground-based detection include:

[0014] The random sampling consensus algorithm and the Hough transform algorithm were used to perform planar detection on the point cloud data of the aquaculture scene, respectively, to obtain the first detection point cloud and the second detection point cloud.

[0015] The intersection of the first and second detection point clouds is taken as the ground plane point cloud;

[0016] Principal component analysis is performed on the ground plane point cloud, and the eigenvectors corresponding to the minimum eigenvalues ​​are extracted as the ground plane normal vectors.

[0017] Furthermore, after determining the ground plane normal vector, the process also includes a step of correcting the direction of the normal vector:

[0018] Extract a subset of point clouds within a preset height range along the direction of the ground plane normal vector;

[0019] Determine if a subset of the point cloud is empty: if it is empty, flip the direction of the ground plane normal vector so that it points to the side of the livestock; if it is not empty, keep the current direction of the normal vector.

[0020] Furthermore, the specific steps of performing clustering screening include:

[0021] The remaining point cloud of the scene is segmented using Euclidean clustering to obtain multiple candidate clusters;

[0022] For each candidate cluster, planar feature detection is performed, the planar point cloud ratio is calculated, and interfering clusters with a planar point cloud ratio less than a preset ratio threshold are removed.

[0023] The remaining clusters after elimination are sorted according to the number of point clouds they contain, and the cluster with the most point clouds is selected as the target cluster.

[0024] Furthermore, in the separation and extraction step, the specific logic for determining whether to remove suspected background planes from the target cluster based on the first included angle and the results of plane detection is as follows:

[0025] If no valid suspected background plane is detected in the target cluster, or if a suspected background plane is detected but the first included angle is greater than or equal to the preset angle threshold, then the target cluster is determined to be a point cloud of the pig body surface and is retained.

[0026] If a valid suspected background plane is detected in the target cluster and the first included angle is less than the preset angle threshold, the suspected background plane is determined to be a breeding environment facility, the suspected background plane is deleted from the target cluster, and the remaining point cloud is used as the point cloud of the pig body surface.

[0027] Furthermore, based on the second included angle and the results of plane detection, the specific logic for determining whether to remove suspected background planes from the target cluster is as follows:

[0028] If no valid suspected background plane is detected in the target cluster, or if a suspected background plane is detected but the second included angle is outside the preset angle range, the target cluster is determined to be a point cloud of the pig body surface and is retained.

[0029] If a valid suspected background plane is detected in the target cluster and the second included angle is within the preset angle range, the suspected background plane is determined to be a breeding environment facility, the suspected background plane is deleted from the target cluster, and the remaining point cloud is used as the point cloud of the pig's body surface.

[0030] Furthermore, the point cloud data of the breeding scene is obtained by tracking livestock through a mobile 3D point cloud acquisition device, and the target cluster is a set of point clouds of a single livestock that is attached to or not attached to the breeding environment facilities.

[0031] Secondly, the present invention provides a point cloud extraction device for the body surface of pigs for use in a breeding environment, comprising:

[0032] The data acquisition module is used to acquire point cloud data of the breeding scene, including point clouds of livestock body surfaces and ground point clouds;

[0033] The ground processing module is used to perform plane fitting on the point cloud data of the aquaculture scene, determine the ground plane normal vector, and remove the ground point cloud from the aquaculture scene point cloud data to obtain the remaining point cloud of the scene.

[0034] The clustering optimization module is used to cluster the remaining point cloud after removing the ground and select the target cluster;

[0035] The background detection module is used to perform plane detection on the target cluster in an attempt to identify the suspected background planes and obtain the orthogonal projection vector of the ground plane normal vector on the suspected background plane, or obtain the normal vector of the suspected background plane.

[0036] The separation and extraction module is used to calculate the first angle between the orthographic projection vector and the ground plane normal vector, or to calculate the second angle between the normal vector of the suspected background plane and the ground plane normal vector. Based on the first or second angle and the plane detection results, it is determined whether the suspected background plane needs to be removed from the target cluster, thereby extracting the final pig body surface point cloud.

[0037] Thirdly, the present invention provides an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the above-described method for extracting point clouds from the surface of pigs.

[0038] Fourthly, the present invention provides a readable storage medium storing a computer program, the computer program including program code for controlling a process to execute the process, the process including the above-described method for extracting point clouds from the surface of a pig.

[0039] The main contributions and innovations of this invention are as follows:

[0040] 1. Solves the problem of point cloud adhesion and achieves high recognition accuracy: This invention innovatively introduces a logical judgment mechanism (logical value L) based on the angle between the normal vector or projection vector and the proportion of the planar point cloud, addressing the common problem of "pig body-wall / fence" adhesion in the breeding environment. This enables the algorithm to not only handle simple scenarios where pigs stand independently, but also effectively cope with complex scenarios where pigs are pressed against walls or fences, accurately removing background planes while retaining complete pig body data.

[0041] 2. Strong anti-interference ability and good robustness: The ground is determined by combining the intersection of RANSAC and Hough transform algorithms in the first plane detection, which effectively avoids false ground detection that may be caused by a single algorithm; at the same time, environmental noise is effectively removed by multiple plane stripping techniques.

[0042] 3. High degree of automation and wide applicability: This method can automatically extract targets from raw scan data without human intervention. The algorithm has a clear logic and moderate computational load, making it suitable for deployment on computing equipment in agricultural fields. It provides a high-quality data foundation for subsequent pig body size measurement, weight estimation and behavior analysis.

[0043] Details of one or more embodiments of the present invention are set forth in the following drawings and description, so that other features, objects and advantages of the invention will be more readily understood. Attached Figure Description

[0044] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:

[0045] Figure 1 This is a flowchart of a method for extracting point clouds from the body surface of pigs for breeding environments, provided in an embodiment of the present invention.

[0046] Figure 2 It is a point cloud diagram of the original farming scene, showing pigs attached to farming facilities (walls or fences);

[0047] Figure 3 It is a point cloud diagram of an original farming scene containing independent pigs (not attached to facilities);

[0048] Figure 4 This is a schematic diagram of the effective scene point cloud after removing the ground point cloud (the situation of pigs adhering to the facility).

[0049] Figure 5 This is a schematic diagram of the effective scene point cloud after removing the ground point cloud (for the case of an independent pig).

[0050] Figure 6 This is a schematic diagram of the effective clustered point cloud after removing planar noise clustering (showing the adhesion between pigs and facilities).

[0051] Figure 7 This is a schematic diagram of the effective clustered point cloud after removing planar noise clustering (for independent pigs).

[0052] Figure 8 This is a schematic diagram of the target cluster ranked first (pigs and breeding facilities are attached together);

[0053] Figure 9 From Figure 8 The diagram shows the point cloud of the pig body surface extracted after removing the background facilities in the target cluster.

[0054] Figure 10 It is an independent schematic diagram of a pig, which can be directly used as a point cloud of the pig's body surface;

[0055] Figure 11 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed Implementation

[0056] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.

[0057] It should be noted that the steps of the corresponding methods are not necessarily performed in the order shown and described in this specification in other embodiments. In some other embodiments, the methods may include more or fewer steps than described in this specification. Furthermore, a single step described in this specification may be broken down into multiple steps in other embodiments; and multiple steps described in this specification may be combined into a single step in other embodiments.

[0058] Example 1

[0059] like Figure 1 As shown, this embodiment of the invention provides a method for extracting point clouds from the body surface of pigs for use in livestock farming environments. This method is mainly applied to complex environments that include pigs, the ground, and livestock farming facilities such as fences or walls. The method specifically includes the following steps:

[0060] Step S1: Obtain point cloud data of the breeding scene, which includes point clouds of livestock body surfaces and ground points;

[0061] Perform ground detection steps: perform plane fitting on the point cloud data of the aquaculture scene, determine the ground plane normal vector, and remove the ground point cloud from the aquaculture scene point cloud data to obtain the remaining point cloud of the scene.

[0062] In this embodiment, a mobile 3D point cloud acquisition device (such as a depth camera) is used to track livestock (pigs) and capture images to obtain raw point cloud data. Due to limitations in the device's field of view, the collected data typically includes the livestock's body surface, the ground, and possible background structures (such as walls or fences). The data scenario usually falls into two categories: one where the pig is adhered to the wall or fence (e.g., ...). Figure 2 As shown), another type is where the pig exists independently (such as...). Figure 3 (As shown).

[0063] To improve the robustness of ground detection, the "first plane detection" in this step preferably uses a combination of two algorithms:

[0064] 1. Initial Planar Screening (First Planar Detection): The Random Sample Consensus (RANSAC) algorithm and the Hough Transform algorithm are used respectively to screen the planes. Perform planar detection. Let the planar point cloud detected by RANSAC be denoted as . The planar point cloud detected by the Hough transform is .

[0065] 2. Find the intersection: Calculate and union Build Enclosing box 1 and Calculate the common area between the two bounding boxes, starting with bounding box 2. Finally, extract... The set of points located within this public area is taken as the final determined first planar detection result (i.e., ground planar point cloud), denoted as... .

[0066] 3. Normal vector calculation: For ground plane point clouds Principal component analysis (PCA) is performed to calculate the covariance matrix and perform eigenvalue decomposition. The eigenvectors corresponding to the smallest eigenvalues ​​are extracted and normalized, serving as the normal vectors of the ground plane, denoted as . .

[0067] Furthermore, to ensure the accuracy of subsequent angle calculations, corrections are required. The direction should be aligned so that it points to one side of the pig's body (i.e., above the ground). The correction method is as follows:

[0068] from Choose one point As a reference point, along The direction is offset by a first distance (e.g., 0.3 meters) and a second distance (e.g., 0.35 meters) to obtain the offset point. and Construct a vector passing through these two points with a normal vector of... There are two parallel planes, Π1 and Π2. Plane Π1 passes through the point... and with As a normal vector, its equation is Plane Π2 passes through point and with As a normal vector, its equation is .

[0069] Detection of raw point clouds The subset of point clouds located between these two parallel planes , }

[0070] like It is an empty set (explanation) (pointing to the ground), then take The opposite direction is used as the corrected ground normal vector. ;

[0071] like Not empty (explanation) It points to the space above the ground, that is, an object existing at a certain height above the ground (usually the body of a pig). .

[0072] Ground removal operations: using set difference operations to remove ground from the original point cloud. Remove ground point clouds Effective aquaculture scenario point cloud Defined as:

[0073]

[0074] in and All points are finite point sets. At this point, ground interference has been removed. The effect after removing the ground is as follows: Figure 4 (Adhesion status) and Figure 5 (Non-adhesive case) is shown.

[0075] Step S2: Perform clustering screening (second planar detection):

[0076] For the remaining point cloud of the scene (the point cloud after removing the ground) Clustering is performed, and the target cluster containing livestock is selected based on the clustering characteristics.

[0077] 1. Euclidean Clustering: To implement the clustering algorithm, the point cloud set is... Considered as an ordered sequence Define the Euclidean distance metric between point pairs:

[0078]

[0079] Based on this distance metric, the cluster radius is set. and minimum points ,right Perform Euclidean clustering to generate M clusters. .

[0080] 2. Second Plane Detection (Filtering Non-Pig Objects): To eliminate interfering clusters formed purely by walls or fences, for each cluster... Perform a "second plane detection" (preferably using the RANSAC algorithm). Calculate the proportion of detected planar point clouds to the total number of points in the cluster.

[0081] If the ratio is less than the preset planar point cloud ratio threshold (In this embodiment, it is preferably set to 0.8), then the cluster is retained; otherwise, it is treated as pure planar noise and deleted, resulting in a valid cluster set. ,like Figure 6 and Figure 7 As shown.

[0082] 3. Sorting and Optimization: Calculate the number of points in each cluster of the effective cluster set and sort them in descending order of point count. Select the cluster with the highest number of points (i.e., the one with the most points) as the "target cluster" (i.e., the aquaculture scenario cluster), denoted as [missing information]. The target cluster at this point may only include pigs (e.g., ...). Figure 10 ), and may also include background facilities for pigs and adhesions (such as Figure 8 ).

[0083] Step S3: Perform background detection (third plane detection): Perform plane detection on the target cluster to attempt to identify suspected background planes and obtain the orthogonal projection vector of the ground plane normal vector onto the suspected background plane.

[0084] Due to the target clustering at this time There are two possibilities:

[0085] Case 1 (Adhesion): such as Figure 8 As shown, the pig's body surface is stuck to the wall or fence. Includes pigs and facilities.

[0086] Case 2 (non-adhesive): such as Figure 10 As shown, Only includes the pig's body (e.g., the pig's back is relatively flat).

[0087] This step is for Perform a "third plane detection". If no obvious plane is detected, mark the detection state D=0; if the detection is successful, mark D=1, and record the detected plane point cloud as... (i.e., suspected background plane). Specifically, the third plane detection is performed using the random sample consensus algorithm, and the detected plane point cloud is denoted as... Simultaneously, obtain its plane equation, and based on this plane equation, obtain the normal vector of the ground plane pointing towards the pig body. The orthographic projection vector of this plane is denoted as the clustering plane vector. .

[0088] Step S4: Calculate the first angle A between the clustering plane vector and the ground plane normal vector. Based on the first angle A and the plane detection results, determine whether it is necessary to remove the suspected background plane from the target cluster, thereby extracting the final pig body surface point cloud.

[0089] Calculate the first angle A between the clustering plane vector and the clustering ground normal vector (this is a standard mathematical calculation and will not be elaborated here). Then, based on the first angle A and the detection state D, calculate the logical extraction value L:

[0090] =

[0091] Where D represents the state of the third plane detection (1 indicates that a plane was detected, and 0 indicates that it was not detected); θ is the preset angle threshold. This indicates that no plane was detected. Represents logical OR, This indicates a logical AND operation.

[0092] Extract based on the logical value L:

[0093] If L=1: This indicates a core cluster. There is no residual planar interference (i.e.) (This refers only to the point cloud of the pig's body surface), then the point cloud of the pig's body surface is: .

[0094] If L=0: This indicates a core cluster. If there are adhered planar interferences (such as fence fragments) in the data, then the point cloud of the pig's body surface is... Deleting clustered planar point clouds The resulting point set, i.e., the output point cloud, is (That is, the remaining part of the planar point cloud after deleting it from the target cluster). For example... Figure 8 After processing, the result is Figure 9 The dot cloud on the surface of the pig is shown.

[0095] Based on the above logic, this embodiment can automatically adapt to different postures and positions of pigs in the farm, effectively solving the problem of background adhesion.

[0096] Example 2

[0097] Based on Embodiment 1, the remaining steps are the same as in Embodiment 1, except that steps S3 and S4 are changed to the following:

[0098] Step S3: Perform background detection (third plane detection): Perform plane detection on the target cluster to attempt to identify suspected background planes and obtain the normal vectors of the suspected background planes.

[0099] Due to the target clustering at this time There are two possibilities:

[0100] Case 1 (Adhesion): such as Figure 8 As shown, the pig's body surface is stuck to the wall or fence. Includes pigs and facilities.

[0101] Case 2 (non-adhesive): such as Figure 10 As shown, Only includes the pig's body (e.g., the pig's back is relatively flat).

[0102] This step also applies to Perform a "third plane detection" (preferably using RANSAC), and denot the detected plane point cloud as follows. However, here we use PCA analysis to obtain the normal vector of the plane, thus obtaining the normal vector of the clustering plane. Similarly, a method similar to the dual-plane slicing method in step S1 (offset distance 0.3m to 0.35m) can be used to verify and correct the result. The direction is used to obtain the corrected normal vector pointing towards the side of the pig's body. The details are as follows:

[0103] To verify and correct The direction makes it point towards the side of the pig's body, from Select a point As a reference point, along The direction is offset by a third distance (e.g., 0.1 meters) to obtain the offset point. Constructed at this offset point and with Detect the original point cloud using the slice plane with normal vectors. The subset of point clouds within a predetermined thickness near the slice plane. If this subset of point clouds is empty, it indicates... If it points outwards from the wall, then take... The opposite direction is used as the corrected normal vector. If it is a non-empty set, then = .

[0104] If no obvious plane is detected, the detection state is marked as D=0; if the detection is successful, the state is marked as D=1.

[0105] Step S4: Calculate the second angle B between the cluster plane normal vector and the ground plane normal vector. Based on the second angle B and the plane detection results, determine whether it is necessary to remove suspected background planes from the target cluster, thereby extracting the final pig body surface point cloud.

[0106] Calculate the second angle B between the clustering plane normal vector and the clustering ground normal vector (this is a standard mathematical calculation and will not be elaborated here). Then, based on the second angle B and the detection state D, calculate the logical extraction value L:

[0107]

[0108] Where D represents the state of the third plane detection (1 indicates that a plane was detected, and 0 indicates that it was not detected); No plane was detected. Represents logical OR, This represents a logical AND. θ is also a preset angle threshold (different from the value in Example 1), with a preset angle range of (90°). θ, 90°+θ).

[0109] Extract based on the logical value L:

[0110] If L=1: This indicates a core cluster. There is no residual planar interference (i.e.) (This refers only to the point cloud of the pig's body surface), then the point cloud of the pig's body surface is:

[0111] If L=0: This indicates a core cluster. If there are adhered planar interferences (such as fence fragments) in the data, then the point cloud of the pig's body surface is... Deleting clustered planar point clouds The resulting point set, i.e., the output point cloud, is (That is, the remaining part of the planar point cloud after deleting it from the target cluster). For example... Figure 8 After processing, the result is Figure 9 The dot cloud on the surface of the pig is shown.

[0112] Example 3

[0113] Based on the same concept, this invention also provides a pig surface point cloud extraction device for a breeding environment, the structural block diagram of which corresponds to the above-described method flow. The device includes:

[0114] 1. First Plane Detection Module (Ground Processing Module and Data Acquisition Module): Configured to execute the above step S1, acquire point cloud data of the aquaculture scene, use multiple plane detection algorithms to determine the ground plane normal vector and remove ground point cloud data.

[0115] 2. Clustering and Second Plane Detection Module (Clustering Optimization Module): Configured to perform the above step S2, perform Euclidean clustering on the remaining point cloud, filter pure plane interference using a plane ratio threshold, and select the target cluster with the most points.

[0116] 3. Third plane detection module (background detection module): configured to perform the above step S3, perform plane detection within the target cluster, and obtain the normal vector of the suspected background plane or the orthogonal projection vector of the ground plane normal vector on the suspected background plane.

[0117] 4. Pig body surface point cloud extraction module (separation extraction module): Configured to perform the above step S4, calculate the first or second angle between the suspected background plane and the ground, and based on the judgment result of the logical value L, select to retain the complete cluster or remove the suspected background plane, thereby outputting the pig body surface point cloud.

[0118] Example 4

[0119] This embodiment also provides an electronic device, see reference. Figure 11 It includes a memory 404 and a processor 402, wherein the memory 404 stores a computer program and the processor 402 is configured to run the computer program to perform the steps in any of the above method embodiments.

[0120] Specifically, the processor 402 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of the present invention.

[0121] Memory 404 may include a mass storage device for data or instructions. For example, and not limitingly, memory 404 may include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), flash memory, an optical disk drive, a magneto-optical disk drive, magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 404 may include removable or non-removable (or fixed) media. Where appropriate, memory 404 may be internal or external to a data processing device. In a particular embodiment, memory 404 is non-volatile memory. In a particular embodiment, memory 404 includes read-only memory (ROM) and random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable read-only memory (PROM), an erasable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), an electrically alterable read-only memory (EAROM), or flash memory, or a combination of two or more of these. Where appropriate, the RAM can be Static Random-Access Memory (SRAM) or Dynamic Random-Access Memory (DRAM). DRAM can be Fast Page Mode Dynamic Random-Access Memory (FPMDRAM), Extended Data Out Dynamic Random-Access Memory (EDODRAM), Synchronous Dynamic Random-Access Memory (SDRAM), etc.

[0122] The memory 404 can be used to store or cache various data files that need to be processed and / or communicated, as well as possible computer program instructions executed by the processor 402.

[0123] The processor 402 reads and executes computer program instructions stored in the memory 404 to implement any of the point cloud extraction methods for pig body surface in the above embodiments for the breeding environment.

[0124] Optionally, the electronic device may further include a transmission device 406 and an input / output device 408, wherein the transmission device 406 is connected to the processor 402, and the input / output device 408 is connected to the processor 402.

[0125] The transmission device 406 can be used to receive or send data via a network. Specific examples of the network described above may include wired or wireless networks provided by the communication provider of the electronic device. In one example, the transmission device includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 406 may be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0126] Input / output device 408 is used to input or output information.

[0127] Example 5

[0128] This embodiment also provides a readable storage medium storing a computer program, the computer program including program code for controlling a process to execute the process, the process including a method for extracting point clouds of pig body surface in a breeding environment according to embodiment one or two.

[0129] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.

[0130] Generally, various embodiments can be implemented in hardware or dedicated circuitry, software, logic, or any combination thereof. Some aspects of the invention can be implemented in hardware, while others can be implemented by firmware or software executed by a controller, microprocessor, or other computing device, but the invention is not limited thereto. Although various aspects of the invention may be shown and described as block diagrams, flowcharts, or using some other graphical representation, it should be understood that, by way of non-limiting example, these blocks, apparatuses, systems, techniques, or methods described herein can be implemented in hardware, software, firmware, dedicated circuitry or logic, general-purpose hardware or controllers or other computing devices, or some combination thereof.

[0131] Embodiments of the present invention can be implemented by computer software, which may be executable by a data processor of a mobile device, such as a processor entity, or by hardware, or by a combination of software and hardware. Computer software or programs (also referred to as program products) including software routines, applets, and / or macros can be stored in any device-readable data storage medium, and they include program instructions for performing specific tasks. The computer program product may include one or more computer-executable components configured to perform the embodiments when the program is run. The one or more computer-executable components may be at least one piece of software code or a portion thereof. Additionally, it should be noted in this respect that, as Figure 1 Any box in the logical flow can represent a program step, or interconnected logic circuits, boxes and functions, or a combination of program steps and logic circuits, boxes and functions. Software can be stored on physical media such as memory chips or blocks of storage implemented within a processor, magnetic media such as hard disks or floppy disks, and optical media such as DVDs and their data variants, CDs, etc. The physical medium is a non-transient medium.

[0132] Those skilled in the art should understand that the technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments have been described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0133] The above embodiments are merely illustrative of several implementations of the present invention, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of the present invention should be determined by the appended claims.

Claims

1. A method for extracting point clouds from the body surface of pigs for use in a breeding environment, characterized in that, Includes the following steps: Acquire point cloud data of a livestock farming scene, including point clouds of livestock body surfaces and ground points; Perform ground detection steps: perform plane fitting on the point cloud data of the aquaculture scene, determine the ground plane normal vector, and remove the ground point cloud from the point cloud data of the aquaculture scene to obtain the remaining point cloud of the scene; Perform clustering and filtering steps: perform clustering processing on the remaining point cloud of the scene, and filter out the target cluster containing livestock based on the clustering features; Perform background detection steps: Perform plane detection on the target cluster to identify suspected background planes, and select one of the following calculation methods: Method 1: Obtain the orthogonal projection vector of the ground plane normal vector onto the suspected background plane; Method 2: Obtain the normal vector of the suspected background plane; Perform the separation and extraction steps: corresponding to Method 1, calculate the first angle between the orthographic projection vector and the ground plane normal vector, or Corresponding to Method 2, calculate the second angle between the normal vector of the suspected background plane and the normal vector of the ground plane; Based on the first included angle or the second included angle and the result of plane detection, it is determined whether the suspected background plane needs to be removed from the target cluster, thereby extracting the final point cloud of the pig body surface.

2. The method for extracting point clouds from the surface of pigs as described in claim 1, characterized in that, The specific steps for performing ground detection include: The random sampling consensus algorithm and the Hough transform algorithm were used to perform planar detection on the point cloud data of the aquaculture scene, respectively, to obtain the first detection point cloud and the second detection point cloud. The intersection of the first detection point cloud and the second detection point cloud is taken as the ground plane point cloud; Principal component analysis is performed on the ground plane point cloud, and the eigenvectors corresponding to the minimum eigenvalues ​​are extracted as the ground plane normal vectors.

3. The method for extracting point clouds from the surface of pigs as described in claim 1, characterized in that, After determining the ground plane normal vector, the process also includes the step of correcting the direction of the normal vector: A subset of point clouds is extracted within a preset height range along the direction of the ground plane normal vector; Determine whether the point cloud subset is empty: if it is empty, flip the direction of the ground plane normal vector so that it points to the side of the livestock body; if it is not empty, keep the current normal vector direction.

4. The method for extracting point clouds from the surface of a pig as described in claim 1, characterized in that, The specific steps of performing clustering screening include: The remaining point cloud of the scene is segmented using Euclidean clustering to obtain multiple candidate clusters; For each candidate cluster, planar feature detection is performed, the planar point cloud ratio is calculated, and interfering clusters whose planar point cloud ratio is greater than or equal to a preset ratio threshold are eliminated. The remaining clusters after elimination are sorted according to the number of point clouds they contain, and the cluster with the most point clouds is selected as the target cluster.

5. The method for extracting point clouds from the surface of pigs as described in claim 1, characterized in that, In the separation and extraction step, the specific logic for determining whether the suspected background plane needs to be removed from the target cluster based on the first included angle and the plane detection results is as follows: If no valid suspected background plane is detected in the target cluster, or if a suspected background plane is detected but the first included angle is greater than or equal to a preset angle threshold, then the target cluster is determined to be a point cloud of the pig body surface and is retained. If a valid suspected background plane is detected in the target cluster, and the first included angle is less than a preset angle threshold, then the suspected background plane is determined to be a breeding environment facility, the suspected background plane is deleted from the target cluster, and the remaining point cloud is used as the point cloud of the pig's body surface.

6. The method for extracting point clouds from the surface of a pig as described in claim 1, characterized in that, Based on the second included angle and the results of plane detection, the specific logic for determining whether the suspected background plane needs to be removed from the target cluster is as follows: If no valid suspected background plane is detected in the target cluster, or if a suspected background plane is detected but the second included angle is outside the preset angle range, then the target cluster is determined to be a point cloud of the pig body surface and is retained. If a valid suspected background plane is detected in the target cluster, and the second included angle is within a preset angle range, then the suspected background plane is determined to be a breeding environment facility, the suspected background plane is deleted from the target cluster, and the remaining point cloud is used as the point cloud of the pig's body surface.

7. The method for extracting point clouds from the surface of a pig as described in claim 1, characterized in that, The point cloud data of the breeding scene is obtained by tracking livestock through a mobile 3D point cloud acquisition device, and the target cluster is a set of point clouds of a single livestock that are either attached to or not attached to the breeding environment facilities.

8. A point cloud extraction device for pig body surface in a breeding environment, characterized in that, include: The data acquisition module is used to acquire point cloud data of the breeding scene, including point clouds of livestock body surfaces and ground point clouds; The ground processing module is used to perform plane fitting on the point cloud data of the aquaculture scene, determine the ground plane normal vector, and remove the ground point cloud from the point cloud data of the aquaculture scene to obtain the remaining point cloud of the scene. The clustering and filtering module is used to cluster the remaining point cloud after removing the ground and filter out the target cluster; The background detection module is used to perform planar detection on the target cluster to identify suspected background planes, and select one of the following calculation methods to perform: Method 1: Obtain the orthogonal projection vector of the ground plane normal vector onto the suspected background plane; Method 2: Obtain the normal vector of the suspected background plane; The separation and extraction module, corresponding to Method 1, calculates the first angle between the orthographic projection vector and the ground plane normal vector, or corresponding to Method 2, calculates the second angle between the normal vector of the suspected background plane and the ground plane normal vector; Based on the first included angle or the second included angle and the result of plane detection, it is determined whether the suspected background plane needs to be removed from the target cluster, thereby extracting the final point cloud of the pig body surface.

9. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the pig body surface point cloud extraction method according to any one of claims 1 to 7.

10. A readable storage medium, characterized in that, The readable storage medium stores a computer program, the computer program including program code for controlling a process to execute the process, the process including the method for extracting point clouds from the surface of a pig according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Livestock farm scene point cloud classification method and device for body size measurement

    CN115331064A

  • Indoor plane extraction method

    CN121477222A