CN110782467B - Horse body ruler measuring method based on deep learning and image processing - Google Patents

Horse body ruler measuring method based on deep learning and image processing Download PDF

Info

Publication number
CN110782467B
CN110782467B CN201911016728.2A CN201911016728A CN110782467B CN 110782467 B CN110782467 B CN 110782467B CN 201911016728 A CN201911016728 A CN 201911016728A CN 110782467 B CN110782467 B CN 110782467B
Authority
CN
China
Prior art keywords
horse body
horse
formula
mask
measurement
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.)
Active
Application number
CN201911016728.2A
Other languages
Chinese (zh)
Other versions
CN110782467A (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.)
Xinjiang Agricultural University
Original Assignee
Xinjiang 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 Xinjiang Agricultural University filed Critical Xinjiang Agricultural University
Priority to CN201911016728.2A priority Critical patent/CN110782467B/en
Publication of CN110782467A publication Critical patent/CN110782467A/en
Application granted granted Critical
Publication of CN110782467B publication Critical patent/CN110782467B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/12Edge-based segmentation
    • 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
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • 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
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

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)
  • Measurement Of The Respiration, Hearing Ability, Form, And Blood Characteristics Of Living Organisms (AREA)

Abstract

The invention relates to the technical field of image processing, in particular to a horse body ruler measuring method based on deep learning and image processing, which comprises the following steps: YOLACT segmentation, preprocessing of horse segmentation images, calibration of horse body ruler measurement points, and Ma Tiche measurement. Based on the YOLACT example segmentation technology, the rapid and high-performance segmentation of the horse body and the background is completed; providing a measuring point calibration method of the dynamic grid, and completing the data calibration of the characteristic points of the horse body ruler; adopting a regression multiple linear regression mode to complete data fitting and three-dimensional prediction of chest circumference and tube circumference in horse body ruler data, taking 640 x 480 two Ili horse body images as examples, and quantitatively obtaining a body ruler measurement result; the results show that the automatic measurement of the Ili Ma Tiche can be effectively performed and the error can be controlled in a smaller range based on the deep learning and image measurement technology, and the research has an exemplary reference meaning in terms of the body scale measurement technology of large-size animals.

Description

