A method for intelligent recognition of body size of a cow
Patent Information
- Application Number
- CN202311067902.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-23
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2043-08-23
AI Technical Summary
[0003]目前,而对于牛体型的测量却多为不便;人们往往采用摄像头采集测量,使用单目或双面摄像头匹配得到视差图像;使用的摄像头组数过多,对数据的采集不能做到精简、准确;尺寸计算过程较为繁琐
该牛体型尺寸智能识别方法,通过确定牛肩胛骨支撑平衡点和髋骨支撑平衡点的位置,然后计算两平衡点的间距,然后根据牛的骨骼比例,计算出牛的体直长、胸围及体高,该计算方式更为简单、准确。
Smart Images

Figure CN117115230B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of animal husbandry technology, specifically to a method for intelligent recognition of cattle body size. Background Technology
[0002] In animal husbandry, precision farming and genetic improvement are playing an increasingly prominent role. Body size parameters not only directly reflect the growth and development of cattle, but are also important indicators for cattle selection and meat quality evaluation in precision farming. As the scale of cattle breeding and farming grows larger, there is an urgent need to establish new, more efficient, accurate, and stress-free methods.
[0003] Currently, measuring the size of cattle is inconvenient; people often use cameras to collect measurements, using monocular or binocular cameras to obtain parallax images; too many camera groups are used, making data collection neither concise nor accurate; and the size calculation process is quite cumbersome.
[0004] Therefore, it is necessary to propose an intelligent method for recognizing the body size of cattle to solve the above problems. Summary of the Invention
[0005] (a) Technical problems to be solved The purpose of this invention is to provide an intelligent method for recognizing bovine body size, so as to solve the problems mentioned in the background art.
[0006] (II) Technical Solution To achieve the above objectives, the present invention provides the following technical solution: a method for intelligent recognition of bovine body size, comprising: Step 1: Install cameras on one side and above the cattle's walking path; Step 2: Calibrate the camera and obtain the conversion relationship between physical size and pixels; Step 3: Use two cameras to capture side and top views of the cow at a specific time and remove the background; Step 4: Count the total number of pixels in the side view image and divide it by the length of the horizontal coordinate of the side view image in the pixel coordinate system to obtain the average number of pixels. Step 5: Count the number of pixels within each unit length of the horizontal axis in the pixel coordinate system, and compare it with the average number of pixels to determine the horizontal axis interval where the cow's limbs are located. Step 6: Calculate the average value u1 of the two forelimb horizontal coordinate intervals and the average value u2 of the two hindlimb horizontal coordinate intervals in the side view image of the pixel coordinate system; Step 7: The distance between the scapular support balance point and the hip support balance point of the cow is i = (u2 - u1)(1 + k1), and the straight body length of the cow is L = iP1, where k1 is the compensation value, and P1 is the conversion relationship between the physical size of the side-shot camera and the pixels. The compensation value k1 is determined according to the skeletal proportion of the cow, and 0.3 ≤ k1 ≤ 0.4.
[0007] Furthermore, calculating a cow's chest circumference involves the following steps: The chest circumference measurement position is determined, that is, the position of the body at the posterior angle of the scapula. Its horizontal coordinate in the pixel coordinate system is u3=u1+ik2, and k2 is determined according to the skeletal proportion of cattle, wherein 0.19≤k2≤0.26; Based on the x-coordinate of the chest measurement location, calculate the difference in y-coordinate between the two endpoint pixels at the chest circumference in the cow's side profile image, i.e., a = |v2 - v1|. Based on the proportional relationship between the side view image and the top view image, determine the horizontal coordinate u3′ of the chest circumference in the top view image of the cow, and then calculate the difference in the vertical coordinates of the two endpoint pixels of the chest circumference in the top view image of the cow, i.e., b=|f2-f1|. The cow's chest circumference is B=k3(bP2π / 2+aP1-bP2), where k3 is determined based on the outline shape of the cow's chest circumference, and P2 is the conversion relationship between the physical size of the overhead camera and pixels. The formula 0.95≤k3≤1.1 is used.
[0008] Furthermore, the calculation of the cow's height includes the following steps: Determine the height measurement position, that is, the vertical height from the highest point of the hairline to the ground; Compare the ordinates of all pixels within the x-coordinate interval of the cow's forelimb in the pixel coordinate system, and obtain the pixel t(u) with the largest ordinate within that interval. t v t ); Get the coordinates of the pixel with the largest ordinate among all x-coordinates within a radius r of centered at pixel t; Calculate the average value of the y-coordinates of the pixels obtained above. ; The height of a cow is H = P1(v) 平 -h1), where h1 is the pixel height of the ground in the image.
[0009] Furthermore, the [u] t -r,u t +r] is within the x-coordinate interval of the two forelimbs.
[0010] (III) Beneficial Effects Compared with existing technologies, the present invention provides a method for intelligent identification of bovine body size, which has the following beneficial effects: This intelligent method for recognizing cattle body size determines the positions of the scapula and hip support balance points, calculates the distance between the two balance points, and then calculates the cattle's body length, chest circumference, and height based on the cattle's skeletal proportions. This calculation method is simpler and more accurate. Attached Figure Description
[0011] Figure 1 This is a schematic diagram of embodiment 1 of the present invention; Figure 2 This is a side view schematic diagram of Embodiment 2 of the present invention; Figure 3 This is a top view schematic diagram of Embodiment 2 of the present invention; Figure 4 This is a schematic diagram of Embodiment 3 of the present invention. Detailed Implementation
[0012] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.
[0013] Example 1 Please see Figure 1 As shown, a method for intelligent recognition of cattle body size. The calculation of the straight length of a cow's body includes the following steps: Cameras are positioned on one side and above the cattle's walking path. The side-view camera should shoot horizontally, and the pixel height h1 occupied by the cattle's walking path in the captured image should be determined. Both cameras should be within a suitable shooting range to ensure that the captured image is clear and free from distortion.
[0014] The camera is calibrated to obtain the conversion relationship between physical size and pixels. The conversion relationship for the side-shot camera is P1, and the conversion relationship for the top-shot camera is P2.
[0015] Two cameras are used to capture side and top views of the cow standing still, and the background is removed. When the cow is standing still and maintaining its balance, its two forelimbs are symmetrically distributed with the cow's shoulder blades as the balance point, and its two hindlimbs are symmetrically distributed with the hip bones as the balance point. Preferably, a color that is significantly different from the cow's color is used as the background when shooting.
[0016] The average number of pixels, m, is obtained by counting all pixels in the side profile image and dividing by the length of the horizontal coordinate of the side profile image in the pixel coordinate system. 平 .
[0017] Count the number of pixels m within each unit length of the horizontal axis in the pixel coordinate system. u And compare it with the average number of pixels to determine the horizontal coordinate range where the cow's limbs are located; Specifically, because the number of pixels per unit length in the cow's abdomen is greater than m 平 To avoid error m u -m 平 >z, where z is determined based on the size of the cow, and z is greater than the number of pixels per unit length in the cow's abdomen and m. 平 The difference.
[0018] Calculate the average value u1 of the two forelimb x-coordinate intervals and the average value u2 of the two hindlimb x-coordinate intervals in the side view image in pixel coordinate system.
[0019] The distance between the scapular support balance point and the hip support balance point of the cow is i = (u2 - u1) · (1 + k1), and the straight body length of the cow is L = iP1, where k1 is the compensation value and P1 is the conversion relationship between the physical size of the side-shot camera and the pixels. The compensation value k1 is determined according to the skeletal proportion of the cow. Since the skeletal proportions of different breeds of cattle are different, the range of k1 is set to 0.3 ≤ k1 ≤ 0.4.
[0020] In this embodiment, the positions of the cow's scapula support balance point and hip support balance point are determined, the distance between the two balance points is calculated, and then the cow's body length is calculated based on the cow's skeletal proportions. This calculation method is simpler and more accurate.
[0021] Example 2 Please see Figure 2-3 As shown, this embodiment is based on Embodiment 1, and calculates the chest circumference of a cow, specifically including the following steps: The chest circumference measurement position is determined, which is the position of the body at the posterior angle of the scapula. Its horizontal coordinate in the pixel coordinate system is u3=u1+ik2, and k2 is determined according to the skeletal proportion of cattle, wherein 0.19≤k2≤0.26.
[0022] Based on the x-coordinate of the chest measurement location, calculate the difference in y-coordinate between the two endpoint pixels at the chest circumference in the cow's side profile image, i.e., a = |v2 - v1|.
[0023] Based on the proportional relationship between the side view and the top view, the horizontal coordinate u3′ of the chest circumference in the top view of the cow is determined. Then, the difference in the vertical coordinates of the two endpoint pixels of the chest circumference in the top view of the cow is calculated, i.e., b=|f2-f1|.
[0024] The cow's chest circumference is B = k3(bP2π / 2 + aP1 - bP2), where k3 is determined based on the outline shape of the cow's chest circumference. The outline shape of the chest circumference is related to the breed of cow, so the value range of k3 is set to 0.95 ≤ k3 ≤ 1.1. P2 is the conversion relationship between the physical size of the overhead camera and pixels.
[0025] Example 3 Please see Figure 4As shown, this embodiment is based on Embodiment 1, and calculates the height of the cow, specifically including the following steps: Determine the height measurement position, that is, the vertical height from the highest point of the hairline to the ground.
[0026] Compare the ordinates of all pixels within the x-coordinate interval of the cow's forelimb in the pixel coordinate system, and obtain the pixel t(u) with the largest ordinate within that interval. t v t ).
[0027] Get the coordinates of the pixel with the largest ordinate among all x-coordinates within a radius r of pixel t as the center.
[0028] Calculate the average value of the y-coordinates of the pixels obtained above. .
[0029] The height of a cow is H = P1(v) 平 -h1), where h1 is the pixel height of the ground in the image.
[0030] Specifically, the [u] t -r,u t +r] is within the x-coordinate interval of the two forelimbs.
[0031] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for intelligent recognition of bovine body size, characterized in that, include: Step 1: Install cameras on one side and above the cattle's walking path; Step 2: Calibrate the camera and obtain the conversion relationship between physical size and pixels; Step 3: Use two cameras to capture side and top views of the cow at a specific time and remove the background; Step 4: Count the total number of pixels in the side view image and divide it by the length of the horizontal coordinate of the side view image in the pixel coordinate system to obtain the average number of pixels. Step 5: Count the number of pixels within each unit length of the horizontal axis in the pixel coordinate system, and compare it with the average number of pixels to determine the horizontal axis interval where the cow's limbs are located. Step 6: Calculate the average value u1 of the two forelimb horizontal coordinate intervals and the average value u2 of the two hindlimb horizontal coordinate intervals in the side view image of the pixel coordinate system; Step 7: The distance between the scapular support balance point and the hip support balance point of the cow is i = (u2 - u1)(1 + k1), and the straight body length of the cow is L = iP1, where k1 is the compensation value, and P1 is the conversion relationship between the physical size of the side-view camera and the pixels. The compensation value k1 is determined according to the skeletal proportion of the cow, and 0.3 ≤ k1 ≤ 0.
4. Step 8: Determine the height measurement position, that is, the vertical height from the highest point of the hairline to the ground; Compare the ordinates of all pixels within the x-coordinate interval of the cow's forelimb in the pixel coordinate system, and obtain the pixel t(u) with the largest ordinate within that interval. t v t ); Get the coordinates of the pixel with the largest ordinate among all x-coordinates within a radius r of centered at pixel t; Calculate the average value of the y-coordinates of the pixels obtained above. ; Where n is the x-coordinate of each unit length within a circle centered at pixel t and with radius r, n = u t r,u t r+1,…,u t +r;v n Let be the ordinate of the pixel with the largest ordinate within a unit length of x-coordinate n; N is the total number of x-coordinate units involved in the summation, N = 2r + 1; the height of the cow is H = P1(v 平 -h1), where h1 is the pixel height of the ground in the image.
2. The intelligent recognition method for bovine body size according to claim 1, characterized in that, The calculation of a cow's chest circumference includes the following steps: Determine the chest circumference measurement location, which is the position of the body at the posterior angle of the scapula. Its horizontal coordinate in the pixel coordinate system is u3=u1+ik2, and k2 is determined according to the skeletal proportions of cattle, 0.19≤k2≤0.26; Based on the x-coordinate of the chest measurement location, calculate the difference in y-coordinate between the two endpoint pixels at the chest measurement location in the cow's side profile image, i.e., a = |v2 - v1|; where v2 is the y-coordinate of the upper endpoint pixel of the cow's body at the chest measurement location in the cow's side profile image, and v1 is the y-coordinate of the lower endpoint pixel of the cow's body at the chest measurement location in the cow's side profile image. Based on the proportional relationship between the side view and the top view, the horizontal coordinate u3′ of the cow's chest circumference in the top view is determined. Then, the difference in the vertical coordinates of the two endpoint pixels at the chest circumference of the cow's chest circumference is calculated, i.e., b=|f2-f1|; where f1 is the vertical coordinate of the endpoint pixel with the smaller vertical coordinate among the two endpoint pixels of the cow's body contour at the horizontal coordinate u3′ in the top view, and f2 is the vertical coordinate of the endpoint pixel with the larger vertical coordinate among the two endpoint pixels of the cow's body contour at the horizontal coordinate u3′ in the top view. The cow's chest circumference is B = k3(bP2π / 2 + aP1 - bP2), where k3 is determined by the outline shape of the cow's chest, and P2 is the conversion relationship between the physical size of the overhead camera and pixels. 0.95 ≤ k3 ≤ 1.
1.
3. The intelligent recognition method for bovine body size according to claim 1, characterized in that: [u t -r,u t +r] is within the x-coordinate interval of the two forelimbs.
Citation Information
Patent Citations
Cow body size measurement system based on deep learning and feature part detection
CN109978937A
