Portable animal and plant phenotype determination method, system and device
Through portable animal and plant phenotype measurement methods and systems, combined with dynamic weight measurement algorithms and RGB-D phenotype measurement algorithms, the problems of inconvenience and errors in animal and plant weight and phenotype measurement in the prior art are solved, and efficient and accurate non-contact measurements are achieved.
Patent Information
- Application Number
- CN202510159744.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-13
- Publication Date
- 2025-03-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing animal and plant weight and phenotype measurement devices are not portable enough, there is a problem of animal stress response, and the measurement efficiency is low, and the calculation results are large errors.
The portable animal and plant phenotype measurement method and system are adopted, combined with the weight measurement module, phenotype measurement module, identity acquisition module and information storage module, non-contact measurement is performed through dynamic weight measurement algorithm and RGB-D phenotype measurement algorithm to realize automated multi-index acquisition.
It realizes convenient, accurate and efficient weight and phenotypic measurements of animals and plants, reduces animal stress response, and improves measurement efficiency and data accuracy.
Smart Images

Figure CN119618082A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of animal and plant phenotype determination, and in particular to a portable animal and plant phenotype determination method, system and device. Background Art
[0002] The weight and phenotype of animals and plants are important indicators that breeding and planting companies pay attention to. These indicators can well reflect the growth status and health status of animals and provide guidance for breeding. In plants, the growth status can also be judged by their phenotype and weight, thereby judging the economic benefits of breeding and planting companies. At present, there are two main methods for measuring the weight and size of farmed animals in farms. The first is manual measurement, that is, the breeder grabs or drives the animal to the scale to measure the weight data, and uses a tape measure to measure the body size data. This manual measurement method will cause stress response in animals, affect growth and development, and even cause death. In addition, the breeder has high work intensity during the measurement process, and data recording is difficult and inefficient. The second is device measurement. By installing cameras and floor scales, the intensity of measurement can be reduced and the efficiency of measurement can be improved, but it is often necessary to enter the site for maintenance, and the camera is generally installed at a high place far away from the measured animal, with a single direction and low clarity, making it difficult to accurately measure the body size.
[0003] With the rapid development of computer vision technology, more and more scholars have used computer vision technology to measure body size and developed corresponding devices for measuring body size and weight, but all of them have shortcomings. In terms of weight measurement, CN215448146U discloses a meat duck weight weighing system, which can be moved between different duck houses and connected to a computer, without manual data recording, but the breeder still needs to grab the meat duck into the measuring device, causing the meat duck's stress response to affect its growth. CN205537893U discloses a fully automatic poultry average weight weighing system, which calculates the average weight by recording the total number of poultry passing through the device, but lacks the weighing of a single individual. CN207798226U discloses a poultry weight measurement device, which can obtain the number of samples by identifying RFID identity tags, collect the weight of the sample group using a walking weighing platform, and obtain the individual weight and average weight of the entire poultry flock through data processing, but the device is not easy to carry and move, and it is difficult to carry out mobile measurements in various farms. In terms of body size measurement, CN118322224A discloses a rigid-flexible coupling mechanical arm type plant phenotypic information measurement platform and measurement method. This method relies on sensors on soft machinery to achieve plant phenotypic measurement, but the device cannot collect the weight of the plant and the collection time is long and inefficient. CN109636779A discloses a method for identifying the volume and body size of poultry. This method installs a depth camera above the poultry to obtain the color image and disparity image of the poultry and segment the target poultry, and then calculates the poultry body size by calculating the point cloud information and the world coordinates. However, this method has the problems of the camera distance being too far, the camera direction being single, and the body size calculation error being large. CN118729947A discloses a livestock body size three-dimensional measurement method and system based on machine vision technology. The system performs body size measurement through three-dimensional reconstruction, but the body size measurement method has a large amount of calculation and cannot quickly obtain body size measurement results.
[0004] In summary, the current weight measurement devices are not portable enough and will cause stress reactions in animals. The phenotypic measurement devices measure a single object, there is no integrated set of equipment, and the calculation time is long and the error is large. Therefore, there is a need for a portable device that can automatically collect multiple indicators and measure the weight phenotype of animals and plants without contact. Summary of the invention
[0005] In view of the above-mentioned deficiencies in the prior art, the present invention proposes a portable animal and plant phenotyping method, system and device to solve the problems existing in the prior art.
[0006] In order to achieve the above-mentioned purpose of the invention, the technical solution adopted by the present invention is: a portable animal and plant phenotyping method, comprising the following steps: S1: Use the weight measurement module to measure the weight of animals and plants based on the dynamic weight measurement algorithm; S2: Use the phenotyping module to measure the phenotype of plants and animals based on the RGB-D-based animal and plant phenotype measurement algorithm; S3: Use the identity acquisition module to identify animals and plants based on the time series data association method; S4: using an information storage module to store the measured weight information, phenotypic information, and identity information; S5: Use the system platform module to perform data query, data export, animal and plant weight report recording, animal and plant phenotype report recording, equipment alarm and visual surface display to complete portable animal and plant phenotyping.
[0007] Furthermore, the dynamic weight measurement algorithm in S1 is an animal and plant dynamic weighing algorithm based on adaptive limited Kalman filtering, including the following sub-steps: S11: Input the collected raw data of animal and plant weights into an adaptive clipping Kalman filter algorithm to eliminate random interference. The adaptive clipping Kalman filter algorithm is:
[0008] in, is the output value of the adaptive limiting Kalman filter algorithm, The dynamic weight data of the currently weighed animals and plants, is the average value of the dynamic weight data of the currently weighed animals and plants, The maximum value of the deviation of the dynamic weight data of the currently weighed animals and plants; S12: Initialize the coefficients of the adaptive clipping Kalman filter algorithm, and predict the system state equation and error covariance at the next moment based on the output value of the adaptive clipping Kalman filter algorithm. The system state equation at the next moment is:
[0009] in, For weighing system The state of the moment, is the state transfer matrix, For weighing system The state of the moment, is the input control matrix, For The effect of the external environment on the weighing system at all times; The error covariance is:
[0010] in, for The error matrix at time, is the prediction noise covariance matrix, for The error matrix at time , superscript is the transpose of the matrix; S13: Based on the system state equation and error covariance at the next moment, the Kalman gain is calculated. The formula is:
[0011] in, is the observation matrix, is the measurement noise covariance matrix; S14: Based on the Kalman gain, the state correction is performed, and the formula is:
[0012] in, for The observed value at time; S15: Based on the state correction result, the covariance matrix is updated, and the iteration is continued until the optimal estimate of the weight data is obtained. The covariance matrix is updated as follows: .
[0013] Furthermore, S2 includes the following sub-steps: S21: when a weight change is detected by the weight sensor and the FRID reader and the FRID reader senses that an animal or plant has entered, it is determined that a phenotypic measurement of the entered animal or plant is required; S22: After reading the FRID tag data, turn on the dual-mode camera and capture the target data. Use the captured data through the multi-target plant and animal recognition algorithm based on yolov8 to determine whether the captured image data contains a complete target image. When the model determines that there is a complete target image in the image, the image data is phenotyped through the RGB-D-based plant and animal phenotype measurement algorithm, otherwise continue to capture the target data.
[0014] Furthermore, the RGB-D-based animal and plant phenotype measurement algorithm in S22 includes the following sub-steps: S221: Inputting the recognized complete target image into a key point recognition model to extract key point information; S222: Mapping the extracted two-dimensional coordinate points to the three-dimensional reconstruction model of the plant and animal, and calculating the completed length parameters of the plant and animal based on the parameter algorithm of the Euclidean distance, the formula is:
[0015] in, is the length, For the identified key points, For the The horizontal coordinate of the point, For the The horizontal coordinate of the point, For the The vertical coordinate of the point, For the The vertical coordinate of the point, For the The vertical coordinate of a point, For the The vertical coordinate of a point; S223: Meshing the three-dimensional reconstructed model of the animals and plants to calculate area parameters of the animals and plants.
[0016] Furthermore, the three-dimensional reconstruction model of plants and animals in S222 is performed in the following steps: S2221: using a depth camera to obtain the depth image of plants and animals and convert the two-dimensional depth image into multi-angle three-dimensional point cloud data based on the camera imaging principle; S2222: Use the RANSAC-based background removal algorithm to remove interference scenes in the three-dimensional point cloud data, including the following steps: a1: Set the number of iterations and threshold, randomly select multiple data sample points from the image data set, where the data sample points meet the number of image data set model, and calculate the parameters of the image data set model; a2: Based on the calculation results, the image dataset model is used to perform distance calculation on all data sample points in the image dataset. When the distance between a data sample point and the image dataset model is less than the set threshold, the data sample point is set as an inner point, otherwise it is set as an outer point. a3: Fit all the data sample points marked as inliers into a new model, calculate the error between all the data sample points marked as inliers and the new model, and update the new model parameters when the error is less than the error of the previous iteration, and record it as the optimal model; a4: When the set number of iterations is reached or the number of internal points of the optimal model is greater than the set ratio of the original data, the iteration is stopped to complete the removal of interference scenes in the three-dimensional point cloud data. The number of iterations satisfies:
[0017]
[0018] in, is the probability that a data point in the image dataset is an outlier, The minimum amount of data required to form a dataset model. The minimum number of iterations required for the image dataset model to be the optimal model. is the confidence level; S2223: Based on the interference scene removal result of the three-dimensional point cloud data, use voxel filtering to remove point cloud noise in the three-dimensional point cloud data, including the following steps: b1: Calculate the coordinate set of the point cloud data after removing the interference background from the 3D point cloud data. axis, Axis and Maximum and minimum values on the axis, and set the voxel grid ; b2: According to axis, Axis and The maximum and minimum values on the axis are used to calculate the side length of the point cloud bounding box. The formula is:
[0019] in, , and They are the point cloud bounding boxes in axis, Axis and The length of the side on the axis, and for The maximum and minimum values on the axis, and for The maximum and minimum values on the axis, and for Maximum and minimum values on the axis; b3: Calculate the voxel grid based on the side length of the point cloud bounding box. The formula is:
[0020] in, , and They are axis, Axis and Voxel grid on axis; b4: Calculate the index of each voxel grid in the 3D point cloud data according to the calculated voxel grid , the index The elements inside are sorted from small to large, and the centroid of the voxel grid is calculated. The centroid replaces all the points in the voxel grid to complete the removal of point cloud noise in the three-dimensional point cloud data. The index The calculation formula is:
[0021] in, , and They are axis, Axis and The index on the axis, , and They are axis, Axis and Points on the axis; S2224: Using the ICP algorithm to register the three-dimensional point cloud data of multiple perspectives after removing the interference scene and point cloud noise, including the following steps: c1: in the target point cloud Select sample points from , and in the source point cloud Find the corresponding point set in ; c2: Set the sample points Point cloud and rotation transformation matrix in and the three-dimensional translation vector Combine to get a new point cloud set , the formula is:
[0022] The rotation transformation matrix and the three-dimensional translation vector The calculation formula is:
[0023] in, is the sum of squared distances between target point clouds, is the number of sample points, is the sample point; c3: Calculate all new point cloud sets And the corresponding point set The average distance between , the formula is:
[0024] c4: If the average distance calculated If the value is less than a preset threshold or the number of iterations is greater than a preset maximum number of iterations, the iteration is stopped; otherwise, the process returns to step c1 and continues iterating until the constraint condition is met, thereby completing the registration of the three-dimensional point cloud data.
[0025] Furthermore, the S223 includes the following sub-steps: S2231: Meshing of point cloud, including the following steps: d1: Randomly select a point in the point cloud, find the two points closest to it, and connect the three points to form a triangle; d2: Take the three sides of the triangle as the boundaries of the mesh and list them as candidate sides, select one side of the triangle as the axis, and use the adaptive radius method to rotate the axis to generate a sphere; d3: When the ball rolls on the point cloud surface and touches a new point, the point and the candidate edge are connected to form a new triangle and included in the reconstructed mesh. The newly formed edge is listed as a new candidate edge, and the edge generated in the previous step is deselected; d4: Select the next edge from the new candidate edge and repeat the above steps d1-d3 until all points are involved in the rolling and a three-dimensional triangular mesh is generated to complete the point cloud meshing; S2232: Based on the point cloud meshing results, calculate the area of each small triangle mesh. The formula is:
[0026]
[0027] in, is the area of the small triangle mesh, , and are the lengths of the three sides of the small triangle, is the area of the small triangle; S2233: Add the area of each small triangle mesh to obtain the sum of the areas of the small triangle meshes. The formula is:
[0028] in, is the sum of the areas of the small triangle meshes, is the triangle mesh number, is the total number of grids.
[0029] Furthermore, in S3, the identity acquisition module is used to associate the weight data with the phenotypic data using a time series-based data association method, including the following sub-steps: S31: using the data association module to monitor the RFID reader, the weight sensor data collection program and the phenotype calculation program; S32: When the data association module listens to the animal or plant ID obtained by the RFID reader, it adds the timestamp T1 to the read ID and saves it to the cache queue Q1; when the data association module listens to the weight of the animal or plant read by the weight sensor, it adds the timestamp T2 to the read weight data and saves it to the cache queue Q2; when the data association module listens to the phenotypic data of the current target animal or plant calculated by the phenotypic calculation program, it saves the phenotypic data to the cache queue Q3; S33: When the data association module reads that the corresponding data exists in the cache queues Q1, Q2 and Q3, it determines whether the timestamp T2 is greater than T1. If so, it proceeds to step S34, otherwise it proceeds to step S35; S34: taking out the head elements of the cache queues Q1, Q2 and Q3 for data association and adding the timestamp T3, obtaining the weight and phenotypic data of the animals and plants for a complete measurement cycle, and completing the data association of the weight data and the phenotypic data; S35: Pop out the head element of the cache queue Q2, and return to step S33 to continue to determine the size of T1 and T2.
[0030] The technical solution also adopted in this scheme is: a portable animal and plant phenotyping system, including: Weight measurement module: used to measure the weight of animals and plants; Phenotypic measurement module: used to measure the phenotype of animals and plants; Identity acquisition module: used to identify animals and plants; Information storage module: used to store measured weight information, phenotypic information and identity information; System platform modules: data query, data export, animal and plant weight report recording, animal and plant phenotype report recording, equipment alarm and visual surface display.
[0031] The technical solution also adopted in this scheme is: a portable animal and plant phenotyping device, including a box surrounded by wire mesh, switch devices are arranged on the doors at the entrance and exit of the box, and an anti-slip rubber slope that can be folded into the box is assembled at the entrance and exit, four lockable universal wheels are installed at the bottom of the box, an RFID reader is installed at the bottom of the side of the box, a weight scale is placed at the bottom of the inner side of the box, a U-shaped handle is installed on the side of the box, and adjustable telescopic arms are installed on both sides of the box, a hollow crossbeam is arranged at the top of the box, a first camera and a computer are installed on the hollow crossbeam, and the weight scale and the RFID reader are both connected through the hollow crossbeam, the first camera is connected to the computer via a USB data cable, and the computer is connected to a remote server.
[0032] Furthermore, the adjustable telescopic swivel arm includes a connected telescopic rod rotating device and a telescopic rod, a second camera is installed on the telescopic rod, and the second camera is fixed by a rotating card holder, and the second camera is connected to the computer via a USB data cable.
[0033] The beneficial effects of the present invention are: The present invention uses RFID to uniquely identify animals and plants, and can detect and track individual animals and plants to avoid missed detection. The structured data is automatically recorded and analyzed, and the timestamp and phenotypic data are used to help determine the growth status of animals and plants within a certain period of time and perform growth health monitoring.
[0034] The RGB-D-based animal and plant phenotype calculation algorithm of the present invention has great robustness and requires less computational effort than the traditional three-dimensional point cloud computing phenotype method. It can obtain the phenotypic data of each animal and plant in a short time, realize the measurement of animal and plant phenotypes in real time, and can be deployed in edge AI devices, with a more flexible usage environment.
[0035] The present invention collects multi-dimensional animal and plant data, which is more convincing than the previous single-dimensional data, and can more accurately and effectively evaluate the production performance of animals and plants.
[0036] The measuring device of the present invention is foldable and portable, and can be operated and moved by one person, thus solving the problem of time-consuming and labor-intensive manual measurement in traditional animal and plant measurement. The measuring method is non-contact, which reduces the stress response of animals and is more adaptable to the environment of breeding farms. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 The present invention is a flow chart of the portable animal and plant phenotyping method.
[0038] Figure 2 This is a module diagram of the portable animal and plant phenotyping system of the present invention.
[0039] Figure 3 This is a diagram of the portable plant and animal phenotyping device of the present invention.
[0040] Figure 4 It is a structural schematic diagram of the first camera of the present invention.
[0041] Figure 5 It is a schematic diagram of the basic structure of the adjustable telescopic jib of the present invention.
[0042] Among them: 1. switch device; 2. anti-slip rubber ramp; 3. lockable universal wheel; 4. RFID reader; 5. weight scale; 6. U-shaped handle; 7. adjustable telescopic arm; 8. hollow crossbeam; 9. first camera; 10. computer; 11. telescopic rod rotating device; 12. telescopic rod; 13. second camera; 14. rotating card holder. DETAILED DESCRIPTION
[0043] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.
[0044] Embodiment 1, as Figure 1As shown, a portable method for measuring plant and animal phenotypes comprises the following steps: S1: Use the weight measurement module to measure the weight of animals and plants based on the dynamic weight measurement algorithm; S2: Use the phenotyping module to measure the phenotype of plants and animals based on the RGB-D-based animal and plant phenotype measurement algorithm; S3: Use the identity acquisition module to identify animals and plants based on the time series data association method; S4: using an information storage module to store the measured weight information, phenotypic information, and identity information; S5: Use the system platform module to perform data query, data export, animal and plant weight report recording, animal and plant phenotype report recording, equipment alarm and visual surface display to complete portable animal and plant phenotyping.
[0045] like Figure 2 As shown, the weight measurement module is divided into two parts: hardware and dynamic weight measurement algorithm. The hardware part is composed of a weight scale and a weight measurement module host computer. The dynamic weight measurement algorithm uses a stepping animal dynamic weighing algorithm with an adaptive limited Kalman filter to measure the weight of the animal entering the weight scale. The phenotypic measurement module is divided into two parts: hardware and algorithm. The hardware part is composed of a dual-mode camera and a phenotypic measurement module host computer. The RGB-D-based animal and plant phenotypic measurement algorithm is composed of the following six algorithms: the multi-target animal and plant recognition algorithm based on yolov8 is used to determine the species of animals and plants entering the device; the key point extraction algorithm based on yolov8-pose extracts the measurement points of various animal and plant body parameters that need to be extracted for the animal and plant species; the background removal algorithm based on RANSAC removes the background (wall or ground) of the point cloud after the depth map is converted into a point cloud; the noise removal algorithm based on voxel filtering removes noise from the point cloud after the background is removed; the registration algorithm based on ICP registers the multi-view point cloud; the parameter algorithm based on Euclidean distance is used to calculate the various animal and plant body parameters after completion; The identity acquisition module is composed of an RFID reader, an RFID tag, and an identity acquisition module host. The RFID tag has a unique number, and the RFID reader can accurately identify the individual animals and plants that enter the device and wear the RFID tag, which is convenient for subsequent information matching, storage, and tracking; The information storage module is composed of an RFID identity information cache queue, a weight information cache queue, a phenotype information cache queue and a database, wherein the RFID identity information cache queue, the weight information cache queue and the phenotype information cache queue use a time series-based data association method to associate individual phenotypes with weights and then store them in the database; The system platform module consists of data query, data export, animal and plant weight and phenotype record report, equipment warning report and visual chart. Data query is used to query existing data; data export is used to export existing data; animal and plant weight and phenotype record report is used to record and store the acquired individual weight and phenotype related data; equipment warning report is used to warn of hardware device disconnection or damage; visual chart is used to visualize the acquired individual weight and phenotype data, so that users can track and analyze individual growth status.
[0046] The specific operations of weight data collection, processing and uploading of the present invention are as follows: after putting an RFID tag for identification on animals and plants, start the computer and the data collector (RFID reader, weight sensor), and the computer executes the data collection program so that the data collector can collect data concurrently in multiple threads. The RFID reader collects data only when the device with the RFID tag enters the magnetic induction area. When the scale body with the weight sensor senses the entry of animals and plants and reads the RFID tag, it starts to continuously record the weight data until the animals and plants leave the scale body and the weight scale data returns to zero, and then uses the stepping animal dynamic weighing algorithm based on adaptive limited Kalman filtering to process the animal dynamic weight data and uses the time series-based data association method to associate with the phenotypic data. After the data association is performed, it is uploaded to the cloud server through the implemented MQTT protocol.
[0047] The dynamic weight measurement algorithm in S1 is an animal and plant dynamic weighing algorithm based on adaptive limited Kalman filtering, and includes the following steps: S11: Input the collected raw data of animal and plant weights into an adaptive clipping Kalman filter algorithm to eliminate random interference. The adaptive clipping Kalman filter algorithm is:
[0048] in, is the output value of the adaptive limiting Kalman filter algorithm, The dynamic weight data of the currently weighed animals and plants, is the average value of the dynamic weight data of the currently weighed animals and plants, The maximum value of the deviation of the dynamic weight data of the currently weighed animals and plants; S12: Initialize the coefficients of the adaptive clipping Kalman filter algorithm, and predict the system state equation and error covariance at the next moment based on the output value of the adaptive clipping Kalman filter algorithm. The system state equation at the next moment is:
[0049] in, For weighing system The state of the moment, is the state transfer matrix. For the weighing system, theoretically it is a state system, and its weight value will not change with time, so the state transfer matrix Set to the identity matrix, For weighing system The state of the moment, is the input control matrix, For The effect of the external environment on the weighing system at all times; The error covariance is:
[0050] in, for The error matrix at time, is the prediction noise covariance matrix, for The error matrix at time , superscript is the transpose of the matrix; S13: Based on the system state equation and error covariance at the next moment, the Kalman gain is calculated. The formula is:
[0051] in, is the observation matrix, is the measurement noise covariance matrix; S14: Based on the Kalman gain, the state correction is performed, and the formula is:
[0052] in, for The observed value at time; S15: Based on the state correction result, the covariance matrix is updated, and the iteration is continued until the optimal estimate of the weight data is obtained. The covariance matrix is updated as follows: .
[0053] The S2 includes the following sub-steps: S21: when a weight change is detected by the weight sensor and the FRID reader and the FRID reader senses that an animal or plant has entered, it is determined that a phenotypic measurement of the entered animal or plant is required; S22: After reading the FRID tag data, turn on the dual-mode camera and capture the target data. Use the captured data through the multi-target plant and animal recognition algorithm based on yolov8 to determine whether the captured image data contains a complete target image. When the model determines that there is a complete target image in the image, the image data is phenotyped through the RGB-D-based plant and animal phenotype measurement algorithm, otherwise continue to capture the target data.
[0054] Phenotypic parameters are divided into length parameters and area parameters. The length parameters that animals need to calculate include body length, body width, body height, body oblique length, etc.; the length parameters that plants need to calculate include plant height, leaf length, leaf width, leaf circumference, etc. The area parameters that animals need to calculate include surface area; the area parameters that plants need to calculate include leaf area.
[0055] The RGB-D-based animal and plant phenotype measurement algorithm in S22 includes the following sub-steps: S221: Inputting the recognized complete target image into a key point recognition model to extract key point information; Prior to this, the dual-mode camera including the color camera and the depth camera must be turned on first. Since the resolutions of the color image and the depth image are different, the resolution and image alignment must be performed first. Secondly, the color camera inputs the pre-trained multi-target plant and animal recognition algorithm to perform object recognition on the target image. When the complete image is recognized, it is sent to the key point recognition model to extract the key point information. S222: Mapping the extracted two-dimensional coordinate points to the three-dimensional reconstruction model of the plant and animal, and calculating the completed length parameters of the plant and animal based on the parameter algorithm of the Euclidean distance, the formula is:
[0056] in, is the length, For the identified key points, For the The horizontal coordinate of the point, For the The horizontal coordinate of the point, For the The vertical coordinate of the point, For the The vertical coordinate of the point, For the The vertical coordinate of a point, For the The vertical coordinate of a point; S223: Meshing the three-dimensional reconstructed model of the animals and plants to calculate area parameters of the animals and plants.
[0057] The three-dimensional reconstruction model of plants and animals in S222 is performed in the following steps: S2221: using a depth camera to obtain the depth image of plants and animals and convert the two-dimensional depth image into multi-angle three-dimensional point cloud data based on the camera imaging principle; S2222: Use the RANSAC-based background removal algorithm to remove interference scenes in the three-dimensional point cloud data, including the following steps: a1: Set the number of iterations and threshold, randomly select multiple data sample points from the image data set, where the data sample points meet the number of image data set model, and calculate the parameters of the image data set model; a2: Based on the calculation results, the image dataset model is used to perform distance calculation on all data sample points in the image dataset. When the distance between a data sample point and the image dataset model is less than the set threshold, the data sample point is set as an inner point, otherwise it is set as an outer point. a3: Fit all the data sample points marked as inliers into a new model, calculate the error between all the data sample points marked as inliers and the new model, and update the new model parameters when the error is less than the error of the previous iteration, and record it as the optimal model; a4: When the set number of iterations is reached or the number of internal points of the optimal model is greater than the set ratio of the original data, the iteration is stopped to complete the removal of interference scenes in the three-dimensional point cloud data. The number of iterations satisfies:
[0058]
[0059] in, is the probability that a data point in the image dataset is an outlier, The minimum amount of data required to form a dataset model. The minimum number of iterations required for the image dataset model to be the optimal model. is the confidence level; S2223: Based on the interference scene removal result of the three-dimensional point cloud data, use voxel filtering to remove point cloud noise in the three-dimensional point cloud data, including the following steps: b1: Calculate the coordinate set of the point cloud data after removing the interference background from the 3D point cloud data. axis, Axis and Maximum and minimum values on the axis, and set the voxel grid ; b2: According to axis, Axis and The maximum and minimum values on the axis are used to calculate the side length of the point cloud bounding box. The formula is:
[0060] in, , and They are the point cloud bounding boxes in axis, Axis and The length of the side on the axis, and for The maximum and minimum values on the axis, and for The maximum and minimum values on the axis, and for Maximum and minimum values on the axis; b3: Calculate the voxel grid based on the side length of the point cloud bounding box. The formula is:
[0061] in, , and They are axis, Axis and Voxel grid on axis; b4: Calculate the index of each voxel grid in the 3D point cloud data according to the calculated voxel grid , the index The elements inside are sorted from small to large, and the centroid of the voxel grid is calculated. The centroid replaces all the points in the voxel grid to complete the removal of point cloud noise in the three-dimensional point cloud data. The index The calculation formula is:
[0062] in, , and They are axis, Axis and The index on the axis, , and They are axis, Axis and Points on the axis; S2224: Using the ICP algorithm to register the three-dimensional point cloud data of multiple perspectives after removing the interference scene and point cloud noise, including the following steps: c1: in the target point cloud Select sample points from , and in the source point cloud Find the corresponding point set in ; c2: Set the sample points Point cloud and rotation transformation matrix in and the three-dimensional translation vector Combine to get a new point cloud set , the formula is:
[0063] The rotation transformation matrix and the three-dimensional translation vector The calculation formula is:
[0064] in, is the sum of squared distances between target point clouds, is the number of sample points, is the sample point; c3: Calculate all new point cloud sets And the corresponding point set The average distance between , the formula is:
[0065] c4: If the average distance calculated If the value is less than a preset threshold or the number of iterations is greater than a preset maximum number of iterations, the iteration is stopped; otherwise, the process returns to step c1 and continues iterating until the constraint condition is met, thereby completing the registration of the three-dimensional point cloud data.
[0066] The S223 includes the following sub-steps: S2231: Meshing of point cloud, including the following steps: d1: Randomly select a point in the point cloud, find the two points closest to it, and connect the three points to form a triangle; d2: Take the three sides of the triangle as the boundaries of the mesh and list them as candidate sides, select one side of the triangle as the axis, and use the adaptive radius method to rotate the axis to generate a sphere; d3: When the ball rolls on the point cloud surface and touches a new point, the point and the candidate edge are connected to form a new triangle and included in the reconstructed mesh. The newly formed edge is listed as a new candidate edge, and the edge generated in the previous step is deselected; d4: Select the next edge from the new candidate edge and repeat the above steps d1-d3 until all points are involved in the rolling and a three-dimensional triangular mesh is generated to complete the point cloud meshing; S2232: Based on the point cloud meshing results, calculate the area of each small triangle mesh. The formula is:
[0067]
[0068] in, is the area of the small triangle mesh, , and are the lengths of the three sides of the small triangle, is the area of the small triangle; S2233: Add the area of each small triangle mesh to obtain the sum of the areas of the small triangle meshes. The formula is:
[0069] in, is the sum of the areas of the small triangle meshes, is the triangle mesh number, is the total number of grids.
[0070] In S3, the identity acquisition module is used to associate the weight data with the phenotype data using a time series-based data association method, including the following steps: S31: using the data association module to monitor the RFID reader, the weight sensor data collection program and the phenotype calculation program; S32: When the data association module listens to the animal or plant ID obtained by the RFID reader, it adds the timestamp T1 to the read ID and saves it to the cache queue Q1; when the data association module listens to the weight of the animal or plant read by the weight sensor, it adds the timestamp T2 to the read weight data and saves it to the cache queue Q2; when the data association module listens to the phenotypic data of the current target animal or plant calculated by the phenotypic calculation program, it saves the phenotypic data to the cache queue Q3; S33: When the data association module reads that the corresponding data exists in the cache queues Q1, Q2 and Q3, it determines whether the timestamp T2 is greater than T1. If so, it proceeds to step S34, otherwise it proceeds to step S35; S34: taking out the head elements of the cache queues Q1, Q2 and Q3 for data association and adding the timestamp T3, obtaining the weight and phenotypic data of the animals and plants for a complete measurement cycle, and completing the data association of the weight data and the phenotypic data; S35: Pop out the head element of the cache queue Q2, and return to step S33 to continue to determine the size of T1 and T2.
[0071] The weight and phenotype data of each plant and animal can be obtained by the time series-based data association method of the present invention. After the associated data is obtained, the data transmission program uploads the data to the database of the cloud server through the implemented MQTT protocol.
[0072] Embodiment 2, a portable animal and plant phenotyping system, comprising: Weight measurement module: used to measure the weight of animals and plants; Phenotypic measurement module: used to measure the phenotype of animals and plants; Identity acquisition module: used to identify animals and plants; Information storage module: used to store measured weight information, phenotypic information and identity information; System platform modules: data query, data export, animal and plant weight report recording, animal and plant phenotype report recording, equipment alarm and visual surface display.
[0073] In order to better record and analyze the weight and phenotype of animals and plants, the present invention builds an intelligent plant and animal phenotype measurement system platform, including data query, data export, animal and plant weight and phenotype record report, equipment warning report and visual chart. The front end is implemented using the Vue framework and ECharts, and the back end is implemented using the SpringBoot framework and MyBatis framework. The specific functions of each module are as follows: Data query module: used to query the weight and phenotypic data of animals and plants, and perform keyword queries according to animal and plant ID and date; Data export module: used to export the weight and phenotypic data of individual animals and plants to external systems or files for further analysis and research. The specific export operation needs to be used in conjunction with the data query module. After keyword querying according to the animal and plant ID and date, external export can be performed as needed; Animal and plant weight and phenotype record report module: including animal and plant code ID, weight, phenotype, and data collection date; Equipment early warning report module: alarms for disconnection or damage of hardware devices such as dual-mode cameras, RFID readers, weight scales, and small computers; Animal and plant weight and phenotype visualization module: used to generate visualization charts, so that users can clearly and intuitively see the weight and phenotype of animals and plants. Visualization charts include animal and plant weight change curves over time, and animal and plant phenotype change curves over time.
[0074] Embodiment 3, as Figure 3 and Figure 4As shown, a portable animal and plant phenotyping device is characterized in that it includes a box surrounded by wire mesh, a switch device 1 is arranged on the doors at the entrance and exit of the box, and an anti-skid rubber slope 2 that can be folded into the box is assembled at the entrance and exit, four lockable universal wheels 3 are installed at the bottom of the box, an RFID reader 4 is installed at the bottom of the side of the box, a weight scale 5 is placed at the bottom of the inner side of the box, a U-shaped handle 6 is installed on the side of the box, and adjustable telescopic arms 7 are installed on both sides of the box, a hollow crossbeam 8 is arranged on the top of the box, a first camera 9 and a computer 10 are installed on the hollow crossbeam 8, and the weight scale 5 and the RFID reader 4 are both connected through the hollow crossbeam 8, the first camera 9 is connected to the computer 10 via a USB data cable, and the computer 10 is connected to a remote server.
[0075] like Figure 5 As shown, the adjustable telescopic swivel arm 7 includes a connected telescopic rod rotating device 11 and a telescopic rod 12, a second camera 13 is installed on the telescopic rod 12, and the second camera 13 is fixed by a rotating card holder 14, and the second camera 13 is connected to the computer 10 via a USB data cable.
[0076] In one embodiment of the present invention, in a large-scale animal breeding base, the device can be placed on a place where animals must pass through for activities (drinking water, eating food). The device has an aisle that can automatically complete functions such as data collection, processing, association and uploading to the server. In order to facilitate placement in different locations, four lockable universal wheels 3 are installed at the bottom of the device, and a U-shaped handle 6 is used for movement. In order to ensure that there is enough time for data collection when the animal passes and only one animal can pass through at a time, the device box has a length of 100 cm, a width of 50 cm, and a height of 100 cm. In order to ensure that the image inside the cage can be accurately captured, the box is surrounded by wire mesh, and the spacing between the wire meshes is 80 mm.
[0077] In order to obtain the weight data of animals and plants, a weight scale 5 is placed in the middle of the passage, and the accuracy of the scale is ±10g. In order to ensure that the lion-headed goose walks onto the scale smoothly, a non-slip rubber slope 2 that can be folded into the box is assembled at the entrance and exit, and a switch device 1 is designed on the entrance and exit doors.
[0078] In order to establish a one-to-one data file with animals and plants, the present invention uses an RFID reader 4 in conjunction with a device with an RFID tag function to perform identity reading. The RFID reader is installed in the center of the outer side of the wire mesh, and the reading range of the RFID reader is limited to the cage, and can only read the tag data in the front 50cm*100cm*100cm rectangular area.
[0079] In order to obtain a suitable target image, the second cameras 13 on the left and right sides are installed on the adjustable telescopic arm 7 to obtain side images, and the first camera 9 on the top is used to obtain a top view image.
[0080] When implementing this embodiment, the weight scale and RFID reader are connected to the small computer 10 through the hollow crossbeam 8, and the camera is connected to the small computer 10 through a USB data cable. The small computer is installed above the channel and connected to the remote server for subsequent processing, association and uploading of weight data, identity data and phenotypic data.
[0081] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and should be understood that the protection scope of the present invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific variations and combinations that do not deviate from the essence of the present invention based on the technical revelations disclosed by the present invention, and these variations and combinations are still within the protection scope of the invention.
Claims
1. A portable method for determining plant and animal phenotypes, characterized in that: The following steps are involved: S1: Use the weight measurement module to measure the weight of animals and plants based on the dynamic weight measurement algorithm; S2: Use the phenotyping module to measure the phenotype of plants and animals based on the RGB-D-based animal and plant phenotype measurement algorithm; S3: Use the identity acquisition module to identify animals and plants based on the time series data association method; S4: using an information storage module to store the measured weight information, phenotypic information, and identity information; S5: Use the system platform module to perform data query, data export, animal and plant weight report recording, animal and plant phenotype report recording, equipment alarm and visual surface display to complete portable animal and plant phenotyping.
2. A portable animal and plant phenotyping method according to claim 1, characterized in that: The dynamic weight measurement algorithm in S1 is an animal and plant dynamic weighing algorithm based on adaptive limited Kalman filtering, and includes the following steps: S11: Input the collected raw data of animal and plant weights into an adaptive clipping Kalman filter algorithm to eliminate random interference. The adaptive clipping Kalman filter algorithm is: in, is the output value of the adaptive limiting Kalman filter algorithm, The dynamic weight data of the currently weighed animals and plants, is the average value of the dynamic weight data of the currently weighed animals and plants, The maximum value of the deviation of the dynamic weight data of the currently weighed animals and plants; S12: Initialize the coefficients of the adaptive clipping Kalman filter algorithm, and predict the system state equation and error covariance at the next moment based on the output value of the adaptive clipping Kalman filter algorithm. The system state equation at the next moment is: in, For weighing system The state of the moment, is the state transfer matrix, For weighing system The state of the moment, is the input control matrix, For The effect of the external environment on the weighing system at all times; The error covariance is: in, for The error matrix at time, is the prediction noise covariance matrix, for The error matrix at time , superscript is the transpose of the matrix; S13: Based on the system state equation and error covariance at the next moment, the Kalman gain is calculated. The formula is: in, is the observation matrix, is the measurement noise covariance matrix; S14: Based on the Kalman gain, the state correction is performed, and the formula is: in, for The observed value at time; S15: Based on the state correction result, the covariance matrix is updated, and the iteration is continued until the optimal estimate of the weight data is obtained. The covariance matrix is updated as follows: 。 3. A portable animal and plant phenotyping method according to claim 1, characterized in that: The S2 includes the following sub-steps: S21: when a weight change is detected by the weight sensor and the FRID reader and the FRID reader senses that an animal or plant has entered, it is determined that a phenotypic measurement of the entered animal or plant is required; S22: After reading the FRID tag data, turn on the dual-mode camera and capture the target data. Use the captured data through the multi-target plant and animal recognition algorithm based on yolov8 to determine whether the captured image data contains a complete target image. When the model determines that there is a complete target image in the image, the image data is phenotyped through the RGB-D-based plant and animal phenotype measurement algorithm, otherwise continue to capture the target data.
4. A portable animal and plant phenotyping method according to claim 3, characterized in that: The RGB-D-based animal and plant phenotype measurement algorithm in S22 includes the following sub-steps: S221: Inputting the recognized complete target image into a key point recognition model to extract key point information; S222: Mapping the extracted two-dimensional coordinate points to the three-dimensional reconstruction model of the plant and animal, and calculating the completed length parameters of the plant and animal based on the parameter algorithm of the Euclidean distance, the formula is: in, is the length, For the identified key points, For the The horizontal coordinate of the point, For the The horizontal coordinate of the point, For the The vertical coordinate of a point, For the The vertical coordinate of a point, For the The vertical coordinate of a point, For the The vertical coordinate of a point; S223: Meshing the three-dimensional reconstructed model of the animals and plants to calculate area parameters of the animals and plants.
5. A portable method for measuring plant and animal phenotypes according to claim 4, characterized in that: The three-dimensional reconstruction model of plants and animals in S222 is performed in the following steps: S2221: using a depth camera to obtain the depth image of plants and animals and convert the two-dimensional depth image into multi-angle three-dimensional point cloud data based on the camera imaging principle; S2222: Use the RANSAC-based background removal algorithm to remove interference scenes in the three-dimensional point cloud data, including the following steps: a1: Set the number of iterations and threshold, randomly select multiple data sample points from the image data set, where the data sample points meet the number of image data set model, and calculate the parameters of the image data set model; a2: Based on the calculation results, the image data set model is used to perform distance calculation on all data sample points of the image data set. When the distance between a data sample point and the image data set model is less than a set threshold, the data sample point is set as an inner point, otherwise it is set as an outer point; a3: Fit all the data sample points marked as inliers into a new model, calculate the error between all the data sample points marked as inliers and the new model, and update the new model parameters when the error is less than the error of the previous iteration, and record it as the optimal model; a4: When the set number of iterations is reached or the number of internal points of the optimal model is greater than the set ratio of the original data, the iteration is stopped to complete the removal of interference scenes in the three-dimensional point cloud data. The number of iterations satisfies: in, is the probability that a data point in the image dataset is an outlier, The minimum amount of data required to form a dataset model. The minimum number of iterations required for the image dataset model to be the optimal model. is the confidence level; S2223: Based on the interference scene removal result of the three-dimensional point cloud data, the point cloud noise in the three-dimensional point cloud data is removed by using voxel filtering, including the following steps: b1: Calculate the coordinate set of the point cloud data after removing the interference background from the 3D point cloud data. axis, Axis and Maximum and minimum values on the axis, and set the voxel grid ; b2: According to axis, Axis and The maximum and minimum values on the axis are used to calculate the side length of the point cloud bounding box. The formula is: in, , and They are the point cloud bounding boxes in axis, Axis and The length of the side on the axis, and for The maximum and minimum values on the axis, and for The maximum and minimum values on the axis, and for Maximum and minimum values on the axis; b3: Calculate the voxel grid based on the side length of the point cloud bounding box. The formula is: in, , and They are axis, Axis and Voxel grid on axis; b4: Calculate the index of each voxel grid in the 3D point cloud data according to the calculated voxel grid , the index The elements inside are sorted from small to large, and the centroid of the voxel grid is calculated. The centroid replaces all the points in the voxel grid to complete the removal of point cloud noise in the three-dimensional point cloud data. The index The calculation formula is: in, , and They are axis, Axis and The index on the axis, , and They are axis, Axis and Points on the axis; S2224: Using the ICP algorithm to register the three-dimensional point cloud data of multiple perspectives after removing the interference scene and point cloud noise, including the following steps: c1: in the target point cloud Select sample points from , and in the source point cloud Find the corresponding point set in ; c2: Set the sample points Point cloud and rotation transformation matrix in and the three-dimensional translation vector Combine to get a new point cloud set , the formula is: The rotation transformation matrix and the three-dimensional translation vector The calculation formula is: in, is the sum of squared distances between target point clouds, is the number of sample points, is the sample point; c3: Calculate all new point cloud sets And the corresponding point set The average distance between , the formula is: c4: If the average distance calculated If the value is less than a preset threshold or the number of iterations is greater than a preset maximum number of iterations, the iteration is stopped; otherwise, the process returns to step c1 and continues iterating until the constraint condition is met, thereby completing the registration of the three-dimensional point cloud data.
6. A portable animal and plant phenotyping method according to claim 4, characterized in that: The S223 includes the following sub-steps: S2231: Meshing of point cloud, including the following steps: d1: Randomly select a point in the point cloud, find the two points closest to it, and connect the three points to form a triangle; d2: Take the three sides of the triangle as the boundaries of the mesh and list them as candidate sides, select one side of the triangle as the axis, and use the adaptive radius method to rotate the axis to generate a sphere; d3: When the ball rolls on the point cloud surface and touches a new point, the point and the candidate edge are connected to form a new triangle and included in the reconstructed mesh. The newly formed edge is listed as a new candidate edge, and the edge generated in the previous step is cancelled as a candidate; d4: Select the next edge from the new candidate edge and repeat the above steps d1-d3 until all points are involved in the rolling and a three-dimensional triangular mesh is generated to complete the point cloud meshing; S2232: Based on the point cloud meshing results, calculate the area of each small triangle mesh. The formula is: in, is the area of the small triangle mesh, , and are the lengths of the three sides of the small triangle, is the area of the small triangle; S2233: Add the area of each small triangle mesh to obtain the sum of the areas of the small triangle meshes. The formula is: in, is the sum of the areas of the small triangle meshes, is the triangle mesh number, is the total number of grids.
7. A portable method for measuring plant and animal phenotypes according to claim 1, characterized in that: In S3, the identity acquisition module is used to associate the weight data with the phenotype data using a time series-based data association method, including the following steps: S31: using the data association module to monitor the RFID reader, the weight sensor data collection program and the phenotype calculation program; S32: When the data association module monitors the animal or plant ID obtained by the RFID reader, it adds a timestamp T1 to the read ID and saves it in the cache queue Q1; When the data association module monitors the weight of the animal or plant read by the weight sensor, it adds the timestamp T2 to the read weight data and saves it in the cache queue Q2; When the data association module monitors that the phenotypic calculation program calculates the phenotypic data of the current target animal or plant, the phenotypic data is saved in the cache queue Q3; S33: When the data association module reads that the corresponding data exists in the cache queues Q1, Q2 and Q3, it determines whether the timestamp T2 is greater than T1. If so, it proceeds to step S34, otherwise it proceeds to step S35; S34: taking out the head elements of the cache queues Q1, Q2 and Q3 for data association and adding the timestamp T3, obtaining the weight and phenotypic data of the animals and plants for a complete measurement cycle, and completing the data association of the weight data and the phenotypic data; S35: Pop out the head element of the cache queue Q2, and return to step S33 to continue to determine the size of T1 and T2.
8. A portable animal and plant phenotyping system, characterized in that: include: Weight measurement module: used to measure the weight of animals and plants; Phenotypic measurement module: used to measure the phenotype of animals and plants; Identity acquisition module: used to identify animals and plants; Information storage module: used to store measured weight information, phenotypic information and identity information; System platform modules: data query, data export, animal and plant weight report recording, animal and plant phenotype report recording, equipment alarm and visual surface display.
9. A portable device for measuring plant and animal phenotypes, characterized in that: The invention comprises a box surrounded by wire mesh, wherein the doors at the entrance and exit of the box are provided with switch devices (1), and the entrance and exit are both assembled with a non-slip rubber slope (2) that can be folded into the box, four lockable universal wheels (3) are installed at the bottom of the box, an RFID reader (4) is installed at the bottom of the side of the box, a weight scale (5) is placed at the bottom of the inner side of the box, a U-shaped handle (6) is installed on the side of the box, and adjustable telescopic arms (7) are installed on both sides of the box, a hollow crossbeam (8) is provided at the top of the box, a first camera (9) and a computer (10) are installed on the hollow crossbeam (8), and the weight scale (5) and the RFID reader (4) are both connected through the hollow crossbeam (8), the first camera (9) is connected to the computer (10) through a USB data cable, and the computer (10) is connected to a remote server.
10. A portable animal and plant phenotyping device according to claim 9, characterized in that: The adjustable telescopic swivel arm (7) comprises a connected telescopic rod rotating device (11) and a telescopic rod (12); a second camera (13) is mounted on the telescopic rod (12), and the second camera (13) is fixed via a rotating card holder (14); the second camera (13) is connected to a computer (10) via a USB data cable.
Citation Information
Patent Citations
Method and device for identifying poultry volume scale and storage medium
CN109636779A
Livestock body size three-dimensional measurement method and system based on machine vision technology
CN118729947A
Full -automatic poultry average weight weighing system
CN205537893U
Poultry weight measuring device
CN207798226U
Data processing method and system of module TV input event
CN105812859A