Horse body ruler measuring method based on deep learning and image processing
Technical Field
The invention relates to the technical field of image processing, in particular to a horse body ruler measuring method based on deep learning and image processing.
Background
The horse body ruler data is an important basis for measuring the growth and development of horses and scientifically feeding and breeding the horses. The horse body measurement technology based on deep learning mainly solves the problem of effective segmentation of the horse body and the background. YOLACT is a simpler method for implementing instance segmentation in a full convolutional network, and the method is applicable to different instance segmentation scenes by virtue of the technical advantages of rapidness, easiness in generalization, high-quality mask generation and the like. The method is adopted in the process of target detection and background segmentation of the horse body, and the segmentation performance of the horse body on an MS-COCO data set is firstly seen; secondly, the horse field target detection object and the environment are relatively single, the dynamic stability of the target image is not required, the detection precision is relatively low, and the method meets the basic requirements of horse body target detection and background segmentation in terms of low loss rate of the image subjected to instance segmentation by the YOLACT.
At present, the horse cultivation mode of a large-scale horse field is more in free-range cultivation, the background of a grassland, houses, other buildings, even cultivation personnel and the like are inevitably brought in when the image information of the horse body is acquired, the measurement of the horse body ruler data by the existing means is not accurate enough, the error is large, and therefore the horse body ruler measurement method based on deep learning and image processing is provided.
Disclosure of Invention
In order to solve the problems, the invention provides a horse body ruler measuring method based on deep learning and image processing.
The invention solves the technical problems by adopting the following technical scheme:
a horse body ruler measuring method based on deep learning and image processing comprises the following steps:
step 1, splitting YOLACT: YOLACT decomposes the segmentation problem into two parallel processes, generates a "mask coefficient" and a "prototype mask" respectively by using a fully connected fc layer that is good at generating semantic vectors and a convolved conv layer that is good at generating spatial coherence masks, combines the mask and the predicted corresponding coefficients linearly, and cuts through the predicted b-box to realize mask synthesis, which is realized by single matrix multiplication in computation;
step 2, preprocessing a horse body segmentation image: obtaining a blue transparent horse body mask through YOLACT segmentation, changing the blue transparent mask into a white mask and a black mask, performing exclusive OR operation on the white mask and the black mask to remove the background, and performing dot multiplication on the white mask and the black mask to obtain a preprocessed horse body measurement model;
step 3, calibrating a measuring point of the horse body ruler: firstly, carrying out horse body edge detection, carrying out contour extraction on an Ili horse body image segmented by a YOLACT example by using a canny operator, carrying out Harris corner detection of horse body measuring points on the basis of horse body edge detection, and then searching key nodes of a horse body ruler by adopting a corner detection method;
measurement of step 4, ma Tiche:
1) High acquisition:
for horses with different standing postures and different body types, the calibration of each measuring point in the dynamic grid is based on the change of the average pixel value in the contour image, and the calculation mode is shown in the formula 1:
Figure GDA0004188070560000021
further, hu is expressed as a dynamic average of the ordinate of the pixel above the Hm average line, calculated as shown in the equation
Formula 2:
Figure GDA0004188070560000022
and Ht is the dynamic average value of the ordinate of the pixel above the Hu average value line, and the calculation is shown in formula 3:
Figure GDA0004188070560000023
the nail vertex a for calibrating the body height is just obtained by the intersection point of Ht and the horse body contour, and meanwhile, the distance from the nail vertex to the straight line Hb where the front foot and the rear foot are located is the height of the horse body, as shown in formula 4:
Figure GDA0004188070560000031
wherein ax+by+c=0 represents the line connecting the forefoot and hindfoot bottoms of the equina;
2) Obtaining the body length:
the Wm line in the dynamic grid represents the mean value of the abscissa of the pixel points of the horse body, and the calculation is shown in formula 5:
Figure GDA0004188070560000032
further, wu lines in the dynamic grid represent bisectors of Wm and its right boundary line in the hydrodynamic grid, and the calculation is shown in formula 6:
Figure GDA0004188070560000033
wherein the horse face is horizontal to the left with flag=1 and to the right with flag= -1;
in the calculation of the body length of the horse body, the buttock endpoint B is exactly obtained by the intersection point of Hu and the tail of the outline of the horse body; the anterior sternal edge point C is defined as the point with larger ordinate in the intersection point of Wu and its contour, and the calculation of the body length is the euclidean distance between the hip end point and the anterior sternal edge point, as shown in formula 7:
Figure GDA0004188070560000034
wherein (x) B ,y B ) Is the coordinates of the buttock end points, (x) C ,y C ) Is the sternum front edge point coordinates;
3) Correction of body length:
from A (x) 1 The straight line L determined by y 1) and B (x 1, y 1) represents the central line of the horse body, which is parallel to the connecting line ax+by+c=0 of the forefoot and the rearfoot of the horse body and forms an included angle with the camera plane L, wherein the relation among the parameters is represented by formula 8:
Figure GDA0004188070560000041
/>
the body length value length obtained according to the formula 7 is brought into the formula 9, and a correction value len_adjust of the body length can be obtained;
Figure GDA0004188070560000042
4) Acquisition of chest circumference diameter:
compared with two-dimensional data of body height and body length, the chest circumference and tube circumference indexes of the horse body are more difficult to obtain based on the plane image, and two plane indexes with stronger correlation are introduced for the chest circumference and tube circumference indexes: the chest circumference diameter and the tube circumference diameter are used for predicting the chest circumference and the tube circumference of the later-period horse body;
the diameter of the chest circumference is introduced to use the strong correlation between the diameter of the chest circumference and the chest circumference, namely, the calibrated measuring points of the diameter of the chest circumference and the chest circumference are overlapped in the plane image of the horse body; the ordinate spacing between the intersection point of the straight line Wm and the contour is the chest circumference diameter d 1 As shown in equation 10:
Figure GDA0004188070560000043
5) Obtaining the diameter of the tube periphery:
in the calculation of the tube diameter, a dynamic grid line Hg is required to be found, namely, the intersection point of one third of the upward position of the sole and the contour of the front foot and the rear foot, and the minimum value is obtained from the intersection point, namely, the tube diameter, as shown in a formula 11:
Figure GDA0004188070560000044
wherein->
Figure GDA0004188070560000045
Preferably, the Harris corner detection of the horse body measuring point is based on the detection of the edge of the horse body, and a common Harris corner detection method is used for screening candidate measuring points in the design; by adjusting the blockSize parameter and the ksize parameter of the corner detection, when more corners are obtained by adjusting the parameters, the measuring points and the non-measuring points required by measurement cannot be well distinguished; otherwise, when the angular points are fewer, part of the measuring points are lost.
Compared with the prior art, the invention has the beneficial effects that: according to the method for measuring the horse body ruler based on the deep learning and the image processing, provided by the invention, the research on key technology in the measurement of the horse body ruler is completed through the image acquisition of the horse field and the field measurement; based on the YOLACT example segmentation technology, the rapid and high-performance segmentation of the horse body and the background is completed; providing a measuring point calibration method of the dynamic grid, and completing the data calibration of the characteristic points of the horse body ruler; adopting a regression multiple linear regression mode to complete data fitting and three-dimensional prediction of chest circumference and tube circumference in horse body ruler data, taking 640 x 480 two Ili horse body images as examples, and quantitatively obtaining a body ruler measurement result; the results show that the automatic measurement of the Ili Ma Tiche can be effectively performed and the error can be controlled in a smaller range based on the deep learning and image measurement technology, and the research has an exemplary reference meaning in terms of the body scale measurement technology of large-size animals.
Drawings
FIG. 1 is a block diagram of a problem decomposition principle of YOLACT;
FIG. 2 is an effect flow diagram of an example split of a horse body;
FIG. 3 is a flow chart of example segmentation and preprocessing;
FIG. 4 is a graph showing the comparison of the effect of edge detection of a horse body;
FIG. 5 is a schematic illustration of calibration of the body ruler measurement points;
FIG. 6 is a linear graph of a data correction function for body length;
FIG. 7 is a calibration of the body scale feature measurement points.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, are intended to fall within the scope of the present invention.
A preferred embodiment is provided below:
as shown in fig. 1, YOLACT decomposes the segmentation problem into two parallel processes, generates "mask coefficients" and "prototype masks" respectively using the fully connected fc layer that is good at generating semantic vectors and the convolved conv layer that is good at generating spatially coherent masks, combines the masks and predicted corresponding coefficients linearly, and cuts through the predicted b-box to achieve mask synthesis, which is achieved by single matrix multiplication in the computation; therefore, the example segmentation method maintains airspace consistency in the horse body characteristic space, and meets the rapid segmentation requirement of horse body target detection; taking image segmentation of Ili horses as an example, the method of YOLACT was used to complete the detection of the horse body target and background segmentation on the trained MS-COCO dataset as shown in FIG. 2.
In a front-end network for YOLACT target detection, the information quantity of a low-level characteristic diagram is less, but the characteristic diagram is larger, so that the method is suitable for detecting a target position accurately and identifying some small objects easily; the information quantity of the high-level characteristic map is rich, but the target position is rough, so that the detection performance of the small object is rapidly reduced; the feature map of the bottom layer is used for detecting smaller targets, the feature map of the top layer is used for detecting larger targets, and the detection performance requirement of the feature map of the top layer is relatively high for the detection of the illite horse body image of a single target.
As a backbone network of the YOLACT detector, a prediction structure adopts a network structure of ResNet-101 with FPN in RetinaNet, and in a typical target detection algorithm based on Anchor, a prediction head usually has two branches, one branch is used for obtaining category confidence and the other branch is used for carrying out bounding box regression; adding a third branch to YOLACT, predicting K mask coefficients for each prototype; in the horse body image segmentation experiment, the prototype is subtracted from the final mask to obtain the segmentation effect of fig. 2, and stable output is generated in nonlinear calculation.
Based on the YOLACT target detection and example segmentation method, preprocessing is carried out on a horse body image with standard standing posture and relatively simple background after segmentation, as shown in figure 3; in fig. 3, based on the horse body mask formed after YOLACT segmentation, in the experiment, the blue transparent mask in the graph (a) is changed into white and black, as shown in (b) and (c), and the background is removed through the exclusive or operation of the graph (b) and the graph (c), and then the graph (d) is obtained by multiplying the original graph, thereby completing the preprocessing of the horse body measurement model.
According to the local standard issued by Xinjiang horse industry association, main measurement indexes of the horse body ruler comprise height, body length, chest circumference, tube circumference and the like, wherein the Ma Tixiang related parts comprise: the hip end point, the anterior sternum edge point, the apex of the fat nail, the posterior shoulder and foot bones, 1/3 of the left anterior canal portion, etc., specifically, the height refers to the vertical distance from the apex of the fat nail to the ground; body length refers to the linear distance from the anterior sternal edge point to the hip end point; the chest circumference refers to the length of the rear edge of the shoulder and foot bones vertically wound around the chest for one week; the tube circumference is the length of the left front tube part which is horizontally wound around the narrowest part of the lower end of 1/3 part.
According to observation, measuring points required by the calibration of the horse body ruler are distributed on the edge outline of the horse body, and in order to obtain the measuring points of the horse body ruler, edge detection of the horse body is required; contour extraction is performed on the Ili horse body image segmented by the Yolact example by using a canny operator, and the effect is shown in fig. 4.
On the basis of horse body edge detection, a common Harris corner detection method is used in the design to screen out candidate measuring points; by adjusting the blockSize parameter and the ksize parameter of the corner detection, when more corners are obtained by adjusting the parameters, the measuring points and the non-measuring points required by measurement cannot be well distinguished; otherwise, when the angular points are fewer, part of the measuring points are lost.
In addition, the Ma Tiche measurement points are mostly concentrated in the detected angular points, but in view of the diversification of the body types and the postures of the horse, the screening of the measurement points in the angular points and the design of a more universal screening template are still difficult.
In summary, the key nodes of the horse body ruler are found by adopting the angular point detection method, the operability is not strong, the complexity is high, and the design adopts the dynamic grid method to partially solve the problem of finding the measuring points in the measurement of the horse body.
1) High access
For horses with different standing postures and different body types, the calibration of each measuring point in the dynamic grid is based on the change of average pixel values in the contour image. As shown in fig. 5, a horizontal middle horizontal line Hm represents a dynamic average value of the ordinate of the pixel point of the horse body, and the calculation mode is shown in formula 1:
Figure GDA0004188070560000081
further, hu is expressed as a dynamic average of the ordinate of the pixel above the Hm average line, calculated as shown in the equation
Represented by formula 2; and Ht is the dynamic average value of the ordinate of the pixel above the Hu average value line, and the calculation is shown in a formula 3.
Figure GDA0004188070560000082
Figure GDA0004188070560000083
Wherein the formazan vertex A for the nominal height is exactly the intersection of Ht with the horse body contour. Meanwhile, according to the distance from the top of the nail to the straight line Hb where the lowest points of the front foot and the rear foot are located, the distance is the height of the horse body, as shown in a formula 4.
Figure GDA0004188070560000084
Where ax+by+c=0 represents the line connecting the forefoot and hindfoot bottoms of the horses.
2) Acquisition of body length
As shown in fig. 5, wm lines in the dynamic grid represent the mean value of the abscissa of the pixel points of the horse body, and the calculation is shown in formula 5:
Figure GDA0004188070560000085
further, wu lines in the dynamic grid represent bisectors of Wm and its right boundary line in the hydrodynamic grid, and the calculation is shown in formula 6:
Figure GDA0004188070560000086
wherein the horse face is horizontally oriented left with flag=1 and right with flag=1.
As shown in fig. 5, in the calculation of the body length of the horse body, the hip endpoint B is obtained from the tail intersection point of Hu and the horse body contour; the anterior sternal edge point C is defined as the point with the larger ordinate of the intersection point of Wu and its contour, and the calculation of the body length is the euclidean distance between the hip end point and the anterior sternal edge point, as shown in formula 7.
Figure GDA0004188070560000091
Wherein (x) B ,y B ) Is the coordinates of the buttock end points, (x) C ,y C ) Is the sternum anterior edge point coordinates.
(3) Correction of body length
In fig. 5, it is easy to see that the standing posture of the horse body is not parallel to the camera, the pixel value of the body length is smaller than the actual value, and data correction is required, and the correction method is shown in fig. 6. .
In fig. 6, the reference value of a (x 1 The straight line L determined by y 1) and B (x 1, y 1) represents the central line of the horse body, which is parallel to the connecting line ax+by+c=0 of the forefoot and the rearfoot of the horse body and forms an included angle with the camera plane L, wherein the relation among the parameters is represented by formula 8.
Figure GDA0004188070560000092
The body length value length obtained according to the formula 7 is brought into the formula 9, and the correction value len_adjust of the body length can be obtained.
Figure GDA0004188070560000093
(4) Acquisition of chest circumference diameter
Compared with two-dimensional data of body height and body length, the chest circumference and tube circumference indexes of the horse body are more difficult to obtain based on the plane image, and two plane indexes with stronger correlation are introduced for the chest circumference and tube circumference indexes: the chest circumference diameter and the tube circumference diameter are used for predicting the chest circumference and the tube circumference of the later-period horse body.
In the design, the diameter of the chest circumference is introduced to use the strong correlation between the diameter of the chest circumference and the chest circumference, namely, the calibrated measuring points of the two are overlapped in the plane image of the horse body. As shown in FIG. 5, the ordinate spacing between the intersection of the straight line Wm and the contour is the bust diameter d 1 As shown in formula 10, the value of the measurement has the strongest correlation with the chest circumference data in the actual measurement.
Figure GDA0004188070560000101
(5) Acquisition of tube diameter
Likewise, the diameter of the tube is introduced in the design in a strong correlation with the tube, namely, the two have identical measuring points in the measurement of the horse tube. As shown in fig. 5, in the calculation of the tube diameter, it is necessary to find a dynamic grid line Hg, that is, an intersection point between the upper third of the sole and the contour of the forefoot and the rear foot, and obtain the minimum value from the intersection point, that is, the tube diameter, as shown in formula 11.
Figure GDA0004188070560000102
Wherein->
Figure GDA0004188070560000103
Body ruler measurement experiments were performed on two ilow horses with image pixels 640 x 480:
based on the above horse body image segmentation, contour extraction and calibration technology of the characteristic measuring points, body ruler measurement is carried out on two Ili horses with 640 x 480 image pixels, and the characteristic measuring points are obtained as shown in fig. 7.
The measurement point data of the two horses obtained according to the body scale characteristic measurement points obtained in fig. 7 are shown in table 1:
TABLE 1 horse body test point data (Unit: pixels)
Figure GDA0004188070560000104
Based on the pixel data in table 1, according to the multiple matching of the manual test and the horse body image pixels, the ratio of 1:1.21 is selected to perform the same-ratio reduction of the pixel data, and the comparison result of the measured data and the measured value of Ma Tiche is shown in table 2:
table 2 comparison of the measurements of the horse body ruler (ratio 1:1.21)
Figure GDA0004188070560000105
Figure GDA0004188070560000111
3.2 data fitting and model prediction
According to the measurement standard of the horse body ruler data, three-dimensional body ruler indexes such as chest circumference and tube circumference measurement have no measurement basis of plane images. The chest dimension diameter and tube circumference diameter indexes introduced in the previous design aim to establish a prediction model of chest circumference and tube circumference by utilizing the correlation of data. Taking the manual measurement data of 100 Ili horses as a sample, the chest circumference and tube circumference prediction model of the body ruler is completed as follows:
(1) Predictive model of chest circumference
In order to obtain a good prediction effect, prediction of the horse chest circumference data is completed by adopting two multiple regression modes, namely Regress and polynominal in the experiment, and the prediction results are shown in table 3.
Table 3 chest circumference prediction results
Figure GDA0004188070560000112
According to Table 3, it is desirable to select the regression model with smaller error for the bust prediction. The regression equation for the chest circumference is shown in equation 12:
Y1=30.6138+0.5367*h+0.4292*w-0.1086*d (12)
wherein Y1 is the chest circumference, h is the height, w is the body length, and d is the chest circumference diameter.
(2) Pipe circumference prediction model
Similarly, the experiments completed prediction of the horse body circumference data by regression and polynominal regression, and the prediction results are shown in table 4.
TABLE 4 pipe circumference prediction results
Figure GDA0004188070560000113
Figure GDA0004188070560000121
As can be seen from table 4, in order to effectively control the measurement error within 5%, the regression model is still selected to predict the tube periphery more desirably, and the regression equation of the tube periphery is shown in formula 13:
Y2=8.3775+0.0009*h+0.081*w-0.1231*c (13)
wherein Y2 is the tube periphery, h is the body height, w is the body length, and c is the tube periphery diameter.
Conclusion 4
The key technical research of four indexes in the measurement of the horse body ruler is completed by taking the Ili horse body as a research object and collecting images of the horse body and manual measurement data of the horse body ruler.
The experiment is based on a YOLACT example segmentation technology of deep learning, and the rapid and high-quality segmentation of the horse body image under a complex background is realized; secondly, a dynamic grid mode is provided for completing the data calibration of the characteristic measuring points of the horse body, the position and the body direction of the horse body in an image are predicted in real time, and the problem of body length correction caused by different standing postures is partially solved; and then adopting a multiple linear and nonlinear prediction mode of regress and Polynomial to compare and realize the prediction of the chest circumference and the tube circumference of the horse, and finally carrying out body size data measurement and error calculation on two Yili horse body samples, wherein each error is between 0.75% and 3.7%, and the technology is complete and has an example reference meaning for large animal body size measurement.
Although the invention has been described hereinabove with reference to embodiments, various modifications thereof may be made and equivalents may be substituted for elements thereof without departing from the scope of the invention. In particular, the features of the disclosed embodiments may be combined with each other in any manner as long as there is no structural conflict, and the exhaustive description of these combinations is not given in this specification merely for the sake of omitting the descriptions and saving resources. Therefore, it is intended that the invention not be limited to the particular embodiment disclosed, but that the invention will include all embodiments falling within the scope of the appended claims.

Claims (2)

1. The horse body ruler measuring method based on deep learning and image processing is characterized by comprising the following steps of:
step 1, splitting YOLACT: YOLACT decomposes the segmentation problem into two parallel processes, generates a "mask coefficient" and a "prototype mask" respectively by using a fully connected fc layer that is good at generating semantic vectors and a convolved conv layer that is good at generating spatial coherence masks, combines the mask and the predicted corresponding coefficients linearly, and cuts through the predicted b-box to realize mask synthesis, which is realized by single matrix multiplication in computation;
step 2, preprocessing a horse body segmentation image: obtaining a blue transparent horse body mask through YOLACT segmentation, changing the blue transparent mask into a white mask and a black mask, performing exclusive OR operation on the white mask and the black mask to remove the background, and performing dot multiplication on the white mask and the black mask to obtain a preprocessed horse body measurement model;
step 3, calibrating a measuring point of the horse body ruler: firstly, carrying out horse body edge detection, carrying out contour extraction on an Ili horse body image segmented by a YOLACT example by using a canny operator, carrying out Harris corner detection of horse body measuring points on the basis of horse body edge detection, and then searching key nodes of a horse body ruler by adopting a corner detection method;
measurement of step 4, ma Tiche:
1) High acquisition:
for horses with different standing postures and different body types, the calibration of each measuring point in the dynamic grid is based on the change of the average pixel value in the contour image, and the calculation mode is shown in the formula 1:
Figure QLYQS_1
further, hu is expressed as a dynamic average value of the ordinate of the pixel above the Hm average value line, and the calculation mode is shown in formula 2:
Figure QLYQS_2
and Ht is the dynamic average value of the ordinate of the pixel above the Hu average value line, and the calculation is shown in formula 3:
Figure QLYQS_3
the nail vertex a for calibrating the body height is just obtained by the intersection point of Ht and the horse body contour, and meanwhile, the distance from the nail vertex to the straight line Hb where the front foot and the rear foot are located is the height of the horse body, as shown in formula 4:
Figure QLYQS_4
wherein ax+by+c=0 represents the line connecting the forefoot and hindfoot bottoms of the equina;
2) Obtaining the body length:
the Wm line in the dynamic grid represents the mean value of the abscissa of the pixel points of the horse body, and the calculation is shown in formula 5:
Figure QLYQS_5
further, wu lines in the dynamic grid represent bisectors of Wm and its right boundary line in the dynamic grid, and the calculation is shown in formula 6:
Figure QLYQS_6
/>
wherein the horse face is horizontal to the left with flag=1 and to the right with flag= -1;
in the calculation of the body length of the horse body, the buttock endpoint B is exactly obtained by the intersection point of Hu and the tail of the outline of the horse body; the anterior sternal edge point C is defined as the point with larger ordinate in the intersection point of Wu and its contour, and the calculation of the body length is the euclidean distance between the hip end point and the anterior sternal edge point, as shown in formula 7:
Figure QLYQS_7
wherein (x) B ,y B ) Is the coordinates of the buttock end points, (x) C ,y C ) Is the sternum front edge point coordinates;
3) Correction of body length:
from A (x) 1 The straight line L determined by y 1) and B (x 1, y 1) represents the central line of the horse body, which is parallel to the connecting line ax+by+c=0 of the forefoot and the rearfoot of the horse body and forms an included angle with the camera plane L, wherein the relation among the parameters is represented by formula 8:
Figure QLYQS_8
the body length value length obtained according to the formula 7 is brought into the formula 9, and a correction value len_adjust of the body length can be obtained;
Figure QLYQS_9
4) Acquisition of chest circumference diameter:
compared with two-dimensional data of body height and body length, the chest circumference and tube circumference indexes of the horse body are more difficult to obtain based on the plane image, and two plane indexes with stronger correlation are introduced for the chest circumference and tube circumference indexes: the chest circumference diameter and the tube circumference diameter are used for predicting the chest circumference and the tube circumference of the later-period horse body;
the diameter of the chest circumference is introduced to use the strong correlation between the diameter of the chest circumference and the chest circumference, namely, the calibrated measuring points of the diameter of the chest circumference and the chest circumference are overlapped in the plane image of the horse body; the ordinate spacing between the intersection point of the straight line Wm and the contour is the chest circumference diameter d 1 As shown in equation 10:
Figure QLYQS_10
5) Obtaining the diameter of the tube periphery:
in the calculation of the tube diameter, a dynamic grid line Hg is required to be found, namely, the intersection point of one third of the upward position of the sole and the contour of the front foot and the rear foot, and the minimum value is obtained from the intersection point, namely, the tube diameter, as shown in a formula 11:
Figure QLYQS_11
2. the method for measuring the horse body ruler based on deep learning and image processing according to claim 1, wherein the method comprises the following steps: the Harris corner detection of the horse body measuring point is based on the horse body edge detection, and a common Harris corner detection method is used for screening candidate measuring points in the design; by adjusting the blockSize parameter and the ksize parameter of the corner detection, when more corners are obtained by adjusting the parameters, the measuring points and the non-measuring points required by measurement cannot be well distinguished; otherwise, when the angular points are fewer, part of the measuring points are lost.
CN201911016728.2A 2019-10-24 2019-10-24 Horse body ruler measuring method based on deep learning and image processing Active CN110782467B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911016728.2A CN110782467B (en) 2019-10-24 2019-10-24 Horse body ruler measuring method based on deep learning and image processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911016728.2A CN110782467B (en) 2019-10-24 2019-10-24 Horse body ruler measuring method based on deep learning and image processing

