Tobacco plant missing positioning method, electronic equipment and storage medium
By using computer processing technology to automatically identify the location of missing plants in tobacco fields, generate vector lines and calculate their lengths, the problem of low efficiency in manual observation is solved, and the efficiency of missing plant detection and the accuracy of yield estimation are improved.
Patent Information
- Application Number
- CN202410081192.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-19
- Publication Date
- 2026-01-27
AI Technical Summary
In existing technologies, the location of missing tobacco plants in tobacco fields mainly relies on manual observation, which is inefficient and cannot detect and deal with the problem in a timely manner, thus affecting the growth and yield of tobacco plants.
By acquiring the vector point set of tobacco plants and the boundary data of the plots, computer processing technology is used to identify the location of missing plants, generate vector lines and calculate their lengths, and automatically detect the situation of missing plants.
It enables efficient detection of missing plants without manual observation, improving the efficiency of locating missing plants in tobacco fields and the accuracy of yield estimation.
Smart Images

Figure CN121415237A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing, and in particular to a method for locating missing tobacco plants, an electronic device, and a storage medium. Background Technology
[0002] During tobacco planting, factors such as poor seed germination, seedling death, pests and diseases, and drought or flooding can lead to planting densities below normal levels, a phenomenon known in agriculture as "short-planting." Short-planting affects crop growth and yield; therefore, timely detection and management of short-planting is crucial in agricultural production management. For tobacco fields, locating short-planting during the transplanting period is invaluable for assessing seedling survival, monitoring transplanting progress, and promptly replanting when necessary. Locating short-planting after transplanting is essential for clarifying the number of tobacco plants, improving yield estimation accuracy, and analyzing the causes of short-planting.
[0003] In existing technologies, the situation of missing plants in tobacco fields is usually obtained by manually observing the tobacco fields. This method is time-consuming and inefficient. Summary of the Invention
[0004] To address the aforementioned technical problems, the technical solution adopted by this invention is as follows: A method for locating missing tobacco plants, comprising the following steps: S1: Obtain the vector point set A of tobacco plants and the vector line boundary data B of the tobacco field to be detected. The vector points in A are the vector points corresponding to each tobacco plant in the tobacco field to be detected.
[0005] S2: Obtain the missing tobacco plant location based on A.
[0006] S2 includes the following steps: S21: Obtain the reference tobacco plant vector point D from A. α and D α Add it to P, where P is the set of vector points.
[0007] S22: Obtain D α tobacco plant vector point E within the preset range α and E α Add it to P.
[0008] S23: According to D α E α Obtain from D α To E α Directional data F α 1 and by E α To D α Directional data F α 2 Fα 1 Taking D α as the reference, with the due north direction being 0 degrees and the clockwise direction being the positive direction, E α with respect to D α the angle value at which it is located, F α 2 Taking E α as the reference, with the due north direction being 0 degrees and the clockwise direction being the positive direction, D α with respect to E α the angle value at which it is located.
[0009] S24: Obtain the set of tobacco plant vector points G α 1 in the F α 1 direction = {G α 1 1, G α 1 2,..., G α 1 j ,..., G α 1 n(α)}, G α 1 j is the j-th vector point in G α 1 , j = 1, 2,..., n(α), n(α) is the number of vector points in G α 1 Delete G α 1 from A, and add G α 1 to P.
[0010] S24 includes the following steps: S241: Obtain the intersection point H α ] / >of the extension line from D α to E α 1 with B, and add H α 1 to P.
[0011] S242: Search for the vector points in A, including the following steps: S2421: When i = m + 1, execute S25; when i < m + |, execute S2422, where m = int(L α 1 / b), i is the number of loops, i = 1, 2,..., m, L α 1 is E αTo H α 1 The distance is denoted by b, where b is the spacing between tobacco plants.
[0012] S2422: Let r1 = 1.5b + i b, obtain D α With point as the center, and r1 as the radius, and [F] as the radius, the circle is drawn. α 1 -arctan(0.5a / r1), F α 1 [+arctan(0.5a / r1)] is the angle range to obtain the vector point in A within the sector, where a is the row spacing of the tobacco plants. If there is no vector point within the range, let i = i + 1 and re-execute S2421. If there is a vector point within the range, then use that vector point as G. α 1 j And execute S2423.
[0013] S2423: Sequentially obtain data from G α 1 1 to G α 1 j The j vector points to E α Distance generation distance list J α 1 ={J α 1 1, J α 1 2, ..., J α 1 j}
[0014] S2424: Obtain max(J) α 1 The corresponding vector point G α 1 max, get E α To G α 1 Max's direction data F α G1, and let F α 1 =F α G1.
[0015] S2425: Obtain E α To G α 1 The intersection point H of the extension of max and B. α G1, and obtain H α The distance L between G1 and E α G1.
[0016] S2426: Let L α 1 =L α G1, if i=m, then H α Add G1 to P, otherwise set i = i + 1 and re-execute S2421 to S2426.
[0017] S25: Use the method obtained from S24 to get G α 1 In the same way, obtain F α 2 The set of vector points G of tobacco plants in the direction α 2 ={G α 2 1, G α 2 2, ..., G α 2 g , ..., G α 2 z(α)}, G α 2 g For G α 2 The g-th vector point in G, g = 1, 2, ..., z(α), z(α) is the vector point of G. α 2 The number of vector points in G α 2 Delete from A and remove from G. α 2 Add it to P.
[0018] S26: Connect the nearest vector point to each vector point in P with the nearest vector point in the opposite direction to generate a vector line, and add each vector line segment to Q. α Q is generated in α ={Q α 1, Q α 2, ..., Q α k Q α t(α)}, Q α k Let t(α) be the k-th vector line, k = 1, 2, ..., t(α), and t(α) be Q. α The total number of vector lines.
[0019] S27: Regarding Q α In each Q α k Get Q α k Length Q α 0k If Q α 0 k >T, Q α k Add it to the pre-defined layer R, where Q is located. α k The location is where the tobacco plant is missing, and T is the length threshold.
[0020] S28: D α E α Remove it from A and let α = α + 1.
[0021] S29: Repeat S21-S28 until the number of vector points in A is 0.
[0022] According to another aspect of the present invention, a non-transitory computer-readable storage medium is provided, wherein at least one instruction or at least one program is stored therein, the at least one instruction or the at least one program being loaded and executed by a processor to implement the aforementioned method.
[0023] According to another aspect of the present invention, an electronic device is provided, including a processor and the aforementioned non-transitory computer-readable storage medium.
[0024] The present invention has at least the following beneficial effects: First, A is obtained using a tobacco plant identification method. Then, the vector points in A are searched, and the vector points corresponding to the tobacco plants in the field to be detected, as well as the intersection points of the straight lines corresponding to each row of tobacco plants with B, are added to P. Next, the nearest vector point and the nearest vector point in the opposite direction of each vector point in P are connected to generate t vector lines, thus generating Q. Then, the length of each vector line is calculated. When the length of the vector line is greater than T, it is considered that there is a missing plant in the tobacco field corresponding to that vector line. This completes the detection of missing plants in the tobacco field without manual observation, improving efficiency. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 This is a flowchart of a method for locating missing tobacco plants provided in an embodiment of the present invention. Detailed Implementation
[0027] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0028] like Figure 1 As shown in the figure, this embodiment of the invention provides a method for locating missing tobacco plants, the specific steps of which are as follows: S1: Obtain the vector point set A of tobacco plants and the vector line boundary data B of the tobacco field to be detected. The vector points in A are the vector points corresponding to each tobacco plant in the tobacco field to be detected.
[0029] Specifically, A is obtained through existing tobacco plant identification methods, such as machine vision, to determine the location of tobacco plants in the tobacco field and to create a model. These tobacco plant identification methods are well-known to those skilled in the art and will not be elaborated upon here. B is the vector line boundary data of the tobacco field plot to be detected, which is obtained by those skilled in the art using existing technologies and will not be elaborated upon here.
[0030] S2: Obtain the missing tobacco plant location based on A.
[0031] Specifically, S2 includes the following steps: S21: Obtain the reference tobacco plant vector point D from A. α and D α Add it to P, where P is the set of vector points.
[0032] Specifically, step S21 includes the following steps: S211: Randomly select any vector point A0 from A.
[0033] S212: Using A0 as the center and β as the radius, search for vector points within A. If other vector points exist within the range, then take A0 as D. α Otherwise, re-execute S211.
[0034] Specifically, β satisfies the following condition: β = 1.5b.
[0035] Specifically, b represents the plant spacing between tobacco plants obtained according to the local "Technical Guidelines for Tobacco Production," which will not be elaborated here.
[0036] S22: Obtain D α tobacco plant vector point E within the preset range α and E α Add it to P.
[0037] S22 includes: S221: D α Centered on point E, search for vector points within a radius of 1.5b. If a vector point exists within the range, then that vector point is designated as point E. α If there are two vector points within the range, then randomly select one of the two vector points as E. α .
[0038] S23: According to D α E α Obtain from D α To E α Directional data F α 1 and by E α To D α Directional data F α 2 F α 1 For D α Using north as the reference, with true north as 0 degrees and clockwise as the positive direction, E α Compared to D α The angle value, F α 2 For E α Using north as the reference, with true north as 0 degrees and clockwise as the positive direction, D α Relative to E α The angle value at which it is located.
[0039] S24: Obtain F α 1 The set of vector points G of tobacco plants in the direction α 1 ={G α 1 1, G α 1 2, ..., G α 1 j , ..., G α 1 n(α)}, G α 1 j For G α 1 The j-th vector point in G, j=1,2,...,n(α), n(α) is the vector point of G. α 1 The number of vector points in the middle, and the removal of G from A. α 1 and G α 1 Add it to P.
[0040] S24 includes the following steps: S241: Obtain the intersection point H of the extension line from D α to E α and B, α 1 and add H α 1 to P.
[0041] S242: Search for the vector points in A, including the following steps: S2421: When i = m + 1, execute S25; when i < m + 1, execute S2422, where m = int(L α 1 / b), i is the number of loops, i = 1, 2,..., m, L α 1 is the distance from E α to H α 1 .
[0042] S2422: Let r1 = 1.5b + i b, obtain the vector points in A within the sector range with the point D α as the center, r1 as the radius, and [F α 1 - arctan(0.5a / r1), F α 1 + arctan(0.5a / r1)] as the angle range. a is the row spacing of tobacco plants. If there are no vector points within the range, let i = i + 1 and re - execute S2421. If there are vector points within the range, take this vector point as G α 1 j , and execute S2423.
[0043] Specifically, a is the row spacing between tobacco plants obtained according to the local "Technical Opinions on Tobacco Leaf Production", which will not be elaborated here.
[0044] Specifically, a and b satisfy the following conditions: a > 1.5b.
[0045] S2423: Sequentially obtain the distances from the j vector points from G α 1 1 to G α 1 j to E α to generate a distance list J α 1 ={J α 1 1, J α1 2, ..., J α 1 j}
[0046] S2424: Obtain max(J) α 1 The corresponding vector point G α 1 max, get E α To G α 1 Max's direction data F α G1, and let F α 1 =F α G1.
[0047] S2425: Obtain E α To G α 1 The intersection point H of the extension of max and B. α G1, and obtain H α The distance L between G1 and E α G1.
[0048] S2426: Let L α 1 =L α G1, if i=m, then H α Add G1 to P, otherwise set i = i + 1 and re-execute S2421 to S2426.
[0049] S25: Use the method obtained from S24 to get G α 1 In the same way, obtain F α 2 The set of vector points G of tobacco plants in the direction α 2 ={G α 2 1, G α 2 2, ..., G α 2 g , ..., G α 2 z(α)}, G α 2 g For G α 2 The g-th vector point in G, g = 1, 2, ..., z(α), z(α) is the vector point of G. α 2 The number of vector points in G α 2Delete from A and add G α 2 to P.
[0050] It can be understood that S25 includes the following steps: S251: Obtain the intersection point H α of the extension line from E α to D α 2 with B, and add H α 2 to P.
[0051] S252: Search for the vector points in A, including the following steps: S2521: When i0 = m0 + 1, execute S26; when i0 < m0 + 1, execute S2522, where m0 = int(L α 2 / b), i0 is the number of loops, i0 = 1, 2,..., m0, L α 2 is the distance from D α to H α 2 to H.
[0052] S2522: Let r2 = 1.5b + i0 b, obtain the vector points in A within the sector range with the point E α as the center, r2 as the radius, and [F α 2 - arctan(0.5a / r2), F α 2 + arctan(0.5a / r2)] as the angle range. If there are no vector points within the range, let i0 = i0 + 1 and re - execute S2521. If there are vector points within the range, take this vector point as G α 2 j , and execute S2523.
[0053] S2523: Sequentially obtain the distances from the g vector points from G α 2 1 to G α 2 g to E to generate a distance list J α 2 ={J α 2 1, J α 2 2... J α 2 g}.
[0054] S2524: Obtain max(J) α 2 The corresponding vector point G α 2 max, get E α To G α 2 Max's direction data F α G2, and let F 2 =F α G2.
[0055] S2525: Obtain D α To G α 2 The intersection point H of the extension of max and B. α G2, and obtain H α G2 and D α Distance L α G2.
[0056] S2526: Let L α 2 =L α G2, if i0 = m0, then H α Add G2 to P, otherwise set i0=i0+1 and execute S2521 to S2526.
[0057] The above can be understood as referring to D. α Search all tobacco plants in the row of the tobacco plant in the corresponding tobacco field to be detected, add the vector points corresponding to all tobacco plants in the row to P, and add the points where the straight line corresponding to each row of tobacco plants intersects with the boundary of the tobacco field to be detected to P, forming a set of vector points. At the same time, delete the tobacco plants in the row and the vector points corresponding to the tobacco plants in the row from A to facilitate subsequent operations.
[0058] S26: Connect the nearest vector point to each vector point in P with the nearest vector point in the opposite direction to generate a vector line, and add each vector line segment to Q. α Q is generated in α ={Q α 1, Q α 2, ..., Q α k Q α t(α)}, Q α k Let t(α) be the k-th vector line, k = 1, 2, ..., t(α), and t(α) be Q. α The total number of vector lines.
[0059] S27: Regarding Q α In each Qα k Get Q α k Length Q α 0 k If Q α 0 k >T, Q α k Add it to the pre-defined layer R, where Q is located. α k The location is where the tobacco plant is missing, and T is the length threshold.
[0060] S28: D α E α Remove it from A and let α = α + 1.
[0061] S29: Repeat S21-S28 until the number of vector points in A is 0.
[0062] As described above, in step S2, the vector points corresponding to the tobacco plants in the tobacco field to be detected, as well as the intersection points of each row of tobacco plants with B, are added to P. Then, every two closest vector points in P and the nearest vector point in the opposite direction of the closest vector point are connected, and each vector line segment is added to Q. α This generates a set of vector lines. Then, each Q is calculated. α k Length Q α 0 k When Q α 0 k If the length exceeds the set threshold T, it is considered that there is a missing plant at the location of the vector line segment, thus obtaining the missing plant information in the tobacco field to be detected.
[0063] Specifically, obtaining the distance between two points is a prior art known to those skilled in the art, and will not be elaborated here.
[0064] Specifically, T is 1.5b.
[0065] The above process first obtains A using a tobacco plant identification method. Then, it searches for vector points in A, adding the vector points corresponding to the tobacco plants in the field to be detected, as well as the intersection points of the straight lines corresponding to each row of tobacco plants with B, to P. Next, it connects each vector point in P to its nearest vector point and the nearest vector point in the opposite direction, generating t vector lines, thus generating Q. α The length of each vector line segment is then calculated. If the length of the vector line is greater than T, it is considered that there are missing plants in the tobacco field corresponding to that vector line segment. This completes the detection of missing plants in the tobacco field without the need for manual observation, thus improving efficiency.
[0066] Embodiments of the present invention also provide a non-transitory computer-readable storage medium that can be disposed in an electronic device to store at least one instruction or at least one program related to implementing a method in the method embodiments, wherein the at least one instruction or the at least one program is loaded and executed by the processor to implement the method provided in the above embodiments.
[0067] Embodiments of the present invention also provide an electronic device, including a processor and the aforementioned non-transitory computer-readable storage medium.
[0068] While specific embodiments of the invention have been described in detail by way of example, those skilled in the art should understand that the above examples are for illustrative purposes only and are not intended to limit the scope of the invention. Those skilled in the art should also understand that various modifications can be made to the embodiments without departing from the scope and spirit of the invention. The scope of the invention is defined by the appended claims.
Claims
1. A method for locating missing tobacco plants, characterized in that, The method includes the following steps: S1: Obtain the vector point set A of tobacco plants and the vector line boundary data B of the tobacco field to be detected. The vector points in A are the vector points corresponding to each tobacco plant in the tobacco field to be detected. S2: Obtain the missing tobacco plant location based on A; S2 includes the following steps: S21: Obtain the reference tobacco plant vector point D from A. α and D α Add it to P, where P is the set of vector points; S22: Obtain D α tobacco plant vector point E within the preset range α and E α Add to P; S23: According to D α E α Obtain from D α To E α Directional data F α 1 and by E α To D α Directional data F α 2 F α 1 For D α Using north as the reference, with true north as 0 degrees and clockwise as the positive direction, E α Compared to D α The angle value, F α 2 For E α Using north as the reference, with true north as 0 degrees and clockwise as the positive direction, D α Relative to E α The angle value at which it is located; S24: Obtain F α 1 The set of vector points G of tobacco plants in the direction α 1 ={G α 1 1, G α 1 2, ..., G α 1 j , ..., G α 1 n(α) }, G α 1 j For G α 1 The j-th vector point in G, j=1,2,...,n(α), n(α) is the vector point of G. α 1 The number of vector points in A, and the removal of G from A. α 1 and G α 1 Add to P; S24 includes the following steps: S241: Obtain from D α To E α The intersection point H of the extension of the line and B α 1 and H α 1 Add to P; S242: Searching for vector points in A includes the following steps: S2421: When i = m + 1, execute S25; when i < m + 1, execute S2422, where m = int(L α 1 / b), i is the number of loop iterations, i = 1, 2,..., m, L α 1 is the distance from E α to H α 1 , and b is the spacing between tobacco plants; S2422: Let r1 = 1.5b + i b, obtain D α With point as the center, and r1 as the radius, and [F] as the radius, the circle is drawn. α 1 -arctan(0.5a / r1), F α 1 [+arctan(0.5a / r1)] is the angle range to obtain the vector point in A within the sector, where a is the row spacing of the tobacco plants. If there is no vector point within the range, let i = i + 1 and re-execute S2421. If there is a vector point within the range, then use that vector point as G. α 1 j and execute S2423; S2423: Sequentially obtain data from G α 1 1 to G α 1 j The j vector points to E α Distance generation distance list J α 1 ={J α 1 1, J α 1 2, ..., J α 1 j }; S2424: Obtain max(J) α 1 The corresponding vector point G α 1 max, get E α To G α 1 Max's direction data F α G1, and let F α 1 =F α G1; S2425: Obtain E α To G α 1 The intersection point H of the extension of max and B. α G1, and obtain H α The distance L between G1 and E α G1; S2426: Let L α 1 =L α G1, if i=m, then H α Add G1 to P; otherwise, set i = i + 1 and re-execute S2421 to S2426. S25: Use the method obtained from S24 to get G α 1 In the same way, obtain F α 2 The set of vector points G of tobacco plants in the direction α 2 ={G α 2 1, G α 2 2, ..., G α 2 g , ..., G α 2 z(α) }, G α 2 g For G α 2 The g-th vector point in G, g = 1, 2, ..., z(α), z(α) is the vector point of G. α 2 The number of vector points in G α 2 Delete from A and remove from G. α 2 Add to P; S26: Connect the nearest vector point to each vector point in P with the nearest vector point in the opposite direction to generate a vector line, and add each vector line segment to Q. α Q is generated in α ={Q α 1, Q α 2, ..., Q α k Q α t(α) }, Q α k Let t(α) be the k-th vector line, k = 1, 2, ..., t(α), and t(α) be Q. α The total number of vector lines; S27: Regarding Q α In each Q α k Get Q α k Length Q α 0 k If Q α 0 k >T, Q α k Add it to the pre-defined layer R, where Q is located. α k The location is where the tobacco plant is missing, and T is the length threshold. S28: D α E α Remove it from A and let α = α + 1; S29: Repeat S21-S28 until the number of vector points in A is 0.
2. The method according to claim 1, characterized in that, The value of T is 1.5b.
3. The method according to claim 1, characterized in that, S21 includes the following steps: S211: Randomly select any vector point A0 from A; S212: Using A0 as the center and β as the radius, search for vector points within A. If other vector points exist within the range, then take A0 as D. α Otherwise, re-execute S211.
4. The method according to claim 1, characterized in that, S22 includes: S221: D α Centered on point E, search for vector points within a radius of 1.5b. If a vector point exists within the range, then that vector point is designated as point E. α If there are two vector points within the range, then randomly select one of the two vector points as E. α .
5. The method according to claim 1, characterized in that, The conditions a and b satisfy the following condition: a > 1.5b.
6. The method according to claim 3, characterized in that, The value of β is 1.5b.
7. A non-transitory computer-readable storage medium, wherein the storage medium stores at least one instruction or at least one program segment, characterized in that, The at least one instruction or the at least one program segment is loaded and executed by the processor to implement the method as described in any one of claims 1-6.
8. An electronic device, characterized in that, Includes a processor and the non-transitory computer-readable storage medium as described in claim 7.
