CN115311356A - Livestock three-dimensional point cloud key area extraction method and device and electronic equipment - Google Patents

Livestock three-dimensional point cloud key area extraction method and device and electronic equipment Download PDF

Info

Publication number
CN115311356A
CN115311356A CN202210785252.4A CN202210785252A CN115311356A CN 115311356 A CN115311356 A CN 115311356A CN 202210785252 A CN202210785252 A CN 202210785252A CN 115311356 A CN115311356 A CN 115311356A
Authority
CN
China
Prior art keywords
leg
slice
livestock
boundary
point cloud
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210785252.4A
Other languages
Chinese (zh)
Inventor
李奇峰
马为红
李嘉位
薛向龙
丁露雨
于沁杨
余礼根
高荣华
蒋瑞祥
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Research Center of Information Technology of Beijing Academy of Agriculture and Forestry Sciences
Original Assignee
Research Center of Information Technology of Beijing Academy of Agriculture and Forestry Sciences
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Research Center of Information Technology of Beijing Academy of Agriculture and Forestry Sciences filed Critical Research Center of Information Technology of Beijing Academy of Agriculture and Forestry Sciences
Priority to CN202210785252.4A priority Critical patent/CN115311356A/en
Publication of CN115311356A publication Critical patent/CN115311356A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/66Analysis of geometric attributes of image moments or centre of gravity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10028Range image; Depth image; 3D point clouds
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A40/00Adaptation technologies in agriculture, forestry, livestock or agroalimentary production
    • Y02A40/70Adaptation technologies in agriculture, forestry, livestock or agroalimentary production in livestock or poultry

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Geometry (AREA)
  • Image Analysis (AREA)

Abstract

The invention provides a method and a device for extracting a livestock three-dimensional point cloud key area and electronic equipment, wherein the method comprises the following steps: acquiring a continuous point cloud slice of a target livestock, wherein the continuous point cloud slice is vertical to a first direction, and the first direction is a direction from the tail of the livestock to the head of the livestock; acquiring a span characteristic distribution fitting curve and a gradient characteristic distribution curve based on the span value of the continuous point cloud slice in a second direction, wherein the second direction is a direction pointing to the head of the livestock from the ground; acquiring the central position of a leg region based on extreme points of a span characteristic distribution fitting curve; acquiring a front leg boundary position and a rear leg boundary position based on the central 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 anterior leg boundary position, the posterior leg boundary position, and the gradient profile, a critical zone slice may be acquired. According to the invention, through determining the key area slice for calculating the body size of the livestock, the non-contact type automatic body size measurement can be realized.

Description

