Method, device and electronic equipment for extracting key areas of livestock three-dimensional point clouds
Through the key area extraction method of livestock three-dimensional point cloud, the center and boundary of the livestock leg area are automatically identified, which solves the randomness and subjectivity problems caused by manual selection of measurement points in the existing technology and realizes non-contact automatic body measurement.
Patent Information
- Application Number
- CN202210785252.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-29
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2042-06-29
AI Technical Summary
In the existing technology, livestock body size measurement requires manual selection of measurement points, which leads to randomness and subjectivity, making it difficult to achieve non-contact automatic measurement.
By obtaining continuous point cloud slices of the target livestock, the center position and boundary of the livestock's leg area are automatically identified based on the span feature distribution fitting curve and the gradient feature distribution curve, and key area slices are obtained for body size calculation.
It realizes non-contact automatic measurement of livestock body size, avoids the randomness and subjectivity of manual selection of measurement points, and improves the accuracy and efficiency of measurement.
Smart Images

Figure CN115311356B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of agricultural information technology, and in particular to a method, device and electronic equipment for extracting key areas of a livestock three-dimensional point cloud. Background Art
[0002] In the intensive breeding model, body size parameters are closely related to livestock weight estimation, breeding value estimation and evaluation, meat quality evaluation, muscle fat content prediction and growth performance evaluation, and are of great significance in livestock breeding management, disease early warning, yield estimation and breed selection and breeding.
[0003] To address the difficulty of measuring production performance, related technologies have employed machine vision technology to measure livestock body dimensions. This eliminates the interference caused by manual measurement and enables non-contact measurement of animal body parameters. However, these methods require experienced workers to manually select measurement points within the animal's point cloud, which introduces a certain degree of randomness and subjectivity. Summary of the Invention
[0004] The present invention provides a method, device and electronic equipment for extracting key areas of livestock three-dimensional point clouds, which are used to solve the defect in the prior art that body size measurement needs to be completed by manually selecting measurement points, and realize non-contact automatic body size measurement.
[0005] In a first aspect, the present invention provides a method for extracting key areas of a livestock three-dimensional point cloud, comprising:
[0006] Acquire continuous point cloud slices of the target livestock, wherein the continuous point cloud slices are perpendicular to a first direction, where the first direction is a direction from the livestock's tail to the livestock's head;
[0007] Obtaining a span feature distribution fitting curve and a gradient feature distribution curve for characterizing a span value change rate based on span values of the continuous point cloud slices in a second direction, wherein the second direction is a direction from the ground to the head of the livestock;
[0008] Obtaining the center position of the leg region of the target livestock based on the extreme value point of the span characteristic distribution fitting curve;
[0009] Obtaining a front leg boundary position and a hind leg boundary position of the target livestock based on the center position of the leg region, the gradient characteristic distribution curve, and the maximum and minimum values of the gradient characteristic distribution curve;
[0010] Based on the front leg boundary position, the hind leg boundary position and the gradient feature distribution curve, a key area point cloud slice for livestock body size calculation is obtained.
[0011] Optionally, according to a livestock three-dimensional point cloud key area extraction method provided by the present invention, the leg area center position includes: the front leg area center position and the hind leg area center position, and obtaining the leg area center position of the target livestock based on the extreme value point of the span feature distribution fitting curve includes:
[0012] Based on a first span threshold, determining a first extreme point set and a second extreme point set from the extreme value points of the span feature distribution fitting curve, wherein the value of any extreme point in the first extreme point set in the second direction is greater than or equal to the first span threshold, and the value of any extreme point in the second extreme point set in the second direction is less than the first span threshold;
[0013] Traversing each target extreme point in the first extreme point set, and merging the target extreme point and its adjacent extreme points until two merged extreme points are obtained;
[0014] The merging of the target extreme point and the extreme points adjacent to the target extreme point includes:
[0015] Determine, in the first extreme point set, an adjacent extreme point of the target extreme point, wherein the absolute value of the difference between the values of the adjacent extreme point and the target extreme point in the first direction is less than or equal to a second span threshold, and the values of the adjacent extreme point and the target extreme point in the first direction are both greater than or less than the values of non-leg extreme points in the first direction, and the non-leg extreme point is any extreme point in the second extreme point set;
[0016] Deleting the adjacent extreme value points of the target extreme value point from the first extreme point set;
[0017] The target extreme point and the extreme points adjacent to the target extreme point are merged to obtain a merged extreme point.
[0018] Optionally, according to a livestock three-dimensional point cloud key area extraction method provided by the present invention, the step of obtaining a gradient characteristic distribution curve for characterizing the span value change rate includes:
[0019] Determining, based on the span values of the continuous point cloud slices in the second direction, a plurality of discrete points for characterizing the span distribution of the continuous point cloud slices;
[0020] Based on a preset number of cluster points, the plurality of discrete points are divided along a second direction to obtain a plurality of point clusters, wherein the number of discrete points in the point clusters is equal to the preset number of cluster points;
[0021] Along the second direction, the average gradient between the multiple point clusters is calculated to obtain the gradient feature distribution curve.
[0022] Optionally, according to a livestock three-dimensional point cloud key area extraction method provided by the present invention, the front leg boundary position includes the front leg front edge boundary and the front leg rear edge boundary, the hind leg boundary position includes the hind leg front edge boundary and the hind leg rear edge boundary, and the method of obtaining a key area point cloud slice for livestock body size calculation based on the front leg boundary position, the hind leg boundary position and the gradient feature distribution curve includes:
[0023] For each target leg boundary among the front leg leading edge boundary, the front leg trailing edge boundary, the rear leg leading edge boundary, and the rear leg trailing edge boundary, moving the target leg boundary toward the center position of the leg region according to a preset step size until the number of clusters of the point cloud slice corresponding to the target leg boundary is 1, where the number of clusters is determined based on the DBSCAN clustering algorithm;
[0024] The key area slice is acquired based on the front leg leading edge boundary, the front leg trailing edge boundary, the rear leg leading edge boundary and the rear leg trailing edge boundary.
[0025] Optionally, according to a livestock three-dimensional point cloud key area extraction method provided by the present invention, the key area slices include a first key area slice, a second key area slice, a third key area slice, and a fourth key area slice, and obtaining the key area slices based on the front edge boundary of the front leg, the rear edge boundary of the front leg, the front edge boundary of the hind leg, and the rear edge boundary of the hind leg includes:
[0026] Determine a front leg front edge region slice where the front leg front edge boundary is located, a front leg rear edge region slice where the front leg rear edge boundary is located, and a rear leg rear edge region slice where the rear leg rear edge boundary is located;
[0027] Among the extreme points of the span characteristic distribution fitting curve, a regional slice where the extreme point is located between the rear edge boundary of the front leg and the front edge boundary of the hind leg is determined as the abdominal region slice; or a regional slice where the abdominal target point is located is determined as the abdominal region slice, where the abdominal target point is located at the midpoint between the rear edge boundary of the front leg and the front edge boundary of the hind leg;
[0028] Determine, based on the lowest point of the abdominal circumference having the smallest value in the second direction in the abdominal circumference region slice, a horizontal segmentation plane where the lowest point of the abdominal circumference is located;
[0029] Determine the parts of the front leg front edge area slice, the front leg rear edge area slice, the abdominal circumference area slice and the rear leg rear edge area slice that are above the horizontal dividing plane as the first key area slice, the second key area slice, the third key area slice and the fourth key area slice, respectively.
[0030] Optionally, according to the livestock three-dimensional point cloud key area extraction method provided by the present invention, after obtaining the key area point cloud slices for livestock body size calculation based on the front leg boundary position, the hind leg boundary position and the gradient feature distribution curve, the method further includes:
[0031] Obtaining the body size of the target livestock based on the first key area slice, the second key area slice, the third key area slice, and the fourth key area slice;
[0032] The body measurements include any one or more of the following: body length, body width, body height, chest circumference or abdominal circumference.
[0033] In a second aspect, the present invention further provides a device for extracting key areas of a livestock three-dimensional point cloud, comprising:
[0034] A first acquisition module is configured to acquire continuous point cloud slices of the target livestock, wherein the continuous point cloud slices are perpendicular to a first direction, where the first direction is from the livestock's tail to the livestock's head;
[0035] a second acquisition module, configured to acquire a span characteristic distribution fitting curve and a gradient characteristic distribution curve for characterizing a span value change rate based on span values of the continuous point cloud slices in a second direction, wherein the second direction is a direction from the ground to the head of the livestock;
[0036] a third acquisition module, configured to acquire a center position of a leg region of the target livestock based on an extreme value point of the span characteristic distribution fitting curve;
[0037] a fourth acquisition module, configured to acquire a front leg boundary position and a hind leg boundary position of the target livestock based on the center position of the leg region, the gradient characteristic distribution curve, and the maximum and minimum values of the gradient characteristic distribution curve;
[0038] The fifth acquisition module is used to acquire key area point cloud slices for livestock body size calculation based on the front leg boundary position, the hind leg boundary position and the gradient feature distribution curve.
[0039] In a third aspect, the present invention also provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for extracting key areas of a three-dimensional point cloud of livestock as described above is implemented.
[0040] In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described methods for extracting key areas from a three-dimensional point cloud of livestock.
[0041] In a fifth aspect, the present invention further provides a computer program product, comprising a computer program, which, when executed by a processor, implements any of the above-described methods for extracting key areas from livestock three-dimensional point clouds.
[0042] The present invention provides a method, device, and electronic device for extracting key areas from a three-dimensional point cloud of a target livestock. By acquiring continuous point cloud slices of the target livestock, a span feature distribution fitting curve and a gradient feature distribution curve can be obtained based on the span values of the continuous point cloud slices in a second direction. The center position of the leg area of the target livestock can then be obtained based on the extreme value points of the span feature distribution fitting curve. The gradient feature distribution curve of the front legs and the gradient feature distribution curve of the hind legs can then be determined in the gradient feature distribution curve. The front and rear edge boundaries of the front legs can be determined based on the maximum and minimum values of the gradient feature distribution curve of the front legs. The front and rear edge boundaries of the hind legs can be determined based on the maximum and minimum values of the gradient feature distribution curve of the hind legs. The key area slices can then be determined based on the front and rear edge boundaries of the front legs and the front and rear edge boundaries of the hind legs. The key area slices can be used for calculating the body size of the livestock, avoiding the need for manual selection of measurement points in the animal point cloud and enabling non-contact automatic body size measurement. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0044] Figure 1 It is a schematic diagram of livestock body size parameters provided by related technology;
[0045] Figure 2 This is one of the flow charts of the method for extracting key areas of livestock three-dimensional point clouds provided by the present invention;
[0046] Figure 3 is a schematic diagram of the coordinate system of livestock point cloud data provided by the present invention;
[0047] Figure 4 This is one of the schematic diagrams of the span characteristic distribution fitting curve provided by the present invention;
[0048] Figure 5 Schematic diagram of the gradient characteristic distribution curve provided by the present invention;
[0049] Figure 6 This is the second schematic diagram of the span characteristic distribution fitting curve provided by the present invention;
[0050] Figure 7This is the second flow chart of the method for extracting key areas of livestock three-dimensional point clouds provided by the present invention;
[0051] Figure 8 Schematic diagram of the boundary error of the livestock leg region provided by the present invention;
[0052] Figure 9 This is the third flow chart of the method for extracting key areas of livestock three-dimensional point clouds provided by the present invention;
[0053] Figure 10 This is one of the schematic diagrams of the point cloud slice at the boundary of the livestock leg provided by the present invention;
[0054] Figure 11 This is the second schematic diagram of the point cloud slice at the boundary of the livestock leg provided by the present invention;
[0055] Figure 12 This is one of the schematic diagrams of the key area slice extraction results provided by the present invention;
[0056] Figure 13 This is the second schematic diagram of the key area slice extraction result provided by the present invention;
[0057] Figure 14 This is the third schematic diagram of the key area slice extraction result provided by the present invention;
[0058] Figure 15 Schematic diagram of the calculation position of livestock body width value provided by the present invention;
[0059] Figure 16 This is the fourth flow chart of the method for extracting key areas of livestock three-dimensional point clouds provided by the present invention;
[0060] Figure 17 This is the fourth schematic diagram of the key area slice extraction result provided by the present invention;
[0061] Figure 18 It is a box plot of the livestock body size calculation error provided by the present invention;
[0062] Figure 19 This is a schematic structural diagram of the device for extracting key areas from a three-dimensional point cloud of livestock provided by the present invention;
[0063] Figure 20 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0064] In order to facilitate a clearer understanding of the embodiments of the present invention, some relevant background knowledge is first introduced as follows.
[0065] According to the body size assessment standards during livestock breeding and fattening, the main body size parameters of livestock include body height, body oblique length, body width, chest circumference or abdominal circumference, etc.
[0066] Figure 1 This is a schematic diagram of livestock body size parameters provided by related technologies, such as Figure 1 As shown in the figure, the body measurements of cattle can include body height (BH), body oblique length (BL), body width (BW), chest circumference (BC), and abdominal circumference (BS). Among them, the measurement standard of body height (BH) is the length of the vertical line segment from the withers to the ground; the measurement standard of body oblique length (BL) is the distance from the shoulder end to the ischium end of the livestock; the measurement standard of body width (BW) is the maximum horizontal width at the withers of the livestock; the measurement standard of chest circumference (BC) is the circumference of the body axis perpendicular to the withers at the posterior angle of the scapula; and the measurement standard of abdominal circumference (BS) is the vertical circumference of the largest part of the livestock's abdomen.
[0067] The traditional measurement method is usually for personnel to measure the body size of livestock using a tape measure and a measuring rod. The measurement takes 10-15 minutes and will cause severe stress reactions in the livestock, causing their feed intake and daily weight gain data before and after the measurement to be seriously reduced, which seriously restricts the frequency and efficiency of body size measurement.
[0068] To address the difficulty of measuring production performance, machine vision technology can be used to measure livestock body dimensions, eliminating the interference caused by manual measurement. Related technologies enable non-contact measurement of pig dimensions by manually selecting measurement points within a point cloud, such as the neck, tail, chest circumference, body height, and hip height. However, these methods require experienced workers to manually select measurement points within the animal point cloud, which introduces a certain degree of randomness and subjectivity.
[0069] In order to overcome the above-mentioned defects, the present invention provides a method, device and electronic equipment for extracting key areas of livestock three-dimensional point clouds, which can realize non-contact automatic body size measurement by slicing key areas for livestock body size calculation.
[0070] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0071] Figure 2 This is one of the flow charts of the livestock three-dimensional point cloud key area extraction method provided by the present invention, such as Figure 2As shown, the execution subject of the livestock three-dimensional point cloud key area extraction method can be an electronic device. The method includes:
[0072] Step 201: Acquire continuous point cloud slices of the target livestock, wherein the continuous point cloud slices are perpendicular to a first direction, where the first direction is from the livestock's tail to the livestock's head.
[0073] Specifically, in order to obtain key area slices for livestock body size calculation, continuous point cloud slices of the target livestock can be obtained first. The continuous point cloud slices include multiple point cloud slices, where each point cloud slice is perpendicular to a first direction, and the first direction is the direction from the livestock's tail to the livestock's head.
[0074] Alternatively, the target livestock may be cattle, sheep, or pigs, etc.
[0075] Optional, Figure 3 is a schematic diagram of the coordinate system of the livestock point cloud data provided by the present invention, such as Figure 3 As shown, the livestock point cloud coordinate system is scaled in millimeters. Coordinate calibration can be performed based on the ground normal vector determination and principal component analysis (PCA) algorithm integrated into the acquisition device. The calibration coordinate system is defined as follows: starting from the center of mass (i.e., geometric center), the direction from the ground toward the livestock head (i.e., the second direction) is recorded as the positive z-axis direction, the direction from the livestock tail toward the head (i.e., the first direction) is recorded as the positive y-axis direction, and the direction toward the right side of the livestock body is recorded as the positive x-axis direction.
[0076] Step 202: obtaining a span feature distribution fitting curve and a gradient feature distribution curve for characterizing a span value change rate based on span values of the continuous point cloud slices in a second direction, wherein the second direction is a direction from the ground to the livestock head;
[0077] Specifically, after obtaining continuous point cloud slices, the span value of each point cloud slice in the second direction can be obtained, and then the discrete points corresponding to each point cloud slice can be determined based on the slice number of each point cloud slice and the span value of each point cloud slice in the second direction, and then the discrete points corresponding to each point cloud slice can be curve fitted to obtain the span feature distribution fitting curve.
[0078] Specifically, based on the span value of each point cloud slice in the second direction, the span value change rate between the point cloud slices can be calculated to obtain the gradient feature distribution curve.
[0079] Optionally, in order to obtain the distribution characteristics of the livestock point cloud, the y-axis ( Figure 3The 3D point cloud is sliced continuously in ascending order with a span of 5 mm in the y-axis direction (shown in FIG). Then, the distance between each point cloud slice and the z-axis ( Figure 3 The span value in the z-axis direction (as shown).
[0080] Optionally, Figure 4 This is one of the schematic diagrams of the span characteristic distribution fitting curve provided by the present invention, such as Figure 4 As shown, the original curve can be determined based on the discrete points corresponding to each point cloud slice, and the fitting curve can be determined by performing high-order curve fitting on the discrete points corresponding to each point cloud slice, and the maximum point of the fitting curve is marked as Figure 4 The black dot shown. Figure 4 It can be seen that the positions of the livestock legs all appear in the area around the two extreme points (A1 or A2) with the largest span values (within the dotted line), and the distribution shows a certain regularity.
[0081] Optionally, in order to obtain the gradient feature distribution curve, the livestock continuous slice span distribution curve can be determined based on the discrete points corresponding to each point cloud slice (for example, Figure 4 ), assuming that the two adjacent "five-point clusters" in the livestock continuous slice span distribution curve are A1 (a1, a2, a3, a4, a5) and A2 (a6, a7, a8, a9, a10), the average gradient P of the five consecutive points can be calculated by the following "five-point average gradient formula":
[0082]
[0083] Among them, a i Represents discrete points in the distribution curve of the span of serial sections of livestock.
[0084] Figure 5 This is a schematic diagram of the gradient characteristic distribution curve provided by the present invention. By using the above-mentioned "five-point average gradient formula", the livestock continuous slice span distribution curves (for example, Figure 4 The average gradient distribution of all "five-point clusters" in the original curve in ( ) can be obtained as follows Figure 5 The gradient characteristic distribution curve is shown.
[0085] Step 203: obtaining the center position of the leg region of the target livestock based on the extreme value point of the span characteristic distribution fitting curve;
[0086] Specifically, based on the span feature distribution fitting curve, multiple extreme points of the span feature distribution fitting curve can be obtained, and the livestock positions corresponding to these extreme points include the center position of the leg area. Then, the extreme point corresponding to the center position of the leg area can be screened out from the multiple extreme points, and then the center position of the leg area of the target livestock can be obtained based on the screened extreme points.
[0087] Step 204: Obtain the front leg boundary position and the back leg boundary position based on the center position of the leg region, the gradient feature distribution curve, and the maximum and minimum values of the gradient feature distribution curve;
[0088] Specifically, after obtaining the center position of the leg area of the target livestock, the gradient characteristic distribution curve can be intercepted based on the center position of the leg area. The front leg gradient characteristic distribution curve used to characterize the change rate of the front leg span value can be intercepted, and the hind leg gradient characteristic distribution curve used to characterize the change rate of the hind leg span value can also be intercepted.
[0089] Specifically, after obtaining the gradient characteristic distribution curve of the front leg and the gradient characteristic distribution curve of the hind leg, the gradient characteristic distribution curve of the front leg can be analyzed to obtain the maximum and minimum values of the gradient characteristic distribution curve of the front leg. The minimum value of the gradient characteristic distribution curve of the front leg corresponds to the front edge boundary of the front leg, and the maximum value of the gradient characteristic distribution curve of the front leg corresponds to the rear edge boundary of the front leg. The gradient characteristic distribution curve of the hind leg can be analyzed to obtain the maximum and minimum values of the gradient characteristic distribution curve of the hind leg. The minimum value of the gradient characteristic distribution curve of the hind leg corresponds to the front edge boundary of the hind leg, and the maximum value of the gradient characteristic distribution curve of the hind leg corresponds to the rear edge boundary of the hind leg.
[0090] Step 205: Based on the front leg boundary position, the hind leg boundary position and the gradient feature distribution curve, a key area point cloud slice for livestock body size calculation is obtained.
[0091] It is understandable that if Figure 1 As shown in the figure, the withers, ischial bone, and shoulder tip are key areas for measuring livestock body dimensions. However, in actual livestock, the raised withers can only be felt and are difficult to identify visually. Visually, the measurement locations for parameters such as chest circumference and body height are related to the withers, which are located at the rear edge of the livestock's forelegs. The oblique length measurement location is related to the shoulder area at the front edge of the livestock's forelegs and the hip area at the rear edge of the hind legs. The abdominal circumference measurement area is located between the livestock's forelegs and hind legs, so the key areas for livestock body dimensions can be determined based on the leg area.
[0092] It is understandable that if Figure 5As shown, the maximum and minimum values of the gradient feature distribution curve for the front legs, as well as the maximum and minimum values of the gradient feature distribution curve for the hind legs, appear at the boundaries of the livestock legs, consistent with the geometric distribution characteristics of the livestock point cloud slices. The minimum value of the gradient feature distribution curve for the front legs can be used as the leading edge boundary of the front legs, the maximum value of the gradient feature distribution curve for the front legs can be used as the trailing edge boundary of the front legs, the minimum value of the gradient feature distribution curve for the hind legs can be used as the leading edge boundary of the hind legs, and the maximum value of the gradient feature distribution curve for the hind legs can be used as the trailing edge boundary of the hind legs. The center point of each leg and its front and rear boundaries are enclosed to form the livestock front and hind leg regions, thus achieving automatic extraction of the leg regions and obtaining key region slices for livestock body size calculation.
[0093] The livestock three-dimensional point cloud key area extraction method provided by the present invention obtains continuous point cloud slices of the target livestock, and can obtain a span feature distribution fitting curve and a gradient feature distribution curve based on the span values of the continuous point cloud slices in the second direction. Then, the center position of the leg area of the target livestock can be obtained based on the extreme value points of the span feature distribution fitting curve. Then, the front leg gradient feature distribution curve and the hind leg gradient feature distribution curve can be determined in the gradient feature distribution curve. The front and rear edge boundaries of the front leg can be determined based on the maximum and minimum values of the front leg gradient feature distribution curve. The front and rear edge boundaries of the hind leg can be determined based on the maximum and minimum values of the hind leg gradient feature distribution curve. Then, the key area slice can be determined based on the front and rear edge boundaries of the front leg and the front and rear edge boundaries of the hind leg. The key area slice can be used for livestock body size calculation, which can avoid manual selection of measurement points in the animal point cloud and realize non-contact automatic body size measurement.
[0094] Optionally, the center position of the leg region includes: the center position of the front leg region and the center position of the hind leg region, and obtaining the center position of the leg region of the target livestock based on the extreme value point of the span characteristic distribution fitting curve includes:
[0095] Based on a first span threshold, determining a first extreme point set and a second extreme point set from the extreme value points of the span feature distribution fitting curve, wherein the value of any extreme point in the first extreme point set in the second direction is greater than or equal to the first span threshold, and the value of any extreme point in the second extreme point set in the second direction is less than the first span threshold;
[0096] Traversing each target extreme point in the first extreme point set, and merging the target extreme point and its adjacent extreme points until two merged extreme points are obtained;
[0097] The merging of the target extreme point and the extreme points adjacent to the target extreme point includes:
[0098] Determine, in the first extreme point set, an adjacent extreme point of the target extreme point, wherein the absolute value of the difference between the values of the adjacent extreme point and the target extreme point in the first direction is less than or equal to a second span threshold, and the values of the adjacent extreme point and the target extreme point in the first direction are both greater than or less than the values of non-leg extreme points in the first direction, and the non-leg extreme point is any extreme point in the second extreme point set;
[0099] Deleting the adjacent extreme value points of the target extreme value point from the first extreme point set;
[0100] The target extreme point and the extreme points adjacent to the target extreme point are merged to obtain a merged extreme point.
[0101] It can be understood that since the values of the adjacent extreme points and the target extreme point in the first direction are greater than or less than the values of the non-leg extreme points in the first direction, it can be ensured that the merged extreme points are located on both sides of the center point of the livestock abdomen.
[0102] Optionally, Figure 6 This is the second schematic diagram of the span characteristic distribution fitting curve provided by the present invention, such as Figure 6 As shown in , according to the distribution characteristics of the livestock body's three-dimensional point cloud, there will be stable extreme points with large span values in the livestock's front and back legs. The location of the livestock's legs can be determined based on the extreme points. However, sometimes there are more than one extreme point, such as Figure 6 As shown, area A is the livestock hind leg area, area B is the livestock front leg area, and two extreme points appear in area A.
[0103] It is understandable that when livestock are walking, their legs are spread apart, and the fitting curve may have two or more extreme points in the leg area (area A or area B). In this case, it is not possible to simply identify the single extreme point position to identify the center position of the leg area.
[0104] Optionally, Figure 7 This is the second flow chart of the method for extracting key areas of livestock three-dimensional point clouds provided by the present invention, such as Figure 7 As shown, when the fitting curve has two or more extreme points in the leg region (region A or region B), in order to identify the center position of the leg region, a "quadratic extreme point screening algorithm" can be used. The algorithm includes steps 701 to 708, wherein:
[0105] Step 701, obtaining all extreme points of the span feature distribution fitting curve;
[0106] Step 702: put all extreme value points whose span is greater than 0.7 times the maximum span into point set A, and put the other extreme value points into point set B; wherein the maximum span may be the largest span value of each point cloud slice in the second direction;
[0107] Step 703: determine a target extreme point in point set A, clear point set C and add the target extreme point to point set C;
[0108] Step 704: Determine adjacent extreme points of the target extreme point in point set A, wherein no extreme points in point set B exist on the point cloud slice between the target extreme point and the adjacent extreme points.
[0109] Step 705: put the adjacent extreme value points of the target extreme value point into point set C, and delete the adjacent extreme value points of the target extreme value point from point set A;
[0110] Step 706: Merge the extreme points in the point set C to obtain a merged extreme point.
[0111] Step 707, determining whether two merging extreme points are obtained, if two merging extreme points are obtained, executing step 707, if two merging extreme points are not obtained, executing step 703;
[0112] Step 708: Output the two acquired merged extreme points.
[0113] It can be understood that in the above-mentioned extreme point secondary screening algorithm, the x-axis ( Figure 6 The poles with similar distances to the horizontal axis in the coordinate system shown are merged, and the merged poles are ensured to be located on both sides of the center point of the livestock abdomen. This ensures that the two center points belonging to the leg area are successfully extracted, namely the x-coordinates of the fitting curves of the livestock's front and hind legs ( Figure 6 The horizontal axis coordinate in the coordinate system shown in FIG) position is then used to determine the y-axis ( Figure 3 y-axis) coordinate position in the coordinate system shown.
[0114] Optionally, obtaining a gradient characteristic distribution curve for characterizing the span value change rate includes:
[0115] Determining, based on the span values of the continuous point cloud slices in the second direction, a plurality of discrete points for characterizing the span distribution of the continuous point cloud slices;
[0116] Based on a preset number of cluster points, the plurality of discrete points are divided along a second direction to obtain a plurality of point clusters, wherein the number of discrete points in the point clusters is equal to the preset number of cluster points;
[0117] Along the second direction, the average gradient between the multiple point clusters is calculated to obtain the gradient feature distribution curve.
[0118] It is understood that the number of preset cluster points can be 2, 3, 4 or 5, etc., and there is no limitation on this. For example, the number of preset cluster points can be 5, and the average gradient P of the five consecutive points at that location can be calculated using the above-mentioned "five-point average gradient formula".
[0119] Optionally, the front leg boundary position includes a front leg front edge boundary and a front leg rear edge boundary, and the hind leg boundary position includes a hind leg front edge boundary and a hind leg rear edge boundary. The step of obtaining a key area point cloud slice for livestock body size calculation based on the front leg boundary position, the hind leg boundary position, and the gradient feature distribution curve includes:
[0120] For each target leg boundary among the front leg leading edge boundary, the front leg trailing edge boundary, the rear leg leading edge boundary, and the rear leg trailing edge boundary, moving the target leg boundary toward the center position of the leg region according to a preset step size until the number of clusters of the point cloud slice corresponding to the target leg boundary is 1, where the number of clusters is determined based on a density-based spatial clustering of applications with noise (DBSCAN) algorithm;
[0121] The key area slice is acquired based on the front leg leading edge boundary, the front leg trailing edge boundary, the rear leg leading edge boundary and the rear leg trailing edge boundary.
[0122] It is understandable that when livestock legs have a large bifurcation during walking, the located leg area will be abnormally enlarged. Figure 8 Schematic diagram of the boundary error of the livestock leg area provided by the present invention, such as Figure 8 As shown, the original leg region boundary is directly determined by the maximum and minimum values of the gradient feature distribution curves for the front legs and the hind legs. However, for livestock point clouds with walking postures, the leg region recognition results are biased, affecting the body size detection results. The ideal target region boundary is obtained by shrinking the original leg region boundary. Before calculating livestock body size, it is necessary to locate the ideal target region boundary to overcome the impact of livestock walking posture on the calculation results.
[0123] Optionally, Figure 9 This is the third flow chart of the method for extracting key areas of livestock three-dimensional point clouds provided by the present invention, such as Figure 9 As shown, in order to locate the ideal target area boundary, the "leg area boundary correction algorithm based on slice clustering features" can be used. The algorithm includes: steps 901 to 905, wherein:
[0124] Step 901, obtaining a point cloud slice corresponding to a target leg boundary;
[0125] Step 902: Obtain the number of clusters of the point cloud slices corresponding to the target leg boundary based on the DBSCAN clustering algorithm;
[0126] Step 903, determining whether the number of clusters is greater than or equal to 2, if the number of clusters is greater than or equal to 2, executing step 904, if the number of clusters is less than 2, executing step 905;
[0127] Step 904, move the target leg boundary 1 pixel toward the center of the leg region, and execute step 902;
[0128] Step 905: Output the corrected target leg boundary.
[0129] The target leg boundary may be any one of the following: a front leg leading edge boundary, a front leg trailing edge boundary, a rear leg leading edge boundary, or a rear leg trailing edge boundary.
[0130] It can be understood that the "Leg Area Boundary Correction Algorithm Based on Slice Clustering Features" extracts point cloud slices at the boundaries of livestock legs and uses the classic DBSCAN algorithm to cluster all points in the slices. If two or more clusters appear, the boundary is moved to narrow the leg area until a slice of a cluster is found.
[0131] Optionally, Figure 10 This is one of the schematic diagrams of the point cloud slice at the boundary of the livestock leg provided by the present invention. Figure 10 It is a longitudinal slice of the livestock point cloud at the leg boundary before the leg boundary shrinks, from Figure 10 It can be seen that in the original extracted region boundary slice, the lower leg part is separated from the body in the slice because the lower edge of the livestock's legs is in a split posture while walking; Figure 11 This is the second schematic diagram of the point cloud slice at the boundary of the livestock leg provided by the present invention. Figure 11 It is the longitudinal slice of the livestock point cloud at the leg boundary after the leg boundary is contracted. Figure 11 It can be seen that in the boundary slice of the livestock leg region after contraction, the leg remains connected to the body.
[0132] It is understandable that the position recognition of key points of livestock is easily affected by changes in animal posture and individual body size differences. When used for body size detection of moving animals, large errors will occur. The present invention can correct the leg area boundary through a leg area boundary correction algorithm based on slice clustering features. In the shrunken livestock leg area boundary slice, the leg remains connected to the body. For livestock point cloud recognition of walking posture, the error of the leg area recognition result can be reduced.
[0133] Optionally, the key area slices include a first key area slice, a second key area slice, a third key area slice, and a fourth key area slice, and acquiring the key area slices based on the front leg leading edge boundary, the front leg trailing edge boundary, the rear leg leading edge boundary, and the rear leg trailing edge boundary includes:
[0134] Determine a front leg front edge region slice where the front leg front edge boundary is located, a front leg rear edge region slice where the front leg rear edge boundary is located, and a rear leg rear edge region slice where the rear leg rear edge boundary is located;
[0135] Among the extreme points of the span characteristic distribution fitting curve, a regional slice where the extreme point is located between the rear edge boundary of the front leg and the front edge boundary of the hind leg is determined as the abdominal region slice; or a regional slice where the abdominal target point is located is determined as the abdominal region slice, where the abdominal target point is located at the midpoint between the rear edge boundary of the front leg and the front edge boundary of the hind leg;
[0136] Determine, based on the lowest point of the abdominal circumference having the smallest value in the second direction in the abdominal circumference region slice, a horizontal segmentation plane where the lowest point of the abdominal circumference is located;
[0137] Determine the parts of the front leg front edge area slice, the front leg rear edge area slice, the abdominal circumference area slice and the rear leg rear edge area slice that are above the horizontal dividing plane as the first key area slice, the second key area slice, the third key area slice and the fourth key area slice, respectively.
[0138] Optionally, Figure 12 This is one of the schematic diagrams of the key area slice extraction results provided by the present invention, such as Figure 12 As shown, the rear edge area of the livestock's front legs is the measurement area of the livestock's body height and body width, and a slice of the rear edge area of the front legs where the rear edge of the front legs is located can be intercepted (such as Figure 12 In slice A), the cut width of the slice of the rear edge area of the front leg can be 30mm.
[0139] Optionally, at the front edge boundary of the front leg and the rear edge boundary of the rear leg, slices with a thickness of 10 mm can be extracted as front edge region slices of the front leg (e.g. Figure 12 Slice B1 in the figure) and slices from the posterior margin of the hind leg (e.g. Figure 12 Slice B2 in the image).
[0140] Optionally, Figure 12 The abdominal area slice (slice C) in the figure can be extracted by the livestock continuous slice span distribution curve, and the extreme points between the leg areas (such as Figure 4 Point B in the middle) is used as the construction point to construct the xz plane ( Figure 3A section with a thickness of 30 mm and parallel to the xz plane in the coordinate system shown in FIG2 is used as the abdominal girth region slice. In the special case where multiple extreme points or no extreme points exist, the midpoint between the rear edge of the livestock's front leg and the front edge of the hind leg can be used as the construction point of slice C.
[0141] Optionally, Figure 13 This is the second schematic diagram of the key area slice extraction result provided by the present invention, such as Figure 13 As shown in the figure, slices B1, A and B2 contain more point clouds of legs. In order to extract parameters such as chest circumference, slices B1, A and B2 can be cut to extract the torso part excluding the legs, and the z coordinate value of the lowest point of the abdominal circumference ( Figure 3 The z coordinate value in the coordinate system shown in the figure is constructed by constructing a section parallel to the ground with a thickness of 30 mm as the horizontal dividing surface ( Figure 13 Slice D).
[0142] Optionally, Figure 14 This is the third schematic diagram of the key area slice extraction result provided by the present invention, such as Figure 14 As shown, slice B1, slice A, and slice B2 are segmented by slice D, and the upper half of slices B1, slice A, and slice B2 are extracted as key areas for calculating the body size of livestock point clouds, and are recorded as the first key area slices ( Figure 14 The second key area slice ( Figure 14 The fourth key area slice ( Figure 14 The slice C itself is the third key region slice ( Figure 14 The area in ξ).
[0143] Optionally, after obtaining a key area point cloud slice for livestock body size calculation based on the front leg boundary position, the hind leg boundary position and the gradient feature distribution curve, the method further includes:
[0144] Obtaining the body size of the target livestock based on the first key area slice, the second key area slice, the third key area slice, and the fourth key area slice;
[0145] The body measurements include any one or more of the following: body length, body width, body height, chest circumference or abdominal circumference.
[0146] Alternatively, to calculate the body oblique length, the livestock point cloud can be plotted in the yz plane ( Figure 3 The projection is performed on the yz plane in the coordinate system shown in FIG. 1 , and for the projected point cloud, a slice in the first key area (eg, Figure 14 In the projection corresponding to the area α in ( ), extract the point Q with the smallest z coordinate value, and slice ( Figure 14The point R with the largest z coordinate value is extracted from the projection corresponding to the area θ in the image. The livestock body oblique length BL can be obtained by the following livestock body oblique length calculation formula:
[0147]
[0148] Among them, Ry represents the y coordinate value of point R, Rz represents the z coordinate value of point R, Qy represents the y coordinate value of point Q, Qz represents the z coordinate value of point Q, and each coordinate value is Figure 3 Coordinate values in the coordinate system shown.
[0149] Optionally, Figure 15 Schematic diagram of the calculation position of the livestock body width value provided by the present invention, such as Figure 15 As shown, in order to calculate the body width, the body width value can be sliced in the second key area ( Figure 14 Measure the region β in the xy plane. Figure 3 The maximum span value of the x coordinate in the calculation area β is the body width value of the livestock, where the body width value calculation position is as follows: Figure 15 The position indicated by the arrow.
[0150] Optionally, to calculate the body height, set the z coordinate value of all points in the livestock point cloud ( Figure 3 The point with the smallest z coordinate value in the coordinate system shown is K, and the second key area slice ( Figure 14 The point with the largest z value among all points in the region β in the equation is T, and the livestock body height value BH can be calculated according to the following body height calculation formula:
[0151] BH=Tz-Kz;
[0152] Wherein, Tz represents the z-coordinate value of point T, and Kz represents the z-coordinate value of point K.
[0153] Optionally, to calculate chest circumference, the second key area slice ( Figure 14 The regional point cloud is placed on the xz plane ( Figure 3 In point cloud projection, the ellipse fitting calculation can be performed using the six-point circular ellipse fitting algorithm, and the minor axis length and major axis length of the fitted ellipse can be obtained. The chest circumference BC can then be calculated using the following chest circumference calculation formula:
[0154]
[0155] Where r represents the length of the minor axis of the fitted ellipse, and R represents the length of the major axis of the fitted ellipse.
[0156] Optionally, to calculate the abdominal circumference, the third key area slice ( Figure 14 The regional point cloud is placed on the xz plane ( Figure 3 In point cloud projection, the ellipse fitting calculation can be performed using the six-point circular ellipse fitting algorithm, and the short axis length and long axis length of the fitted ellipse can be obtained. The waist circumference BS can then be calculated using the following chest circumference calculation formula:
[0157]
[0158] Where r represents the length of the minor axis of the fitted ellipse, and R represents the length of the major axis of the fitted ellipse.
[0159] It is understood that the livestock 3D point cloud key region extraction method provided by the present invention can automatically extract multiple point cloud regions and automatically extract parameters such as livestock height, oblique length, body width, chest circumference, and abdominal circumference, enabling body measurement of livestock in different postures. The measurement results can provide data support for livestock production performance measurement, weight prediction, and breeding value estimation.
[0160] Figure 16 This is the fourth flow chart of the method for extracting key areas of livestock three-dimensional point clouds provided by the present invention, such as Figure 16 As shown, the method includes: steps 1601 to 1607, wherein:
[0161] Step 1601, obtaining a three-dimensional point cloud of beef cattle in standard coordinates;
[0162] Step 1602: Acquire continuous point cloud slices in a first direction;
[0163] Step 1603, obtaining a span feature distribution fitting curve;
[0164] Step 1604, determining the center position of the leg region of the beef cattle;
[0165] Optionally, the aforementioned “extreme secondary screening algorithm” may be used to determine the center position of the leg region of the beef cattle, wherein the center position of the leg region of the beef cattle includes the center position of the front leg region and the center position of the rear leg region.
[0166] Step 1605, determining the boundary position of the leg region of the beef cattle;
[0167] Optionally, the aforementioned "leg area boundary correction algorithm based on slice clustering features" can be used to extract point cloud slices at the boundary of the livestock leg, and the classic DBSCAN algorithm can be used to cluster all points in the slice. If two or more clusters appear, the boundary is moved to narrow the leg area until a slice of a cluster is found, and the corrected leg boundary is output.
[0168] Step 1606, obtaining a key area slice for livestock body size calculation;
[0169] Optionally, the key region slice may include a first key region slice ( Figure 14 The second key area slice ( Figure 14 The third key area slice ( Figure 14 The region ξ in the slicing diagram and the fourth key region slice ( Figure 14 The portion of the front leg front edge region slice, the front leg rear edge region slice, the abdominal region slice, and the hind leg rear edge region slice that is above the horizontal segmentation plane can be determined as the first key region slice, the second key region slice, the third key region slice, and the fourth key region slice, respectively.
[0170] Step 1607: Obtain the body size of the beef cattle.
[0171] Optionally, based on the first key area slice, the second key area slice, the third key area slice and the fourth key area slice, the body size of the beef cattle can be obtained; the body size includes any one or more of the following: body oblique length, body width, body height, chest circumference or abdominal circumference.
[0172] It can be understood that first, through the y-axis coordinate ( Figure 3 The y-axis coordinate of the coordinate system shown in the figure is used to locate and extract the three-dimensional point cloud area of the front and hind legs of the livestock, and then identify the position of the segmentation line of the key area for livestock body size measurement in the area. Finally, the key area slices are calculated based on the extracted body size to realize automatic calculation of the livestock body size.
[0173] Optionally, in order to verify the livestock three-dimensional point cloud key area extraction method provided by the present invention, key area extraction and body size parameter calculation are performed on 182 point clouds from 10 livestock in different postures to test the accuracy and robustness of the algorithm.
[0174] Figure 17 This is the fourth schematic diagram of the key area slice extraction result provided by the present invention, such as Figure 17 As shown in Figure 1, the point cloud distribution is not coherent in some slices, but it can still well reflect the body size parameters of livestock. For example, region α is the upper half of the front edge of the livestock's forelegs, which well describes the position of the livestock's shoulder end. The lower edge of this region is the starting point for measuring the oblique length of the body. Region β reflects the characteristics of the livestock's withers and is the location for measuring the livestock's body height, chest circumference, and body width. Region θ is the z-axis of the livestock's trunk ( Figure 3 The slice with the largest span (z-axis of the coordinate system shown) can be approximately considered as the location of the livestock's abdomen and is used to measure the abdominal circumference; the area ξ is the location of the rear edge of the livestock's hind legs, which is close to the livestock's buttocks. However, due to the quality of the existing data, there is a certain amount of loss in the livestock's buttocks, but the z coordinate of this area ( Figure 3The point with the largest z coordinate in the coordinate system shown is still approximately close to the end point of the livestock's ischium, and can be determined as the end point of the measurement of the body oblique length.
[0175] The present invention collected point cloud data of 24, 16, 19, 26, 14, 22, 20, 11, 18, and 12 points for the 10 livestock, respectively, for a total of 182 point cloud data. The body size parameters of each livestock were manually measured and compared with the measurement results of the livestock three-dimensional point cloud key area extraction method provided by the present invention. As shown in Table 1, the algorithm measurement is the average of multiple measurement results of the method provided by the present invention, and the average error is the average of the errors of all measurement results.
[0176] Table 1 Measurement results of livestock body size parameters
[0177]
[0178]
[0179]
[0180] As can be seen from Table 1, in terms of body measurement accuracy, body width is the most accurate, with a total average error of 1.6%. The average measurement errors of body length, body height, chest circumference, and abdominal circumference are 2.3%, 2.8%, 2.8%, and 2.6%, respectively. From the macroscopic data, the livestock three-dimensional point cloud key area extraction method provided by the present invention has a certain degree of robustness.
[0181] In order to further study the situation of micro data, the measurement error distribution of each body size parameter was statistically analyzed for each measurement. Figure 18 It is a box plot of the livestock body size calculation error provided by the present invention, such as Figure 18 As shown in the figure, from the error distribution point of view, the error distribution of livestock body length, body width, body height and other body size parameters obtained by automatic calculation is relatively stable, and is evenly distributed on both sides of the manual measurement value.
[0182] Overall, the proposed method for extracting key regions from livestock 3D point clouds enables automated measurement of livestock body dimensions in real-world production environments, yielding stable and reliable body dimension data. In practical applications, if the same livestock were allowed to pass through the body dimension measurement device multiple times over a period of time (one to several days), the average of these multiple measurements could yield a more accurate body dimension value.
[0183] The following describes the livestock three-dimensional point cloud key area extraction device provided by the present invention. The livestock three-dimensional point cloud key area extraction device described below and the livestock three-dimensional point cloud key area extraction method described above can be referenced to each other.
[0184] Figure 19Schematic diagram of the structure of the key area extraction device of livestock three-dimensional point cloud provided by the present invention, such as Figure 19 As shown, the apparatus includes: a first acquisition module 1901, a second acquisition module 1902, a third acquisition module 1903, a fourth acquisition module 1904, and a fifth acquisition module 1905, wherein:
[0185] A first acquisition module 1901 is configured to acquire continuous point cloud slices of a target livestock, wherein the continuous point cloud slices are perpendicular to a first direction, where the first direction is from the livestock's tail to the livestock's head;
[0186] A second acquisition module 1902 is configured to acquire a span feature distribution fitting curve and a gradient feature distribution curve representing a span value change rate based on span values of the continuous point cloud slices in a second direction, wherein the second direction is a direction from the ground to the livestock head;
[0187] The third acquisition module 1903 is configured to acquire the center position of the leg region of the target livestock based on the extreme value point of the span characteristic distribution fitting curve;
[0188] A fourth acquisition module 1904 is configured to acquire a front leg boundary position and a hind leg boundary position of the target livestock based on the center position of the leg region, the gradient characteristic distribution curve, and the maximum and minimum values of the gradient characteristic distribution curve;
[0189] The fifth acquisition module 1905 is configured to acquire a key area point cloud slice for livestock body size calculation based on the front leg boundary position, the hind leg boundary position, and the gradient feature distribution curve.
[0190] The livestock three-dimensional point cloud key area extraction device provided by the present invention can obtain a span feature distribution fitting curve and a gradient feature distribution curve based on the span values of the continuous point cloud slices in the second direction by obtaining continuous point cloud slices of the target livestock, and then obtain the center position of the leg area of the target livestock based on the extreme value points of the span feature distribution fitting curve, and then determine the front leg gradient feature distribution curve and the hind leg gradient feature distribution curve in the gradient feature distribution curve. The front and rear edge boundaries of the front legs can be determined based on the maximum and minimum values of the front leg gradient feature distribution curve, and the front and rear edge boundaries of the hind legs can be determined based on the maximum and minimum values of the hind leg gradient feature distribution curve. Then, the key area slice can be determined based on the front and rear edge boundaries of the front legs and the front and rear edge boundaries of the hind legs. The key area slice can be used for livestock body size calculation, which can avoid manual selection of measurement points in the animal point cloud and realize non-contact automatic body size measurement.
[0191] Figure 20 Schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 20As shown, the electronic device may include: a processor 2010, a communication interface 2020, a memory 2030, and a communication bus 2040, wherein the processor 2010, the communication interface 2020, and the memory 2030 communicate with each other via the communication bus 2040. The processor 2010 may call the logic instructions in the memory 2030 to execute a method for extracting key areas of a livestock three-dimensional point cloud, for example, the method includes:
[0192] Acquire continuous point cloud slices of the target livestock, wherein the continuous point cloud slices are perpendicular to a first direction, where the first direction is a direction from the livestock's tail to the livestock's head;
[0193] Obtaining a span feature distribution fitting curve and a gradient feature distribution curve for characterizing a span value change rate based on span values of the continuous point cloud slices in a second direction, wherein the second direction is a direction from the ground to the head of the livestock;
[0194] Obtaining the center position of the leg region of the target livestock based on the extreme value point of the span characteristic distribution fitting curve;
[0195] Obtaining a front leg boundary position and a hind leg boundary position of the target livestock based on the center position of the leg region, the gradient characteristic distribution curve, and the maximum and minimum values of the gradient characteristic distribution curve;
[0196] Based on the front leg boundary position, the hind leg boundary position and the gradient feature distribution curve, a key area point cloud slice for livestock body size calculation is obtained.
[0197] In addition, the logic instructions in the above-mentioned memory 2030 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0198] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can perform the livestock three-dimensional point cloud key area extraction method provided by the above methods. For example, the method includes:
[0199] Acquire continuous point cloud slices of the target livestock, wherein the continuous point cloud slices are perpendicular to a first direction, where the first direction is a direction from the livestock's tail to the livestock's head;
[0200] Obtaining a span feature distribution fitting curve and a gradient feature distribution curve for characterizing a span value change rate based on span values of the continuous point cloud slices in a second direction, wherein the second direction is a direction from the ground to the head of the livestock;
[0201] Obtaining the center position of the leg region of the target livestock based on the extreme value point of the span characteristic distribution fitting curve;
[0202] Obtaining a front leg boundary position and a hind leg boundary position of the target livestock based on the center position of the leg region, the gradient characteristic distribution curve, and the maximum and minimum values of the gradient characteristic distribution curve;
[0203] Based on the front leg boundary position, the hind leg boundary position and the gradient feature distribution curve, a key area point cloud slice for livestock body size calculation is obtained.
[0204] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the livestock three-dimensional point cloud key area extraction method provided by the above methods, for example, the method comprising:
[0205] Acquire continuous point cloud slices of the target livestock, wherein the continuous point cloud slices are perpendicular to a first direction, where the first direction is a direction from the livestock's tail to the livestock's head;
[0206] Obtaining a span feature distribution fitting curve and a gradient feature distribution curve for characterizing a span value change rate based on span values of the continuous point cloud slices in a second direction, wherein the second direction is a direction from the ground to the head of the livestock;
[0207] Obtaining the center position of the leg region of the target livestock based on the extreme value point of the span characteristic distribution fitting curve;
[0208] Obtaining a front leg boundary position and a hind leg boundary position of the target livestock based on the center position of the leg region, the gradient characteristic distribution curve, and the maximum and minimum values of the gradient characteristic distribution curve;
[0209] Based on the front leg boundary position, the hind leg boundary position and the gradient feature distribution curve, a key area point cloud slice for livestock body size calculation is obtained.
[0210] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0211] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.
[0212] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A method for extracting key areas of livestock three-dimensional point clouds, characterized in that: include: Acquire continuous point cloud slices of the target livestock, wherein the continuous point cloud slices are perpendicular to a first direction, where the first direction is a direction from the livestock's tail to the livestock's head; Obtaining a span feature distribution fitting curve and a gradient feature distribution curve for characterizing a span value change rate based on span values of the continuous point cloud slices in a second direction, wherein the second direction is a direction from the ground to the head of the livestock; Obtaining the center position of the leg region of the target livestock based on the extreme value point of the span characteristic distribution fitting curve; Obtaining a front leg boundary position and a hind leg boundary position of the target livestock based on the center position of the leg region, the gradient characteristic distribution curve, and the maximum and minimum values of the gradient characteristic distribution curve; Based on the front leg boundary position, the hind leg boundary position and the gradient feature distribution curve, a key area point cloud slice for livestock body size calculation is obtained.
2. The livestock three-dimensional point cloud key area extraction method according to claim 1, characterized in that: The center position of the leg region includes: the center position of the front leg region and the center position of the hind leg region. The obtaining of the center position of the leg region of the target livestock based on the extreme value point of the span characteristic distribution fitting curve includes: Based on a first span threshold, determining a first extreme point set and a second extreme point set from the extreme value points of the span feature distribution fitting curve, wherein the value of any extreme point in the first extreme point set in the second direction is greater than or equal to the first span threshold, and the value of any extreme point in the second extreme point set in the second direction is less than the first span threshold; Traversing each target extreme point in the first extreme point set, and merging the target extreme point and its adjacent extreme points until two merged extreme points are obtained; The merging of the target extreme point and the extreme points adjacent to the target extreme point includes: Determine, in the first extreme point set, an adjacent extreme point of the target extreme point, wherein the absolute value of the difference between the values of the adjacent extreme point and the target extreme point in the first direction is less than or equal to a second span threshold, and the values of the adjacent extreme point and the target extreme point in the first direction are both greater than or less than the values of non-leg extreme points in the first direction, and the non-leg extreme point is any extreme point in the second extreme point set; Deleting the adjacent extreme value points of the target extreme value point from the first extreme point set; The target extreme point and the extreme points adjacent to the target extreme point are merged to obtain a merged extreme point.
3. The method for extracting key areas of livestock three-dimensional point clouds according to claim 1, characterized in that: The step of obtaining a gradient characteristic distribution curve for characterizing the span value change rate includes: Determining, based on the span values of the continuous point cloud slices in the second direction, a plurality of discrete points for characterizing the span distribution of the continuous point cloud slices; Based on a preset number of cluster points, the plurality of discrete points are divided along a second direction to obtain a plurality of point clusters, wherein the number of discrete points in the point clusters is equal to the preset number of cluster points; Along the second direction, the average gradient between the multiple point clusters is calculated to obtain the gradient feature distribution curve.
4. The method for extracting key areas of livestock three-dimensional point clouds according to any one of claims 1 to 3, characterized in that: The front leg boundary position includes the front leg front edge boundary and the front leg rear edge boundary, the hind leg boundary position includes the hind leg front edge boundary and the hind leg rear edge boundary, and obtaining a key area point cloud slice for livestock body size calculation based on the front leg boundary position, the hind leg boundary position and the gradient feature distribution curve includes: For each target leg boundary among the front leg leading edge boundary, the front leg trailing edge boundary, the rear leg leading edge boundary, and the rear leg trailing edge boundary, moving the target leg boundary toward the center position of the leg region according to a preset step size until the number of clusters of the point cloud slice corresponding to the target leg boundary is 1, where the number of clusters is determined based on the DBSCAN clustering algorithm; The key area slice is acquired based on the front leg leading edge boundary, the front leg trailing edge boundary, the rear leg leading edge boundary and the rear leg trailing edge boundary.
5. The method for extracting key areas of livestock three-dimensional point clouds according to claim 4, characterized in that: The key area slices include a first key area slice, a second key area slice, a third key area slice, and a fourth key area slice. The acquiring of the key area slices based on the front leg leading edge boundary, the front leg trailing edge boundary, the rear leg leading edge boundary, and the rear leg trailing edge boundary includes: Determine a front leg front edge region slice where the front leg front edge boundary is located, a front leg rear edge region slice where the front leg rear edge boundary is located, and a rear leg rear edge region slice where the rear leg rear edge boundary is located; Among the extreme points of the span characteristic distribution fitting curve, a regional slice where the extreme point is located between the rear edge boundary of the front leg and the front edge boundary of the hind leg is determined as the abdominal region slice; or a regional slice where the abdominal target point is located is determined as the abdominal region slice, where the abdominal target point is located at the midpoint between the rear edge boundary of the front leg and the front edge boundary of the hind leg; Determine, based on the lowest point of the abdominal circumference having the smallest value in the second direction in the abdominal circumference region slice, a horizontal segmentation plane where the lowest point of the abdominal circumference is located; Determine the parts of the front leg front edge area slice, the front leg rear edge area slice, the abdominal circumference area slice and the rear leg rear edge area slice that are above the horizontal dividing plane as the first key area slice, the second key area slice, the third key area slice and the fourth key area slice, respectively.
6. The method for extracting key areas of livestock three-dimensional point clouds according to claim 5, characterized in that: After obtaining the key area point cloud slices for livestock body size calculation based on the front leg boundary position, the hind leg boundary position and the gradient feature distribution curve, the method further includes: Obtaining the body size of the target livestock based on the first key area slice, the second key area slice, the third key area slice, and the fourth key area slice; The body measurements include any one or more of the following: body length, body width, body height, chest circumference or abdominal circumference.
7. A device for extracting key areas of livestock three-dimensional point clouds, characterized in that: include: A first acquisition module is configured to acquire continuous point cloud slices of the target livestock, wherein the continuous point cloud slices are perpendicular to a first direction, where the first direction is from the livestock's tail to the livestock's head; a second acquisition module, configured to acquire a span characteristic distribution fitting curve and a gradient characteristic distribution curve for characterizing a span value change rate based on span values of the continuous point cloud slices in a second direction, wherein the second direction is a direction from the ground to the head of the livestock; a third acquisition module, configured to acquire a center position of a leg region of the target livestock based on an extreme value point of the span characteristic distribution fitting curve; a fourth acquisition module, configured to acquire a front leg boundary position and a hind leg boundary position of the target livestock based on the center position of the leg region, the gradient characteristic distribution curve, and the maximum and minimum values of the gradient characteristic distribution curve; The fifth acquisition module is used to acquire key area point cloud slices for livestock body size calculation based on the front leg boundary position, the hind leg boundary position and the gradient feature distribution curve.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the livestock three-dimensional point cloud key area extraction method as described in any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for extracting key areas from a three-dimensional point cloud of livestock as claimed in any one of claims 1 to 6 is implemented.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method for extracting key areas from a three-dimensional point cloud of livestock as claimed in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Effective characteristic extraction method for cell black corner detection
CN108418553A
Livestock point cloud bidirectional fault region segmentation method and device
CN114022489A