CN111166338A - Pregnant sow body size calculation method based on TOF depth data - Google Patents

Pregnant sow body size calculation method based on TOF depth data Download PDF

Info

Publication number
CN111166338A
CN111166338A CN201911348973.3A CN201911348973A CN111166338A CN 111166338 A CN111166338 A CN 111166338A CN 201911348973 A CN201911348973 A CN 201911348973A CN 111166338 A CN111166338 A CN 111166338A
Authority
CN
China
Prior art keywords
data
point
coordinate
pig
calculating
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.)
Granted
Application number
CN201911348973.3A
Other languages
Chinese (zh)
Other versions
CN111166338B (en
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.)
Tianjin Agricultural University
Original Assignee
Tianjin Agricultural University
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 Tianjin Agricultural University filed Critical Tianjin Agricultural University
Priority to CN201911348973.3A priority Critical patent/CN111166338B/en
Publication of CN111166338A publication Critical patent/CN111166338A/en
Application granted granted Critical
Publication of CN111166338B publication Critical patent/CN111166338B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/103Detecting, measuring or recording devices for testing the shape, pattern, colour, size or movement of the body or parts thereof, for diagnostic purposes
    • A61B5/107Measuring physical dimensions, e.g. size of the entire body or parts thereof
    • A61B5/1072Measuring physical dimensions, e.g. size of the entire body or parts thereof measuring distances on the body, e.g. measuring length, height or thickness
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/103Detecting, measuring or recording devices for testing the shape, pattern, colour, size or movement of the body or parts thereof, for diagnostic purposes
    • A61B5/107Measuring physical dimensions, e.g. size of the entire body or parts thereof
    • A61B5/1079Measuring physical dimensions, e.g. size of the entire body or parts thereof using optical or photographic means
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B2503/00Evaluating a particular growth phase or type of persons or animals
    • A61B2503/40Animals

