A computer-aided automatic sheep identification and sheep body measurement device
By designing a computer-assisted automated sheep recognition and sheep body measurement device, using binocular cameras and computer vision methods, the problem of time-consuming and labor-intensive measurement of sheep body performance in sheep farming is solved, and efficient and accurate sheep body is achieved Measurement.
Patent Information
- Application Number
- CN201911132762.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-11-19
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2039-11-19
AI Technical Summary
In the current breeding of sheep, it takes time-consuming and labor-intensive to measure the performance of sheep, and the error is large, and the sheep are only prone to stress during manual measurement, which affects growth.
A computer-assisted automated sheep recognition and sheep body measurement device is designed, using a contactless, fully automated binocular camera and computer vision method, combined with infrared sensors and earmark identifiers to realize sheep body measurement.
The measurement of the sheep body ruler is fully automatic without contact within 10 seconds, with an accuracy of 97%-99%, reducing costs and improving efficiency and accuracy.
Smart Images

Figure CN110741964B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of sheep breeding management, and specifically to a computer-assisted automatic sheep identification and sheep body measurement device. Background Art
[0002] In sheep production, the physical performance of sheep is extremely important. It not only provides reference data for breeders to guide production more scientifically, but is also indispensable information in breeding work.
[0003] At present, the measurement of these data in China is mainly done by catching sheep, binding them and then manually measuring, or measuring with instruments. Sheep have the natural attribute of animals, that is, they are active, so they must be restrained when measuring. Therefore, manual measurement of live sheep is very time-consuming and labor-intensive, and the work efficiency is very low. It is also difficult to quickly and accurately find the location of each part of the sheep. If the location is inaccurate, the data will be distorted, resulting in large manual measurement errors. In addition, in the process of manually catching sheep, the sheep will experience stress, which is not conducive to their growth. At the same time, there are actual conditions in farms such as "expensive and difficult to employ, uneven standardization levels, and poor efficiency of indoor breeding".
[0004] Developing a fully automatic measurement system for sheep weight and size using mechanical, electronic communication, information and other technologies will greatly facilitate the measurement of body size performance and significantly improve the accuracy and efficiency of breeding. Therefore, designing a contactless, fully automated, easy-to-operate sheep body detection device that can improve efficiency is exactly the problem that the inventor wants to solve. Summary of the invention
[0005] In view of the shortcomings of the prior art, the purpose of the invention is to provide a computer-assisted automated sheep identification and sheep body measurement device that can utilize mechanical, electronic communication, information and other technologies to achieve contactless, fully automated and easy-to-operate functions that can improve efficiency.
[0006] 1. The technical solution adopted by the invention to solve the technical problem is: a computer-aided automatic sheep identification and sheep body measurement device, including a frame, a top plate, an entrance door, an entrance door motor, an exit door, an exit door motor, a step, an infrared sensor A, an infrared sensor B, an ear tag identifier, an adjustable background plate, a binocular camera, a weighing device and a computer. The frame is a rectangular parallelepiped, a top plate is arranged above the frame, an adjustable back plate is arranged in the frame and is parallel to the front frame, the front frame is provided with a fence, two frame beams are arranged at the rear part of the frame, an adjustment rod is installed on the upper beam of the frame beam, and the adjustment rod is connected to the adjustable background plate, the frame is provided with an entrance door and an exit door, the entrance door and the exit door are respectively provided with steps, and the upper part of the entrance door is provided with a step. An entrance door motor is installed on the top plate at the upper position of the frame, an exit door motor is installed on the top plate above the exit door, guardrails are respectively provided at the steps, a group of infrared sensors A are installed on the lower inner side of the outer railing of the entrance door guardrail, a group of infrared sensors B are installed on the lower inner side of the inner railing of the entrance door guardrail, an earring identifier is installed on the upper inner side of the entrance door guardrail, an L-shaped mounting frame is provided at the center of the front upper cross beam of the frame, the binocular camera is installed at the lower end of the mounting frame and faces the background plate, a weighing device is installed below the frame and the plane of the device is at the same height as the steps, and the infrared sensor A, infrared sensor B, entrance door motor, exit door motor, ear tag identifier, binocular camera, weighing device and computer are electrically connected.
[0007] Furthermore, each group of sensors is in the shape of long strips and is symmetrically installed.
[0008] Furthermore, the entrance door and the exit door are double-leaf doors, and the door shafts of the entrance door and the rear door are connected with a cam disc, and the disc is transmission-connected to a motor, and the number of the motors is 4.
[0009] The present invention also provides a computer-aided automated sheep identification method, comprising the following steps:
[0010] Step 1: Provide a contactless and fully automated sheep body detection device.
[0011] Step 2: Adjust the adjustable background board according to the size of the sheep whose body size parameters need to be measured, so as to restrict the sheep from turning around and facing the camera sideways.
[0012] Step 3: When the infrared sensor A signal changes from nothing to something, the ear tag number is detected by the ear tag identifier, and a control signal is given to control the exit door motor to close the exit door and the entrance door motor to open the entrance door.
[0013] Step 4: When the infrared sensor B signal changes from on to off, a control signal is given to control the entrance door motor to close the entrance door. At the same time, the weighing device is used to detect whether the weight is zero. If it is zero, it means that the sheep has not entered and the process is abnormal. Then return to step 3 to restart the control process, otherwise continue.
[0014] Step 5: Turn on the binocular camera and start shooting.
[0015] Step 6: Take a group of images, capture the contours of the left and right images and compare them. Use background subtraction and regional threshold segmentation to extract the contours, which takes 0.2-0.3 seconds.
[0016] Step 7: Determine the similarity of the left and right contours. Use the matchShapes function provided by the OPENCV library and set the return value threshold to 0.1 through statistics. If it is greater than 0.1, they are not similar. Dissimilar databases are discarded, and similar ones proceed to the next step. It takes 0.001 seconds.
[0017] Step 8. Determine the left and right contour postures. Starting from the first pixel point, compare it with the pixel values in the surrounding 5*5 range to determine whether it is 0 or 255. Then extract the joint points of the acquired image and save the completed image. Use it as data for SVM model training to obtain the posture model, so as to determine whether it is a standard posture. The non-standard contour posture database is written and discarded, and the standard enters the next step, which takes 0.13 seconds.
[0018] Step 9: Obtain the coordinates of the feature point based on the curvature and the mathematical characteristics of the highest point, which takes 0.1 seconds.
[0019] Step 10: Calculate the 3D coordinates of each feature point and the length of each body scale using the 2D coordinate information in the left and right images obtained in the previous step. This takes 0.02 seconds.
[0020] Step 11: Check whether there are 10 groups of images in the database that have not been lost, otherwise return to step 5.
[0021] Step 12: After the shooting is completed, a control signal is given to control the exit door motor to open the exit door.
[0022] Step 13: Use the cuckoo algorithm to fuse multiple sets of data. Hip height is a relatively stable data. Then, the relationship between hip height and body length and height is set as the confidence level, and other body size data are fused to obtain the final body size data.
[0023] Step 14: Store the sheep body size data into the database.
[0024] Step 15: Export data.
[0025] The beneficial effects of the invention are:
[0026] The present invention designs a sheep body measurement device and uses computer vision methods to measure the sheep body, so that the equipment is fully automated and does not require manual intervention in measurement. The sheep body measurement work can be completed fully and automatically within 10 seconds without contact, with an accuracy of 97%-99%. The cost is reduced and the efficiency and accuracy are improved, and the functions of contactless, fully automated and convenient operation to improve efficiency are realized. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a schematic diagram of the structure of the device of the present invention.
[0028] Figure 2 It is a flowchart of the present invention.
[0029] Figure 3 It is a flow chart of body size calculation process of the present invention.
[0030] Description of the drawings: frame 1; adjustable background plate 2; entrance door 3; exit door 4; motor 5; infrared sensor A6; infrared sensor B7; ear tag identifier 8; weighing device 9; L-shaped mounting frame 10; frame beam 11. DETAILED DESCRIPTION
[0031] The invention is further described below in conjunction with specific embodiments. It should be understood that these embodiments are only used to illustrate the invention and are not used to limit the scope of the invention. In addition, it should be understood that after reading the content of the invention, those skilled in the art can make various changes or modifications to the invention, and these equivalent forms also fall within the scope defined by the claims attached to the application.
[0032] See also Figures 1 to 2It is a schematic diagram of the structure of the invention and a block diagram of the circuit system, including a frame 1, a top plate, an entrance door 3, an entrance door 3 motor 5, an exit door 4, an exit door 4 motor 5, a step, an infrared sensor A6, an infrared sensor B7, an ear tag identifier, an adjustable background plate 2, a binocular camera, a weighing device 9 and a computer. The frame 1 is a rectangular parallelepiped, a top plate is arranged above the frame 1, an adjustable back plate is arranged inside the frame 1 and is parallel to the front frame 1, the front frame 1 is provided with a fence, two frame beams 11 are arranged at the rear part of the frame 1, an adjusting rod is installed on the upper beam of the frame beam 11, and the adjusting rod is connected to the adjustable background plate 2, the frame 1 is provided with an entrance door 3 and an exit door 4, steps are respectively arranged at the entrance door 3 and the exit door 4, the entrance door 3 motor 5 is installed on the top plate above the entrance door 3, the exit door 4 motor 5 is installed on the top plate above the exit door 4, and the steps are respectively arranged at the top plate above the entrance door 3. A guardrail is provided, a group of infrared sensors A6 is installed at the lower inner side of the outer railing of the guardrail of the entrance door 3, a group of infrared sensors B7 is installed at the lower inner side of the inner railing of the guardrail of the entrance door 3, an earring identifier 8 is installed at the upper inner side of the guardrail of the entrance door 3, an L-shaped mounting frame 10 is provided at the center of the front upper crossbeam of the frame 1, the binocular camera is installed at the lower end of the mounting frame and faces the background plate, a weighing device 9 is installed below the frame 1 and the height of the device plane is equal to that of the step, the infrared sensor A6, the infrared sensor B7, the motor 5 of the entrance door 3, the motor 5 of the exit door 4, the ear tag identifier, the binocular camera, the weighing device 9, and the computer are electrically connected, each group of the sensors is long and symmetrically installed, the entrance door 3 and the exit door 4 are double-leaf doors, the entrance door 3 and the exit door door shaft are connected with a cam disc, the disc is transmission-connected with the motor 5, and the number of the motors 5 is 4.
[0033] Adjust the adjustable background plate 2 to make it fit the size of the sheep, guide the sheep into the detection device, when the sheep passes the infrared sensor A6, the infrared sensor A6 signal changes from zero to positive, and the ear tag identifier detects the sheep ear tag number, and gives a control signal to control the exit door 4 motor 5 to close the exit door 4, and controls the entrance door 3 motor 5 to open the entrance door 3. When the sheep completely enters the detection device, the infrared sensor B7 signal changes from positive to negative, and gives a control signal to control the entrance door 3 motor 5 to close the entrance door 3. At the same time, the weighing device 9 detects that the weight is not zero, and the binocular camera starts to shoot the sheep body, shoots a group of images, and the left and right images are intercepted and compared. The background subtraction and regional threshold segmentation are used to extract the contour, and the matchShapes function provided by the OPENCV library is used to determine the similarity of the left and right contours, and the posture of the left and right contours is determined. Starting from a pixel point, compare it with the pixel values in the surrounding 5*5 range to determine whether it is finally 0 or 255, then extract the joint points of the acquired image, save the completed image, and use it as data for SVM model training to obtain a posture model, so as to determine whether it is a standard posture. According to the curvature and the mathematical characteristics of the highest point, the coordinates of the feature points are obtained. The three-dimensional coordinates of each feature point are calculated through the two-dimensional coordinate information in the upper and left pictures, and the length of each body size is calculated. Continuous shooting reaches 10 groups, and the control signal is given to control the exit door 4 motor 5 to open the exit door 4. Use the cuckoo algorithm to fuse multiple groups of data. The hip height is a relatively stable data, and then the relationship between the hip height and the body length and body height is set as the confidence range. The other body size data are fused to obtain the final body size data, and the sheep body size data is stored in the database and exported.
[0034] The present invention designs a sheep body measurement device and uses computer vision methods to measure the sheep body, so that the equipment is fully automated and does not require manual intervention in measurement. The sheep body measurement work can be completed fully and automatically within 10 seconds without contact, with an accuracy of 97%-99%. The cost is reduced and the efficiency and accuracy are improved, and the functions of contactless, fully automated and convenient operation to improve efficiency are realized.
Claims
1. A method for sheep identification and measurement using a computer-assisted automated sheep body measurement device, characterized in that: The computer-aided automated sheep body measurement device comprises a frame, a top plate, an entrance door, an entrance door motor, an exit door, an exit door motor, steps, an infrared sensor A, an infrared sensor B, an ear tag identifier, an adjustable background plate, a binocular camera, a weighing device and a computer. The frame is a rectangular parallelepiped, a top plate is arranged above the frame, an adjustable back plate is arranged in the frame and is parallel to the front frame, a fence is arranged on the front frame, two frame beams are arranged at the rear part of the frame, an adjustment rod is installed on the upper beam of the frame beam, and the adjustment rod is connected to the adjustable background plate, the frame is provided with an entrance door and an exit door, steps are arranged at the entrance door and the exit door respectively, and an entrance door motor is installed on the top plate above the entrance door. A machine, an exit door motor is installed on the top plate above the exit door, guardrails are respectively provided at the steps, a group of infrared sensors A is installed at the lower inner side of the outer railing of the entrance door guardrail, a group of infrared sensors B is installed at the lower inner side of the inner railing of the entrance door guardrail, an earring identifier is installed at the upper inner side of the entrance door guardrail, an L-shaped mounting frame is provided at the center of the front upper crossbeam of the frame, the binocular camera is installed at the lower end of the mounting frame and faces the background plate, a weighing device is installed below the frame and the plane of the weighing device is at the same height as the steps, and the infrared sensor A, infrared sensor B, entrance door motor, exit door motor, ear tag identifier, binocular camera, weighing device, and computer are electrically connected; The sheep identification determination method includes the following steps: Step 1: providing a computer-assisted automated sheep body measurement device; Step 2: Adjust the adjustable background board according to the size of the sheep whose body size parameters need to be measured, so as to restrict the sheep from turning around and facing the camera sideways; Step 3: When the infrared sensor A signal changes from zero to one, the ear tag identifier detects the ear tag number and gives a control signal to control the exit door motor to close the exit door and the entrance door motor to open the entrance door; Step 4: When the signal of infrared sensor B changes from being present to being absent, a control signal is given to control the entrance door motor to close the entrance door; At the same time, the weighing device is used to detect whether the weight is zero. If it is zero, it means that the sheep has not entered and the process is abnormal, then return to step 3 to restart the control process, otherwise continue; Step 5: Turn on the binocular camera and start shooting; Step 6: Take a group of images, extract the contours of the left and right images and compare them, and extract the contours by background subtraction and regional threshold segmentation, which takes 0.2-0.3 seconds; Step 7: Determine the similarity of the left and right contours. Use the matchShapes function provided by the OPENCV library and set the return value threshold to 0.1 through statistics. If it is greater than 0.1, they are not similar. Dissimilar databases are discarded, and similar ones proceed to the next step. It takes 0.001 seconds. Step 8: Determine the left and right contour postures. Starting from the first pixel, compare it with the pixel values in the surrounding 5*5 range to determine whether it is 0 or 255. Then extract the joint points of the acquired image, save the completed image, and use it as data for SVM model training to obtain the posture model, so as to determine whether it is a standard posture. The non-standard contour posture database is written and discarded, and the standard enters the next step. It takes 0.13 seconds. Step 9: Obtain the coordinates of the feature points based on the curvature and the mathematical characteristics of the highest point, which takes 0.1 seconds; Step 10: Calculate the 3D coordinates of each feature point and the length of each body scale using the 2D coordinate information of the left and right images obtained in the previous step, which takes 0.02 seconds. Step 11: Check whether there are 10 groups of images in the database that have not been lost, otherwise return to step 5; Step 12: After the shooting is completed, a control signal is given to control the exit door motor to open the exit door; Step 13: Use the cuckoo algorithm to fuse multiple sets of data. The hip height is a relatively stable data. Then, the relationship between the hip height and the body length and height is set as the confidence level, and other body size data are fused to obtain the final body size data. Step 14: store the sheep body size data into the database; Step 15: Export data.
2. The method for sheep identification and measurement using a computer-assisted automated sheep measurement device according to claim 1, characterized in that: Each group of infrared sensors A and infrared sensors B are in the shape of long strips and are symmetrically installed.
Citation Information
Patent Citations
Sheep weight body size automatic measuring system and measuring method thereof
CN107347706A
Automatic living pig measuring device and method
CN109380146A
Computer-assisted automatic sheep identification and sheep body determination device
CN211430581U