Livestock three-dimensional point cloud key area extraction method and device and electronic equipment
Technical Field
The invention relates to the technical field of agricultural informatization, in particular to a method and a device for extracting a three-dimensional point cloud key area of livestock and electronic equipment.
Background
Under the intensive breeding mode, the body size parameters are closely related to the livestock weight estimation, breeding value estimation and evaluation, meat quality evaluation, muscle fat content prediction and growth performance evaluation, and the method has important significance in livestock breeding management, disease early warning, yield estimation and seed selection breeding.
In the related art, in order to solve the problem of difficult measurement of production performance, the machine vision technology is used for measuring the body size of the livestock, so that the interference caused to the livestock in artificial measurement is eliminated, and the non-contact measurement of the parameters of the body size of the livestock can be realized. However, the method in the related art needs to manually select a measuring point from the animal point cloud by an experienced worker to complete body size measurement, which brings certain contingency and subjectivity.
Disclosure of Invention
The invention provides a method and a device for extracting a key area of three-dimensional point cloud of livestock and electronic equipment, which are used for solving the defect that body size measurement needs to be completed by manually selecting a measuring point in the prior art and realizing non-contact type automatic body size measurement.
In a first aspect, the invention provides a method for extracting a livestock three-dimensional point cloud key region, which comprises the following steps:
acquiring a continuous point cloud slice of a target livestock, wherein the continuous point cloud slice is perpendicular to a first direction, and the first direction is a direction from the tail of the livestock to the head of the livestock;
based on the span value of the continuous point cloud slice in a second direction, acquiring a span characteristic distribution fitting curve and acquiring a gradient characteristic distribution curve for representing the span value change rate, wherein the second direction is a direction pointing to the head of the livestock from the ground;
acquiring the central position of the leg region of the target livestock based on the extreme points of the span feature distribution fitting curve;
acquiring a front leg boundary position and a rear leg boundary position of the target livestock based on the leg region center position, the gradient feature distribution curve and the maximum and minimum values of the gradient feature distribution curve;
and acquiring a key area point cloud slice for calculating the body scale of the livestock based on the front leg boundary position, the rear leg boundary position and the gradient feature distribution curve.
Optionally, according to the livestock three-dimensional point cloud key region extraction method provided by the invention, the leg region center position includes: the obtaining of the central position of the leg region of the target livestock based on the extreme points of the span feature distribution fitting curve comprises:
determining a first pole point set and a second pole point set in extreme points of the span feature distribution fitting curve based on a first span threshold, wherein the value of any one extreme point in the first pole point set in the second direction is greater than or equal to the first span threshold, and the value of any one extreme point in the second pole 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 an adjacent extreme point of the target extreme point until two merging poles are obtained;
the merging the target extreme point and the adjacent extreme point of the target extreme point includes:
determining adjacent extreme points of the target extreme points in the first extreme point set, wherein the absolute value of the difference between the values of the adjacent extreme points and the target extreme points in the first direction is less than or equal to a second span threshold, the values of the adjacent extreme points and the target extreme points in the first direction are both greater than or less than the value of a non-leg extreme point in the first direction, and the non-leg extreme point is any one extreme point in the second extreme point set;
deleting adjacent extreme points of the target extreme point from the first extreme point set;
and merging the target extreme point and the adjacent extreme point of the target extreme point to obtain the merged pole.
Optionally, according to the livestock three-dimensional point cloud key region extraction method provided by the invention, the obtaining of the gradient feature distribution curve for representing the change rate of the span value includes:
determining a plurality of discrete points characterizing a span distribution of the continuous point cloud slice based on the span value of the continuous point cloud slice in the second direction;
dividing the plurality of discrete points along a second direction based on the number of preset clustering point positions to obtain a plurality of point clusters, wherein the number of the discrete points in the point clusters is equal to the number of the preset clustering point positions;
and calculating the average gradient among the plurality of point clusters along a second direction to obtain the gradient characteristic distribution curve.
Optionally, according to the method for extracting the key area of the three-dimensional point cloud of the livestock provided by the invention, the front leg boundary position includes a front leg front edge boundary and a front leg rear edge boundary, the rear leg boundary position includes a rear leg front edge boundary and a rear leg rear edge boundary, and the obtaining of the key area point cloud slice for the livestock body ruler calculation based on the front leg boundary position, the rear leg boundary position and the gradient feature distribution curve includes:
for each target leg boundary in the front leg front edge boundary, the front leg rear edge boundary, the rear leg front edge boundary and the rear leg rear edge boundary, executing an operation of moving the target leg boundary to the center position of the leg region according to a preset step length until the number of cluster clusters of the point cloud slices corresponding to the target leg boundary is 1, wherein the number of the cluster clusters is determined based on a DBSCAN clustering algorithm;
obtaining the critical area slice based on the leading leg leading edge boundary, the leading leg trailing edge boundary, the trailing leg leading edge boundary, and the trailing leg trailing edge boundary.
Optionally, according to the method for extracting the key area of the three-dimensional point cloud of the livestock 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 the obtaining the key area slices based on the front leg front edge boundary, the front leg rear edge boundary, the rear leg front edge boundary and the rear leg rear edge boundary includes:
determining 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;
determining an area slice where the extreme point between the rear edge boundary of the front leg and the front edge boundary of the rear leg is located as an abdominal region slice in the extreme point of the span characteristic distribution fitting curve; or determining an area slice where the abdominal circumference target point is located as an abdominal circumference area slice, wherein the abdominal circumference target point is located at a midpoint position between the rear edge boundary of the front leg and the front edge boundary of the rear leg;
determining a horizontal splitting plane where the minimum abdominal circumference point is located based on the minimum abdominal circumference point which is minimum in value in the second direction in the abdominal circumference region slice;
determining the parts of the front leg leading edge region slice, the front leg trailing edge region slice, the abdominal region slice and the rear leg trailing edge region slice which are above the horizontal dividing plane as the first key region slice, the second key region slice, the third key region slice and the fourth key region slice respectively.
Optionally, according to the method for extracting a key area of a three-dimensional point cloud of a livestock provided by the present invention, after acquiring a key area point cloud slice for livestock body size calculation based on the front leg boundary position, the rear leg boundary position and the gradient feature distribution curve, the method further includes:
acquiring 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 ruler comprises any one or more of the following items: body slant length, body width, body height, chest circumference or abdomen circumference.
In a second aspect, the present invention further provides a device for extracting a key region of a three-dimensional point cloud of a livestock, including:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a continuous point cloud slice of a target livestock, the continuous point cloud slice is perpendicular to a first direction, and the first direction is a direction from the tail of the livestock to the head of the livestock;
the second acquisition module is used for acquiring a span characteristic distribution fitting curve and a gradient characteristic distribution curve for representing the span value change rate based on the span value of the continuous point cloud slice in a second direction, wherein the second direction is a direction pointing to the head of the livestock from the ground;
a third obtaining module, configured to obtain a leg region center position of the target livestock based on an extreme point of the span feature distribution fitting curve;
a fourth obtaining module, configured to obtain a front leg boundary position and a rear leg boundary position of the target livestock based on the leg region center position, the gradient feature distribution curve, and a maximum and minimum value of the gradient feature distribution curve;
and the fifth acquisition module is used for acquiring a key area point cloud slice for calculating the body size of the livestock based on the front leg boundary position, the rear leg boundary position and the gradient characteristic distribution curve.
In a third aspect, the present invention further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement any one of the above methods for extracting a three-dimensional point cloud key region of a livestock.
In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the method for extracting the key region of the three-dimensional point cloud of livestock as described in any one of the above.
In a fifth aspect, the present invention further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the method for extracting a livestock three-dimensional point cloud key area as described in any one of the above.
According to the method, the device and the electronic equipment for extracting the key area of the three-dimensional point cloud of the livestock, provided by the invention, by acquiring the continuous point cloud slice of the target livestock, a span characteristic distribution fitting curve and a gradient characteristic distribution curve can be acquired based on the span value of the continuous point cloud slice in the second direction, the central position of the leg area of the target livestock can be acquired based on the extreme point of the span characteristic distribution fitting curve, a front leg gradient characteristic distribution curve and a rear leg gradient characteristic distribution curve can be further determined in the gradient characteristic distribution curve, the front leg front and rear edge boundary can be determined based on the maximum value and the minimum value of the front leg gradient characteristic distribution curve, the rear leg front and rear edge boundary can be determined based on the front leg front and rear edge boundary and the rear leg front and rear edge boundary, the key area slice can be used for calculating the livestock body scale, the manual selection of a measuring point in the animal can be avoided, and the non-contact type automatic measurement of the body scale can be realized.
Drawings
In order to more clearly illustrate the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a schematic view of livestock body scale parameters provided by the related art;
FIG. 2 is a schematic flow chart of a method for extracting a key region from a three-dimensional point cloud of a livestock according to the present invention;
FIG. 3 is a schematic diagram of a coordinate system of the livestock point cloud data provided by the present invention;
FIG. 4 is one of the schematic diagrams of a span feature distribution fitting curve provided by the present invention;
FIG. 5 is a schematic illustration of a gradient profile provided by the present invention;
FIG. 6 is a second schematic diagram of a span characteristic distribution fitting curve provided by the present invention;
FIG. 7 is a second schematic flow chart of the method for extracting the key area of the three-dimensional point cloud of livestock according to the present invention;
FIG. 8 is a schematic illustration of a livestock leg zone boundary error provided by the present invention;
FIG. 9 is a third schematic flowchart of a method for extracting a key area from a three-dimensional point cloud of livestock according to the present invention;
FIG. 10 is one of the schematic views of a point cloud slice at a livestock leg boundary provided by the present invention;
FIG. 11 is a second schematic view of a point cloud slice at a livestock leg boundary provided by the present invention;
FIG. 12 is a schematic diagram of a key region slice extraction result provided by the present invention;
FIG. 13 is a second schematic diagram illustrating the slice extraction result of the critical area provided by the present invention;
FIG. 14 is a third schematic diagram of the key region slice extraction result provided by the present invention;
FIG. 15 is a schematic view of the calculation position of the body width value of the livestock provided by the present invention;
FIG. 16 is a fourth flowchart illustrating a method for extracting a key area from a three-dimensional point cloud of livestock according to the present invention;
FIG. 17 is a fourth schematic diagram illustrating the extraction result of the key region slice provided by the present invention;
FIG. 18 is a boxline graph of errors in the calculation of body size of livestock according to the invention;
FIG. 19 is a schematic structural diagram of a device for extracting a key area from a three-dimensional point cloud of livestock according to the present invention;
fig. 20 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
In order to facilitate a clearer understanding of embodiments of the present invention, some relevant background information is first presented below.
According to the body size state evaluation standard in the breeding and fattening process of livestock, the main body size parameters of the livestock comprise a body height value, a body slant length, a body width value, a chest circumference value or an abdominal circumference value and the like.
Fig. 1 is a schematic diagram of livestock body size parameters provided by the related art, and as shown in fig. 1, body size measurements for cattle may include a body height value (BH), a body slant length (BL), a body width value (BW), a chest circumference value (BC), and a abdominal circumference value (BS). Wherein the measurement criterion for the body height value (BH) is the length of the vertical line segment at the livestock fat axis to the ground; the measurement standard of the body inclination length (BL) is the distance from the shoulder end of the livestock to the hip end; the measurement criterion for the body width value (BW) is the maximum horizontal width at the fat axis; the measure of the circumference at the thorax value (BC) is the vertical body axis circumference at the rear corner axis of the scapula; the abdominal circumference (BS) is measured as the vertical circumference of the largest abdominal region of a livestock animal.
In a traditional measuring mode, people usually measure the body size of livestock through a measuring tape and a measuring stick, the measuring time is 10-15 minutes, and severe stress response can be generated to the livestock in the measuring process, so that the feed intake and daily gain data before and after the livestock is measured are seriously reduced, and the frequency and the efficiency of body size measuring are seriously restricted.
In order to solve the problem of difficult production performance measurement, the machine vision technology can be used for measuring the body size of the livestock and eliminating the interference caused by manual measurement on the livestock. In the related art, non-contact body ruler measurement of the pig body can be realized by manually marking neck, tail, chest circumference, body height and hip height measurement points in a point cloud. However, the method in the related art needs to manually select a measuring point from the animal point cloud by an experienced worker to complete body size measurement, which brings certain contingency and subjectivity.
In order to overcome the defects, the invention provides a method and a device for extracting a key area of three-dimensional point cloud of livestock and an electronic device.
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 2 is a schematic flow chart of the method for extracting a key region of a three-dimensional point cloud of a livestock according to the present invention, and as shown in fig. 2, an execution subject of the method for extracting a key region of a three-dimensional point cloud of a livestock may be an electronic device. The method comprises the following steps:
step 201, acquiring a continuous point cloud slice of a target livestock, wherein the continuous point cloud slice is perpendicular to a first direction, and the first direction is a direction from the tail of the livestock to the head of the livestock;
specifically, in order to obtain a key area slice for livestock body size calculation, a continuous point cloud slice of a target livestock may be obtained first, the continuous point cloud slice including a plurality of point cloud slices, wherein each point cloud slice is perpendicular to a first direction, the first direction being a direction from a tail of the livestock to a head of the livestock.
Alternatively, the target livestock may be cattle, sheep, pigs, or the like.
Optionally, fig. 3 is a schematic diagram of a coordinate system of the livestock point cloud data provided by the present invention, and as shown in fig. 3, the unit scale of the livestock point cloud coordinate system is mm. Coordinate calibration can be performed based on a ground normal vector judgment and Principal Component Analysis (PCA) algorithm integrated in the acquisition device, and a calibration coordinate system is defined as starting from a centroid (namely a geometric center) origin, recording a direction from the ground to the head of the livestock (namely a second direction) as a positive z-axis direction, recording a direction from the tail of the livestock to the head (namely a first direction) as a positive y-axis direction, and recording a direction to the right of the body of the livestock as a positive x-axis direction.
Step 202, acquiring a span characteristic distribution fitting curve and a gradient characteristic distribution curve for representing the span value change rate based on the span value of the continuous point cloud slice in a second direction, wherein the second direction is a direction pointing to the head of the livestock from the ground;
specifically, after the continuous point cloud slices are obtained, a span value of each point cloud slice in the second direction can be obtained, and then discrete points corresponding to each point cloud slice can be determined based on the slice serial number of each point cloud slice and the span value of each point cloud slice in the second direction, and then curve fitting can be performed on the discrete points corresponding to each point cloud slice to obtain a span characteristic distribution fitting curve.
Specifically, based on the span value of each point cloud slice in the second direction, the span value change rate between each point cloud slice can be calculated, and then a gradient feature distribution curve can be obtained.
Alternatively, in order to obtain the livestock point cloud distribution features, the three-dimensional point cloud may be subjected to continuous slicing processing in an ascending direction with a span of 5mm in the y-axis direction of the livestock point cloud (the y-axis shown in fig. 3), and then the span value of each point cloud slice in the z-axis direction (the z-axis shown in fig. 3) may be counted one by one.
Optionally, fig. 4 is one of schematic diagrams of a span characteristic distribution fitting curve provided by the present invention, as shown in fig. 4, an original curve may be determined based on discrete points corresponding to each cloud slice, a fitting curve may be determined by performing high-order curve fitting on the discrete points corresponding to each cloud slice, and a maximum point of the fitting curve is marked as a black dot shown in fig. 4. As can be seen from fig. 4, the livestock leg positions are both present in the area (within the dotted line) around the two poles (A1 or A2) where the span values are the largest, and the distribution shows a certain regularity.
Alternatively, in order to obtain a gradient feature distribution curve, a livestock continuous slice span distribution curve (for example, the original curve in fig. 4) may be determined based on discrete points corresponding to cloud slices of each point, and assuming that two adjacent "five-point clusters" in the livestock continuous slice span distribution curve are A1 (A1, A2, a3, a4, a 5) and A2 (a 6, a7, a8, a9, a 10) in sequence, an average gradient P of the continuous five points may be calculated by the following "five-point average gradient formula":
Figure BDA0003721163910000101
wherein, a i Representing discrete points in a livestock serial slice span distribution curve.
Fig. 5 is a schematic diagram of a gradient feature distribution curve provided by the present invention, and the gradient feature distribution curve shown in fig. 5 can be obtained by sequentially extracting the average gradient distribution of all the "five-point clusters" in the livestock serial section span distribution curve (for example, the original curve in fig. 4) according to the ascending order of the independent variable by using the above "five-point average gradient formula".
Step 203, acquiring the central position of the leg region of the target livestock based on the extreme point of the span characteristic distribution fitting curve;
specifically, based on span characteristic distribution fitting curve, can acquire a plurality of extreme points of span characteristic distribution fitting curve, including the regional central point of shank in the domestic animal position that these extreme points correspond, and then can sieve out the regional central point of shank that central point corresponds in a plurality of extreme points, and then can acquire the regional central point of shank of target domestic animal based on the extreme point of sieving.
Step 204, acquiring a front leg boundary position and a rear leg boundary position based on the leg region center position, the gradient characteristic distribution curve and the maximum and minimum values of the gradient characteristic distribution curve;
specifically, after the leg region center position of the target livestock is obtained, the gradient feature distribution curve may be intercepted based on the leg region center position, the front leg gradient feature distribution curve used for representing the change rate of the front leg span value may be intercepted, and the back leg gradient feature distribution curve used for representing the change rate of the back leg span value may be intercepted.
Specifically, after obtaining the front leg gradient characteristic distribution curve and the rear leg gradient characteristic distribution curve, the front leg gradient characteristic distribution curve may be analyzed to obtain a maximum value and a minimum value of the front leg gradient characteristic distribution curve, where the minimum value of the front leg gradient characteristic distribution curve corresponds to the front leg leading edge boundary, the maximum value of the front leg gradient characteristic distribution curve corresponds to the front leg trailing edge boundary, and the rear leg gradient characteristic distribution curve may be analyzed to obtain a maximum value and a minimum value of the rear leg gradient characteristic distribution curve, where the minimum value of the rear leg gradient characteristic distribution curve corresponds to the rear leg leading edge boundary, and the maximum value of the rear leg gradient characteristic distribution curve corresponds to the rear leg trailing edge boundary.
And step 205, acquiring a key area point cloud slice for calculating the livestock body size based on the front leg boundary position, the rear leg boundary position and the gradient feature distribution curve.
It will be appreciated that the axis staff position, the ischial position and the shoulder position are critical regions of the livestock body ruler detection as shown in figure 1. Whereas in the livestock actually raised, the elevation at the axis of the fat may only be found by touch and is difficult to identify visually. Visually, the measurement positions of parameters such as bust, body height, etc. of the animal are all related to the axis of fat, which is located in the region of the trailing edge of the forelegs of the animal; the body slant length measuring position is related to the shoulder area of the front edge of the front leg of the livestock and the hip area of the rear edge of the rear leg; the abdominal circumference measuring area is in the middle of the front leg area and the back leg area of the livestock, so that the key area for measuring the body size of the livestock can be determined based on the leg area.
It can be understood that, as shown in fig. 5, at the boundary of the livestock leg, the maximum and minimum values in the front leg gradient characteristic distribution curve and the maximum and minimum values in the back leg gradient characteristic distribution curve are present, which are consistent with the geometric distribution characteristics of the livestock point cloud slice. The minimum value of the front leg gradient feature distribution curve may be used as the front leg front edge boundary, the maximum value of the front leg gradient feature distribution curve may be used as the front leg rear edge boundary, the minimum value of the rear leg gradient feature distribution curve may be used as the rear leg front edge boundary, and the maximum value of the rear leg gradient feature distribution curve may be used as the rear leg rear edge boundary. And (3) surrounding the central point of each leg part and the boundary between the central point and the front part and the rear part of each leg part into a front leg area and a rear leg area of the livestock, namely realizing the automatic extraction of the leg part areas, and acquiring a key area slice for calculating the body size of the livestock.
According to the livestock three-dimensional point cloud key area extraction method provided by the invention, by obtaining the continuous point cloud slice of the target livestock, a span characteristic distribution fitting curve and a gradient characteristic distribution curve can be obtained based on the span value of the continuous point cloud slice in the second direction, the central position of the leg area of the target livestock can be further obtained based on the extreme point of the span characteristic distribution fitting curve, a front leg gradient characteristic distribution curve and a rear leg gradient characteristic distribution curve can be further determined in the gradient characteristic distribution curve, the front leg front and rear edge boundary can be determined based on the maximum value and the minimum value of the front leg gradient characteristic distribution curve, the rear leg front and rear edge boundary can be determined based on the maximum value and the minimum value of the rear leg gradient characteristic distribution curve, the key area slice can be used for livestock body size calculation, the manual selection of a measuring point in animal point cloud can be avoided, and the non-contact type body size automatic measurement can be realized.
Optionally, the leg region center position comprises: the obtaining of the central position of the leg region of the target livestock based on the extreme points of the span feature distribution fitting curve comprises:
determining a first pole point set and a second pole point set in extreme points of the span feature distribution fitting curve based on a first span threshold, wherein the value of any one extreme point in the first pole point set in the second direction is greater than or equal to the first span threshold, and the value of any one extreme point in the second pole 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 an adjacent extreme point of the target extreme point until two merged poles are obtained;
the merging the target extreme point and the adjacent extreme point of the target extreme point includes:
determining adjacent extreme points of the target extreme points in the first extreme point set, wherein the absolute value of the difference between the adjacent extreme points and the target extreme points in the first direction is less than or equal to a second span threshold, the values of the adjacent extreme points and the target extreme points in the first direction are both greater than or less than the value of a non-leg extreme point in the first direction, and the non-leg extreme point is any one extreme point in the second extreme point set;
deleting neighboring extrema points of the target extremum point from the first set of extrema points;
and merging the target extreme point and the adjacent extreme point of the target extreme point to obtain one merged pole.
It can be understood that, because the values of the adjacent extreme points and the target extreme point in the first direction are both greater than or less than the value of the non-leg extreme point in the first direction, the merged poles can be ensured to be positioned at two sides of the center point of the abdomen of the livestock.
Optionally, fig. 6 is a second schematic diagram of a span characteristic distribution fitting curve provided by the present invention, as shown in fig. 6, according to the three-dimensional point cloud distribution characteristics of the livestock body, a pole with a large span value stably exists in the front and rear leg regions of the livestock, and the positions of the legs of the livestock can be determined according to the pole. However, sometimes more than one pole appears, as shown in fig. 6, the area a is the livestock hind leg area, the area B is the livestock foreleg area, and two poles appear in the area a.
It will be appreciated that when the animal is walking with the legs in a diverging position, the fitted curve may have two or more poles in the leg regions (region a or region B). In this case, the single-pole position cannot be easily identified to identify the leg region center position.
Optionally, fig. 7 is a second schematic flow chart of the livestock three-dimensional point cloud key region extraction method provided by the present invention, as shown in fig. 7, for a case that a fitted curve has two or more poles in a leg region (a region or B region), in order to be able to identify a center position of the leg region, a "pole quadratic filtering algorithm" may be adopted, where the algorithm includes: step 701 to step 708, wherein:
step 701, acquiring all extreme points of a span characteristic distribution fitting curve;
step 702, putting the extreme points which are more than 0.7 times of the maximum span in all the extreme points into a point set A, and putting other extreme points into a point set B; wherein the maximum span may be a largest one of span values of each point cloud slice in the second direction;
step 703, determining a target extreme point in the point set A, emptying the point set C and putting the target extreme point into the point set C;
step 704, determining adjacent extreme points of the target extreme point in the point set A, wherein the extreme points in the point set B do not exist on the point cloud slices between the target extreme point and the adjacent extreme points;
705, putting the adjacent extreme points of the target extreme points into the point set C, and deleting the adjacent extreme points of the target extreme points from the point set A;
step 706, merging the extreme points in the point set C to obtain merged poles;
step 707, determining whether two merging poles are obtained, if so, executing step 707, and if not, executing step 703;
and step 708, outputting the obtained two combined poles.
It can be understood that, in the above-mentioned pole quadratic screening algorithm, the poles with similar distances in the x-axis (horizontal axis in the coordinate system shown in fig. 6) are merged, and at the same time, the merged poles are ensured to be located on both sides of the center point of the abdomen of the livestock, so that it can be ensured that two center points belonging to the leg region, that is, the x-coordinate (horizontal axis in the coordinate system shown in fig. 6) positions of the fitting curve of the front leg and the back leg of the livestock, are successfully extracted, and further the y-axis (y-axis in the coordinate system shown in fig. 3) coordinate position of the center point in the leg region in the point cloud of the livestock is determined.
Optionally, the obtaining a gradient profile for characterizing a change rate of the span value includes:
determining a plurality of discrete points characterizing a span distribution of the continuous point cloud slice based on the span value of the continuous point cloud slice in the second direction;
dividing the plurality of discrete points along a second direction based on the number of preset clustering point positions to obtain a plurality of point clusters, wherein the number of the discrete points in the point clusters is equal to the number of the preset clustering point positions;
and calculating the average gradient among the plurality of point clusters along a second direction to obtain the gradient characteristic distribution curve.
It is understood that the number of the preset clustering points may be 2, 3, 4 or 5, etc., and is not limited thereto. For example, if the number of the preset clustering points may be 5, the average gradient P of five consecutive points at this point may be calculated by the above-mentioned "five-point average gradient formula".
Optionally, the front leg boundary positions include a front leg leading edge boundary and a front leg trailing edge boundary, the rear leg boundary positions include a rear leg leading edge boundary and a rear leg trailing edge boundary, and the acquiring a key area point cloud slice for livestock body scale calculation based on the front leg boundary positions, the rear leg boundary positions and the gradient feature distribution curve includes:
for each target leg boundary of the front leg front edge boundary, the front leg rear edge boundary, the rear leg front edge boundary and the rear leg rear edge boundary, performing an operation of moving to the leg region center position on the target leg boundary by a preset step until the number of cluster clusters of a point cloud slice corresponding to the target leg boundary is 1, wherein the number of cluster clusters is determined Based on a Density-Based Clustering algorithm with Noise (DBSCAN);
obtaining the critical area slice based on the leading leg leading edge boundary, the leading leg trailing edge boundary, the trailing leg leading edge boundary, and the trailing leg trailing edge boundary.
It can be understood that, in the walking process of livestock, when the legs of livestock have large branches, the positioned leg regions are abnormally increased, fig. 8 is a schematic diagram of the boundary error of the leg regions of livestock provided by the invention, as shown in fig. 8, the original leg region boundary is directly determined by the maximum value and the minimum value of the gradient characteristic distribution curve of the front leg and the maximum value and the minimum value of the gradient characteristic distribution curve of the back leg, but for the point cloud of livestock in the walking posture, the recognition result of the leg regions is larger, and the detection result of the body size is influenced. The ideal target area boundary is obtained after the original leg area boundary is shrunk, and before the livestock body ruler is calculated, the ideal target area boundary needs to be positioned, so that the influence of the walking posture of the livestock on the calculation result is overcome.
Optionally, fig. 9 is a third schematic flow chart of the livestock three-dimensional point cloud key region extraction method provided by the present invention, as shown in fig. 9, in order to locate an ideal target region boundary, a "leg region boundary correction algorithm based on slice clustering features" may be adopted, and the algorithm includes: step 901 to step 905, wherein:
step 901, acquiring a point cloud slice corresponding to a target leg boundary;
step 902, acquiring the number of cluster clusters of point cloud slices corresponding to the boundary of the target leg part based on a DBSCAN clustering algorithm;
step 903, judging whether the number of the clustered clusters is more than or equal to 2, if so, executing step 904, and if not, executing step 905;
step 904, moving the target leg boundary by 1 pixel towards the center of the leg region, and executing step 902;
step 905, outputting the corrected target leg boundary.
Wherein the target leg boundary may be any one of: a leading leg leading edge boundary, a leading leg trailing edge boundary, a trailing leg leading edge boundary, or a trailing leg trailing edge boundary.
It can be understood that the 'leg region boundary correction algorithm based on slice clustering features' extracts point cloud slices at the leg boundaries of livestock, clusters all points in the slices by using the classic DBSCAN algorithm, and moves the boundary to narrow the leg region range if two or more cluster clusters appear until a slice of one cluster is found.
Alternatively, fig. 10 is one of schematic diagrams of point cloud slices at the boundary of the leg of the livestock provided by the present invention, fig. 10 is a longitudinal slice of point cloud of the livestock at the boundary of the leg before the boundary of the leg is contracted, and as can be seen from fig. 10, in the originally extracted section of the boundary of the region, the lower leg part in the slice will be separated from the body because the lower edge of the leg of the livestock is in a diverging posture during walking; fig. 11 is a second schematic diagram of a point cloud slice at a boundary of a leg of a livestock provided by the invention, fig. 11 is a longitudinal slice of the point cloud of the livestock at the boundary of the leg after the boundary of the leg is contracted, and as can be seen from fig. 11, in the contracted boundary slice of the leg area of the livestock, the leg is kept connected with a body.
The method can correct the leg region boundary through a leg region boundary correction algorithm based on slice clustering characteristics, the legs and the body of the contracted livestock leg region boundary slice are kept in a connected state, and errors of the recognition result of the leg region can be reduced aiming at the livestock point cloud recognition of the walking posture.
Optionally, the key zone slices include a first key zone slice, a second key zone slice, a third key zone slice, and a fourth key zone slice, and the obtaining the key zone slices based on the leading-leg boundary, the trailing-leg boundary, the leading-leg boundary, and the trailing-leg boundary includes:
determining 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;
determining a region slice in which the extreme point between the rear edge boundary of the front leg and the front edge boundary of the rear leg is located as an abdominal region slice in the extreme point of the span characteristic distribution fitting curve; or determining an area slice where the abdominal circumference target point is located as an abdominal circumference area slice, wherein the abdominal circumference target point is located at a midpoint position between the rear edge boundary of the front leg and the front edge boundary of the rear leg;
determining a horizontal splitting plane where the minimum abdominal circumference point is located based on the minimum abdominal circumference point which is minimum in value in the second direction in the abdominal circumference region slice;
determining the parts of the front leg leading edge region slice, the front leg trailing edge region slice, the abdominal region slice and the rear leg trailing edge region slice which are above the horizontal dividing plane as the first key region slice, the second key region slice, the third key region slice and the fourth key region slice respectively.
Alternatively, fig. 12 is a schematic diagram of a key area slice extraction result provided by the present invention, as shown in fig. 12, the livestock foreleg posterior edge area is a measurement area of the body width of the livestock body height value, a slice (for example, a slice a in fig. 12) of the foreleg posterior edge area where the foreleg posterior edge boundary is located may be cut, and the cut width of the foreleg posterior edge area slice may be 30mm.
Alternatively, at the leading edge boundary of the leading leg and at the trailing edge boundary of the trailing leg, slices having a thickness of 10mm may be extracted as a leading edge region slice (e.g., slice B1 in fig. 12) and a trailing edge region slice (e.g., slice B2 in fig. 12), respectively.
Alternatively, the abdominal region slice (slice C) in fig. 12 may be extracted from the livestock continuous slice span distribution curve, with the extreme point between the leg regions (e.g., point B in fig. 4) as the construction point, and a section parallel to the x-z plane (x-z plane in the coordinate system shown in fig. 3) and having a thickness of 30mm as the abdominal region slice. In particular, if there are a plurality of poles or there is no pole in the special case, the midpoint between the position of the boundary of the posterior leg posterior edge and the position of the boundary of the posterior leg anterior edge of the livestock can be used as the slice C construction point.
Optionally, fig. 13 is a second schematic diagram of the slice extraction result of the critical area provided by the present invention, as shown in fig. 13, the point cloud including more legs in the slice B1, the slice a and the slice B2, in order to extract parameters such as the circumference of the chest, the slice B1, the slice a and the slice B2 may be cut to extract the trunk part not including legs, and a horizontal division plane (slice D in fig. 13) may be constructed by using a z-coordinate value (z-coordinate value in the coordinate system shown in fig. 3) of the lowest point of the circumference of the abdomen, which is parallel to the ground and has a thickness of 30mm.
Optionally, fig. 14 is a third schematic diagram of a slice extraction result of the key region provided by the present invention, as shown in fig. 14, the slice B1, the slice a, and the slice B2 are divided by the slice D, the upper halves of the slice B1, the slice a, and the slice B2 are extracted as the livestock point cloud scale calculation key regions, which are respectively denoted as a first key region slice (region α in fig. 14), a second key region slice (region β in fig. 14), and a fourth key region slice (region θ in fig. 14), and the slice C itself is used as a third key region slice (region ξ in fig. 14).
Optionally, after acquiring a critical area point cloud slice for livestock body scale calculation based on the front leg boundary position, the rear leg boundary position and the gradient feature distribution curve, the method further includes:
acquiring 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 ruler comprises any one or more of the following items: body slant length, body width, body height, chest circumference or abdomen circumference.
Alternatively, in order to calculate the body slant length, the livestock point cloud may be projected on a y-z plane (y-z plane in the coordinate system shown in fig. 3), for the projected point cloud, in the projection corresponding to the first critical area slice (for example, area α in fig. 14), the point Q with the minimum z-coordinate value is extracted, and in the projection corresponding to the fourth critical area slice (for example, area θ in fig. 14), the point R with the maximum z-coordinate value is extracted, and the body slant length BL may be obtained by the following body slant length calculation formula:
Figure BDA0003721163910000181
wherein r.y represents the y coordinate value of the R point, r.z represents the z coordinate value of the R point, q.y represents the y coordinate value of the Q point, q.z represents the z coordinate value of the Q point, and each coordinate value is a coordinate value in the coordinate system shown in fig. 3.
Alternatively, fig. 15 is a schematic diagram of a livestock body width value calculation position provided by the present invention, and as shown in fig. 15, in order to calculate the body width, the body width value can be measured in a second critical zone slice (zone β in fig. 14) according to the body width definition. The area beta is projected in the x-y plane (the x-y plane in the coordinate system shown in fig. 3). In the calculation region β, the maximum span value of the x coordinate is the body width value of the animal, wherein the body width value calculation position is as shown by the arrow in fig. 15.
Alternatively, in order to calculate the body height, assuming that K is the point with the smallest z-coordinate value (z-coordinate value in the coordinate system shown in fig. 3) among all points in the livestock point cloud, and T is the point with the largest z-value among all points in the second critical area slice (area β in fig. 14), the livestock body height value BH may be calculated according to the following body height value calculation formula:
BH=T.z-K.z;
wherein, T.z represents the z-coordinate value of the T point, and K.z represents the z-coordinate value of the K point.
Alternatively, to calculate the circumference, one can proceed based on the second critical area slice (area β in fig. 14), projecting the area point cloud on the x-z plane (x-z plane in the coordinate system shown in fig. 3). In the point cloud projection, ellipse fitting calculation can be performed through a six-point circular ellipse fitting algorithm, and the short axis length of the fitting ellipse and the long axis length of the fitting ellipse are obtained, so that the chest circumference BC can be calculated through the following chest circumference calculation formula:
Figure BDA0003721163910000191
where R represents the minor axis length of the fitted ellipse and R represents the major axis length of the fitted ellipse.
Alternatively, to calculate the abdominal circumference, a projection of the regional point cloud onto the x-z plane (the x-z plane in the coordinate system shown in FIG. 3) may be performed based on the third critical region slice (region xi in FIG. 14). In point cloud projection, ellipse fitting calculation can be performed through a six-point circular ellipse fitting algorithm, and the short axis length of the fitting ellipse and the long axis length of the fitting ellipse are obtained, so that the abdominal circumference BS can be calculated through the following chest circumference calculation formula:
Figure BDA0003721163910000192
where R represents the minor axis length of the fitted ellipse and R represents the major axis length of the fitted ellipse.
The method for extracting the key areas of the three-dimensional point cloud of the livestock can automatically extract a plurality of point cloud areas, automatically extract parameters such as the height, the oblique length, the body width, the chest circumference and the abdominal circumference of the livestock and can realize body ruler measurement aiming at the livestock with different postures. The measurement results can provide data support for livestock production performance determination, weight prediction or breeding value estimation and the like.
Fig. 16 is a fourth schematic flow chart of the livestock three-dimensional point cloud key region extraction method provided by the present invention, as shown in fig. 16, the method includes: step 1601 to step 1607, wherein:
step 1601, acquiring a beef cattle three-dimensional point cloud under standard coordinates;
step 1602, acquiring a first-direction continuous point cloud slice;
step 1603, acquiring a span characteristic distribution fitting curve;
step 1604, determining the center position of the leg area of the beef cattle;
optionally, the foregoing "pole quadratic screening algorithm" may be adopted to determine the leg region center position of the beef cattle, where the leg region center position of the beef cattle includes the front leg region center position and the rear leg region center position.
1605, determining the boundary position of the leg area of the beef cattle;
optionally, the point cloud slices at the leg boundaries of the livestock can be extracted by adopting the "leg region boundary correction algorithm based on slice clustering characteristics", all points in the slices are clustered by using a classic DBSCAN algorithm, if two or more clustering clusters appear, the boundary is moved to reduce the leg region range until a slice of one clustering cluster is found, and the corrected leg boundary is output.
Step 1606, acquiring a key area slice for calculating the body size of the livestock;
alternatively, the key region slices may include a first key region slice (region α in fig. 14), a second key region slice (region β in fig. 14), a third key region slice (region ξ in fig. 14), and a fourth key region slice (region θ in fig. 14); the parts of the front leg front edge region slice, the front leg rear edge region slice, the abdominal circumference region slice and the rear leg rear edge region slice which are positioned above the horizontal dividing plane can be determined to be respectively used as a first key region slice, a second key region slice, a third key region slice and a fourth key region slice
1607, obtaining the body size of the beef cattle.
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 acquired; the body ruler comprises any one or more of the following items: oblique body length, body width, body height, bust or abdominal girth.
It can be understood that automatic calculation of the body size of the livestock can be achieved by first locating and extracting three-dimensional point cloud regions of front and rear leg portions of the livestock through y-axis coordinates (y-axis coordinates of a coordinate system shown in fig. 3), then identifying the positions of body size measurement key region dividing lines in the regions, and finally calculating key region slices based on the extracted body sizes.
Optionally, in order to verify the livestock three-dimensional point cloud key region extraction method provided by the invention, key region extraction and body size parameter calculation are performed on 182 point clouds from 10 livestock in different postures, so as to test the accuracy and robustness of the algorithm.
Fig. 17 is a fourth schematic diagram illustrating the extraction result of the critical area slice provided by the present invention, as shown in fig. 17, the distribution of the cloud of points in a part of slices is not consistent, but the cloud of points can still better reflect the parameters of the body size of the livestock. If the area alpha is the upper half part of the front edge of the foreleg of the livestock, the position of the shoulder end of the livestock is better described, and the lower edge of the area is the measurement starting point of the body slope length; the region beta reflects the characteristics of the livestock fat part and is the measurement position of the body height value, the chest circumference value and the body width value of the livestock; the region θ is a slice of the livestock torso with the largest span of z-axis (z-axis of the coordinate system shown in fig. 3), and can be approximately regarded as the position of the livestock abdomen, and is used for measuring abdominal circumference value; the region xi is the position of the rear edge of the hind leg of the livestock, the position is close to the hip tail part of the livestock, but the quality of the existing data is limited, the hip of the livestock is lost, but the point with the maximum z coordinate (the z coordinate of the coordinate system shown in fig. 3) of the region is still approximately close to the ischial end point of the livestock, and the region xi can be judged as the measurement end point of the oblique length.
The invention respectively collects point clouds 24, 16, 19, 26, 14, 22, 20, 11, 18 and 12 from the 10 livestock, totally 182 point cloud data are obtained, the body size parameter of each livestock is manually measured, and is compared with the measurement result of the livestock three-dimensional point cloud key area extraction method provided by the invention, as shown in table 1, the algorithm measurement is the average value of the multiple measurement results of the method provided by the invention, and the average error is the average value of all measurement result errors.
TABLE 1 livestock body ruler parameter measurement results table
Figure BDA0003721163910000211
Figure BDA0003721163910000221
Figure BDA0003721163910000231
From table 1, it can be seen that, from the accuracy of body size calculation, the body width value is the most accurate in calculation, the total average error is 1.6%, and the average measurement errors of the oblique body length, the body height, the chest circumference and the abdominal circumference are 2.3%, 2.8% and 2.6%, respectively.
In order to further study the situation of microscopic data, and count the measurement error distribution situation of each body size parameter for each measurement, fig. 18 is a box plot of the body size calculation error of the livestock provided by the invention, and as shown in fig. 18, from the error distribution, the body size parameters such as body slant length, body width, body height, etc. obtained by automatic calculation are relatively stable in error distribution and are evenly distributed on two sides of the manual measurement value.
On the whole, the method for extracting the key area of the three-dimensional point cloud of the livestock can realize the automatic measurement of the body size of the livestock in the actual production environment and obtain stable and reliable body size data. In practical application, if the same livestock can pass through the body size measuring equipment for multiple times within a period of time (one day to several days), more accurate body size measuring value can be obtained by calculating the average value of multiple measurements.
The following describes the device for extracting the key area of the three-dimensional point cloud of livestock provided by the invention, and the device for extracting the key area of the three-dimensional point cloud of livestock described below and the method for extracting the key area of the three-dimensional point cloud of livestock described above can be referred to correspondingly.
Fig. 19 is a schematic structural diagram of a livestock three-dimensional point cloud key region extraction device provided by the invention, as shown in fig. 19, the device comprises: 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:
a first obtaining module 1901, configured to obtain a continuous point cloud slice of a target livestock, where the continuous point cloud slice is perpendicular to a first direction, and the first direction is a direction from a tail of the livestock to a head of the livestock;
a second obtaining module 1902, configured to obtain a span characteristic distribution fitting curve and a gradient characteristic distribution curve for representing a span value change rate based on a span value of the continuous point cloud slice in a second direction, where the second direction is a direction pointing to a head of the livestock from the ground;
a third obtaining module 1903, configured to obtain a leg region center position of the target livestock based on an extreme point of the span feature distribution fitting curve;
a fourth obtaining module 1904, configured to obtain a front leg boundary position and a rear leg boundary position of the target livestock based on the leg region center position, the gradient feature distribution curve, and a maximum and minimum value of the gradient feature distribution curve;
a fifth obtaining module 1905, configured to obtain a point cloud slice of a key area for calculating a body size of a livestock based on the front leg boundary position, the rear leg boundary position, and the gradient feature distribution curve.
According to the device for extracting the key region of the three-dimensional point cloud of the livestock, provided by the invention, by obtaining the continuous point cloud slice of the target livestock, a span characteristic distribution fitting curve and a gradient characteristic distribution curve can be obtained based on the span value of the continuous point cloud slice in the second direction, the central position of the leg region of the target livestock can be further obtained based on the extreme point of the span characteristic distribution fitting curve, a front leg gradient characteristic distribution curve and a rear leg gradient characteristic distribution curve can be further determined in the gradient characteristic distribution curve, the front leg front and rear edge boundary can be determined based on the maximum value and the minimum value of the front leg gradient characteristic distribution curve, the front leg front and rear edge boundary can be further determined based on the front leg front and rear edge boundary and the rear leg front and rear edge boundary, the key region slice can be used for calculating the livestock body size, the manual selection of a measuring point in the animal point cloud can be avoided, and the non-contact type automatic measurement of the body size can be realized.
Fig. 20 is a schematic structural diagram of an electronic device provided in the present invention, and as shown in fig. 20, the electronic device may include: a processor (processor) 2010, a communication Interface (Communications Interface) 2020, a memory (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. Processor 2010 may invoke logic instructions in memory 2030 to perform a livestock three-dimensional point cloud key area extraction method, for example, the method comprising:
acquiring a continuous point cloud slice of a target livestock, wherein the continuous point cloud slice is perpendicular to a first direction, and the first direction is a direction from the tail of the livestock to the head of the livestock;
based on the span value of the continuous point cloud slice in a second direction, acquiring a span characteristic distribution fitting curve and acquiring a gradient characteristic distribution curve for representing the span value change rate, wherein the second direction is a direction pointing to the head of the livestock from the ground;
acquiring the central position of the leg region of the target livestock based on the extreme point of the span characteristic distribution fitting curve;
acquiring a front leg boundary position and a rear leg boundary position of the target livestock based on the leg region center position, the gradient feature distribution curve and the maximum and minimum values of the gradient feature distribution curve;
and acquiring a key area point cloud slice for calculating the body size of the livestock based on the front leg boundary position, the rear leg boundary position and the gradient characteristic distribution curve.
Furthermore, the logic instructions in the memory 2030 may be implemented in software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as a separate product. Based on such understanding, the technical solution of the present invention or a part thereof which substantially contributes to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present invention further provides a computer program product, the computer program product 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, a computer can execute the livestock three-dimensional point cloud key area extraction method provided by the above methods, for example, the method includes:
acquiring a continuous point cloud slice of a target livestock, wherein the continuous point cloud slice is perpendicular to a first direction, and the first direction is a direction from the tail of the livestock to the head of the livestock;
based on the span value of the continuous point cloud slice in a second direction, acquiring a span characteristic distribution fitting curve and acquiring a gradient characteristic distribution curve for representing the span value change rate, wherein the second direction is a direction pointing to the head of the livestock from the ground;
acquiring the central position of the leg region of the target livestock based on the extreme point of the span characteristic distribution fitting curve;
acquiring a front leg boundary position and a rear leg boundary position of the target livestock based on the leg region center position, the gradient feature distribution curve and the maximum and minimum values of the gradient feature distribution curve;
and acquiring a key area point cloud slice for calculating the body size of the livestock based on the front leg boundary position, the rear leg boundary position and the gradient characteristic distribution curve.
In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, the computer program being implemented by a processor to execute the livestock three-dimensional point cloud key region extraction method provided by the above methods, for example, the method includes:
acquiring a continuous point cloud slice of a target livestock, wherein the continuous point cloud slice is perpendicular to a first direction, and the first direction is a direction from the tail of the livestock to the head of the livestock;
based on the span value of the continuous point cloud slice in a second direction, acquiring a span characteristic distribution fitting curve and acquiring a gradient characteristic distribution curve for representing the span value change rate, wherein the second direction is a direction pointing to the head of the livestock from the ground;
acquiring the central position of the leg region of the target livestock based on the extreme point of the span characteristic distribution fitting curve;
acquiring a front leg boundary position and a rear leg boundary position of the target livestock based on the leg region center position, the gradient feature distribution curve and the maximum and minimum values of the gradient feature distribution curve;
and acquiring a key area point cloud slice for calculating the body scale of the livestock based on the front leg boundary position, the rear leg boundary position and the gradient feature distribution curve.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment may be implemented by software plus a necessary general hardware platform, and may also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for extracting a key area of a three-dimensional point cloud of livestock is characterized by comprising the following steps:
acquiring a continuous point cloud slice of a target livestock, wherein the continuous point cloud slice is perpendicular to a first direction, and the first direction is a direction from the tail of the livestock to the head of the livestock;
based on the span value of the continuous point cloud slice in a second direction, acquiring a span characteristic distribution fitting curve and acquiring a gradient characteristic distribution curve for representing the span value change rate, wherein the second direction is a direction pointing to the head of the livestock from the ground;
acquiring the central position of the leg region of the target livestock based on the extreme point of the span characteristic distribution fitting curve;
acquiring a front leg boundary position and a rear leg boundary position of the target livestock based on the leg region center position, the gradient feature distribution curve and the maximum and minimum values of the gradient feature distribution curve;
and acquiring a key area point cloud slice for calculating the body size of the livestock based on the front leg boundary position, the rear leg boundary position and the gradient characteristic distribution curve.
2. The method for extracting key areas of the three-dimensional point cloud of livestock according to claim 1, wherein the leg area center position comprises: the obtaining of the central position of the leg region of the target livestock based on the extreme points of the span feature distribution fitting curve comprises:
determining a first pole point set and a second pole point set in extreme points of the span feature distribution fitting curve based on a first span threshold, wherein the value of any one extreme point in the first pole point set in the second direction is greater than or equal to the first span threshold, and the value of any one extreme point in the second pole 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 an adjacent extreme point of the target extreme point until two merging poles are obtained;
the merging the target extreme point and the adjacent extreme point of the target extreme point includes:
determining adjacent extreme points of the target extreme points in the first extreme point set, wherein the absolute value of the difference between the values of the adjacent extreme points and the target extreme points in the first direction is less than or equal to a second span threshold, the values of the adjacent extreme points and the target extreme points in the first direction are both greater than or less than the value of a non-leg extreme point in the first direction, and the non-leg extreme point is any one extreme point in the second extreme point set;
deleting adjacent extreme points of the target extreme point from the first extreme point set;
and merging the target extreme point and the adjacent extreme point of the target extreme point to obtain one merged pole.
3. The method for extracting the key area of the three-dimensional point cloud of the livestock according to claim 1, wherein the obtaining of the gradient feature distribution curve for representing the change rate of the span value comprises:
determining a plurality of discrete points characterizing a span distribution of the continuous point cloud slice based on the span value of the continuous point cloud slice in the second direction;
dividing the plurality of discrete points along a second direction based on the number of preset clustering point positions to obtain a plurality of point clusters, wherein the number of the discrete points in the point clusters is equal to the number of the preset clustering point positions;
and calculating the average gradient among the plurality of point clusters along a second direction to obtain the gradient characteristic distribution curve.
4. The livestock three-dimensional point cloud key area extraction method according to any one of claims 1 to 3, wherein the front leg boundary positions comprise a front leg front edge boundary and a front leg rear edge boundary, the rear leg boundary positions comprise a rear leg front edge boundary and a rear leg rear edge boundary, and the obtaining of the key area point cloud slice for livestock body scale calculation based on the front leg boundary positions, the rear leg boundary positions and the gradient feature distribution curve comprises:
for each target leg boundary in the front leg front edge boundary, the front leg rear edge boundary, the rear leg front edge boundary and the rear leg rear edge boundary, executing an operation of moving the target leg boundary to the center position of the leg region according to a preset step length until the number of cluster clusters of the point cloud slices corresponding to the target leg boundary is 1, wherein the number of the cluster clusters is determined based on a DBSCAN clustering algorithm;
obtaining the critical area slice based on the leading leg leading edge boundary, the leading leg trailing edge boundary, the trailing leg leading edge boundary, and the trailing leg trailing edge boundary.
5. The method for extracting key areas from three-dimensional point cloud of livestock according to claim 4, wherein the key area slices comprise a first key area slice, a second key area slice, a third key area slice and a fourth key area slice, and the obtaining of the key area slices based on the front leg front edge boundary, the front leg rear edge boundary, the rear leg front edge boundary and the rear leg rear edge boundary comprises:
determining 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;
determining a region slice in which the extreme point between the rear edge boundary of the front leg and the front edge boundary of the rear leg is located as an abdominal region slice in the extreme point of the span characteristic distribution fitting curve; or determining an area slice where the abdominal circumference target point is located as an abdominal circumference area slice, wherein the abdominal circumference target point is located at a midpoint position between the rear edge boundary of the front leg and the front edge boundary of the rear leg;
determining a horizontal splitting plane where the minimum abdominal circumference point is located based on the minimum abdominal circumference point which is minimum in value in the second direction in the abdominal circumference region slice;
determining the parts of the front leg leading edge region slice, the front leg trailing edge region slice, the abdominal region slice and the rear leg trailing edge region slice which are above the horizontal dividing plane as the first key region slice, the second key region slice, the third key region slice and the fourth key region slice respectively.
6. The method for extracting livestock three-dimensional point cloud key area according to claim 5, further comprising, after acquiring a key area point cloud slice for carcass size calculation based on the front leg boundary position, the rear leg boundary position and the gradient feature distribution curve:
acquiring 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 ruler comprises any one or more of the following items: body slant length, body width, body height, chest circumference or abdomen circumference.
7. The utility model provides a domestic animal three-dimensional point cloud key region extraction element which characterized in that includes:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a continuous point cloud slice of a target livestock, the continuous point cloud slice is perpendicular to a first direction, and the first direction is a direction from the tail of the livestock to the head of the livestock;
the second acquisition module is used for acquiring a span characteristic distribution fitting curve and a gradient characteristic distribution curve for representing the span value change rate based on the span value of the continuous point cloud slice in a second direction, wherein the second direction is a direction pointing to the head of the livestock from the ground;
a third obtaining module, configured to obtain a leg region center position of the target livestock based on an extreme point of the span feature distribution fitting curve;
a fourth obtaining module, configured to obtain a front leg boundary position and a rear leg boundary position of the target livestock based on the leg region center position, the gradient feature distribution curve, and a maximum and minimum value of the gradient feature distribution curve;
and the fifth acquisition module is used for acquiring a key area point cloud slice for calculating the body size of the livestock based on the front leg boundary position, the rear leg boundary position and the gradient characteristic distribution curve.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method for extracting the livestock three-dimensional point cloud key area according to any one of claims 1 to 6 when executing the program.
9. A non-transitory computer-readable storage medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the livestock three-dimensional point cloud key area extraction method according to any one of claims 1 to 6.
10. A computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements the livestock three-dimensional point cloud key area extraction method of any one of claims 1 to 6.
CN202210785252.4A 2022-06-29 2022-06-29 Livestock three-dimensional point cloud key area extraction method and device and electronic equipment Pending CN115311356A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210785252.4A CN115311356A (en) 2022-06-29 2022-06-29 Livestock three-dimensional point cloud key area extraction method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210785252.4A CN115311356A (en) 2022-06-29 2022-06-29 Livestock three-dimensional point cloud key area extraction method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN115311356A true CN115311356A (en) 2022-11-08

Family

ID=83856881

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210785252.4A Pending CN115311356A (en) 2022-06-29 2022-06-29 Livestock three-dimensional point cloud key area extraction method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN115311356A (en)

Similar Documents

Publication Publication Date Title
CN111243005B (en) Livestock weight estimation method, apparatus, device and computer readable storage medium
CN110986788B (en) Automatic measurement method based on three-dimensional point cloud livestock phenotype body size data
Wang et al. ASAS-NANP SYMPOSIUM: Applications of machine learning for livestock body weight prediction from digital images
Weber et al. Estimation of backfat thickness using extracted traits from an automatic 3D optical system in lactating Holstein-Friesian cows
CN112262408A (en) Method and apparatus for characterizing a living specimen from a distance
Liu et al. Automatic estimation of dairy cattle body condition score from depth image using ensemble model
Zhang et al. Algorithm of sheep body dimension measurement and its applications based on image analysis
Wang et al. Automated calculation of heart girth measurement in pigs using body surface point clouds
CN112825791B (en) Milk cow body condition scoring method based on deep learning and point cloud convex hull characteristics
CN113470106B (en) Non-contact cow body size information acquisition method
CN111386075A (en) Livestock weight measuring system and livestock weight measuring method using same
CN101052306B (en) Data acquisition for sorting and qualitative and quantitive measurement to body of lovestock slaughtered
CN113780144A (en) Crop plant number and stem width automatic extraction method based on 3D point cloud
Li et al. A posture-based measurement adjustment method for improving the accuracy of beef cattle body size measurement based on point cloud data
CN115331064A (en) Method and device for classifying point clouds of farm scene facing body size measurement
CN115311356A (en) Livestock three-dimensional point cloud key area extraction method and device and electronic equipment
CN114155377A (en) Poultry self-adaptive feeding method based on artificial intelligence and growth cycle analysis
CN113379561A (en) Intelligent calculation method, equipment and medium for poultry number
Liu et al. Estimation of weight and body measurement model for pigs based on back point cloud data
CN112712590A (en) Animal point cloud generation method and system
US20230354781A1 (en) Full-cycle health detection system for dairy cow based on visual recognition
CN111166338B (en) Pregnant sow body size calculation method based on TOF depth data
CN114708233A (en) Method for measuring pig carcass thickness and related product
Nishide et al. Calf robust weight estimation using 3D contiguous cylindrical model and directional orientation from stereo images
CN116558411A (en) Animal body ruler measuring method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination