Image recognition method for the number of seeds per corner of rapeseed
By establishing a model relating rapeseed pod length characteristics to seed count and using image processing methods, the number of seeds per pod in rapeseed can be quickly and accurately identified, solving the problem of low efficiency in manual counting and improving the efficiency and accuracy of breeding and yield prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-22
- Publication Date
- 2026-03-13
AI Technical Summary
The existing manual counting method for the number of seeds per pod of rapeseed is time-consuming, labor-intensive, and inefficient, and cannot meet the needs of modern rapeseed breeding and yield measurement.
A model was established to show the relationship between the length of rapeseed pods and the number of seeds. Image processing methods were used to identify the length of pods and calculate the number of seeds, including image preprocessing, thinning, endpoint and intersection detection, endpoint pairing, etc. The DBSCAN clustering algorithm was used to remove redundant intersections, and endpoints and intersections were identified by combining lookup tables and structuring elements.
It enables rapid and accurate identification of the number of seeds per pod of rapeseed, improving the efficiency of breeding and yield prediction, with an identification accuracy of 83.87%.
Smart Images

Figure CN114067312B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to an image recognition method for the number of seeds per corner of rapeseed. Technical Background
[0002] Rapeseed is an important oilseed crop in my country. In the process of rapeseed breeding and production, it is necessary to estimate its yield. At present, the traditional method of estimating rapeseed yield is adopted. This method involves manually obtaining the number of pods on a single rapeseed plant, taking a certain number of pods to test the average number of seeds per pod, and then testing the thousand-seed weight of rapeseed at a certain moisture content. Based on this, the yield of a single rapeseed plant can be calculated according to the yield estimation formula. Based on this, the rapeseed yield per unit area in the field can be estimated.
[0003] Currently, the number of seeds per pod is counted manually by opening the pods. This manual counting is time-consuming, labor-intensive, and inefficient, and is no longer suitable for modern rapeseed breeding, seed evaluation, and yield measurement. This invention aims to identify the number of seeds per pod by quickly and accurately obtaining the characteristic parameters of rapeseed pods using an image method, based on a model showing the relationship between the characteristic parameters of rapeseed pods and the number of seeds. Summary of the Invention
[0004] (a) Technical problems to be solved
[0005] The technical problem this invention aims to solve is that the number of seeds per pod in rapeseed is currently still counted manually. This manual counting method is time-consuming, labor-intensive, and inefficient, and is no longer suitable for the needs of modern rapeseed breeding, seed evaluation, and yield measurement.
[0006] (II) Technical Solution
[0007] The image recognition method for the number of seeds per pod of rapeseed in the technical solution of this invention includes three steps: establishing a relationship model between the length feature parameter of rapeseed pod and the number of seeds; image recognition of the length of rapeseed pod; and calculating the number of seeds per pod based on the image recognition length of rapeseed pod and the relationship model between the length feature parameter of rapeseed pod and the number of seeds.
[0008] Standard for measuring the length of rapeseed pods: The length of rapeseed pods is measured based on the length of the pod portion after removing the flower stalk and beak. This standard is applicable to both manual measurement and image testing.
[0009] Model of the relationship between rapeseed pod length characteristic parameters and seed quantity: The length of pods is manually measured according to the standard for measuring pod length, and the number of seeds inside the pods is counted to establish a model of the relationship between rapeseed pod length characteristic parameters and seed quantity.
[0010] The relationship between rapeseed pod length and seed quantity is modeled as follows: y = 0.5407x - 9.4591, y = 0.5989x - 16.501, y = 0.6379x - 12.351, with a coefficient of determination R0. 2 =0.8914, R 2 =0.8867, R 2 =0.8812;
[0011] Rapeseed pod image acquisition: Use a scanner to acquire rapeseed pod images. The rapeseed pods are arranged in the scanner so that they do not overlap, but they can cross each other.
[0012] The silique image processing method consists of the following steps: image preprocessing, image thinning, endpoint and intersection detection, endpoint matching, and silique length calculation.
[0013] Image preprocessing: After grayscale conversion, binarization, hole filling, and removal of small areas, a complete binary image of rapeseed siliques can be obtained. Since the standard for measuring the length of siliques does not include the pedicel and beak, the opening operation is used to remove the pedicel and beak.
[0014] Image thinning: The rapeseed pod image is thinned, and the pods are transformed into skeletal lines (thin lines) located at the center of the pods. The thinned binary pod image and the line are only a single pixel wide. The edges of the rapeseed pod image will have a small amount of roughness, so the thinned rapeseed pod image will inevitably have burrs. Five pixels are removed from each skeletal line to remove the burrs.
[0015] Endpoint and intersection detection: This method uses the hit-and-miss transformation principle to detect isolated foreground pixels or endpoint pixels of line segments; the hit-and-miss transformation of A by B is defined as follows: B is a structuring element pair B = (B1, B2), therefore Endpoint and intersection detection involves two steps: setting up a lookup table and scanning to find endpoints or intersections.
[0016] Setting up a lookup table: When the hit / miss structuring element is small, a faster method for calculating the hit / miss transformation is to use a lookup table (LUT). To use a lookup table, each possible shape must be assigned a unique index. The detection template used is a 3×3 structuring element. In the binary image, each position can only have values of 0 and 1, so this detection template has a total of 2... 9 = 512 distinct shapes. To assign a unique index value to each shape, multiply the elements of that shape by the matrix below. By summing the multiplications, a unique value can be assigned to each 3×3 shape in the range [0-511]. The endpoints of a line segment can only have one 1 within its 8-connected domain, excluding itself; that is, the sum of the template elements at that point is 2 and the template center point is 1. Based on this, a column vector lookup table of length 512 is constructed. The index value of each template is calculated and incremented by 1 (making the index value [1-512]). Endpoints satisfying the endpoint condition are set to 1 at the corresponding position in the lookup table, otherwise they are set to 0, resulting in the final lookup table.
[0017] Scanning to find endpoints or intersections: Scanning is a searching process. The 3×3 template structure elements are traversed throughout the rapeseed branch skeleton image and the index value within each shape is calculated. Then, the corresponding value in the lookup table is used. A value of 1 indicates an endpoint, and a value of 0 indicates a non-endpoint. Simply changing the sum of the template elements from 2 to 4, while keeping the other conditions unchanged, can effectively identify the intersections between pods and their nearby points. In the identification of pod intersections, this method does not identify a single intersection, but rather the intersection itself and a cluster of points nearby. Therefore, it is necessary to remove redundant intersections.
[0018] DBSCAN clustering is a density-based, noisy spatial clustering algorithm that divides regions with sufficient density into clusters. Since the intersection points of rapeseed pods are indeed clustered, this algorithm can be used to cluster these intersection points. By selecting one point from each cluster as the intersection point and removing the remaining points from that cluster, redundant intersection points can be removed. DBSCAN clustering has the following six basic definitions: Eps neighborhood, core point, boundary point, noisy point, directly density-reachable, density-reachable, density-connected, and centered on the core point.
[0019] Endpoint pairing: Endpoint pairing requires that the two matched endpoints are the actual endpoints of a single silique, and the distance between these two endpoints is the length of the silique. In a fully tiled image of rapeseed siliques, due to the large number of silique endpoints, correct pairing is too difficult. Therefore, extracting silique images by connected components and then pairing the endpoints of the siliques in the sub-images can reduce the matching difficulty and improve the matching accuracy. Pairing is classified according to the number of endpoints d and the number of intersections p in the sub-images. The pairing forms are: single silique type d=2 and p=0, double silique type d=4 and p=1, and ordinary type.
[0020] Common pairing method: First, choose any intersection point o of the angles as the origin, and draw vectors oa and ob from o to any two endpoints a and b, respectively. Find vectors The included angle θ between them (0≤θ≤180°).
[0021] Let the coordinates of endpoints a and b be (x1, y1) and (x2, y2) respectively. Draw the equation of a straight line passing through points a and b. Take an x-value every unit between the two endpoints and calculate the corresponding y-value. Assume a total of t coordinate points are taken, and u coordinate points fall within the rapeseed pods (the coordinates correspond to a value of 1 in the binary graph of the rapeseed pods). Find the degree of overlap between the line and the pods.
[0022] Based on the straightness of the silique itself, if endpoints a and b satisfy θ ≥ 170° and ξ ≥ 0.9, then endpoints a and b are the two endpoints of a silique. Connecting a and b gives the length of the silique. When pairing unpaired endpoints again, the pairing conditions need to be reduced. The reduction standard is that θ decreases by 10° each time and ξ decreases by 0.1 each time. That is, in the second pairing, the two unpaired endpoints only need to satisfy θ ≥ 160° and ξ ≥ 0.8. This process continues until the conditions are reduced to θ ≥ 120° and ξ ≥ 0.4, at which point the endpoint pairing ends. After multiple pairings, siliques with both endpoints identified have been correctly paired, but siliques with only one endpoint identified are still unpaired. The endpoints of such siliques intersect with other siliques to form intersection points. Therefore, the pairing method for such siliques should be pairing endpoints with intersection points, with the pairing condition being ξ ≥ 0.95. Among all intersection points that meet the conditions, the intersection point farthest from the endpoint is selected for pairing. If there are still unpaired endpoints after one pairing, then the pairing criteria are lowered and a second pairing is performed, just like above, until all endpoints are paired, and then the pairing ends.
[0023] Kale length calculation: Assuming the coordinates of the two endpoints a and b of the paired kale are (x1, y1) and (x2, y2), the pixel length d of the kale can be obtained by using the distance formula between the two points; set the conversion ratio k for converting the pixel length d to the physical size length d'; in the modeling set, the length of the rapeseed kale is the physical size length, so the pixel length d needs to be converted to the physical size length d'.
[0024] Calculation of seed count in siliques: Substitute the obtained silique length d' into the linear relationship model between rapeseed silique length and seed count to obtain the seed count in rapeseed siliques.
[0025] (III) Beneficial Effects
[0026] To address the issue of seed count per silique in rapeseed, this invention establishes a correlation model between the characteristic length parameter of the rapeseed silique and the number of seeds within it. Based on the analysis of the characteristic length parameter and the number of seeds within the silique, it obtains the silique length parameter using image processing methods and calculates the seed count using the correlation model. This achieves the goal of quickly and accurately identifying the seed count per silique. By establishing this correlation model, rapeseed silique images can be directly acquired, and the silique length parameter can be obtained using image processing methods. This allows for rapid, accurate, and automatic identification of the seed count per silique, which is beneficial for accelerating rapeseed breeding, variety evaluation, and yield prediction processes. Attached Figure Description
[0027] Figure 1 Image processing algorithm flow
[0028] Figure 2 Images of siliques collected
[0029] Figure 3 Preprocessed rapeseed pod image
[0030] Figure 4 Template collection of endpoint and non-endpoint regions
[0031] Figure 5 silique endpoint recognition results
[0032] Figure 6 Selection results of rapeseed pod intersection points
[0033] Figure 7 Result of horned fruit endpoint pairing
[0034] Figure 8 Sicaria cross-type
[0035] Figure 9 Common silique end pairing process
[0036] Figure 10 Overall results of silique endpoint pairing Detailed Implementation
[0037] The image recognition method for the number of seeds per pod of rapeseed according to the technical solution of the present invention is illustrated by taking the image of rapeseed pods acquired by a scanner as an example. The method uses image processing to identify the length dimension parameter of the pods and calculates the number of seeds per pod based on the established relationship model between the length feature parameter of rapeseed pods and the number of seeds.
[0038] The image recognition method for the number of seeds per pod of rapeseed in this invention includes three steps: establishing a relationship model between the length feature parameter of rapeseed pods and the number of seeds; image recognition of the length of rapeseed pods; and calculating the number of seeds per pod from the image recognition length of rapeseed pods and the relationship model between the length feature parameter of rapeseed pods and the number of seeds. The specific image recognition method for the number of seeds per pod of rapeseed is shown in the flowchart. Figure 1 As shown
[0039] Standard for measuring the length of rapeseed pods: The length of rapeseed pods is measured based on the length of the pod portion after removing the flower stalk and beak. This standard is applicable to both manual measurement and image testing.
[0040] Model of the relationship between rapeseed pod length characteristic parameters and seed quantity: The length of pods is manually measured according to the standard for measuring pod length, and the number of seeds inside the pods is counted to establish a model of the relationship between rapeseed pod length characteristic parameters and seed quantity.
[0041] The relationship between rapeseed pod length and seed quantity is modeled as follows: y = 0.5407x - 9.4591, y = 0.5989x - 16.501, y = 0.6379x - 12.351, with a coefficient of determination R0. 2 =0.8914, R 2 =0.8867, R 2 =0.8812;
[0042] During image acquisition, simply lay the rapeseed pods flat on the scanner to obtain images of the rapeseed pods on the PC. The scanning parameter is 300 dpi. Taking the 'Fengyou 737' variety as an example, the scanned rapeseed pod images are as follows: Figure 2 As shown.
[0043] Three rapeseed varieties, 'Fengyou 737', 'Yangyou 5', and 'Suyou 1', were used in the experiment. The pods were cut off with scissors and then air-dried in the laboratory. The number of pods tested for the three varieties were 206, 228, and 289, respectively, with 101, 133, and 199 in the modeling set and 105, 95, and 90 in the validation set. The actual length of the pods was measured using vernier calipers, with the measurement standard being the length of the pod after removing the flower stalk and beak. The number of seeds per pod was obtained manually.
[0044] The silique image processing method consists of the following steps: image preprocessing, image thinning, endpoint and intersection detection, endpoint matching, and silique length calculation.
[0045] Image preprocessing: After preprocessing such as grayscale conversion, binarization, hole filling, and removal of small areas, a complete binary image of the rapeseed silique is obtained. Since the standard for measuring silique length in this paper does not include the pedicel and beak, an opening operation is used to remove the pedicel and beak. The preprocessed rapeseed silique image is shown below. Figure 3 As shown.
[0046] Image thinning: Image thinning transforms an object into a skeleton with the skeleton lines (thin lines) located at the center of the object. The thinned binary object and its shape are only a single pixel wide. Since the rapeseed pod image has some rough edges, the thinned rapeseed pod image inevitably has burrs. To remove burrs, 5 pixels are removed from each skeleton line.
[0047] Endpoint and corner detection includes: setting up a lookup table and scanning to find endpoints or intersections;
[0048] Hit-and-miss transform: This transform uses the hit-and-miss principle to detect isolated foreground pixels or endpoint pixels of line segments; the hit-and-miss transform of A being hit or missed by B is defined as follows: B is a structuring element pair B = (B1, B2), therefore
[0049] Using Lookup Tables: When the hit / miss structuring element is small, a faster method for calculating the hit / miss transformation is to use a lookup table (LUT). To use a lookup table, each possible shape must be assigned a unique index. The detection template used in this paper is a 3×3 structuring element. In the binary image, each position can only have values of 0 and 1, so this detection template has a total of 2... 9 = 512 distinct shapes. To assign a unique index value to each shape, multiply the elements of that shape by the following matrix:
[0050]
[0051] By summing the multiplications, a unique value can be assigned to each 3×3 shape in the range [0-511]. The endpoint of a line segment can only have one 1 in its 8-connected domain, except for itself, that is, the sum of the template elements at that point is 2 and the center point of the template is 1. Based on this, a column vector lookup table of length 512 is constructed. The index value of each template is calculated and incremented by 1 (making the index value [1-512]). If the endpoint condition is satisfied, the corresponding position in the lookup table is set to 1, otherwise it is set to 0. The final lookup table is shown in Table 1.
[0052] Table 1 Lookup Table
[0053]
[0054] Scanning to find the endpoints or intersections of the rapeseed branches: Scanning is a searching process that involves traversing the entire rapeseed branch skeleton image with 3×3 structuring elements and calculating the index value within each shape. Then, the value is matched to a lookup table: 1 indicates an endpoint, and 0 indicates a non-endpoint. When the detection template acquires... Figure 4 When calculating the area shown in (a), the index value corresponding to this shape element is 1×0+2×0+4×0+8×0+16×1+32×1+64×0+128×0+256×0+1=49. Using the lookup table, the value is 1, so this point (the red center point) is an endpoint. When the detection template detects and collects data such as… Figure 4 When calculating the area shown in (b), the index value corresponding to the shape element is 1×0+2×0+4×0+8×1+16×1+32×1+64×0+128×0+256×0+1=57. The value can be obtained by looking up the table, so the point (red center point) is not an endpoint.
[0055] Endpoint scan results as follows Figure 5 As shown in the figure, the endpoints of each silique have been identified (the position of '0' is the identified endpoint position), indicating that the method can accurately identify the endpoints of the silique.
[0056] Experiments showed that simply changing the sum of the template elements from 2 to 4, while keeping the other conditions unchanged, can effectively identify the intersections between horns and their neighboring points. In the identification of horn intersections, this method does not identify a single intersection, but rather the intersection itself and a cluster of points nearby. Therefore, it is still necessary to remove redundant intersections.
[0057] DBSCAN Clustering Algorithm: The DBSCAN clustering algorithm is a density-based spatial clustering algorithm with noise. It divides regions with sufficient density into clusters. Since the identification results of intersections between rapeseed pods are indeed clustered, this algorithm can be used to cluster these intersections. By selecting one point from each cluster as the intersection point and removing the remaining points from that cluster, redundant intersections can be removed. The DBSCAN clustering algorithm has the following six basic definitions: Eps neighborhood, core point, boundary point, noise point, directly density-reachable, density-reachable, density-connected, and centered on the core point.
[0058] The DBSCAN clustering algorithm (Eps=80, minPts=2) is used to cluster the intersection points of rapeseed pods. The first point in each cluster is selected as the intersection point, and the remaining points are discarded to remove redundant intersection points. Figure 6 As shown.
[0059] Endpoint pairing: Endpoint pairing requires that the two matched endpoints are the actual endpoints of a single silique, and the distance between these two endpoints is the length of the silique. In a fully tiled image of rapeseed siliques, due to the large number of silique endpoints, correct pairing is too difficult. Therefore, extracting silique images by connected components and then pairing the endpoints of the siliques in the sub-images can reduce the matching difficulty and improve the matching accuracy. Pairing is classified according to the number of endpoints d and the number of intersections p in the sub-images. The pairing forms are: single silique type d=2 and p=0, double silique type d=4 and p=1, and ordinary type.
[0060] Single-angled fruit type: d=2 and p=0. This type of endpoint pairing is the simplest; simply connecting the two endpoints directly will achieve correct pairing. The pairing result is as follows: Figure 7 As shown.
[0061] Dichotomous cross type: d=4 and p=1, the image of this type of silique is as follows Figure 8 As shown in (a), the zigzag image has four intersection points: a, b, c, and d, with coordinates (x1, y1), (x2, y2), (x3, y3), and (x4, y4). By permutation and combination, these four points can form three different pairings: (ad, bc), (ab, dc), and (ac, bd). Clearly, only the (ac, bd) combination is the correct pairing. To ensure that the pairing result is only the (ac, bd) combination, we need to find the intersection point between the two paired lines. The combination where the intersection point lies within the quadrilateral formed by the four endpoints is the (ac, bd) combination. Taking the (ac, bd) combination as an example, the intersection point is found using... The formula calculates the intersection point (x, y) by solving a system of equations. The condition that the intersection point lies inside the quadrilateral formed by the four endpoints is x. min ≤x≤x max And y min ≤y≤y max , where x min The minimum x-coordinate among the four endpoints, x max The maximum x-coordinate and y-coordinate among the four endpoints. min The minimum y-coordinate among the four endpoints, y max It is the maximum value of the ordinate among the four endpoints.
[0062] Pairing results are as follows Figure 8 As shown in (b).
[0063] Standard type: The characteristic of standard silique images is that there are many silique intersection points and their distribution is disordered, making pairing difficult. First, select any silique intersection point o as the origin, and draw vectors oa and ob from point o to any two endpoints a and b (e.g., ...). Figure 9 (a) shows that they are respectively represented as From the formula of the included angle of vectors Find vectors The included angle θ between them (0≤θ≤180°).
[0064] Let the coordinates of endpoints a and b be (x1, y1) respectively. ) Given points (x2, y2), construct the equation of the straight line passing through points a and b.
[0065] Take an x-value every unit between the two endpoints and calculate the corresponding y-value. Assume a total of t coordinate points are taken, and u coordinate points fall within the rapeseed pod (the coordinates correspond to a value of 1 in the binary image of the rapeseed pod). Then, use the formula... Find the degree of overlap between the line and the angle.
[0066] Based on the straight nature of the silique, if endpoints a and b satisfy θ ≥ 170° and ξ ≥ 0.9, then endpoints a and b are the two endpoints of a certain silique. Connecting a and b gives the length of the silique. The pairing results are as follows: Figure 9 As shown in (b), this condition is not suitable for all siliques, because not all siliques are straight. However, this condition can prioritize the correct pairing of siliques with clearly defined and straight endpoints, thus reducing the difficulty of subsequent pairings. When pairing unpaired endpoints again, the pairing conditions need to be reduced. The reduction standard is that θ decreases by 10° each time and ξ decreases by 0.1 each time. That is, in the second pairing, the two unpaired endpoints only need to satisfy θ≥160° and ξ≥0.8. This process continues until the conditions are reduced to θ≥120° and ξ≥0.4, at which point endpoint pairing ends. The pairing results are as follows: Figure 9 As shown in (c), after multiple pairings, all horns with both endpoints identified have been correctly paired, but horns with only one endpoint identified remain unpaired. These horns form intersection points when their endpoints intersect with other horns; therefore, the pairing method for these horns should be endpoint-intersection pairing, with a pairing condition of ξ≥0.95. Among all intersection points meeting this condition, the intersection point furthest from the endpoint is selected for pairing. If there are still unpaired endpoints after one pairing, the pairing standard is lowered and a second pairing is performed until all endpoints are paired, at which point the pairing ends. The pairing results are shown in Figure 9(d). The endpoint pairing results of the rapeseed horn image in the flat state are as follows: Figure 10 As shown.
[0067] Silique length calculation: Assuming the coordinates of the two endpoints a and b of a paired silique are (x1, y1) and (x2, y2), respectively, the length can be calculated using the distance formula between the two points. The pixel length d of the horn can then be obtained.
[0068] In the modeling set, the length of the rapeseed pod is the physical dimension length, so the pixel length d needs to be converted to the physical dimension length d'. First, scan an A4 sheet of paper under the same scanning conditions and fit it to the minimum bounding rectangle. The length and width (l, w) of this rectangle are the pixel length and width of the A4 paper. Then, use the formula... The conversion ratio k can be calculated using (mm / pixel). The physical length of the horn is d' = kd (mm).
[0069] Seed pod length identification results: Using manually measured lengths as the actual seed pod lengths, the proposed image recognition method was used to identify the seed pod lengths of three rapeseed varieties. The correlation coefficients (R²) between the identified seed pod lengths and the actual seed pod lengths of the three rapeseed varieties were analyzed. 2 The correlation coefficients were all above 0.97, indicating a highly significant correlation. This demonstrates that the rapeseed pod length identification method proposed in this paper can accurately identify the length of rapeseed pods when laid flat.
[0070] The average absolute errors for identifying the length of rapeseed pods for the three varieties were 1.35 mm, 0.78 mm, and 2.13 mm, respectively, with average relative errors of 2.6%, 2.35%, and 3.29%, respectively. The average accuracy for identifying the length of rapeseed pods for the three varieties was 97.25%. This indicates that the endpoint detection and pairing method proposed in this paper can achieve the requirements of high-throughput, high-accuracy, and automated identification of rapeseed pod length.
[0071] Calculation of seed count in siliques: Substitute the obtained silique length d′ into the linear relationship model between rapeseed silique length and seed count to obtain the seed count in rapeseed siliques.
[0072] Seed count prediction results for siliques: The seed count can be obtained by substituting the identified rapeseed silique length information into the correlation model between silique length and seed count for the corresponding rapeseed variety. Manual counting is used as the actual seed count. The correlation coefficient (R²) between the predicted seed count per silique and the actual seed count for the three rapeseed silique image data is shown. 2 The correlation coefficients were all above 0.84, indicating a highly significant correlation and demonstrating the feasibility of the proposed rapeseed pod length image recognition method. The average absolute errors for predicting the number of seeds per pod for the three rapeseed varieties were 3.40, 1.43, and 3.23, respectively, with average relative errors of 17.77%, 12.75%, and 17.86%, respectively. The average prediction accuracy for the number of seeds per pod for the three rapeseed varieties was 83.87%. This demonstrates that the rapeseed pod length recognition algorithm and the rapeseed pod length prediction algorithm proposed in this invention are accurate and feasible.
[0073] The image recognition method for the number of seeds per pod of rapeseed described in this invention is not limited to rapeseed pods, but is also applicable to the recognition of the number of seeds in pods of other pod crops such as peas, broad beans, and soybeans.
Claims
1. A method for image recognition of the number of grains per node of oilseed rape, characterized in that, The method comprises the steps of: S1. The length of the rapeseed pod was determined based on the length of the pod portion after removing the flower stalk and beak. The pod length was measured manually, and the number of seeds per pod was counted. Relationship models between the characteristic parameters of pod length and the number of seeds per pod were established for three rapeseed varieties: v = 0.5407w - 9.4591, v = 0.5989w - 16.501, v = 0.6379w - 12.
351. The coefficient of determination for the model was R0. 2 =0.8914, R 2 =0.8867, R 2 =0.8812; S2. An image recognition method for the length of the rape silique: collecting the image of the rape silique in a flat state, and recognizing the physical length of the silique through the steps of silique image preprocessing, silique image thinning, detection of the end points and intersection points of the silique line segment, pairing of the end points of the silique line segment, and silique length calculation; Step S2 further comprises: S2.1 collecting the image of the batch of rape silique in a flat state by using a scanner, and obtaining the complete silique binary image after the rape silique image is subjected to grayscale, binarization, hole filling, and small-area removal; and removing the pedicel and beak of the silique by using the opening operation; S2.2 thinning the rape silique image, so that the silique becomes a skeletal thin line located at the center position of the silique, and the thinned silique binary image and shape are only a single-pixel-wide line; and removing 5 pixel points from each skeletal thin line to achieve the purpose of removing burrs; S2.3 detecting the end points and intersection points of the silique line segment by using the hit-or-miss transform principle; the detection of the end points and intersection points of the silique line segment comprises two steps of setting a lookup table and scanning for the end points and intersection points of the silique line segment; the two steps specifically comprise: The setting lookup table in step S2.3 includes: using a detection template with a 3*3 shape as a structural element, only 0 and 1 are possible values of each position in the binal image of the silique, the detection template has 2 9 =512 different shapes, multiplying the shape element with the matrix , and adding the product to obtain a unique value of 0-511 for each 3*3 shape; the end point of the silique line segment can only exist one 1 in the 8 silique connected domain except itself, that is, the sum of the detection template elements is 2 and the center point of the detection template is 1, and a column vector lookup table with a length of 512 is constructed according to this, the index value of each detection template is calculated and added by 1, the index value is changed to 1-512, 1 is placed in the corresponding position of the lookup table if the line segment end point condition is met, otherwise 0 is placed, and finally the lookup table is generated; The scanning for the end points and intersection points of the silique line segment in step S2.3 comprises traversing the entire rape silique skeletal image by using a 3*3-shaped detection template structure element and calculating the index value of each shape, then corresponding to the corresponding value on the lookup table, which is 1 for a line segment end point and 0 for a non-line segment end point; changing the sum of the template elements from 2 to 4 while keeping the remaining conditions unchanged, so that the intersection points between the silique line segments and a cluster of intersection points near the intersection points can be effectively identified; S2.4 the identification result of the intersection points between the silique line segments is a cluster of clusters, so the DBSCAN clustering algorithm is used to cluster the intersection points of the silique line segment, a point is selected from each cluster as the intersection point of the silique line segment, and the remaining points in the cluster are removed, so that the redundant intersection points are removed; S2.5 extracting the silique sub-image in units of silique connected domains, and then pairing the end points of the silique line segment in the silique sub-image; and classifying and pairing according to the number d of the end points of the silique line segment and the number p of the intersection points of the silique line segment; the pairing forms include single-silique type d=2 and p=0, double-silique intersection type d=4 and p=1, and ordinary type; S2.6 General type pairing step: select any silique line segment intersection point o as the origin, make vector oa, ob from o to the two end points a, b of the arbitrary silique, respectively, as Calculate the angle θ between the vectors Make the equation of the straight line passing through the two silique line segment end points a, b, take every 1 unit of x coordinate value between the two end points and calculate the corresponding y coordinate value, assume that t straight line coordinate points are taken and u coordinate points fall within the rape silique, then the coincidence degree of the straight line and the silique is If the end points a, b satisfy θ≥170° and ξ≥0.9, then the end points a, b are the two end points of a silique line segment, when pairing the unpaired end points again, reduce the pairing condition to θ by 10° and ξ by 0.1, until the condition is reduced to θ≥120° and ξ≥0.4, end the end point pairing; S2.7 assuming that the coordinates of the paired end points a and b of the silique line segment are (x1, y1) and (x2, y2), the pixel length d of the silique is obtained through the distance formula between the two points; and setting the conversion proportion coefficient k of the pixel length d into the physical length d' of the silique; S3. substituting the physical length of the silique obtained by image recognition into the relationship model between the length characteristic parameter of the corresponding variety of rape silique and the number of grains per silique, so as to obtain the number of grains per silique in the rape silique.
Citation Information
Patent Citations
A method for counting seeds of a wheatear portion per wheat
CN103632157A
Rape yield estimation method
CN111191543A