Landscapes

  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Medical Informatics (AREA)
  • Molecular Biology (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Biophysics (AREA)
  • Pathology (AREA)
  • Engineering & Computer Science (AREA)
  • Biomedical Technology (AREA)
  • Heart & Thoracic Surgery (AREA)
  • Dentistry (AREA)
  • Physics & Mathematics (AREA)
  • Surgery (AREA)
  • Animal Behavior & Ethology (AREA)
  • General Health & Medical Sciences (AREA)
  • Public Health (AREA)
  • Veterinary Medicine (AREA)
  • Image Analysis (AREA)
  • Measurement Of The Respiration, Hearing Ability, Form, And Blood Characteristics Of Living Organisms (AREA)
  • Apparatus For Radiation Diagnosis (AREA)

Abstract

The invention discloses a pregnant sow body size calculation method based on TOF depth data, which is characterized in that a TOF depth camera is used for respectively acquiring data of a Changbai sow and a Rongchang sow to directly obtain high-resolution depth data, the acquired depth data are preprocessed, an extraction algorithm of body size growth parameters of a sow body is designed, and an envelope analysis method is used for identifying the middle point of an ear root and the middle point of a tail root of the sow body; calculating the length of the back curved pig body by using a method of accumulating each adjacent point of the three-dimensional depth data; and calculating the chest circumference by adopting an ellipse fitting method, thereby obtaining the four pig body growth parameters of the body length, the chest width, the body height and the chest circumference of the sow. The real-time and quick acquisition of the body size parameters of the sows can be realized, and the acquisition of the body size parameters of different types of sows can also be realized.

Description

Pregnant sow body size calculation method based on TOF depth data
Technical Field
The invention belongs to the technical field of machine vision, and particularly relates to a pregnant sow body ruler calculation method based on TOF depth data.
Background
The growth condition, the body size character, the body shape character and the reproduction character of the sow are closely related, and the change of the body size parameter can directly reflect the growth condition of the sow. Changes in the body ruler parameters of pregnant sows play a key role in the number of surviving farrowing piglets, weight of piglets at birth and weight of weaned piglets. The sow is directly contacted and measured by adopting a conventional method for obtaining body size parameters, so that the stress is brought to the sow, and the healthy growth of the sow is influenced. By adopting the monocular vision technology, the three-dimensional data of the sow body cannot be acquired, while by adopting the monocular vision technology, the body size parameters of the sow can be acquired without stress, but the three-dimensional data reconstruction efficiency is low due to the limitation of factors such as conditions of camera erection, illumination when data are acquired, and the like, and the execution efficiency of the sow body size acquisition is influenced.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a pregnant sow body ruler calculation method based on TOF depth data.
The invention is realized by the following technical scheme:
a pregnant sow body ruler calculation method based on TOF depth data comprises the following steps:
the method comprises the following steps: collecting pig body depth data by using a TOF camera;
step two: filtering background data and reducing noise;
step three: adjusting the center of gravity;
setting the barycentric coordinates of the data as origin coordinates by taking an average value of X, Y, Z coordinate data and subtracting the corresponding average values from X, Y, Z coordinates of the original data to set the barycentric coordinates of the data as [000 ];
step four: rotating data;
performing characteristic rotation on the data to adjust the position of the acquired data, setting the length direction of the pig as an X axis of coordinates, and setting a Y axis vertical to the X axis direction as a Y axis of the pig body data;
the method based on two-dimensional principal component analysis rotates an X axis and a Y axis of original data by an angle theta in a Z coordinate at the same time to obtain a coordinate axis F1And F2Rotating transformation formula such as formula (1) and formula (2) to obtain coordinate axis F1And F2New coordinate system X, Y axes for subsequent data processing
F1=X cosθ+Y sinθ (1)
F2=Y cosθ-X sinθ (2)
Step five: back data projection
Projecting the three-dimensional data of the pig body from the back, setting the Z-axis coordinate of the pig body as 0, acquiring the projection data of an XOY surface of the three-dimensional data, and processing the data by using a function in Matlab to obtain a contour line and an envelope line for identifying the pig body measuring point;
step six: body length calculation
1) Taking the middle point of the ear root as the starting point of the body length measuring point, circularly calculating the distance between every two adjacent points of the data on the envelope curve, identifying a line segment L1 with the longest distance, and identifying the data of the contour line in the coordinate range according to the coordinate range of the line segment L1 and marking as L2; circularly calculating the distance from each point in L2 to the line segment L1, identifying the point farthest from L1 in L2 as the ear root point A1, similarly calculating another ear root point A2, and calculating the midpoint of the coordinates of a point A1 and a point A2 as the midpoint Am of the ear root;
2) taking the middle point of the tail root as the terminal point of the body length measuring point, obtaining tail root identification points B1 and B2, and calculating the middle point of coordinates B1 and B2 as the middle point Bm of the tail root;
3) calculating the body length: and respectively taking the x and y coordinates of the middle point of the ear root and the middle point of the tail root as ranges, acquiring the three-dimensional point coordinates of each point on the body length measuring line corresponding to the x and y two-dimensional coordinates on the line between the two points, and calculating the length of the connecting line of every two adjacent three-dimensional points in an accumulating manner to be recorded as the body length.
In the above technical solution, the method further comprises the following steps: body height calculation
1) Firstly, finding the midpoint of the widest position of the pig body contour line: dividing pig body data into an upper part and a lower part by taking a straight line Lh determined by the middle point of the ear root and the middle point of the tail root as a boundary, combining with an X coordinate of the middle point of the ear root and an X coordinate of the center of gravity as boundaries respectively, selecting a body height identification area of a contour line, calculating distances from points on a pig body contour line to Lh in the area respectively, marking the points with the maximum distances from the points on the contour line to the line Lh as H1 and H2, calculating the middle points Hm of H1 and H2, and the Hm is a two-dimensional coordinate point of a body height measuring point on the contour line;
2) selecting point cloud data in a range of a circle with an Hm coordinate point as a circle center and a radius of 0.1cm +/-in the longitudinal section of the three-dimensional data, and solving the mean value of Z coordinates of the data in the circle;
3) and selecting the minimum value of the Z coordinate in the whole three-dimensional data, namely the Z value of the ground data, calculating the distance between the Z value of the ground data and the Z mean value of the three-dimensional body height measuring point, and recording as the body height.
In the above technical solution, the method further comprises the following steps: chest width calculation
In the two-dimensional data, the data is cut out by taking an X coordinate point of the middle point of the ear root and a center of gravity X as 0 coordinate as boundary lines, the distance from the chest width part to the center of gravity is 1/6 of the distance from the middle point of the ear root to the center of gravity, and the width of the chest width part is calculated to be the chest width.
In the above technical solution, the method further comprises the following steps: chest circumference calculation
Selecting data in the chest width measurement range, removing ground data, remaining three-dimensional data information of the back, and projecting the data onto a YOZ plane;
1) inserting a point A with a certain height from the ground into the radian information, wherein the point A takes the midpoint of the back radian data as an X coordinate, and the height of the manually measured chest circumference of the pig from the ground as a Y coordinate;
2) the two end points B, C of the acquired data of the radian are analyzed, and the linear distance L between B, C two points is calculatedBCAnd calculating B, C the coordinate of the midpoint E of the two-point connecting line;
3) calculating the arc length of a semicircle with the diameter of BC as the arc length of the back of the pig, namely the arc length of an arc BC with the radius of E point as the circle center BE or EC as the arc length of the back of the pig;
4) calculating the perimeter of the ellipse by taking EB or EC as a short semi-axis and AE as a long semi-axis, and taking out the half length of the perimeter of the ellipse to define the abdominal arc length of the pig;
5) and calculating the sum of the back arc length and the abdomen arc length to obtain the chest circumference of the sow pig body.
In the technical scheme, the Y coordinates of different breeds of pigs have different values, the height of the Rongchang sow is 20cm away from the ground, and the height of the Changbai sow is 25cm away from the ground.
The invention has the advantages and beneficial effects that:
the method comprises the steps of respectively carrying out data acquisition on the Changbai sow and the Rongchang sow by using a TOF depth camera, directly obtaining high-resolution depth data, preprocessing the obtained depth data, designing an extraction algorithm of a body ruler growth parameter of the sow body, and identifying the middle point of the ear root and the middle point of the tail root of the sow body by using an envelope analysis method; calculating the length of the back curved pig body by using a method of accumulating each adjacent point of the three-dimensional depth data; and calculating the chest circumference by adopting an ellipse fitting method, thereby obtaining the four pig body growth parameters of the body length, the chest width, the body height and the chest circumference of the sow. The real-time and quick acquisition of the body size parameters of the sows can be realized, and the acquisition of the body size parameters of different types of sows can also be realized.
Drawings
Fig. 1 is a schematic diagram of data acquisition according to a first embodiment of the present invention.
FIG. 2 is a schematic diagram of two-dimensional PCA according to a first embodiment of the present invention.
Fig. 3 is a schematic diagram of data before rotation according to the first embodiment of the present invention.
Fig. 4 is a schematic diagram of a data rotation according to a first embodiment of the present invention.
Fig. 5 is a pig body contour line and an envelope line chart according to the first embodiment of the present invention.
Fig. 6 is a block diagram of a pig body length calculation method according to a first embodiment of the invention.
Fig. 7 is a view showing the identification of the ear root and tail root of a pig according to the first embodiment of the present invention.
Fig. 8 is volume data in the three-dimensional data according to the first embodiment of the present invention.
Fig. 9 is a block diagram of a pig height calculation method according to a second embodiment of the present invention.
FIG. 10 is a schematic view of the body height measuring point according to the second embodiment of the present invention.
Fig. 11 is a body height measurement point cloud chart according to the second embodiment of the present invention.
Fig. 12 is a schematic diagram illustrating chest width calculation according to a third embodiment of the present invention.
Fig. 13 is a schematic method diagram of the chest circumference calculation method according to the fourth embodiment of the present invention.
For a person skilled in the art, other relevant figures can be obtained from the above figures without inventive effort.
Detailed Description
In order to make the technical solution of the present invention better understood, the technical solution of the present invention is further described below with reference to specific examples.
Example one
A pregnant sow body ruler calculation method based on TOF depth data comprises the following steps:
the method comprises the following steps: acquisition of pig body depth data using TOF camera
The experimental subjects of the embodiment are Changbai sows and Rongchang sows, the age of the sows is about 24 months, the depth data of the obtained sows are obtained by using a Basler TOF camera, the model of the camera is TOF640-20gm _850nm, and the depth data acquisition software is TOF Viewer and is mainly used for displaying three-dimensional data and obtaining data when the software is used for obtaining the data.
The pregnant sow is fed by a limiting fence, and in order to ensure that the postures of the pig body for acquiring the image data are consistent as much as possible, a fence with the height of 60cm, the width of 60cm and the length of 2.1m is arranged at a platform scale of a pigsty channel to limit the activity and stabilize the posture of the sow when the data are acquired. Meanwhile, a camera support is installed on the uppermost portion of the platform scale, so that the camera is made to be in direct incidence with the back of the pig body to collect three-dimensional depth data, and the installation height of the camera above the platform scale is 255cm away from the ground. The channel only allows one pig to pass through at every time, when the pig enters a shooting area, TOF Viewer software is used for controlling a TOF camera to manually collect depth data of the back of the pig body, and meanwhile tools such as a scale, a tape measure and a measuring stick are used for manually acquiring data of body size parameters such as body length, body height and chest circumference. The camera is arranged right above the fence, 600 groups of depth image data of 30 Rongchang sows, 30 Changbai sows and 60 sows are collected, and the resolution of the acquired images is 640px 480 px. And (3) acquiring depth data, wherein the naming format of the data is shooting time/pig ear number/pig variety. A schematic of the data acquisition is shown in fig. 1.
Step two: filtering background data and noise reduction
After the data are obtained, because the data contain too complicated background information and influence the processing result, background data in the image are removed by using Meshlab software, and back data information and partial ground data of the pig body are left; the data was then imported into Matlab using the pcdenoise denoising function to remove small and cluttered points.
Step three: adjusting the centre of gravity
Since the origin of the data is at the center of the camera lens and the coordinates of the center of gravity [000] of the data are used in the post-processing, the coordinates of the center of gravity of the data are set as the coordinates of the origin by averaging the coordinates of X, Y, Z and subtracting the corresponding averages from the X, Y, Z coordinates of the original data to set the coordinates of the center of gravity of the data as [000 ].
Step four: data rotation
Because the position of the pig is not controlled, a specific shooting angle between the pig and the TOF camera cannot be guaranteed, although the position of the pig is limited by the limiting fence, the data acquired by the TOF camera still has a skew condition, and the length direction of the pig cannot be guaranteed to be on the X axis, so that the data needs to be subjected to characteristic rotation to adjust the position of the acquired data, the length direction of the pig is set as the X axis of a coordinate, the Y axis (namely, the orthogonal coordinate axis) perpendicular to the X axis direction is set as the Y axis of the pig body data, and then the next analysis is carried out.
One-dimensional principal component analysis method: namely, all sample information is projected to a straight line corresponding to the sample mean value; a two-dimensional principal component analysis method in which the distribution of data in a plane is regarded as an elliptical distribution, the direction of the major and minor axes of the ellipse is determined, data information is projected in the two major and minor axis directions, the direction of projection is the direction of the major and minor axes of the ellipse on the plane, and orthogonal coordinate axes more suitable for the set of data can be found again from the distribution of input data to the input data, the method being schematically shown in FIG. 2, and the coordinate axes representing the distribution of the elliptical distribution are certainly the major axes F of the ellipse from the distribution of the elliptical distribution drawn in the figure1And a minor axis F2Rather than the original X, Y axis; this step is a two-dimensional principal component analysis-based method, which willBefore and after the rotation of the original data through the Z coordinate, as shown in FIGS. 3 and 4, the X axis and the Y axis are simultaneously rotated by an angle theta in the counterclockwise direction to obtain a coordinate axis F1And F2Rotating transformation formula such as formula (1) and formula (2) to obtain coordinate axis F1And F2As a new coordinate system X, Y axis for subsequent data processing.
F1=X cosθ+Y sinθ (1)
F2=Y cosθ-X sinθ (2)
Step five: back data projection
When an algorithm is designed, projection data of the back of a pig body need to be acquired, and the data are processed by using a function in Matlab, so that a contour line and an envelope line for identifying a pig body measuring point are obtained.
The method for acquiring the two-dimensional projection data is to project the three-dimensional data of the pig body from the back, set the Z-axis coordinate of the three-dimensional data as 0, acquire the projection data of the XOY plane of the three-dimensional data, and then use the boundaryfacests function and the alphaShape function of Matlab, and set different thresholds, wherein the thresholds are respectively set to be 80 and 200, the contour line of the projection data obtained by 80 is set, and the envelope line of the projection data is obtained by 200. The contour line and the envelope curve of the obtained pig body projection data are shown in fig. 5, the line of the inner circle is the contour line of the pig body projection data, and the line of the outer circle is the envelope curve of the pig body projection data.
Step six: body length calculation
The middle points of the ear root and the tail root of the pig are measured, and the distance between the two middle points is calculated as the body length.
By analyzing the envelope and the contour line, it can be found that: the ear root point and the tail root point are the maximum points of the distance from a certain point on the contour line to the envelope line, the data are divided into four parts, namely an upper ear root part, a lower ear root part, an upper tail root part and a lower tail root part, according to the coordinates of the gravity center [000] of the data after the contour line is obtained, firstly, the longest envelope line of each part of the four parts is calculated, the points of the four parts on the contour line with the maximum distance to the longest envelope line are respectively obtained, the identified points are marked as the ear root point and the tail root point, after the two ear root points and the two tail root points are identified, the middle points of the ear root and the tail root are respectively calculated and marked as the middle point of the ear root and the middle point of the tail root, and the. The following describes a body length calculation method in detail with reference to fig. 7 and 8.
1) The middle point of the ear root is used as the starting point of the body length measuring point. Circularly calculating the distance between every two adjacent points of the data on the envelope curve, identifying a line segment L1 with the longest distance, and identifying the data of the contour line in the coordinate range according to the coordinate range of the line segment L1, and marking as L2; the distance from each point in L2 to the line segment L1 is circularly calculated, the point farthest from L1 is identified as the ear root point A1 in L2, another ear root point A2 is calculated in the same way, and the middle points of the coordinates of the point A1 and the point A2 are calculated as the middle point Am of the ear root.
2) The middle point of the tail root is used as the terminal point of the body length measuring point. The method of the tail root identification point is the same as that of the ear root identification point, the tail root identification points B1 and B2 are obtained, and the middle point of the coordinates of B1 and B2 is calculated to be the tail root middle point Bm.
3) Calculating the body length: in the process of manually measuring the body length, the method of measuring the middle point of the ear root and the tail root by closing to the skin of the pig body is adopted for measurement, and if the straight line distance between the middle point of the ear root and the middle point of the tail root is directly calculated based on point cloud data to be the body length, the error is large. The method respectively takes the x and y coordinates of the ear root midpoint Am and the tail root midpoint Bm as ranges to obtain the three-dimensional point coordinates of each point on the body length measuring line corresponding to the x and y two-dimensional coordinates on the line between the two points, for example, the line on the back of the pig body in figure 8 is the connecting line of each three-dimensional point on the pig body length line in the range from the three-dimensional point Am to the three-dimensional point Bm, and the length of each two adjacent points is calculated in an accumulating way and then recorded as the body length.
Example two
On the basis of the first embodiment, the method further includes the seventh step:
step seven: body height calculation
The specific location of body height is at the temple, i.e. posterior scapular edge. The body height calculation flowchart is shown in fig. 9.
1) Firstly, finding the midpoint of the widest position of the pig body contour line: a straight line Lh determined by the middle point of the ear root and the middle point of the tail root is used as a boundary line to divide the pig body data into an upper part and a lower part, and the upper part and the lower part are respectively combined with the X coordinate of the middle point of the ear root and the X coordinate of the center of gravity as boundary lines to select a body height identification area of a contour line, namely a range between two dotted lines in the body height measuring point schematic diagram 10. And respectively calculating the distances from the points on the pig body contour line to the Lh within the range, recording the points with the maximum distances from the points on the contour line to the line Lh as H1 and H2, and calculating the middle points Hm of the H1 and H2, wherein Hm is the two-dimensional coordinate point of the body height measuring point on the contour line.
2) In order to ensure that the two-dimensional coordinates of the Hm point are in the three-dimensional point cloud and the Z value of the three-dimensional point cloud data of the corresponding point can be found, the algorithm selects point cloud data in the range of a circle which takes the Hm coordinate point as the center of the circle and takes 0.1cm +/-as the radius from the longitudinal section (vertical to the length direction of the pig body and along the three-dimensional point cloud section of the Hm point) of the three-dimensional data, and calculates the mean value of the Z coordinate of the data in the circle.
3) And selecting the minimum value of the Z coordinate in the whole three-dimensional data, namely the Z value of the ground data, calculating the distance between the Z value of the ground data and the Z mean value of the three-dimensional body height measuring point, and recording as the body height. The body height measurement point cloud depth data distribution graph is shown in fig. 11, the Hm point marked by the circle represents the position of the body height measurement point on the pig body back projection profile surface, and the H3 point marked by the point represents the measurement point of the body height in the three-dimensional data.
EXAMPLE III
On the basis of the second embodiment, further, the method further comprises the step eight:
step eight: chest width calculation
And measuring the transverse linear distance of the chest of the pig body to be the chest width by using a measuring stick. The chest width calculation method comprises the following steps: after the measuring points of the body length and the body height are identified, the measuring point of the chest width moves a certain position on the position of the measuring point of the body height. In the two-dimensional data, the data is cut out with the X coordinate point of the middle point of the ear root and the center of gravity X being 0 coordinate as boundary lines, as shown by Lw1 and Lw2 in the chest width diagram 12. The identification point of the position is not easy to identify, and the pig body length is different, so that a fixed threshold value cannot be set to accurately position, and therefore the ratio of the chest width position in the pig body is calculated by using a pig body ratio method. Through a large amount of data calculation and experimental verification, the chest width part is found to be 1/6 of the selected data (namely, the distance from the chest width part to the center of gravity is 1/6 of the distance from the middle point of the ear root to the center of gravity), and the width of the chest width part is calculated to be the chest width.
Example four
On the basis of the third embodiment, further, the method further comprises the step nine:
step nine: chest circumference calculation
The length of one circle around the chest behind the shoulder is the chest circumference. The chest circumference calculation method comprises the following steps: and selecting data in the chest width measurement range, removing ground data, remaining three-dimensional data information of the back, and projecting the data onto a YOZ plane. The chest circumference is calculated as shown in fig. 13.
1) A point A with a certain height from the ground is inserted into the radian information (the ground data is stored when a body height measuring point is calculated), the midpoint of the back radian data is used as an X coordinate of the point A, and the height of the manually measured chest circumference of the pig from the ground is used as a Y coordinate. The Y coordinate values of different breeds of breeding pigs are different, for example, the Rongchang sow is 20cm away from the ground, and the Changbai sow is 25cm away from the ground.
2) The two end points B, C of the acquired data of the radian are analyzed, and the linear distance L between B, C two points is calculatedBCAnd the coordinate of the midpoint E of the two-point line is calculated B, C.
3) Calculating the arc length of a semicircle taking BC as the diameter to BE defined as the back arc length of the pig, namely the arc length of an arc BC taking E point as the center BE or EC as the radius is defined as the back arc length of the pig. The calculation formula is pi.LBC/2
4) The perimeter of the ellipse is calculated by taking EB or EC as a minor semi-axis and AE as a major semi-axis, and the half length of the perimeter of the ellipse is taken out to be defined as the abdominal arc length of the pig.
5) And calculating the sum of the back arc length and the abdomen arc length to obtain the chest circumference of the sow pig body. The thick line in fig. 13 is a diagram of the calculated bust size.
The invention has been described in an illustrative manner, and it is to be understood that any simple variations, modifications or other equivalent changes which can be made by one skilled in the art without departing from the spirit of the invention fall within the scope of the invention.

Claims (5)

1. A pregnant sow body ruler calculation method based on TOF depth data is characterized by comprising the following steps:
the method comprises the following steps: collecting pig body depth data by using a TOF camera;
step two: filtering background data and reducing noise;
step three: adjusting the center of gravity;
setting the barycentric coordinates of the data as origin coordinates by taking an average value of X, Y, Z coordinate data and subtracting the corresponding average values from X, Y, Z coordinates of the original data to set the barycentric coordinates of the data as [000 ];
step four: rotating data;
performing characteristic rotation on the data to adjust the position of the acquired data, setting the length direction of the pig as an X axis of coordinates, and setting a Y axis vertical to the X axis direction as a Y axis of the pig body data;
rotating the X axis and the Y axis of the original data by an angle theta at the same time according to the Z coordinate to obtain a coordinate axis F1And F2Rotating transformation formula such as formula (1) and formula (2) to obtain coordinate axis F1And F2New coordinate system X, Y axes as subsequent data processing;
F1=X cosθ+Y sinθ (1)
F2=Y cosθ-X sinθ (2)
step five: back data projection
Projecting the three-dimensional data of the pig body from the back, setting the Z-axis coordinate of the pig body as 0, acquiring projection data of an XOY surface of the three-dimensional data, and then acquiring a contour line and an envelope line for identifying a pig body measuring point;
step six: body length calculation
1) Taking the middle point of the ear root as the starting point of the body length measuring point, circularly calculating the distance between every two adjacent points of the data on the envelope curve, identifying a line segment L1 with the longest distance, and identifying the data of the contour line in the coordinate range according to the coordinate range of the line segment L1 and marking as L2; circularly calculating the distance from each point in L2 to the line segment L1, identifying the point farthest from L1 in L2 as the ear root point A1, similarly calculating another ear root point A2, and calculating the midpoint of the coordinates of a point A1 and a point A2 as the midpoint Am of the ear root;
2) taking the middle point of the tail root as the terminal point of the body length measuring point, obtaining tail root identification points B1 and B2, and calculating the middle point of coordinates B1 and B2 as the middle point Bm of the tail root;
3) calculating the body length: and respectively taking the x and y coordinates of the middle point of the ear root and the middle point of the tail root as ranges, acquiring the three-dimensional point coordinates of each point on the body length measuring line corresponding to the x and y two-dimensional coordinates on the line between the two points, and calculating the length of the connecting line of every two adjacent three-dimensional points in an accumulating manner to be recorded as the body length.
2. The pregnant sow body size calculation method based on TOF depth data as claimed in claim 1, further comprising a seventh step of body height calculation:
1) firstly, finding the midpoint of the widest position of the pig body contour line: dividing pig body data into an upper part and a lower part by taking a straight line Lh determined by the middle point of the ear root and the middle point of the tail root as a boundary, combining with an X coordinate of the middle point of the ear root and an X coordinate of the center of gravity as boundaries respectively, selecting a body height identification area of a contour line, calculating distances from points on a pig body contour line to Lh in the area respectively, marking the points with the maximum distances from the points on the contour line to the line Lh as H1 and H2, calculating the middle points Hm of H1 and H2, and the Hm is a two-dimensional coordinate point of a body height measuring point on the contour line;
2) selecting point cloud data in a range of a circle with an Hm coordinate point as a circle center and a radius of 0.1cm +/-in the longitudinal section of the three-dimensional data, and solving the mean value of Z coordinates of the data in the circle;
3) and selecting the minimum value of the Z coordinate in the whole three-dimensional data, namely the Z value of the ground data, calculating the distance between the Z value of the ground data and the Z mean value of the three-dimensional body height measuring point, and recording as the body height.
3. The pregnant sow body size calculation method based on TOF depth data as claimed in claim 2, further comprising the step eight of chest width calculation:
in the two-dimensional data, the data is cut out by taking an X coordinate point of the middle point of the ear root and a center of gravity X as 0 coordinate as boundary lines, the distance from the chest width part to the center of gravity is 1/6 of the distance from the middle point of the ear root to the center of gravity, and the width of the chest width part is calculated to be the chest width.
4. The pregnant sow body size calculation method based on TOF depth data as claimed in claim 3, wherein: further comprising the ninth step of calculating the chest circumference:
1) inserting a point A with a certain height from the ground into the radian information, wherein the point A takes the midpoint of the back radian data as an X coordinate, and the height of the manually measured chest circumference of the pig from the ground as a Y coordinate;
2) the two end points B, C of the acquired data of the radian are analyzed, and the linear distance L between B, C two points is calculatedBCAnd calculating B, C the coordinate of the midpoint E of the two-point connecting line;
3) calculating the arc length of a semicircle with the diameter of BC as the arc length of the back of the pig, namely the arc length of an arc BC with the radius of E point as the circle center BE or EC as the arc length of the back of the pig;
4) calculating the perimeter of the ellipse by taking EB or EC as a short semi-axis and AE as a long semi-axis, and taking out the half length of the perimeter of the ellipse to define the abdominal arc length of the pig;
5) and calculating the sum of the back arc length and the abdomen arc length to obtain the chest circumference of the sow pig body.
5. The pregnant sow body size calculation method based on TOF depth data as claimed in claim 4, wherein: when the Y coordinate of the chest circumference of the pig body from the ground is determined, the Y coordinates of different breeds of pigs have different values, the Rongchang sow is 20cm away from the ground, and the Changbai sow is 25cm away from the ground.
CN201911348973.3A 2019-12-24 2019-12-24 Pregnant sow body size calculation method based on TOF depth data Active CN111166338B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911348973.3A CN111166338B (en) 2019-12-24 2019-12-24 Pregnant sow body size calculation method based on TOF depth data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911348973.3A CN111166338B (en) 2019-12-24 2019-12-24 Pregnant sow body size calculation method based on TOF depth data

Publications (2)

Publication Number Publication Date
CN111166338A true CN111166338A (en) 2020-05-19
CN111166338B CN111166338B (en) 2022-04-08

Family

ID=70620237

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911348973.3A Active CN111166338B (en) 2019-12-24 2019-12-24 Pregnant sow body size calculation method based on TOF depth data

Country Status (1)

Country Link
CN (1) CN111166338B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113180640A (en) * 2021-04-30 2021-07-30 山东大学 Size measuring method and system for livestock breeding

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101144705A (en) * 2007-07-25 2008-03-19 中国农业大学 Method for monitoring pig growth using binocular vision technology
US20130064432A1 (en) * 2010-05-19 2013-03-14 Thomas Banhazi Image analysis for making animal measurements
CN103884280A (en) * 2014-03-14 2014-06-25 中国农业大学 Mobile system for monitoring body sizes and weights of pigs in multiple pigsties
CN107464249A (en) * 2017-06-13 2017-12-12 内蒙古农业大学 A kind of sheep only contactless body measurement method
CN108230290A (en) * 2016-12-15 2018-06-29 广东技术师范学院 Live pig body ruler detection method based on stereoscopic vision
CN108682000A (en) * 2018-02-12 2018-10-19 中国农业大学 The long body width detecting method of pig body based on Kinect videos
CN109288176A (en) * 2018-11-02 2019-02-01 北京遥测技术研究所 A kind of method of cutting the garment according to the figure based on millimeter wave
US20190150405A1 (en) * 2016-04-28 2019-05-23 Osaka University Health condition estimation device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101144705A (en) * 2007-07-25 2008-03-19 中国农业大学 Method for monitoring pig growth using binocular vision technology
US20130064432A1 (en) * 2010-05-19 2013-03-14 Thomas Banhazi Image analysis for making animal measurements
CN103884280A (en) * 2014-03-14 2014-06-25 中国农业大学 Mobile system for monitoring body sizes and weights of pigs in multiple pigsties
US20190150405A1 (en) * 2016-04-28 2019-05-23 Osaka University Health condition estimation device
CN108230290A (en) * 2016-12-15 2018-06-29 广东技术师范学院 Live pig body ruler detection method based on stereoscopic vision
CN107464249A (en) * 2017-06-13 2017-12-12 内蒙古农业大学 A kind of sheep only contactless body measurement method
CN108682000A (en) * 2018-02-12 2018-10-19 中国农业大学 The long body width detecting method of pig body based on Kinect videos
CN109288176A (en) * 2018-11-02 2019-02-01 北京遥测技术研究所 A kind of method of cutting the garment according to the figure based on millimeter wave

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
OLE-JOHANNES H.N. GRYMYR 等: "Assessment of 3D motion increases the applicability of accelerometers for monitoring left ventricular function", 《INTERACTIVE CARDIOVASCULAR AND THORACIC SURGERY》 *
李卓 等: "基于深度图像的猪体尺检测***", 《猪业观察》 *
苑飞燕: "基于TOF深度数据的妊娠母猪体尺识别方法研究", 《中国优秀博硕士学位论文全文数据库(硕士)农业科技辑》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113180640A (en) * 2021-04-30 2021-07-30 山东大学 Size measuring method and system for livestock breeding