Publications (2)

Publication Number Publication Date
CN110782467A CN110782467A (en) 2020-02-11
CN110782467B true CN110782467B (en) 2023-05-30

Family

ID=69387298

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911016728.2A Active CN110782467B (en) 2019-10-24 2019-10-24 Horse body ruler measuring method based on deep learning and image processing

Country Status (1)

Country Link
CN (1) CN110782467B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111507985A (en) * 2020-03-19 2020-08-07 北京市威富安防科技有限公司 Image instance segmentation optimization processing method and device and computer equipment
CN111798456A (en) * 2020-05-26 2020-10-20 苏宁云计算有限公司 Instance segmentation model training method and device and instance segmentation method
CN111915565B (en) * 2020-07-03 2022-04-12 太原理工大学 Method for analyzing cracks of porcelain insulator of power transmission and transformation line in real time based on YOLACT algorithm
CN111862189B (en) * 2020-07-07 2023-12-05 京东科技信息技术有限公司 Body size information determining method, body size information determining device, electronic equipment and computer readable medium
CN112040132A (en) * 2020-09-09 2020-12-04 清华大学 Animal external feature obtaining method and device and computer equipment
CN113569865B (en) * 2021-09-27 2021-12-17 南京码极客科技有限公司 Single sample image segmentation method based on class prototype learning

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108805980A (en) * 2018-07-17 2018-11-13 新疆农业大学 A kind of horse body measurement system and data correcting method based on 3D
CN109655010A (en) * 2018-10-31 2019-04-19 上海畅联智融通讯科技有限公司 A kind of camera Dynamic Networks are formatted the method for taking the photograph object measurement

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6990221B2 (en) * 1998-02-07 2006-01-24 Biodiscovery, Inc. Automated DNA array image segmentation and analysis

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108805980A (en) * 2018-07-17 2018-11-13 新疆农业大学 A kind of horse body measurement system and data correcting method based on 3D
CN109655010A (en) * 2018-10-31 2019-04-19 上海畅联智融通讯科技有限公司 A kind of camera Dynamic Networks are formatted the method for taking the photograph object measurement

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
基于3D的马体尺测量及数据修正方法设计;张婧婧;李勇伟;;江苏农业科学(第21期) *
基于机器视觉的枸杞枝条识别方法研究;田志超;刘玉萍;李娟;朱学岩;;计算机测量与控制(第09期) *
基于机器视觉的马体尺测量***设计与研究;张婧婧;李勇伟;;计算机测量与控制(第12期) *

