# A Multi-View Real-Time Approach for Rapid Point Cloud Acquisition and Reconstruction in Goats

Yi Sun, Qifeng Li, Weihong Ma, Mingyu Li, Anne de La Torre, Simon X. Yang, Chunjiang Zhao

► To cite this version:

Yi Sun, Qifeng Li, Weihong Ma, Mingyu Li, Anne de La Torre, et al. A Multi-View Real-Time Approach for Rapid Point Cloud Acquisition and Reconstruction in Goats. Agriculture, 2024, 14 (10), pp.1785. 10.3390/agriculture14101785. [https://doi.org/10.3390/agriculture14101785](https://doi.org/10.3390/agriculture14101785)

HAL Id: hal-04947859

https://hal.inrae.fr/hal-04947859v1

Submitted on 14 Feb 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
<figure><img src="image_2.png" /></figure>

Article

# A Multi-View Real-Time Approach for Rapid Point Cloud Acquisition and Reconstruction in Goats

Yi Sun<fnref n="1" /> ID, Qifeng Li<fnref n="2" />,<fnref n="3" />, Weihong Ma<fnref n="2" />,*, ID, Mingyu Li<fnref n="2" />, Anne De La Torre<fnref n="4" />, Simon X. Yang<fnref n="5" /> ID
and Chunjiang Zhao<fnref n="1" />,<fnref n="2" />,*

**Abstract:** The body size, shape, weight, and scoring of goats are crucial indicators for assessing their growth, health, and meat production. The application of computer vision technology to measure these parameters is becoming increasingly prevalent. However, in real farm environments, obstacles, such as fences, ground conditions, and dust, pose significant challenges for obtaining accurate goat point cloud data. These obstacles lead to difficulties in rapid data extraction and result in incomplete reconstructions, causing substantial measurement errors. To address these challenges, we developed a system for real-time, non-contact acquisition, extraction, and reconstruction of goat point clouds using three depth cameras. The system operates in a scenario where goats walk naturally through a designated channel, and bidirectional distributed triggering logic is employed to ensure real-time acquisition of the point cloud. We also designed a noise recognition and filtering method tailored to handle complex environmental interferences found on farms, enabling automatic extraction of the goat point cloud. Furthermore, a distributed point cloud completion algorithm was developed to reconstruct missing sections of the goat point cloud caused by unavoidable factors such as railings and dust. Measurements of body height, body slant length, and chest circumference were calculated separately with deviation of no more than 25 mm and an average error of 3.1%. The system processes each goat in an average time of 3–5 s. This method provides rapid and accurate extraction and complementary reconstruction of 3D point clouds of goats in motion on real farms, without human intervention. It offers a valuable technological solution for non-contact monitoring and evaluation of goat body size, weight, shape, and appearance.

**Keywords:** target extraction; region segmentation; 3D reconstruction; point cloud completion

## 1. Introduction

Lamb meat is a significant source of protein for humans, with a growing demand globally [1]. Enhancing meat production efficiency in individual goats while minimizing farming costs is crucial for the development of the goat meat industry [2]. Goat body size is strongly correlated with developmental status, physiological function, production performance, and genetic traits [3,4]. Therefore, accurately measuring body size at different developmental stages is essential for evaluating body condition [5], meat production efficiency [6], and breeding potential [7]. However, manual body size measurements in livestock are time-consuming, labor-intensive, and can induce stress, leading to reduced feed intake and slower growth [8].

<figure><img src="image_3.png" /></figure>

### check for updates

**Citation:** Sun, Y.; Li, Q.; Ma, W.; Li, M.; Torre, A.D.L.; X. Yang, S.; Zhao, C. A Multi-View Real-Time Approach for Rapid Point Cloud Acquisition and Reconstruction in Goats. *Agriculture* **2024**, *14*, 1785. https://doi.org/10.3390/agriculture14101785

Academic Editor: Miriam Piles

Received: 9 September 2024

Revised: 26 September 2024

Accepted: 1 October 2024

Published: 11 October 2024

<figure><img src="image_4.png" /></figure>

**Copyright:** © 2024 by the authors.
Licensee MDPI, Basel, Switzerland.
This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

<footnote n="1">¹ College of Information Engineering, Northwest A&F University, Yangling 712100, China;
sunyi@nwafu.edu.cn</footnote>

<footnote n="2">² Information Technology Research Center, Beijing Academy of Agriculture and Forestry Sciences,
Beijing 100097, China; liqf@nercita.org.cn (Q.L.); limy@nercita.org.cn (M.L.)</footnote>

<footnote n="3">³ National Innovation Center for Digital Seed Industry, Beijing 100097, China</footnote>

<footnote n="4">⁴ Université Clermont Auvergne, INRAE, VetAgro Sup, UMR Herbivores,
F-63122 Saint-Genès-Champanelle, France</footnote>

<footnote n="5">⁵ Advanced Robotics and Intelligent Systems Laboratory, School of Engineering, University of Guelph,
Guelph, ON N1G 2W1, Canada; syang@uoguelph.ca</footnote>

<footnote>* Correspondence: mawh@nercita.org.cn (W.M.); zhaocj@nercita.org.cn (C.Z.)</footnote>
To address the limitations of manual measurements in animal husbandry, computer vision technology has increasingly been integrated into the field [9–12], resulting in the development of non-invasive, automated methods for obtaining livestock body size data [13]. Chang-bok et al. [14] developed a method for estimating cattle body weight based on 2D images, which achieved accurate weight measurements for the cattle. However, the inherent limitations of 2D images—providing less information and fewer measurable parameters—have hindered the practical application of 2D imagery for body measurements in livestock such as cattle and sheep [15]. The advent of 3D devices, such as depth cameras and scanners, has spurred research into the segmentation and extraction of animal body parts using 3D data [16]. 3D data provides spatial dimensional information, allowing for the precise capture of an object’s shape, position, and depth, enabling more comprehensive analysis and modeling [17]. For example, Xuelei et al. [18] utilized an enhanced region-growing algorithm for point cloud segmentation and the measurement of sheep body size parameters. Similarly, Kaixuan et al. [19] evaluates the body condition of dairy cows based on their 3D data. Hao et al. [20] used three depth cameras arranged above and on either side of a pig to acquire 3D data, facilitating point cloud segmentation and measurement of key body parts.

In practical animal breeding settings, point cloud data often suffer from incompleteness due to various interfering factors, including equipment, fences, dust, and animal movement. This issue hampers the accurate representation of the animal's shape characteristics, leading to imprecise measurements of body size and weight [21]. Zhou et al. [22] proposed a method for acquiring point cloud data and measuring body size using a three-dimensional scanner on sheep specimens. While this method achieves high accuracy in reproducing sheep body point cloud data, it is limited by the requirement that the sheep remain motionless during data acquisition. Li et al. [23] utilized a single Kinect v2 camera positioned above the pig's watering area to capture a unilateral point cloud of the pig's back. This method enables unobstructed data collection from an overhead perspective, but is limited to capturing only the pig's back, thereby constraining the range of measurable body parts. Luo et al. [24] introduced a parametric model employing three Kinect v2 cameras to collect data and generate precise 3D models of cattle. However, the time-consuming nature of the algorithm restricts its practical applicability. The current study faces significant challenges in addressing occlusions and interferences that frequently arise during data collection of live animals in the complex environment of an actual farm. They are also unable to promptly address missing key measurement areas caused by these interferences, which is crucial for the accurate and complete extraction and reconstruction of the animal's point cloud. Efficiently overcoming these challenges is essential for achieving a more comprehensive and precise 3D representation of the animal's body, ensuring reliable measurements and analyses.

This study addresses the issue of incomplete point cloud extraction and the difficulties associated with capturing point clouds of live goats in motion within farm environments. It presents a multi-view automatic point cloud acquisition system designed for goats in real farming environments and develops a method for identifying and filtering environmental noise in goat farms, along with a distributed point cloud completion algorithm based on goat phenotypic characteristics. These developments ensure the precise extraction and reconstruction of 3D goat models.

## 2. Materials and Methods

A system was developed for the rapid and precise non-contact, real-time acquisition, extraction, and reconstruction of goat point clouds. The technical workflow is illustrated in Figure 1.
<figure><img src="image_5.png" /><figcaption>**Figure 1.** Technical workflow diagram of the system.</figcaption></figure>

## 2.1. 3D Goat Point Cloud Acquisition Equipment

A gated goat 3D point cloud acquisition system, measuring 160 cm in height and 170 cm in width, has been developed. This system comprises an industrial computer, a high-frequency (HF) ear identification reader, a pair of opposing grating sensors, and three Kinect DK depth cameras. The HF ear identification reader, positioned on the right side of the channel gantry, identifies individual goats as it passes through the channel. The grating trigger sensor, located on the left side of the channel gantry, determines the precise position of each goat within the channel. Two Kinect DK cameras were installed on the sides of the equipment rack, and the third was positioned centrally on the top beam to collect data from the left, right, and top views, respectively, as shown in Figure 2A. All connecting cables were routed internally within the rack. USB 3.0 cables were employed to transmit data to an industrial control computer, thereby minimizing disturbance to the animals. The finalized system's key parameters are detailed in Table 1.
<figure><img src="image_6.png" /><figcaption>**Figure 2.** Acquisition equipment. (A) Equipment deployed in goat farms. (B) Goats passing through the equipment.</figcaption></figure>

<table><caption>**Table 1.** Equipment parameters.</caption><thead><tr><th>Installations</th><th>Specific Categories</th><th>Parameters</th><th>Specific Categories</th><th>Parameters</th></tr></thead><tbody><tr><td>Brackets</td><td>Beam height/cm</td><td>160</td><td>Span on both sides/cm</td><td>170</td></tr><tr><td>Industrial computer</td><td>Processing unit</td><td>I7-8700</td><td>Running memory/GB</td><td>16</td></tr><tr><td>High-frequency ear tag reader</td><td>Frequency/MHz</td><td>902–928</td><td>Radio frequency output</td><td>23</td></tr><tr><td>Angle grating</td><td>Number of points of light/number</td><td>2</td><td>Spot distance/cm</td><td>20</td></tr><tr><td>Depth camera</td><td>Perspectives/(°)</td><td>120 × 120</td><td>Scope of work/m</td><td>0.25–2.88</td></tr></tbody></table>

## 2.2. Experimental Environment and Acquisition Logic

The experiment was conducted from June to July 2024 in a passageway within a partitioned goat pen at the Kunming Breeding Farm in Yunnan, China. Fourteen Boer and Yushang Black goats, aged between 6 and 12 months and fitted with high-frequency ear tags, were selected for the study. The floor of the sub-pen was made from concrete mix, and the environment contained disturbances such as dust, feces, rails, and equipment.

The experiment was conducted using C++ as the primary programming language due to its efficiency and control over system resources, which are essential for real-time processing. The K4A SDK was utilized for its advanced depth sensing capabilities, enabling precise 3D data acquisition. Additionally, the Point Cloud Library (PCL) was employed for its robust algorithms and data structures specifically designed for handling point cloud data, facilitating effective processing and analysis. Given the rapid movement of the goat through the channel and their significant postural changes, capturing high-quality point cloud data of the goat's body as they passed under the acquisition equipment was critical. Manual triggering proved impractical, prompting the development of a bidirectional distributed trigger logic that separates the HF ear tag reading from the grating sensor triggering. The HF ear tag reader continuously monitors the goat's ear tags until they are successfully read, while the grating sensor ensures the goat's precise location. As the goat traverses the channel, as depicted in Figure 3, triggering the grating sensor activates the three Kinect DK cameras to begin collecting depth image data. The system then verifies whether the ear tag information has been captured. When both the ear tag information and grating signal are acquired simultaneously, the depth image data are converted to point
cloud data using the camera's internal parameters. The detailed process is illustrated in Figure 3.

<figure><img src="image_7.png" /><figcaption>**Figure 3.** Acquisition process overview (T: true. F: false).</figcaption></figure>

## 2.3. Multi-View 3D Point Cloud Registration

The three Kinect DK cameras in the device capture point cloud data from different angles, resulting in minimal overlap among each viewpoint's data, which renders traditional alignment algorithms highly inefficient. To address this, the top-viewpoint cloud is used as the reference due to the relatively fixed physical positions of the depth cameras. The required rotation angles and translation distances to align the left- and right-side point clouds with the top-viewpoint clouds are calculated, yielding in the corresponding rotation matrices. The left- and right-side point clouds are then transformed using these rotation matrices and merged with the top-viewpoint cloud to produce the final composite point cloud, as illustrated in Figure 4.

<figure><img src="image_8.png" /><figcaption>**Figure 4.** Point cloud registration result.</figcaption></figure>
## 2.4. Environmental Noise Recognition and Filtering Method for Goat Farm

Due to the complexity of the goat farm collection environment, a significant amount of irrelevant data points, such as dust, ground surfaces, and equipment, contains the collected point cloud. To accurately extract the goat point cloud from this complex farm environment, a comprehensive noise recognition and filtering method has been developed. This method primarily focuses on distinguishing and filtering out points related to goats, railings, non-useful spatial areas, redundant points, ground surfaces, railings, and other random interference noises, as illustrated in Figure 7.

### 2.4.1. Filtering Noise in Point Clouds between Goat and Railing

To minimize the influence of a substantial number of irrelevant noisy points, filtering is performed based on the number of neighboring points within a specified radius around each data point in the 3D space. For the collected point cloud data $P\{p_1, p_2, \dots, p_n\}$, the number of neighboring points, $n_i$, within a radius of r around each point, $p_i$, is calculated,

$$n_i = \{p_j \in P \mid \| p_i - p_j \| \le r\} \quad (1)$$

$\| p_i - p_j \|$ denotes the Euclidean distance between $p_i$ and $p_j$. The calculated number of neighboring points, $n_i$, is then compared to the minimum neighbor threshold, k. If $n_i \ge k$, $p_i$ is retained; otherwise, it is deemed an outlier and removed, as depicted in Figure 5a,b, the final result of our goat point cloud processing is shown in Figure 7A.

<figure><img src="image_9.png" /><figcaption>Figure 5. Radius filter schematic (a: retained point; b: removed point). The first blue dot is a, and the second blue dot is b. Due to the red circle being drawn with a certain radius centered on the blue point, the point is highlighted in blue.</figcaption></figure>

### 2.4.2. Filtering Noise in Unused Spatial Regions

To further reduce environmental noise from non-acquisition zones such as equipment and clutter, a specialized target region extraction method for the point cloud was devised, tailored to the physical arrangement of equipment in the goat farm's acquisition environment. By analyzing the spatial distribution of environmental noise, the target region was defined as a spatial matrix, and the target point cloud within this matrix was obtained using straight-through filtering ($P_f$).

$$P_f = \{p_i \in P \mid a_x \le x_i \le b_x \land a_y \le y_i \le b_y \land a_z \le z_i \le b_z\} \quad (2)$$

The spatial matrix is defined by lateral boundaries formed by the railings on both sides $[a_x, b_x]$ (including the railings), extends longitudinally along the direction of the goat channel in front of and behind the device $[a_y, b_y]$, and vertically spans from the top camera to the extended ground $[a_z, b_z]$, as illustrated in Figure 7B.
### 2.4.3. Filtering Redundant Points

Point clouds obtained from depth cameras generally contain a substantial amount of data, and given that the target point cloud is synthesized from multiple cameras with varying viewpoints, the resulting data often contain significant redundancy. This redundancy can impact subsequent computational processes. To preserve the essential features of the target point cloud while reducing data volume, a voxel downsampling method is applied. This method divides the target point cloud into equal-sized voxels with dimensions ($v_x, v_y, v_z$), followed by computing voxel indices ($m_x, m_y, m_z$) for clustering,

$$m_x = \lfloor \frac{x_i}{v_x} \rfloor, m_y = \lfloor \frac{y_i}{v_y} \rfloor, m_z = \lfloor \frac{z_i}{v_z} \rfloor \quad (3)$$

Consider a voxel containing $d$ points {$p_{m1}, p_{m2}, \dots, p_{md}$}. The center of mass for this voxel is computed as:

$$p_c = \left( \frac{1}{d} \sum_{j=1}^{d} x_{mj}, \frac{1}{d} \sum_{j=1}^{d} y_{mj}, \frac{1}{d} \sum_{j=1}^{d} z_{mj} \right) \quad (4)$$

The final target point cloud data are denoted as $P' = \{p_{c1}, p_{c2}, \dots\}$, as shown in Figure 7C.

### 2.4.4. Filtering Ground Noise

Given that ground noise in goat farms typically presents unique planar geometric features, it can be automatically detected using the Random Sample Consensus (RANSAC) algorithm. The process begins by selecting three points from the goat body point cloud for plane fitting as represented by the equation:

$$ax_i + by_i + cz_i + d = 0 \quad (5)$$

The parameters, $a, b, c, d$, of the fitting plane are determined. The distance, $D$, from each point to the plane is then calculated,

$$D = \frac{|ax_i + by_i + cz_i + d|}{\sqrt{a^2 + b^2 + c^2}} \quad (6)$$

A threshold, $\beta$, is defined such that a point is classified as being on the plane if the condition $D < \beta$ is met. After completing the plane fitting, the number of iterations, $n$, is specified, and the preceding step is repeated. The results of this process are presented in Figure 7D.

### 2.4.5. Filtering Railing and Other Random Noise

To effectively remove railing interference noise, it is necessary to first determine the location of the railings. For this purpose, let the point cloud, after ground noise removal, be denoted as $P_L \{p_{l1}, p_{l2}, \dots\}$, sampled along the x-axis at 6 mm intervals. The longitudinal point cloud clusters are then extracted as $S\{s_1, s_2, \dots, s_n\}$,

$$s_i = \{ p_{li} \in P_L \mid x - 3 \le x_i \le x + 3 \} \quad (7)$$

Subsequently, calculate the number of data points in each point cloud cluster $M\{m_1, m_2, \dots, m_n\}$ individually to generate a distribution Figure 6A that shows the number of data points within each cluster.

To preliminarily identify the L and R railing intervals, the point cloud difference, $V_L\{v_{l1}, v_{l2}, \dots\}$, before and after the L region, is calculated,

$$v_{li} = m_{i+1} - m_i \quad (8)$$
Along with the point cloud difference before and after the R region, $V_R\{v_{r1}, v_{r2}, \dots\}$,

$$v_{ri} = m_{i-1} - m_i \qquad (9)$$

<figure><img src="image_10.png" /><figcaption>**Figure 6.** Distribution and variance of point counts in point cloud clusters. (A) The background shows the point cloud after processing by the preceding algorithm. Blue bars represent the actual distribution of points within each point cloud cluster, while black curves depict a moving average fit to these blue bars. The manually selected railing locations are marked as L and R. (B) A scatter plot illustrates the differences in points counts within each point cloud cluster in region L, arranged from left to right (b1: plunging differences in points counts within point cloud cluster). (C) A scatter plot shows the differences in points counts within each point cloud cluster in region R, arranged from right to left (c1: flat differences in points counts within point cloud cluster, c2: plunging differences in points counts within point cloud cluster).</figcaption></figure>

For $V_L$ of the target point cloud, Figure 6B illustrates that for each successive point cloud cluster, from the outer point cloud of the railing to the inner point cloud, the data volume initially shows a sharp increase, followed by a sharp decrease, and then stabilizes. In Figure 6C, $V_R$ shows that the data volume in successive point cloud clusters increases abruptly at the front and back, exhibits a relatively flat region at c1 in the middle, decreases sharply, and finally levels off. This variability suggests that human errors occur in the placement of railings, leading to non-uniformity in their alignment across different farms. To improve the algorithm's robustness, the plunging point clouds, b1 and c2, that consistently appear in the L and R regions are selected as initial identification points for railing removal, while retaining the intermediate goat point cloud $T\{t_1, t_2, \dots\}$,

$$T = \{t_i \in P_L \mid b1_x \le x_i \le c2_x\} \qquad (10)$$

To precisely determine the plunge points, b1 and c2, within various point cloud scenes, their typical characteristics must first be established. As depicted in the figure, when a point cloud begins to plunge, the number of point clouds before and after the plunge decreases, resulting in a negative difference value. The difference value of the number of point clouds before and after the plunge is, therefore, defined as $v_n$. When $v_{li} \le v_n$, the position is
marked as b1x, and when $v_{li} \le v_n$, it is marked as c2x, enabling the initial identification and removal of railing intervals.

Given that the railing and other noises may not be fully removed, additional noise reduction is required. To address this, an empty point cloud cluster set, U, is initialized. For each unprocessed data point, $t_i$, if $t_i$ is not associated with any processed set, a new point cloud cluster, u, is created as follows:

$$u = \{t_i\} \qquad (11)$$

Subsequently, the Euclidean distance is computed between point $t_i(x_i, y_i, z_i)$ and point $t_j(x_j, y_j, z_j)$ within any given goat point cloud:

$$d(t_i, t_j) = \sqrt{(x_i - x_j)^2 + (y_i - y_j)^2 + (z_i - z_j)^2} \qquad (12)$$

A distance threshold, $\gamma$, is established. If $d(t_i, t_j) \le \gamma$, then points $t_i$ and $t_j$ are assigned to the same point cloud cluster, and the cluster is subsequently updated as follows:

$$u = u \cup \{t_j | d(t_i, t_j) \le \gamma\} \qquad (13)$$

Upon completion of the extension, it is necessary to evaluate whether the cluster meets the established criteria:

$$N_{min} \le u \le N_{max} \qquad (14)$$

$N_{min}$ and $N_{max}$ represent the minimum and maximum thresholds established for the goat point cloud, respectively. If these conditions are met, the point cloud cluster, u, is included in the set, U; otherwise, it is discarded. The process continues until all points have been processed. The application of Euclidean clustering effectively eliminates residual railing noise and other potential interference points, resulting in the accurate extraction of the goat point cloud, as illustrated in Figure 7E.

<figure><img src="image_11.png" /><figcaption>**Figure 7.** Workflow for noise identification and filtering in a goat farm environment. (A) Initial removal of noise between the goat and railings, along with the elimination of substantial irrelevant noise. (B) Filtering of noise in non-essential spatial regions. (C) Processing of redundant points related to goats. (D) Ground noise detection and filtering. (E) Identification and removal of railing-related and other random noises.</figcaption></figure>
## 2.5. Distributed Point Cloud Completion Algorithm

Although the goat point cloud has been successfully extracted using the environmental noise recognition and filtering method for goat farm, the presence of various unavoidable environmental interferences in the farm environment—such as dust, railings, and hair— result in partial loss of the obtained goat point cloud data. To address this issue, a point cloud completion algorithm has been developed to reconstruct the missing parts of the goat point cloud.

### 2.5.1. Determining the Point Cloud Segmentation Position

To accurately identify the positions of the goat's head, neck, and limb cuts, the ratio $R_p\{r_{p1}, r_{p2}, \dots, r_{p33}\}$ is computed by comparing the leg cut location, $s_{pi.p}$, to the ground, $G_z$, and the total point cloud height, $s_{pi.z}$, for each of the 33 sets of goat point cloud data $S_p\{s_{p1}, s_{p2}, \dots, s_{p33}\}$. The ratio is defined as follows:

$$r_{pi} = \frac{(s_{pi.p} - G_z)}{s_{pi.z}} \qquad (15)$$

As illustrated in Figure 8, the blue points correspond to the raw data, while the black curve denotes the fitted moving average. It is evident that the percentage of the distance from the leg cutting position to the ground, relative to the overall point cloud distance of the goat, consistently falls within the range $\{r_{pi} \in R_p | 0.3 \le r_{pi} \le 0.45\}$. Thus, the leg cutting position is initially determined within region X, with plane b indicating the theoretical leg cutting position.

<figure><img src="image_12.png" /><figcaption>**Figure 8.** Initial identification of the range of segmentation positions (X: the white arrow indicates that the leg cutting position is initially determined within region b; the black dashed line indicates the theoretical leg cutting position).</figcaption></figure>

Given that the alignment process utilizes the top view (where the top camera captures images perpendicular to the ground), it is essential to analyze all extracted goat point clouds, $U_p\{u_{p1}, u_{p2}, \dots\}$, to identify the maximum, $max_z$, and minimum, $min_z$, values of their z-coordinates, $z_i \in (min_z, max_z)$. Subsequently, point cloud clusters, $F\{f_1, f_2, \dots\}$, are extracted sequentially along the z-axis at 20 mm intervals within the region X, defined as:

$$f_i = \{u_{pi} \in P | z - 10 \le z_i \le z + 10\} \qquad (16)$$

Figure 9A indicates that a1 marks the true leg cutting position, corresponding to the lowest point within the point cloud cluster, b2, shown in Figure 9B. Therefore, the precise cutting location can be determined by identifying the actual cutting cluster (ACC) of b2. In order to effectively distinguish ACCs from the non-cutting point cloud clusters (non-ACC),
this study extracted 243 point cloud clusters from 44 groups of goat point clouds, of which 44 clusters were classified as ACCs, while the remaining clusters were categorized as non-ACCs. Three characteristic features were selected to define these intervals.

<figure><img src="image_13.png" /><figcaption>Figure 9. Determining the actual segmentation position.</figcaption></figure>

The actual cutting position of the point cloud cluster is represented as a percentage of $W_A$, calculated as the ratio of the z-coordinate from the ground to the cutting point cloud position, $G_s$, and the overall goat interval, $S_A$:

$$W_A = \frac{G_s}{S_A} \qquad (17)$$

The point difference density, $D_p$, is defined as the ratio of the difference in the number of points between the current point cloud cluster, $N_f$, and the preceding cluster, $N_b$, to the width of the cut point cloud cluster along the z-axis, $W_c$:

$$D_p = \frac{N_f - N_b}{W_c} \qquad (18)$$

The point share, $N_d$, is defined as the ratio of the number of points in the cut point cloud clusters, $N_p$, to the total number of points in the point cloud, $S_n$:

$$N_d = \frac{N_p}{S_n} \qquad (19)$$

Significant differences exist between the actual cut point cloud clusters (ACC) and non-cut point cloud clusters (non-ACC) regarding the aforementioned features; however, some overlap remains, rendering direct differentiation using threshold values ineffective.
Therefore, a logistic regression model is utilized to identify the actual cut point cloud clusters (ACC), yielding the following fitting results:

$$Y = -16.336 + 30.162 \times W_A - 5.014 \times D_p - 153.491 \times N_d \quad (20)$$

The probability P is calculated as:

$$P = \frac{1}{1 + e^{-Y}} \quad (21)$$

A point cloud cluster is classified as an actual cut point cloud cluster (ACC) if the probability is $P \ge 0.24$; otherwise, it is categorized as a non-cut point cloud cluster (non-ACC).

### 2.5.2. Point Cloud Completion

As illustrated in Figure 10, the maximum y-coordinate value in the actual cutting point cloud clusters (ACC) is identified first. A cutting plane, denoted as 'h', is then established perpendicularly to the y-axis based on this maximum value, enabling effective segmentation of the goat's head, neck, and carcass. Simultaneously, the maximum z-coordinate value in the point cloud cluster is determined, and a cutting plane 'l', perpendicular to the z-axis, is established to facilitate effective segmentation of the carcass and legs. Consequently, distinct regions for the legs (L), torso (T), and head and neck (H) are obtained. Given the differing data point distribution characteristics of the leg, torso, and head and neck point clouds, varying search radiuses, sampling radiuses, and sampling step sizes are utilized for their respective complementation processes. For each point in the point cloud cluster, $P_t\{p_{t1}, p_{t2}, \dots\}$, the set of all neighboring points within a search radius, $R_h$, is identified as $N_t(p_{ti}, R_h)$:

$$N_t(p_{ti}, R_h) = \{p_{tj} \in P_t \mid \|p_{ti} - p_{tj}\| \le R_h\} \quad (22)$$

Then, define a new plane

$$z_i = ax_i + by_i + c \quad (23)$$

To compute the coefficients, $a, b, c$, the least squares method is employed to minimize the objective function F:

$$F = \sum_{p_{ti} \in N_t} (z_i - (ax_i + by_i + c))^2 \quad (24)$$

The final range is determined based on the sampling radius, $r_h$:

$$(x_j - x_i)^2 + (y_j - y_i)^2 \le r_h \quad (25)$$

Additionally, the distance between the sampling steps, $s_h$, is considered:

$$\sqrt{(x_j - x_i)^2 + (y_j - y_i)^2} = s_h \quad (26)$$

The newly generated point, $p_{tj}$, is determined as follows:

$$p_{tj} = (x_j, y_j, z_j) = (x_i + m \times s_h, y_i + n \times s_h, a(x_i + m \times s_h) + b(y_i + n \times s_h) + c) \quad (27)$$

where $m$ and $n$ are integers used to determine the relative position of the new points in the plane. The final complementary result for the goat is illustrated as M in Figure 10. Subsequently, voxel downsampling is applied once more to restore the goat point cloud to its previous density.
<figure><img src="image_14.png" /><figcaption>**Figure 10.** Schematic of distributed point cloud complementation algorithm (h: cutting plane of the goat's head, neck, and carcass, l: cutting plane of the goat's legs and carcass).</figcaption></figure>

## 3. Results

To assess the accuracy and speed of the goat point cloud extraction and reconstruction method, an experiment was carried out involving 14 goats.

### 3.1. *Point Cloud Extraction and Reconstruction Results*

The results of the goat point cloud extraction and reconstruction are demonstrated using an example to illustrate the effectiveness of the algorithm. First, the point cloud data captured by the top-angle depth camera on the top shelf serves as the reference for aligning the point clouds from the left and right sides, with the final result depicted in Figure 11A. To accommodate various farm environments and potential human influences,
we employ an environmental noise recognition and filtering method for goat point cloud extraction, as illustrated in Figure 11B. In the actual farming environment, factors such as dust, insects, fences, equipment, and hair can interfere with the laser emitted by the depth camera, leading to reduced data accuracy due to blockage or multiple reflections. Thus, the distributed goat point cloud completion algorithm is applied to address the missing critical parts of the goat point cloud, as illustrated in Figure 11C. While detailed point cloud data, such as the ears and head contours, may not be fully recovered, these missing details do not impact the overall characteristics of the goat point cloud, allowing for accurate evaluation of the goat's physical parameters without uncertainty.

<figure><img src="image_15.png" /><figcaption>**Figure 11.** Results of the goat extraction and reconstruction algorithm. (A) Alignment results of goat point cloud. (B) Results of environmental noise recognition and filtering in the goat farm. (C) Results of the distributed point cloud complementation algorithm.</figcaption></figure>

## 3.2. Accuracy of Goat Point Cloud Reconstruction

In this study, point cloud data of goats collected using depth cameras were utilized. To assess the accuracy of the extracted and reconstructed goat point clouds, data from ten experimental goats were selected, with point clouds of three different postures randomly chosen for each goat. Manual calibration of the measurement points was employed to determine body height, body slant length, and chest circumference of the goat. These measurements were then compared to direct measurements taken with a tape measure and a measuring rod in the actual breeding environment, as detailed in Table 2. In the table, 'Id' represents the identification number for each goat, 'M' denotes the median value, 'L' indicates manual measurement data (all in millimeters), and 'E' signifies the average error percentage.

<table><caption>**Table 2.** Point cloud reconstruction accuracy.</caption><thead><tr><th rowspan="2">Id</th><th colspan="3">Body Height</th><th colspan="3">Body Oblique Length</th><th colspan="3">Chest Girth</th></tr><tr><th>M</th><th>L</th><th>E</th><th>M</th><th>L</th><th>E</th><th>M</th><th>L</th><th>E</th></tr></thead><tbody><tr><td>1</td><td>550</td><td>553</td><td>1.8</td><td>620</td><td>617</td><td>1.1</td><td>650</td><td>648</td><td>1.2</td></tr><tr><td>2</td><td>580</td><td>581</td><td>0.4</td><td>620</td><td>622</td><td>0.5</td><td>615</td><td>634</td><td>2.7</td></tr><tr><td>3</td><td>515</td><td>514</td><td>0.7</td><td>580</td><td>583</td><td>1.2</td><td>620</td><td>615</td><td>1.9</td></tr><tr><td>4</td><td>610</td><td>619</td><td>1.5</td><td>660</td><td>676</td><td>1.7</td><td>800</td><td>801</td><td>1.1</td></tr><tr><td>5</td><td>680</td><td>693</td><td>1.8</td><td>730</td><td>728</td><td>1.0</td><td>860</td><td>861</td><td>0.8</td></tr><tr><td>6</td><td>620</td><td>616</td><td>0.5</td><td>670</td><td>692</td><td>3.1</td><td>790</td><td>778</td><td>1.3</td></tr><tr><td>7</td><td>590</td><td>579</td><td>1.8</td><td>630</td><td>612</td><td>2.1</td><td>690</td><td>704</td><td>1.8</td></tr><tr><td>8</td><td>630</td><td>620</td><td>2.5</td><td>730</td><td>745</td><td>3.7</td><td>800</td><td>814</td><td>2.2</td></tr><tr><td>9</td><td>630</td><td>625</td><td>0.9</td><td>650</td><td>658</td><td>2.1</td><td>720</td><td>735</td><td>1.6</td></tr><tr><td>10</td><td>585</td><td>596</td><td>1.4</td><td>640</td><td>645</td><td>1.6</td><td>680</td><td>682</td><td>2.5</td></tr></tbody><tfoot><tr><td colspan="10">Overall average error/%</td><td>1.3</td><td>1.8</td><td>1.7</td></tr></tfoot></table>
The results indicate that none of the average errors for the measured points exceeded 3.1%, and the absolute errors of the median values were all within 25 mm compared to the manual measurements. These findings demonstrate that the environment-adaptive point cloud extraction method and the distributed point cloud completion algorithm significantly enhance accuracy, providing reliable 3D data for goat phenotypic feature extraction and non-contact body measurements. This approach reduces the stress on the goat and decreases the need for manual labor.

### 3.3. System Speed Test

Computational experiments, including on-site acquisition, alignment, and extraction of goat point clouds, were conducted with 14 goats in a real-world farming environment to evaluate the time efficiency of the automated point cloud extraction and reconstruction process. Table 3 presents the duration of each stage of the algorithm operating independently, with each column representing the time spent on various stages of the process.

<table><caption>**Table 3.** System runtime breakdown. (T1: Time for depth camera data acquisition; T2: Time for multi-view reconstruction; T3: Time for environmentally adaptive point cloud extraction; T4: Time for distributed point cloud complementation algorithm).</caption><thead><tr><th></th><th>T1/s</th><th>T2/s</th><th>T3/s</th><th>T4/s</th><th>Total Time/s</th></tr></thead><tbody><tr><td>1</td><td>0.10</td><td>0.44</td><td>12.34</td><td>4.63</td><td>17.51</td></tr><tr><td>2</td><td>0.08</td><td>0.34</td><td>12.61</td><td>4.12</td><td>17.15</td></tr><tr><td>3</td><td>0.09</td><td>0.36</td><td>13.50</td><td>4.08</td><td>18.03</td></tr><tr><td>4</td><td>0.09</td><td>0.33</td><td>12.36</td><td>3.82</td><td>16.60</td></tr><tr><td>5</td><td>0.10</td><td>0.29</td><td>11.96</td><td>4.22</td><td>16.57</td></tr><tr><td>6</td><td>0.09</td><td>0.33</td><td>12.25</td><td>4.25</td><td>16.92</td></tr><tr><td>7</td><td>0.11</td><td>0.38</td><td>12.13</td><td>4.13</td><td>16.75</td></tr><tr><td>8</td><td>0.09</td><td>0.27</td><td>11.52</td><td>3.87</td><td>15.75</td></tr><tr><td>9</td><td>0.08</td><td>0.26</td><td>11.86</td><td>3.96</td><td>16.16</td></tr><tr><td>10</td><td>0.10</td><td>0.35</td><td>12.71</td><td>4.14</td><td>17.30</td></tr><tr><td>11</td><td>0.12</td><td>0.37</td><td>13.73</td><td>3.89</td><td>18.11</td></tr><tr><td>12</td><td>0.09</td><td>0.29</td><td>12.35</td><td>4.32</td><td>17.05</td></tr><tr><td>13</td><td>0.08</td><td>0.41</td><td>12.08</td><td>4.17</td><td>16.74</td></tr><tr><td>14</td><td>0.09</td><td>0.33</td><td>11.98</td><td>3.83</td><td>16.23</td></tr><tr><td>Mean</td><td>0.09</td><td>0.33</td><td>12.38</td><td>4.10</td><td>16.91</td></tr></tbody></table>

The data in the table indicates that the average time T1 for multi-viewpoint cloud acquisition is 0.09 s, occurring as the goat passes through the system. In contrast, the average times for subsequent processing stages are significantly longer: multi-view reconstruction T2 averages 0.33 s, environmental noise recognition and filtering method for goat farm T3 averages 12.38 s, and the distributed goat point cloud completion algorithm T4 averages 4.1 s. Collectively, T2, T3, and T4 account for approximately 99% of the total system time. To enhance system efficiency, a multi-threaded approach was implemented, allowing T2, T3, and T4 to be processed in background threads while T1 remains in the main thread. As a result, the average reconstruction time for extracting the point cloud for each goat is reduced to approximately 3–5 s.

## 4. Discussion

### 4.1. Discussion of Real-Time Goat Point Cloud Acquisition

In contrast to the data collection methods employed by other researchers, such as Kiyoun et al. [25], who used four depth cameras and a guiding frame to optimize the field of view for acquiring pig point clouds, their method lacks the ability to accurately determine the precise positions of pigs within the passage or to distinguish between individual pigs without manual ear tag recording. Similarly, Guangyuan et al. [26] utilized a mobile phone camera to capture multi-view images of stationary cattle, which were subsequently transformed into 3D point cloud data. While this method is less expensive than using depth
cameras, it necessitates immobilizing the livestock, and the point cloud generation process is time-consuming. To address these challenges, we developed a two-way distributed trigger logic system for real-time goat point cloud acquisition. This system includes a high-frequency ear tag reader to automatically distinguish between individual goats and a photoelectric sensor to accurately detect each goat's position during image capture. With this method, goats simply walk through the passage, allowing the system to automatically collect point cloud data as each goat triggers the sensor, while the ear tag reader identifies individual goats. As illustrated in Figure 3, this approach effectively meets the practical needs of farms.

## 4.2. Discussion of Point Cloud Extraction Methods

In contrast to laboratory environments, which are typically unobstructed and clean, the actual breeding environment presents challenges in point cloud data acquisition due to two primary types of noise. The first type is noise, which occurs between the goat and the fencing equipment, and the second type is fence noise originating from the fencing itself. The analysis examines the effects of these two types of noise on the acquired goat point cloud data.

### 4.2.1. Impact of Noise between Goat and Railing

Point cloud data collected from depth cameras often contain substantial noise. One of the primary issues in the goat point cloud is the presence of numerous outliers between the goats and the railings, which lack distinct geometric features or typical distribution patterns. These noise points can significantly reduce the accuracy of goat body parameter measurements. The noise is minimized only when the goats are positioned centrally between the railings, maintaining an adequate distance from both sides—an arrangement that is impractical for real-world applications. Although we considered using a statistical filter for denoising, this approach requires prior statistical analysis of the entire point cloud, making it sensitive to environmental variations across different farming setups. Instead, we chose radius filtering, defining a specific radius, $r_L$, to determine the number of points, $n_L$, within this radius, which then allows us to calculate the point cloud density $D$:

$$D = \frac{n_L}{r_L} \qquad (28)$$

The density values, $D\{0.1, 0.2, \dots, 1.9\}$, are analyzed, as shown in Figure 12.

<figure><img src="image_16.png" /><figcaption>Figure 12. Filtering results for different values of parameter D.</figcaption></figure>
Figure 12 illustrates a significant reduction in noise with increasing *D*. For *D* values ranging between 0.1 and 0.7, residual noise persists between the fence and the goat. Values of *D* of 1 or higher effectively eliminate this noise. However, increasing *D* further results in a growing risk of inadvertently filtering out sections of the goat's point cloud, causing notable distortions. Thus, the selection of *D* should be tailored to the specific needs of the analysis: generally, a *D* value between 1 and 1.6 is preferred. In cases where the completeness of the goat point cloud is less critical, a higher *D* value can be utilized to ensure comprehensive removal of noise.

### 4.2.2. Analysis of Railing Noise Removal

Because goats are non-rigid and their position and posture are arbitrary while passing through the channel under the device, human control over their precise positioning is impractical. This is evident in scenarios where goats are close to the railing, as depicted in Figure 13A. Utilizing the Euclidean clustering extraction method directly is insufficient for separating the railing from the goat point cloud, as shown in Figure 13B. Consequently, the railing noise recognition algorithm is applied to initially identify and remove the railing, as illustrated in Figure 13C. After the main railing point cloud is removed, the remaining stray points are scattered, and further noise removal can be effectively achieved using Euclidean clustering extraction, as demonstrated in Figure 13D. In practical applications, it is difficult to completely eliminate railing interference. Despite fixed equipment specifications, variations in railing construction occur, making uniform and straight placement challenging. When the railing exhibits curvature, as seen in Figure 13C, straight pass filtering alone is inadequate. To maintain the integrity of the goat point cloud, a point cloud extraction method for the goat farm is required. This method automatically identifies and removes interfering point clouds, such as those from the ground, railings, and equipment, and, thus, improves robustness and suitability for various farming environments.

<figure><img src="image_17.png" /><figcaption>**Figure 13.** Comparison of fence noise removal. (A) Schematic diagram of the railing near the goat. (B) Direct extraction results using the Euclidean clustering method. (C) Preliminary railing filtering results using the environmental noise recognition method in the goat farm. (D) Final railing filtering results using the environmental noise recognition and filtering method in goat farm.</figcaption></figure>
### 4.3. Analysis of Distributed Goat Point Cloud Completion Algorithm

To evaluate the distributed point cloud completion algorithm's ability to accurately pinpoint the segmentation locations in the goat point cloud and to improve data completeness, the following section provides a comprehensive analysis of the algorithm's performance.

#### 4.3.1. Analysis of Goat Point Cloud Segmentation Position

The segmentation surfaces of the goat point cloud, specifically the leg segmentation surface, *l*, and the head and neck segmentation surface, *e*, are evaluated. The recognition accuracy for the leg segmentation surface, *l*, is denoted as $R_l$, while the recognition accuracy for the head and neck segmentation surface, *e*, is denoted as $R_e$, as shown below:

$$R_l = \frac{z_c - z_f}{z_A} \qquad (29)$$

$$R_e = \frac{y_c - y_f}{y_A} \qquad (30)$$

The coordinates $z_c$ and $y_c$ represent the predicted positions of the segmentation plane in the z and y directions as determined by the algorithm, while $z_f$ and $y_f$ represent the ideal positions in a theoretical context. The ranges $z_A$ and $y_A$ correspond to the overall z and y coordinates of the goat point cloud. Based on the segmentation results, when the recognition accuracies, $R_l$ and $R_e$, are both less than 0.05, the segmentation planes, *l* and *e*, correctly correspond to the legs, head, and neck, indicating successful segmentation. The recognition accuracies of the segmentation planes are summarized in Table 4. The table shows that among 112 goat point clouds, there was only one instance of misrecognition. Since both segmentation planes, *l* and *e*, are derived from the same point cloud cluster, an error in recognizing this cluster typically leads to inaccuracies in identifying both planes. Consequently, the recognition accuracy for both planes is 99.1%, with an average error of less than 1%. The high overall accuracy and low average error demonstrate that the method satisfies practical requirements.

<table><caption>**Table 4.** The region segmentation accuracy.</caption><thead><tr><th>Surface</th><th>Input Count</th><th>Segmentation Success Count</th><th>Accuracy/%</th><th>Average Error/%</th></tr></thead><tbody><tr><td>l</td><td rowspan="2">112</td><td>111</td><td>99.1</td><td>0.7</td></tr><tr><td>e</td><td>111</td><td>99.1</td><td>0.6</td></tr></tbody></table>

#### 4.3.2. Analysis of Goat Point Cloud Completion for Different Missing Area Scenarios

When using three cameras to acquire goat point clouds in a farm environment, it is inevitable to encounter interference and occlusions, such as bars and dust, which may result in the point clouds of the torso, legs, and head being partially missing. Qi [27] applied an improved moving least squares method to reconstruct cow point clouds. While this method effectively completed the missing portions of the cattle's body point cloud, it did not address the issue where the moving least squares method tends to enlarge the contours of regions with varying curvatures, particularly in the leg area, as shown in Figure 14A. To address this issue, we introduced machine learning techniques. By using a logistic regression model, we defined segmentation intervals based on the actual segmentation locations, selected three representative features, and determined the segmentation boundaries of the goat point cloud. This allowed us to separate the leg, torso, and head-neck regions. Subsequently, we set different search radii, sampling radii, and sampling step sizes according to the surface curvature of each area. As shown in Table 5, we randomly selected points on the legs of 111 goat point clouds and compared the original data with the data obtained after applying the completion algorithms. The average error for leg data using the least squares-based completion method was 41.7 mm, which severely affects the accuracy of
body shape assessment. In contrast, the distributed point cloud completion algorithm yielded an average error of only 1.4 mm. This demonstrates that the point cloud completion algorithm can effectively and automatically complete the missing point cloud data while preserving the phenotypic characteristics of the goat, as shown in Figure 14B.

<figure><img src="image_18.png" /><figcaption>**Figure 14.** Comparison of completion algorithm results (c1: original chest point cloud, c2: completed chest point cloud, d1: original abdominal point cloud, d2: completed abdominal point cloud, d3: original the surface of the goat's body, d4: smooths the surface of the goat's body).</figcaption></figure>
<table><caption>**Table 5.** Error of completion methods relative to the true value.</caption><thead><tr><td>Completion Method</td><td>Number of Point Cloud</td><td>Average Error/mm</td></tr></thead><tbody><tr><td>Moving least squares</td><td>111</td><td>41.7</td></tr><tr><td>Distributed point cloud completion algorithm</td><td>111</td><td>1.4</td></tr></tbody></table>

In cases where the goat point cloud is incomplete due to obstructions like railings or other factors, the chest and abdominal point clouds, which are commonly used in body measurements, were manually segmented, as depicted in Figure 14(c1,d1). The absence of chest and abdominal point clouds negatively impacts the calculation of essential parameters, including chest and abdominal circumferences, which are vital for accurate body measurements. To address this, a distributed goat point cloud completion algorithm is applied to effectively reconstruct the missing parts without altering the phenotypic features of the original point cloud. The results, as shown in Figure 14C,D, demonstrate that this method successfully complements the chest and abdomen point clouds. The error between the measured chest circumference and the actual value after point cloud complementation is used as an evaluation metric to quantitatively assess the results, with the findings presented in Table 2, indicating high accuracy of the fitting results. Furthermore, this method not only completes the missing point cloud but also smooths the surface of the goat's body, eliminating factors like raised wool that could affect the accuracy of the measurements, as seen in Figure 14(d3,d4). This reduces the impact of missing point cloud data on measurement accuracy. Furthermore, the algorithm is computationally efficient, meeting the time requirements for real-world applications, as shown in Table 2 (T4). However, the algorithm cannot fully restore large missing sections, such as the head, neck, or hindquarters of the goat. To address this, future work could involve adjusting the positions of the depth cameras on both sides to capture more complete data from these regions or incorporating novel point cloud techniques to further enhance the distributed point cloud completion algorithm.

## 5. Conclusions

We have developed an advanced system for the real-time acquisition, extraction, and reconstruction of goat point clouds in operational farm environments, optimized for capturing body phenotypic data in dynamic scenarios. This system automatically detects and identifies goats as they approach, accurately detects their positions, and captures multi-viewpoint cloud data instantaneously. We introduced an environmental noise recognition and filtering method tailored for goat farms, capable of automatically filtering out various disturbances inherent to these settings, thereby ensuring precise extraction of the target point cloud. Additionally, we implemented a distributed point cloud completion algorithm based on moving least squares, effectively addressing issues of missing data and reducing measurement inaccuracies. In practical applications, the system can automatically extract and reconstruct goat point cloud data from complex farm environments within an average of 3 to 5 s. The resulting goat point cloud data shows a deviation of no more than 25 mm, with an overall error ranging between 0.4% and 3.1%, indicating that the system accurately restores the real shape of the goats. However, challenges remain in effectively completing areas with significant missing data, such as the head, neck, and rump of the goat. In the future, we will adjust the positions of the depth cameras on both sides to capture more comprehensive point cloud data. Concurrently, we will explore new point cloud technologies to further enhance the distributed point cloud completion algorithm. By utilizing complete goat point clouds, we will analyze the phenotypic characteristics of the goats through segmentation and other point cloud algorithms, enabling precise body measurements, weight estimation, and physical appearance scoring in real farm environments.

**Author Contributions:** Conceptualization, W.M. and Y.S.; data curation, Q.L.; formal analysis, Q.L.; funding acquisition, W.M. and C.Z.; methodology, Y.S.; project administration, C.Z.; resources, Q.L.;
software, Y.S. and M.L.; supervision, W.M., A.D.L.T., S.X.Y. and C.Z.; validation, Y.S.; visualization, M.L.; writing—original draft, Y.S.; writing—review and editing, W.M., S.X.Y. and C.Z. All authors have read and agreed to the published version of the manuscript.

**Funding:** This work was supported by the National Key R&D Program of China (2021YFD1200900).

**Institutional Review Board Statement:** The animal study protocol was approved by the Information Technology Research Center, Beijing Academy of Agriculture and Forestry Sciences (Approval Number: AW30175316-6-1).

**Data Availability Statement:** The data presented in this study are available on request from the corresponding author.

**Conflicts of Interest:** The authors declare no conflicts of interest.

## References

1. Tullo, E.; Finzi, A.; Guarino, M. Review: Environmental impact of livestock farming and Precision Livestock Farming as a mitigation strategy. *Sci. Total Environ.* **2019**, *650*, 2751–2760. [CrossRef] [PubMed]

2. Pulina, G.; Francesconi, A.H.D.; Stefanon, B.; Sevi, A.; Calamari, L.; Lacetera, N.; Dell Orto, V.; Pilla, F.; Ajmone Marsan, P.; Mele, M.; et al. Sustainable ruminant production to help feed the planet. *Ital. J. Anim. Sci.* **2017**, *16*, 140–171. [CrossRef]

3. Lina, Z.; Pei, W.; Chuanzhong, X.; Yanqiu, L.; Juan, W. Advances in body size measurement and conformation appraisal for sheep. *Trans. Chin. Soc. Agric. Eng.* **2016**, *32*, 190–197. [CrossRef]

4. Liu, D.; Peng, L.; Zhao, Z. A review of intelligent methods of health assessment technology. *Intell. Robot.* **2023**, *3*, 355–373. [CrossRef]

5. Zhang, J.; Lei, J.; Wu, J.; Lu, H.; Guo, H.; Pezzuolo, A.; Kolpakov, V.; Ruchay, A. Automatic method for quantitatively analyzing the body condition of livestock from 3D shape. *Comput. Electron. Agric.* **2023**, *214*, 108307. [CrossRef]

6. Pethick, D.W.; Hocquette, J.; Scollan, N.D.; Dunshea, F.R. Review: Improving the nutritional, sensory and market value of meat products from sheep and cattle. *Animal* **2021**, *15*, 100356. [CrossRef]

7. Hastie, M.; Jacob, R.; Ha, M.; Hepworth, G.; Torrico, D.; Ashman, H.; Warner, R. Effect of carcase characteristics and sheep breeding values on the yield of dry- and wet-aged multipurpose merino cull ewe meat. *Livest. Sci.* **2021**, *243*, 104375. [CrossRef]

8. Yang, G.; Xu, X.; Song, L.; Zhang, Q.; Duan, Y.; Song, H. Automated measurement of dairy cows body size via 3D point cloud data analysis. *Comput. Electron. Agric.* **2022**, *200*, 107218. [CrossRef]

9. Fernandes, A.F.A.; Dórea, J.R.R.; Rosa, G.J.D.M. Image Analysis and Computer Vision Applications in Animal Sciences: An Overview. *Front. Vet. Sci.* **2020**, *7*, 551269. [CrossRef]

10. Borges Oliveira, D.A.; Ribeiro Pereira, L.G.; Bresolin, T.; Pontes Ferreira, R.E.; Reboucas Dorea, J.R. A review of deep learning algorithms for computer vision systems in livestock. *Livest. Sci.* **2021**, *253*, 104700. [CrossRef]

11. Khan, H.; Haq, I.U.; Munsif, M.; Mustaqeem, Khan, S.U.; Lee, M.Y. Automated Wheat Diseases Classification Framework Using Advanced Machine Learning Technique. *Agriculture* **2022**, *12*, 1226. [CrossRef]

12. Munsif, M.; Khan, S.U.; Khan, N.; Baik, S.W. Attention-Based Deep Learning Framework for Action Recognition in a Dark Environment. *Hum-Cent. Comput. Info* **2024**, *14*, 1–22. [CrossRef]

13. Yin, M.; Ma, R.; Luo, H.; Li, J.; Zhao, Q.; Zhang, M. Non-contact sensing technology enables precision livestock farming in smart farms. *Comput. Electron. Agric.* **2023**, *212*, 108171. [CrossRef]

14. Lee, C.; Lee, H.; Cho, H. Cattle Weight Estimation Using Fully and Weakly Supervised Segmentation from 2D Images. *Appl. Sci.* **2023**, *13*, 2896. [CrossRef]

15. Li, K.; Teng, G. Study on Body Size Measurement Method of Goat and Cattle under Different Background Based on Deep Learning. *Electronics* **2022**, *11*, 993. [CrossRef]

16. Jia, N.; Kootstra, G.; Koerkamp, P.G.; Shi, Z.; Du, S. Segmentation of body parts of cows in RGB-depth images based on template matching. *Comput. Electron. Agric.* **2021**, *180*, 105897. [CrossRef]

17. Yang, S.; Hou, M.; Li, S. Three-Dimensional Point Cloud Semantic Segmentation for Cultural Heritage: A Comprehensive Review. *Remote Sens.* **2023**, *15*, 548. [CrossRef]

18. Xuelei, M.; Heru, X.; Yanqin, Z.; Xinhua, J.; Na, L. Point cloud segmentation and measurement of the body size parameters of sheep based on the improved region growing method. *J. China Agric. Univ.* **2020**, *25*, 99–105. [CrossRef]

19. Zhao, K.; Zhang, M.; Shen, W.; Liu, X.; Ji, J.; Dai, B.; Zhang, R. Automatic body condition scoring for dairy cows based on efficient net and convex hull features of point clouds. *Comput. Electron. Agric.* **2023**, *205*, 107588. [CrossRef]

20. Hao, H.; Jincheng, Y.; Ling, Y.; Gengyuan, C.; Sumin, Z.; Huan, Z. An improved PointNet++ point cloud segmentation model applied to automatic measurement method of pig body size. *Comput. Electron. Agric.* **2023**, *205*, 107560. [CrossRef]

21. Wang, Y.; Mücher, S.; Wang, W.; Guo, L.; Kooistra, L. A review of three-dimensional computer vision used in precision livestock farming for cattle growth management. *Comput. Electron. Agric.* **2023**, *206*, 107687. [CrossRef]

22. Zhou, Y.; Xue, H.; Wang, C.; Jiang, X.; Gao, X.; Bai, J. *Reconstruction and Body Size Detection of 3D Sheep Body Model Based on Point Cloud Data*; Springer International Publishing: Berlin/Heidelberg, Germany, 2019; pp. 251–262. [CrossRef]
23. Li, G.; Liu, X.; Ma, Y.; Wang, B.; Zheng, L.; Wang, M. Body size measurement and live body weight estimation for pigs based on back surface point clouds. *Biosyst. Eng.* **2022**, *218*, 10–22. [CrossRef]

24. Luo, X.; Hu, Y.; Gao, Z.; Guo, H.; Su, Y. Automated measurement of livestock body based on pose normalisation using statistical shape model. *Biosyst. Eng.* **2023**, *227*, 36–51. [CrossRef]

25. Kwon, K.; Park, A.; Lee, H.; Mun, D. Deep learning-based weight estimation using a fast-reconstructed mesh model from the point cloud of a pig. *Comput. Electron. Agric.* **2023**, *210*, 107903. [CrossRef]

26. Yang, G.; Li, R.; Zhang, S.; Wen, Y.; Xu, X.; Song, H. Extracting cow point clouds from multi-view RGB images with an improved YOLACT++ instance segmentation. *Expert. Syst. Appl.* **2023**, *230*, 120730. [CrossRef]

27. Zhang, Q.; Hou, Z.; Huang, L.; Wang, F.; Meng, H. Reparation with moving least squares sampling and extraction of body sizes of beef cattle from unilateral point clouds. *Comput. Electron. Agric.* **2024**, *224*, 109208. [CrossRef]

**Disclaimer/Publisher's Note:** The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.