Also Published As

Publication number Publication date
CN111166338B (en) 2022-04-08

Similar Documents

Publication Publication Date Title
CN111243005B (en) Livestock weight estimation method, apparatus, device and computer readable storage medium
CN103913131B (en) Free curve method vector measurement method based on binocular vision
CN110986788A (en) Automatic measurement method based on three-dimensional point cloud livestock phenotype body size data
WO2022213612A1 (en) Non-contact three-dimensional human body size measurement method
CN106890031B (en) Marker identification and marking point positioning method and operation navigation system
CN112262408A (en) Method and apparatus for characterizing a living specimen from a distance
JP7049657B2 (en) Livestock weight estimation device and livestock weight estimation method
CN103793905B (en) Determine the method and device in brain image Coronal direction
CN110490161B (en) Captive animal behavior analysis method based on deep learning
CN112825791B (en) Milk cow body condition scoring method based on deep learning and point cloud convex hull characteristics
CN111754553A (en) Multi-modal scanning image registration method and device, computer equipment and storage medium
CN113470106B (en) Non-contact cow body size information acquisition method
EP4233782A1 (en) Oral image processing device and oral image processing method
CN111166338B (en) Pregnant sow body size calculation method based on TOF depth data
CN111768418A (en) Image segmentation method and device and training method of image segmentation model
CN113627425A (en) Hair follicle identification and extraction method and system based on neural network model
Li et al. A posture-based measurement adjustment method for improving the accuracy of beef cattle body size measurement based on point cloud data
CN108682000B (en) Pig body length and body width detection method based on Kinect video
US20100284588A1 (en) System and Method for Candidate Generation and New Features Designed for the Detection of Flat Growths
CN104809688B (en) Sheep body body measurement method and system based on affine transformation registration Algorithm
CN116071417B (en) Sheep body ruler weight acquisition system and method based on Azure Kinect
CN109087357A (en) Scan orientation method, apparatus, computer equipment and computer readable storage medium
Liu et al. Estimation of weight and body measurement model for pigs based on back point cloud data
CN112545537A (en) Head shadow measurement tracing graph generation method and system
CN113610726B (en) Improved cubic B-spline interpolation repairing method for region limitation

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
GR01 Patent grant
GR01 Patent grant