Also Published As

Publication number Publication date
CN110782467A (en) 2020-02-11

Similar Documents

Publication Publication Date Title
CN110782467B (en) Horse body ruler measuring method based on deep learning and image processing
CN110443836B (en) Point cloud data automatic registration method and device based on plane features
Sun et al. Three-dimensional photogrammetric mapping of cotton bolls in situ based on point cloud segmentation and clustering
Yu et al. Segmentation and measurement scheme for fish morphological features based on Mask R-CNN
Müller-Linow et al. The leaf angle distribution of natural plant populations: assessing the canopy with a novel software tool
Gené-Mola et al. In-field apple size estimation using photogrammetry-derived 3D point clouds: Comparison of 4 different methods considering fruit occlusions
Peña et al. Estimating tree height and biomass of a poplar plantation with image-based UAV technology
CN108918820B (en) Method and device for acquiring graded distribution of salinization degree of farmland soil
Lati et al. Plant growth parameter estimation from sparse 3D reconstruction based on highly-textured feature points
CN111429490A (en) Agricultural and forestry crop three-dimensional point cloud registration method based on calibration ball
Yang et al. 3D reconstruction method for tree seedlings based on point cloud self-registration
CN110610438B (en) Crop canopy petiole included angle calculation method and system
Harandi et al. How to make sense of 3D representations for plant phenotyping: a compendium of processing and analysis techniques
Xiang et al. PhenoStereo: a high-throughput stereo vision system for field-based plant phenotyping-with an application in sorghum stem diameter estimation
CN116883480A (en) Corn plant height detection method based on binocular image and ground-based radar fusion point cloud
Niknejad et al. Phenotyping of architecture traits of loblolly pine trees using stereo machine vision and deep learning: Stem diameter, branch angle, and branch diameter
CN113554691B (en) Plant height measuring method
CN117115669B (en) Object-level ground object sample self-adaptive generation method and system with double-condition quality constraint
CN111814666A (en) Single tree parameter extraction method, system, medium and equipment under complex forest stand
CN116763295A (en) Livestock scale measuring method, electronic equipment and storage medium
CN116051537A (en) Crop plant height measurement method based on monocular depth estimation
Zhu et al. Stem-leaf segmentation and phenotypic trait extraction of maize shoots from three-dimensional point cloud
Li et al. Nondestructive Detection of Key Phenotypes for the Canopy of the Watermelon Plug Seedlings Based on Deep Learning
Li et al. Automatic reconstruction and modeling of dormant jujube trees using three-view image constraints for intelligent pruning applications
Chimwai et al. Fresh Weight Estimation of Lettuce Using 3D Stereoscopic Technique

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