A control method for laser weeding and a controller for a laser weeding system

CN122363241BActive Publication Date: 2026-10-16SHANGHAI XINLIJI SEMICON CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610803596.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-06-05
Publication Date
2026-10-16
Estimated Expiration
2046-06-05

AI Technical Summary

Technical Problem

[0004]例如,当目标杂草与邻近作物的距离过近时,激光光斑、热扩散或执行偏差可能导致作物受损;当目标姿态不稳定时,激光在实际作用瞬间可能偏离原先计算的作用位置;当识别置信度不足或目标分割边界不稳定时,系统可能对非目标区域或目标边界外区域进行作用

Benefits of technology

采用本发明的控制方法,可使激光除草系统在激光执行之前完成风险筛选,并在执行阶段根据风险层自动切换控制措施,从而提高激光除草作业的安全性、稳定性和可工程化应用能力。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122363241B_ABST
    Figure CN122363241B_ABST
Patent Text Reader

Abstract

The application discloses a control method for laser weeding and a controller for a laser weeder. The control method determines a predicted action area for removing target weeds based on a target laser execution scheme and a position of the target weeds, calculates an expected risk value of the target weeds for the target laser execution scheme according to a distance between the target weeds and adjacent crops, a stability of a posture of the target weeds, a reliability of a recognition result of the target weeds, the predicted action area and a safety boundary of the adjacent crops, and determines a corresponding laser execution measure, i.e., direct execution, offset aiming, delayed re-inspection or prohibition of striking, according to a preset mapping relationship between the expected risk value and the laser execution measure. The control method can ensure the weeding capacity while significantly improving the crop protection capacity and the operation safety.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical fields of intelligent agricultural equipment, machine vision, laser operation control and agricultural robot safety control, specifically relating to a control method for laser weeding and a controller for a laser weeding machine. Background Technology

[0002] Existing laser weed control systems typically include basic steps such as image acquisition, weed identification, coordinate calculation, and laser execution. Their core objective is to determine "where the target weed is" and "where the laser should be aimed." Current solutions primarily focus on improving target detection accuracy, positioning accuracy, and laser hit rate to achieve targeted action on weed leaves, growth points, or localized areas.

[0003] However, in real agricultural scenarios, crops and weeds often grow close together, and leaves can easily overlap, obscure, or have blurred boundaries. Furthermore, the target can be affected by wind, vibration, platform movement, or elastic deformation of the leaves, causing changes in its posture. Even if the system identifies a weed target, it does not necessarily mean that the target is in a safe operating state.

[0004] For example, when the target weed is too close to neighboring crops, laser spot size, heat spread, or execution deviations may damage the crops; when the target's posture is unstable, the laser may deviate from the originally calculated target position at the moment of actual action; when the recognition confidence is insufficient or the target segmentation boundary is unstable, the system may act on non-target areas or areas outside the target boundary. Without risk assessment and suppression control mechanisms oriented towards crop safety constraints, the system may still emit lasers under unsuitable conditions, leading to problems such as accidental crop damage, ineffective action, or overly conservative approaches resulting in missed operations. In other words, the overall safety and robustness of existing laser weeding systems remain insufficient.

[0005] The challenge in laser weed control systems is to improve crop protection and operational safety while ensuring weed control capabilities. Summary of the Invention

[0006] The technical problem this invention aims to solve is to address the shortcomings and deficiencies of existing technologies by providing an improved control method for laser weeding. When this control method is used in a laser weeding system, it can significantly improve crop protection and operational safety while ensuring weeding capacity.

[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A method for controlling laser weeding, the method comprising the following steps: S1: Determine the predicted area of ​​action for removing the target weeds based on the target laser execution scheme and the location of the target weeds; S2: Calculate the expected risk value of the target laser execution scheme for the target weed, wherein the expected risk value is determined based on the distance between the target weed and the neighboring crops, the stability of the target weed's posture, the reliability of the target weed identification result, the predicted action area, and the safety boundary of the neighboring crops; S3: Based on the preset mapping relationship between expected risk values ​​and laser execution measures, determine the laser execution measures corresponding to the expected risk values ​​for removing target weeds; the mapping relationship includes: If the expected risk value is less than the threshold of the first risk layer In this case, the laser execution measure is to directly execute according to the target laser execution plan; If the expected risk value is greater than or equal to the threshold of the first risk layer And less than the threshold of the second risk layer The laser execution measure is to offset the target laser execution scheme to obtain an updated laser execution scheme, recalculate the updated expected risk value corresponding to the updated laser execution scheme, and perform step S3 based on the updated expected risk value. If the expected risk value is greater than or equal to the second risk layer threshold And less than the threshold of the third risk layer If the laser execution measure is not to execute the target laser execution plan, and to wait at a preset time interval... Then repeat steps S1-S3; The , satisfy: .

[0008] In this invention, the target laser execution scheme can follow the conventional laser execution scheme for laser weeding in existing technologies, such as targeting the center of the target weed area with a laser spot to facilitate effective weed removal. This invention performs a risk assessment before execution of existing target laser execution schemes and takes appropriate laser execution measures accordingly, achieving a significant improvement in crop protection and operational safety while ensuring weed control capabilities. For example, when the expected risk value is less than the first risk layer threshold... When the expected risk value is between a certain threshold, it indicates that the probability of the target laser execution plan harming nearby crops is very small, and the laser plan can be executed directly; however, when the expected risk value increases to between a certain threshold, it indicates that the probability of the target laser execution plan harming nearby crops is very small. and While the risk is relatively controllable, there is still a possibility of accidentally damaging neighboring crops. In this case, it is necessary to adjust the current laser execution plan and shift it. If the risk is reduced to below the first risk layer threshold after the shift, the laser will be successfully applied. Then, the adjusted laser execution scheme can be implemented, i.e., offset aiming; while when the expected risk value increases to between If this happens, the current planned laser execution scheme is paused for a delayed review, meaning that after a period of time, the aforementioned steps are repeated.

[0009] The expected risk value comprehensively considers five factors: the distance between the target weed and neighboring crops, the stability of the target weed's posture, the reliability of the target weed identification result, the predicted area of ​​action, and the safety boundary of neighboring crops. These factors are all closely related to whether laser execution will accidentally damage neighboring crops.

[0010] In some implementations, the mapping relationship further includes: if the expected risk value is greater than the threshold of the third risk layer. If the laser removal plan is not executed on the target weed, then steps S1-S3 will be performed on other target weeds. This means that the risk of accidentally damaging neighboring crops is high, so laser removal of that weed is abandoned, and the laser removal of the next weed target is initiated.

[0011] In some implementations, the expected risk value R is calculated through the following steps:

[0012] in, , , , and Let be the weighting coefficients, and satisfy: All are greater than or equal to 0 and less than or equal to 1, and ; ; ; ; ; ; in, Representing 0 and The maximum value in; This represents the distance normalization reference threshold. This represents the normalized reference threshold for attitude stability. Indicates the reference threshold for normalized boundary distance; The minimum distance between the target weed area and the adjacent crop area. Z represents the stability of the target weed posture, and Z represents the uncertainty of the target weed identification result. To predict the overlap ratio between the affected area and the crop safety boundary area, This is the minimum distance between the boundary of the predicted action area and the boundary of the crop safety boundary area.

[0013] The expected risk value R takes into account the above five factors. The weighting coefficients can be adjusted according to factors such as crop type, specific terrain to be weeded, and specific weeding implementation projects. For example, each weighting coefficient can be set to 0.2.

[0014] In some embodiments, the control method further includes the following steps: An image of the target weeding area is acquired using a preset image acquisition unit, the target weeding area including the target weed area. and adjacent crop areas ; The target weed areas in the image are identified by a preset target recognition unit. and adjacent crop areas .

[0015] In some embodiments, the The minimum Euclidean distance between the boundary of the target weedy area and the boundary of the adjacent crop area:

[0016] in, Indicates the target area covered by weeds; Indicates the area adjacent to crops; Represents the set of boundary points of the target weedy region; Represents the set of boundary points of neighboring crop regions; Let represent any point on the boundary of the target weeds, and let its coordinates be denoted as . ; Let represent any point on the boundary of the adjacent crop, and let its coordinates be denoted as . .

[0017] In some implementations, the minimum distance between the target weed area and the adjacent crop area is calculated through the following steps. : 1) Preprocess the target weed area and the adjacent crop area to obtain the set of boundary points of the target weed area, the set of boundary points of the adjacent crop area, the bounding rectangle of the target weed area, and the bounding rectangle of the adjacent crop area; The bounding rectangle of the target weed area is denoted as . The circumscribed rectangle of the adjacent crop area is denoted as . ; in, Let x be the minimum x-coordinate of the target weedy area. Let be the minimum ordinate of the target weedy area. The x-coordinate of the target weedy area is [value]. The maximum ordinate of the target weedy area; The minimum x-coordinate of the adjacent crop area. The minimum ordinate of the adjacent crop area. The x-coordinate of the adjacent crop area. The maximum ordinate of the adjacent crop area; 2) Calculate the shortest geometric distance between the bounding rectangle of the target weed area and the bounding rectangle of the adjacent crop area. :

[0018] in,

[0019]

[0020] Represents 0, , The maximum value in; Represents 0, , The maximum value in; 3) Determine the shortest geometric distance With respect to the preset safe distance threshold Size relationship: like Then the shortest geometric distance As ; like Then a local ROI (Region of Interest) is constructed. The bounding rectangle of the target weed area and the bounding rectangle of the adjacent crop area are merged, and the boundary is expanded outward by an amount of [missing information]. get:

[0021]

[0022]

[0023]

[0024] in, Represents the minimum x-coordinate of a local ROI. Represents the maximum x-coordinate of the local ROI. The minimum ordinate of the local ROI. Represents the maximum ordinate of a local ROI; express The minimum value in; express The maximum value in; express The minimum value in, express The maximum value in; 4) Calculate any point in the set of boundary points of the target weedy region. Distance to the boundary of adjacent crop areas :

[0025] in, Indicates the local adjacent crop areas The set of boundary points, express any point on; 5) Based on the distance , and intersection Is it an empty set? Determine the minimum distance in the image plane :

[0026] 6) Based on the second mapping relationship preset by the image acquisition unit and the... To obtain the true physical distance in physical space and will As .

[0027] Among them, the minimum distance between the target weed area and the adjacent crop area. The process involves two stages: coarse screening and fine calculation. Coarse screening is based on calculations using the circumscribed rectangle, while fine calculations are based on local ROI distance transformations. This is based on "circumscribed rectangle coarse screening—local..." The coarse-to-fine two-level distance measurement mechanism of "distance transformation and fine calculation" can reduce the computational load of the system while ensuring measurement accuracy.

[0028] In some implementations, the distance safety threshold Dynamic adaptation can be achieved through the following methods: 1) Based on the preset agricultural requirements and the maximum thermal diffusion radius of the laser spot, set the safe blocking distance in physical space. ; 2) Based on the focal length of the image acquisition unit and its physical installation height Calculate the reference pixel threshold at the optical center of the image. :

[0029] 3) Obtain the coordinates of the center point of the circumscribed rectangle of the target weed area. The optical center coordinates of the image of the target weeding area Calculate the normalized image coordinates of both. :

[0030] This leads to the square of the relative radial distance between the target weed and the optical center. :

[0031] 4) Calculate the distance safety threshold after dynamic adaptation. :

[0032] in, The first radial distortion coefficient of the image acquisition unit, This is the second radial distortion coefficient of the image acquisition unit.

[0033] The first radial distortion coefficient and the second radial distortion coefficient can be determined by camera calibration.

[0034] In the first stage of the above-mentioned outer rectangular coarse screening, if a globally fixed distance safety threshold is used... Due to the perspective projection characteristics of industrial cameras and the radial distortion at the lens edges, the actual physical distance represented by the same pixel distance varies non-linearly across different regions of the image. To prevent premature blocking or missed blocking at the edge of the field of view, this invention further proposes a dynamic adaptive coarse screening threshold model based on camera parameters and physical height. Through this dynamic adaptive adjustment mechanism, the system calculates the shortest geometric distance... It can automatically compensate for image compression or stretching effects at the edges of the field of view. When the target is located at the edge of an image with significant distortion, Automatic scaling ensures that the algorithm maintains strict consistency in the physical criteria for determining the "absolute safe distance" within the global field of view, greatly improving the robustness and spatial distortion resistance of the weeding system for nearby crops.

[0035] In some implementations, the stability S of the target weed posture is calculated through the following steps: 1) Before obtaining the target laser execution plan, the target weeding area is continuously observed within the set continuous observation window. Frame image; 2) Regarding the above Continuous detection or segmentation of the same target weed in the frame image yields the target region of the same target weed at each time step. The target weed area in the frame image is denoted as ,in Then the first Target weed area in frame image The geometric center is ; in,

[0036] in, Indicates the first Target weed area in frame image The number of pixels within; Indicates the first Target weed area in frame image Inner The coordinates of each pixel in the image coordinate system; and They represent the first Target weed area in frame image The x and y coordinates of the geometric center are obtained by averaging the coordinates of all pixels within the area. 3) Calculate the continuous The center displacement between two adjacent frames in a frame image:

[0037] in: Indicates the first Frame image and the first Target weed area between frames The displacement of the geometric center; Then calculate the average displacement of the geometric center of the target weed area within the continuous observation window. :

[0038] 4) Calculate the continuous The first frame of the image Frame image and the first Overlap rate of target weed areas in frame image :

[0039] in, This represents the intersection area of ​​the target weed region in two adjacent image frames; This represents the union area of ​​the target weed regions in two adjacent image frames; Then calculate the average overlap rate of the target weed area within the continuous observation window. :

[0040] 5) Calculate the stability of the target weed posture. :

[0041] Among them, the Average displacement The weighting coefficients, the Average overlap rate The weighting coefficients; and All are greater than or equal to 0 and less than or equal to 1, and .

[0042] Weighting coefficient , The value can be adjusted based on crop density, wind conditions, etc., for example, 0.5 can be used for all crops.

[0043] In some implementations, the uncertainty of the target weed identification result is Z=1-P, where P is the confidence level of the target weed identification result, and 0≤P≤1.

[0044] In some embodiments, the control method further includes the following steps: An image of the target weeding area is acquired using a preset image acquisition unit, the target weeding area including the target weed area. and adjacent crop areas ; The target weed areas in the image are identified by a preset target recognition unit. and adjacent crop areas ; The recognition model of the target recognition unit is selected from the target detection model, the semantic segmentation model, or the instance segmentation model; When the recognition model is a target detection model, P is the classification probability that the target weed belongs to the corresponding weed category; When the recognition model is a semantic segmentation model or an instance segmentation model, P is the average pixel probability that the target weed region belongs to the corresponding weed category, and is calculated in the following way:

[0045] in, Indicates the number of pixels within the target weed area; Indicates the first [unit] within the target weed area The probability that a pixel belongs to the corresponding weed category.

[0046] When using the target detection model, the reliability P of the target weed identification result is a probability given based on the overall experience base; while when using the semantic segmentation model or the instance segmentation model, P is the average pixel probability calculated based on pixels, rather than giving a probability for the entire image as a whole.

[0047] In some implementations, the predicted action area A of the target laser actuation scheme is determined using the following steps: 1) Let W be the target weed area in the image, and let the total number of its pixels be . Calculate the geometric center of the target weed region W. :

[0048] in,( Let M be the coordinates of the k-th pixel, where k = 1, 2, 3...M; 2) From the geometric center homogeneous coordinates in the image coordinate system Predicting the center of action in the physical plane through mapping calculation homogeneous coordinates in the physical plane coordinate system :

[0049] Where H is a 3x3 mapping matrix, which is obtained by calibrating the image plane coordinates and the corresponding physical plane coordinates; To make the z-axis coordinate in homogeneous coordinates normalize to 1 by a scaling factor; Indicates the center of predictive action Coordinates in the physical plane coordinate system; 3) From the predictive center Coordinates in the physical plane coordinate system Calculate the predicted area of ​​effect A:

[0050] in, Indicates the distance from point x to the center of prediction. The Euclidean distance; Let be the radius of the theoretically circular laser spot.

[0051] Furthermore, the H matrix can be determined using a calibration method based on image plane coordinates and corresponding physical plane coordinates. For example, calibration can be performed in the following way: The system sets up four or more non-collinear calibration points on the actual physical plane (the weeding work plane) and records the first... The coordinates of each calibration point in the real physical plane coordinate system And its pixel coordinates in the image (image area acquired during laser weeding) coordinate system. When the number of calibration points At that time, a system of linear equations is formed by the corresponding points of each group, and is solved by direct linear transformation and least squares method. Then, the matrix mapping relationship between the image plane coordinates and the real physical plane coordinates is obtained. Then, the coordinates of the corresponding geometric center in the real physical working plane coordinates are obtained by mapping the coordinates of the geometric center in the image coordinate system. Finally, based on the radius of the circular action spot in laser theory, the predicted action area can be obtained.

[0052] In some implementations, the following steps are used to calculate the overlap ratio between the predicted action area and the crop safety boundary area. : 1) The predicted area is denoted as A, and the adjacent crop area is denoted as C. Calculate the safety boundary area of ​​the adjacent crop area C. :

[0053] in, Indicates the preset safety boundary width; Point to neighboring crop areas The Euclidean distance; 2) Calculate the predicted action area A and the safety boundary area. overlapping area :

[0054] in, This represents the prediction area A and the safety boundary area. The area of ​​the intersection region; 3) Calculate the overlap ratio parameter between the predicted action area and the crop safety boundary area. :

[0055] in, Indicates the predicted area of ​​effect The area.

[0056] In some implementations, the following steps are used to calculate the minimum distance between the boundary of the predicted action area and the boundary of the crop safety boundary area. :

[0057] in, Represents any point on the boundary of the prediction area; Represents any point on the boundary of the crop safety boundary area; Point With point The Euclidean distance between them.

[0058] The overlap ratio between the predicted action area and the crop safety boundary area Minimum distance between the boundary of the predicted action area and the boundary of the crop safety boundary area. It is a parameter characterizing the spatial relationship between the prediction area and the crop safety boundary. The smaller the size, the lower the risk of laser weeding accidentally damaging neighboring crops. The larger the laser weeding device, the lower the risk of accidentally damaging neighboring crops.

[0059] In some implementations, a preset predictive action area calculation unit is used to call a preset laser action model. Under the constraints of the target laser execution scheme, the predicted action area is determined based on the identification results of the target weed area and the adjacent crop area in the acquired image, and the third mapping relationship between image coordinates and physical space coordinates.

[0060] In some implementations, the expected risk value is calculated using a preset parameter extraction unit.

[0061] In some implementations, the offset of the updated laser actuation scheme relative to the target laser actuation scheme is calculated through the following steps. : 1) The center of the predicted area is denoted as... The boundary point closest to the center in the crop safety boundary area is denoted as... Calculate the unit direction vector from the crop safety boundary to the center. :

[0062] in, express and The Euclidean distance between them; 2) The predicted area is denoted as A, and the adjacent crop area is denoted as C. Calculate the safety boundary area of ​​the adjacent crop area C. :

[0063] in, Indicates the preset safety boundary width; Point to neighboring crop areas The Euclidean distance; 3) Calculate the predicted action area A and the safety boundary area. safety margin :

[0064] in, This represents the prediction area A and the safety boundary area. The area of ​​the intersection region; Indicates the empty set; The minimum distance between the target weedy area and the adjacent crop area; 4) Calculate the offset. :

[0065] in, Here, 'e' represents the preset target safety margin, and 'e' represents the system error. The prediction area A and the safety boundary area are defined as follows. Safety margin; 0 and The maximum value in.

[0066] When the expected risk value is between and At this time, the laser's execution method is offset aiming, and it is necessary to determine the offset amount. The offset can be determined using the method described above.

[0067] The system error e is the sum of various errors, and the types of errors may include one or more combinations of calibration error, execution control error, mechanical hysteresis (with minimum accuracy during mechanical movement) and thermal diffusion compensation (systematic error caused by heat transfer of the laser spot).

[0068] After the laser weeding system performs offset aiming, it recalculates the expected risk value and, based on the mapping relationship between the expected risk value and the laser execution measures, re-derives the corresponding laser execution measures. Once offset aiming is complete, the expected risk value decreases to below the first risk layer threshold. In this case, laser weeding is performed directly using the laser scheme after offset aiming.

[0069] The present invention also provides a controller for a laser weeding system, the controller being used to execute the aforementioned laser weeding control method.

[0070] In some implementations, the controller includes: The target identification unit is used to identify target weed areas and adjacent crop areas; A prediction area calculation unit, used to determine the prediction area; A parameter extraction unit is used to calculate the expected risk value; An execution measure decision unit is used to determine the laser execution measure.

[0071] In some implementations, the controller further includes a risk level display layer for displaying risk levels; If the expected risk value is less than the threshold of the first risk layer If so, the risk level display layer displays a low risk level; If the expected risk value is greater than or equal to the threshold of the first risk layer And less than the threshold of the third risk layer If so, the risk level display layer displays a risk level of medium. If the expected risk value is greater than the threshold of the third risk layer If so, the risk level display layer will show a high risk level.

[0072] The risk level display layer can intuitively show users of the laser weeding system the risk level of the current target laser execution plan.

[0073] In some implementations, the controller is mounted on the laser weeding system, or the controller is separately connected to the laser weeding system.

[0074] The present invention also provides a laser weeding system, comprising: A laser actuator unit, used to perform laser-driven actions; An image acquisition unit is used to acquire images of the target weeding area; The controller is the aforementioned controller for the laser weeding system.

[0075] By employing the controller of this invention, the laser weeding system of this invention can significantly improve crop protection and operational safety while ensuring weeding capacity, and will basically not damage neighboring crops.

[0076] The present invention also provides an application of the aforementioned laser weeding system in smart agriculture.

[0077] Due to the application of the above technical solution, the present invention has the following advantages compared with the prior art: The control method of this invention enables the laser weeding system to complete risk screening before laser execution and automatically switch control measures according to the risk level during the execution phase, thereby improving the safety, stability and engineering applicability of laser weeding operations.

[0078] The control method of this invention can improve crop protection and operational safety while ensuring weed control capabilities. Attached Figure Description

[0079] To more clearly illustrate the technical solutions in the embodiments of this application, 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 recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0080] Figure 1 The overall structure and data flow relationship of the laser weeding system of the present invention are shown, including units such as image acquisition, target recognition, prediction of the effective area calculation, parameter extraction, risk layer determination, implementation measure decision and laser execution, as well as the processing link from the parameter layer to the risk layer, then to the measure layer and the risk level layer; Figure 2 This invention illustrates the mapping relationship between risk assessment and implementation measures in an embodiment of the invention. Specifically, based on parameter layer inputs such as the minimum distance between the target and the crop, the target's attitude stability, the identification confidence level, and the relationship between the predicted action area and the crop safety boundary, the risk layer state of the target is determined as follows: can be executed normally, can be executed with restrictions, requires delayed re-inspection, or is prohibited from execution. This is then mapped to the corresponding implementation measures and risk levels. Figure 3 The invention illustrates a closed-loop control process of "perception-assessment-restricted execution" in an embodiment of the invention. It starts with image input and distance coarse screening, combines other parameters to complete a comprehensive risk assessment, and then drives the hardware to perform normal strike, offset aiming, delayed re-inspection or prohibition of strike based on the risk assessment results, and then enters the next target or returns to reassess. Detailed Implementation

[0081] Existing laser weed control systems typically include basic steps such as image acquisition, weed identification, coordinate calculation, and laser execution. Their core objective is to determine "where the target weed is" and "where the laser should be aimed." Current solutions primarily focus on improving target detection accuracy, positioning accuracy, and laser hit rate to achieve targeted action on weed leaves, growth points, or localized areas.

[0082] However, in real-world agricultural scenarios, crops and weeds often grow very close together, with leaves easily overlapping, obscuring, or blurring boundaries. Furthermore, the target weeds can be affected by wind, vibration, platform movement, or leaf elastic deformation, causing changes in their posture. Even if a laser weeding system identifies a weed target, it doesn't necessarily mean that the target is in a safe operating state. For example, when the weed target and crop are too close, the existing "weed detection and weeding" method has a high probability of accidentally damaging the crop. Similarly, when the target weed sways, rotates, or deforms at its boundaries, existing laser weeding systems are prone to operational deviations. In other words, existing laser weeding systems may still emit lasers under unsuitable conditions, leading to problems such as accidental crop damage, ineffective operation, or overly conservative approaches resulting in missed operations.

[0083] The challenge in laser weed control systems is to improve crop protection and operational safety while ensuring weed control capabilities.

[0084] To address this, this invention proposes a laser weeding execution permission control method based on risk assessment and crop safety constraints within the laser targeting technology chain, which is based on weed identification. This invention integrates the safe distance between the target weed and neighboring crops, the target's attitude stability, identification confidence, and the spatial relationship between the predicted action area and the crop safety boundary to generate a risk layer for the current target. During the laser execution phase, it outputs corresponding execution measures and risk level expressions based on this risk layer, enabling the laser weeding system to implement appropriate protective actions according to the corresponding risk level before laser execution. This achieves the aforementioned technical effect of improving crop protection and operational safety while ensuring weeding capability. The control method of this invention does not use "directly firing the laser upon identifying weeds" as the default strategy. Instead, it first generates a risk layer based on crop safety constraints and target risk parameters, and then selects the corresponding execution measures based on the risk layer.

[0085] Among them, the safety distance refers to the minimum safe gap between the target weed area and the adjacent crop area, which can be represented by the boundary distance, center distance or buffer margin; the target posture stability refers to the degree of center drift, contour change, angle change or short-term jitter of the target weed in continuous images; the recognition confidence refers to the degree of confidence of the target detection, segmentation or recognition model in that the current target weed belongs to the usable weed; the spatial relationship between the predicted action area and the crop safety boundary refers to the spatial state of the theoretical laser action area relative to the crop safety boundary, including the situation of maintaining margin, approaching the boundary or entering the boundary.

[0086] This invention upgrades laser weeding control from "direct execution after identification" to "layered execution after parameter determination," significantly improving operational safety. By introducing a mapping relationship between expected risk values ​​and corresponding laser execution measures, this invention makes the laser weeding decision-making logic clearer, facilitating implementation and protection. This invention can automatically switch between normal strike, offset aiming, delayed re-inspection, or strike prohibition measures based on different expected risk value states, thus balancing weeding efficiency and crop protection.

[0087] The controller of this invention is suitable for laser weeding equipment in complex agricultural environments and can be combined with existing identification, positioning and execution modules as a safety control layer.

[0088] The laser weeding system of the present invention, which includes the above-mentioned controller, can improve crop protection and operational safety while ensuring weeding capacity.

[0089] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0090] It should be noted that the terms "first," "second," "third," etc., used in the specification and claims of this invention are used to distinguish similar objects and are not necessarily used to describe specific numerical values ​​or numerical relationships. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, apparatus, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0091] like Figure 1-3 As shown, this embodiment provides a laser weeding control method based on risk assessment and crop safety constraints, as well as a corresponding controller and laser weeding system.

[0092] The laser weeding control method includes the following steps: S1: Determine the predicted area of ​​action for removing the target weeds based on the target laser execution scheme and the location of the target weeds; S2: Calculate the expected risk value of the target laser execution scheme for the target weed, wherein the expected risk value is determined based on the distance between the target weed and the neighboring crops, the stability of the target weed's posture, the reliability of the target weed identification result, the predicted action area, and the safety boundary of the neighboring crops; S3: Based on the preset mapping relationship between expected risk values ​​and laser execution measures, determine the laser execution measures corresponding to the expected risk values ​​for removing target weeds; the mapping relationship includes: If the expected risk value is less than the threshold of the first risk layer In this case, the laser execution measure is to directly execute according to the target laser execution plan; If the expected risk value is greater than or equal to the threshold of the first risk layer And less than the threshold of the second risk layer The laser execution measure is to offset the target laser execution scheme to obtain an updated laser execution scheme, recalculate the updated expected risk value corresponding to the updated laser execution scheme, and perform step S3 based on the updated expected risk value. If the expected risk value is greater than or equal to the second risk layer threshold And less than the threshold of the third risk layer If the laser execution measure is not to execute the target laser execution plan, and to wait at a preset time interval... Then repeat steps S1-S3; The , satisfy: .

[0093] In this invention, the target laser execution scheme can follow the conventional laser execution scheme for laser weeding in the prior art, such as striking the center of the target weed area with the laser spot to facilitate the effective removal of weeds.

[0094] This invention involves conducting a risk assessment before implementing existing laser-based target execution schemes and taking appropriate laser execution measures to significantly improve crop protection and operational safety while ensuring weed control capabilities.

[0095] For example, when the expected risk value is less than the threshold of the first risk layer When the expected risk value is between a certain threshold, it indicates that the probability of the target laser execution plan harming nearby crops is very small, and the laser plan can be executed directly; however, when the expected risk value increases to between a certain threshold, it indicates that the probability of the target laser execution plan harming nearby crops is very small. and While the risk is relatively controllable, there is still a possibility of accidentally damaging neighboring crops. In this case, it is necessary to adjust the current laser execution plan and shift it. If the risk is reduced to below the first risk layer threshold after the shift, the laser will be successfully applied. Then, the adjusted laser execution scheme can be implemented, i.e., offset aiming; while when the expected risk value increases to between If this happens, the current planned laser execution scheme is paused, and a delayed re-inspection is performed. That is, after a period of time, the aforementioned steps are repeated. For the cache scheduling and task management technology during the delayed re-inspection, conventional technologies in this field can be adopted.

[0096] Furthermore, the mapping relationship also includes: if the expected risk value is greater than the threshold of the third risk layer. If the laser removal plan is not executed on the target weed, then steps S1-S3 will be performed on other target weeds. This means that the risk of accidentally damaging neighboring crops is high, so laser removal of that weed is abandoned, and the laser removal of the next weed target is initiated.

[0097] Further, the expected risk value R is calculated through the following steps:

[0098] in, , , , and Let be the weighting coefficients, and satisfy: All are greater than or equal to 0 and less than or equal to 1, and ; ; ; ; ; ; in, Representing 0 and The maximum value in; This represents the distance normalization reference threshold. This represents the normalized reference threshold for attitude stability. Indicates the reference threshold for normalized boundary distance; The minimum distance between the target weed area and the adjacent crop area. Z represents the stability of the target weed posture, and Z represents the uncertainty of the target weed identification result. To predict the overlap ratio between the affected area and the crop safety boundary area, This is the minimum distance between the boundary of the predicted action area and the boundary of the crop safety boundary area.

[0099] The expected risk value R takes into account the above five factors. The weighting coefficients can be adjusted according to factors such as crop type, specific terrain to be weeded, and specific weeding implementation projects. For example, each weighting coefficient can be set to 0.2.

[0100] Furthermore, the control method further includes the following steps: An image of the target weeding area is acquired using a preset image acquisition unit, the target weeding area including the target weed area. and adjacent crop areas ; The target weed areas in the image are identified by a preset target recognition unit. and adjacent crop areas .

[0101] The image acquisition unit can be a conventional image acquisition unit, such as image acquisition hardware like a camera.

[0102] The following are the five parameters mentioned above. Stability of the target weed posture Uncertainty Z in target weed identification results; overlap ratio between the predicted area and the crop safety boundary area. The minimum distance between the boundary of the predicted action area and the boundary of the crop safety boundary area. Perform the calculations separately.

[0103] Furthermore, the aforementioned The minimum Euclidean distance between the boundary of the target weedy area and the boundary of the adjacent crop area:

[0104] in, Indicates the target area covered by weeds; Indicates the area adjacent to crops; Represents the set of boundary points of the target weedy region; Represents the set of boundary points of neighboring crop regions; Let represent any point on the boundary of the target weeds, and let its coordinates be denoted as . ; Let represent any point on the boundary of the adjacent crop, and let its coordinates be denoted as . .

[0105] Furthermore, the minimum distance between the target weed area and the adjacent crop area is calculated through the following steps. : 1) Preprocess the target weed area and the adjacent crop area to obtain the set of boundary points of the target weed area, the set of boundary points of the adjacent crop area, the bounding rectangle of the target weed area, and the bounding rectangle of the adjacent crop area; The bounding rectangle of the target weed area is denoted as . The circumscribed rectangle of the adjacent crop region is denoted as . ; in, Let x be the minimum x-coordinate of the target weedy area. Let be the minimum ordinate of the target weedy area. The x-coordinate of the target weedy area is [value]. The maximum ordinate of the target weedy area; The minimum x-coordinate of the adjacent crop area. The minimum ordinate of the adjacent crop area. The x-coordinate of the adjacent crop area. The maximum ordinate of the adjacent crop area; 2) Calculate the shortest geometric distance between the bounding rectangle of the target weed area and the bounding rectangle of the adjacent crop area. :

[0106] in,

[0107]

[0108] Represents 0, , The maximum value in; Represents 0, , The maximum value in; 3) Determine the shortest geometric distance With respect to the preset safe distance threshold Size relationship: like Then the shortest geometric distance As ; like Then a local ROI (Region of Interest) is constructed. The bounding rectangle of the target weed area and the bounding rectangle of the adjacent crop area are merged, and the boundary is expanded outward by an amount of [missing information]. get:

[0109]

[0110]

[0111]

[0112] in, Represents the minimum x-coordinate of a local ROI. Represents the maximum x-coordinate of the local ROI. The minimum ordinate of the local ROI. Represents the maximum ordinate of a local ROI; express The minimum value in; express The maximum value in; express The minimum value in, express The maximum value in; 4) Calculate any point in the set of boundary points of the target weedy region. Distance to the boundary of adjacent crop areas :

[0113] in, Indicates the local adjacent crop areas The set of boundary points, express any point on; 5) Based on the distance , and intersection Is it an empty set? Determine the minimum distance in the image plane :

[0114] 6) Based on the second mapping relationship preset by the image acquisition unit and the... To obtain the true physical distance in physical space and will As .

[0115] That is, the minimum distance between the target weed area and the adjacent crop area. The process involves two stages: coarse screening and fine calculation. Coarse screening is based on calculations using the circumscribed rectangle, while fine calculations are based on local ROI distance transformations. This is based on "circumscribed rectangle coarse screening—local..." The coarse-to-fine two-level distance measurement mechanism of "distance transformation and fine calculation" can reduce the computational load of the system while ensuring measurement accuracy.

[0116] In the first stage of the above-mentioned outer rectangular coarse screening, if a globally fixed distance safety threshold is used... Due to the perspective projection characteristics of industrial cameras and the radial distortion at the lens edges, the actual physical distance represented by the same pixel distance varies non-linearly in different regions of the image. To prevent premature blocking or missed blocking at the edge of the field of view, this invention further proposes a dynamic adaptive coarse screening threshold model based on camera parameters and physical height.

[0117] Specifically, the distance safety threshold Dynamic adaptation can be achieved through the following methods: 1) Based on the preset agricultural requirements and the maximum thermal diffusion radius of the laser spot, set the safe blocking distance in physical space. ; 2) Based on the focal length of the image acquisition unit and its physical installation height Calculate the reference pixel threshold at the optical center of the image. :

[0118] 3) Obtain the coordinates of the center point of the circumscribed rectangle of the target weed area. The optical center coordinates of the image of the target weeding area Calculate the normalized image coordinates of both. :

[0119] This leads to the square of the relative radial distance between the target weed and the optical center. :

[0120] 4) Calculate the distance safety threshold after dynamic adaptation. :

[0121] in, The first radial distortion coefficient of the image acquisition unit, This is the second radial distortion coefficient of the image acquisition unit.

[0122] The first radial distortion coefficient and the second radial distortion coefficient can be determined by camera calibration. The intrinsic distortion correction of the image acquisition unit, such as the camera, can employ conventional techniques in this field.

[0123] Through this dynamic adaptive adjustment mechanism, the system calculates the shortest geometric distance. It can automatically compensate for image compression or stretching effects at the edges of the field of view. When the target is located at the edge of an image with significant distortion, Automatic scaling ensures that the algorithm maintains strict consistency in the physical criteria for determining the "absolute safe distance" within the global field of view, greatly improving the robustness and spatial distortion resistance of the weeding system for nearby crops.

[0124] Furthermore, the stability S of the target weed posture is calculated through the following steps: 1) Before obtaining the target laser execution plan, the target weeding area is continuously observed within the set continuous observation window. Frame image; 2) Regarding the above Continuous detection or segmentation of the same target weed in the frame image yields the target region of the same target weed at each time step. The target weed area in the frame image is denoted as ,in Then the first Target weed area in frame image The geometric center is ; in,

[0125] in, Indicates the first Target weed area in frame image The number of pixels within; Indicates the first Target weed area in frame image Inner The coordinates of each pixel in the image coordinate system; and They represent the first Target weed area in frame image The x and y coordinates of the geometric center are obtained by averaging the coordinates of all pixels within the area. 3) Calculate the continuous The center displacement between two adjacent frames in a frame image:

[0126] in: Indicates the first Frame image and the first Target weed area between frames The displacement of the geometric center; Then calculate the average displacement of the geometric center of the target weed area within the continuous observation window. :

[0127] 4) Calculate the continuous The first frame of the image Frame image and the first Overlap rate of target weed areas in frame image :

[0128] in, This represents the intersection area of ​​the target weed region in two adjacent image frames; This represents the union area of ​​the target weed regions in two adjacent image frames; Then calculate the average overlap rate of the target weed area within the continuous observation window. :

[0129] 5) Calculate the stability of the target weed posture. :

[0130] Among them, the Average displacement The weighting coefficients, the Average overlap rate The weighting coefficients; and All are greater than or equal to 0 and less than or equal to 1, and .

[0131] Weighting coefficient , The value can be adjusted based on crop density, wind conditions, etc., for example, 0.5 can be used for all crops.

[0132] Furthermore, the uncertainty of the target weed identification result is Z=1-P, where P is the reliability of the target weed identification result, and 0≤P≤1. The larger Z is, the greater the expected risk value and the greater the probability of accidentally damaging neighboring crops.

[0133] Furthermore, in order to calculate P, the control method further includes the following steps: An image of the target weeding area is acquired using a preset image acquisition unit, the target weeding area including the target weed area. and adjacent crop areas ; The target weed areas in the image are identified by a preset target recognition unit. and adjacent crop areas ; The recognition model of the target recognition unit is selected from the target detection model, the semantic segmentation model, or the instance segmentation model; When the recognition model is a target detection model, P is the classification probability that the target weed belongs to the corresponding weed category; When the recognition model is a semantic segmentation model or an instance segmentation model, P is the average pixel probability that the target weed region belongs to the corresponding weed category, and is determined in the following way:

[0134] in, Indicates the number of pixels within the target weed area; Indicates the first [unit] within the target weed area The probability that a pixel belongs to the corresponding weed category.

[0135] When using the target detection model, the reliability P of the target weed identification result is a probability given based on the overall experience base; while when using the semantic segmentation model or the instance segmentation model, P is the average pixel probability calculated based on pixels, rather than giving a probability for the entire image as a whole.

[0136] The object detection model, semantic segmentation model, or instance segmentation model can adopt the existing conventional corresponding model, and its specific network structure and training process can adopt the conventional corresponding techniques in this field.

[0137] Further, the predicted action area A of the target laser actuation scheme is determined using the following steps: 1) Let W be the target weed area in the image, and let the total number of its pixels be . Calculate the geometric center of the target weed region W. :

[0138] in,( Let M be the coordinates of the k-th pixel, where k = 1, 2, 3...M; 2) From the geometric center homogeneous coordinates in the image coordinate system Predicting the center of action in the physical plane through mapping calculation homogeneous coordinates in the physical plane coordinate system :

[0139] Where H is a 3x3 mapping matrix, which is obtained by calibrating the image plane coordinates and the corresponding physical plane coordinates; To make the z-axis coordinate in homogeneous coordinates normalize to 1 by a scaling factor; Indicates the center of predictive action Coordinates in the physical plane coordinate system; 3) From the predictive center Coordinates in the physical plane coordinate system Calculate the predicted area of ​​effect A:

[0140] in, Indicates the distance from point x to the center of prediction. The Euclidean distance; Let be the radius of the theoretically circular laser spot.

[0141] Furthermore, the H matrix can be determined using a calibration method based on image plane coordinates and corresponding physical plane coordinates. For example, calibration can be performed in the following way: The system sets up four or more non-collinear calibration points on the actual physical plane (the weeding work plane) and records the first... The coordinates of each calibration point in the real physical plane coordinate system And its pixel coordinates in the image (image area acquired during laser weeding) coordinate system. When the number of calibration points At that time, a system of linear equations is formed by the corresponding points of each group, and is solved by direct linear transformation and least squares method. Then, the matrix mapping relationship between the image plane coordinates and the real physical plane coordinates is obtained. Then, the coordinates of the corresponding geometric center in the real physical working plane coordinates are obtained by mapping the coordinates of the geometric center in the image coordinate system. Finally, based on the radius of the circular action spot in laser theory, the predicted action area can be obtained.

[0142] Further, the following steps are used to calculate the overlap ratio between the predicted action area and the crop safety boundary area. : 1) The predicted area is denoted as A, and the adjacent crop area is denoted as C. Calculate the safety boundary area of ​​the adjacent crop area C. :

[0143] in, Indicates the preset safety boundary width; Point to neighboring crop areas The Euclidean distance; 2) Calculate the predicted action area A and the safety boundary area. overlapping area :

[0144] in, This represents the prediction area A and the safety boundary area. The area of ​​the intersection region; 3) Calculate the overlap ratio parameter between the predicted action area and the crop safety boundary area. :

[0145] in, Indicates the predicted area of ​​effect The area.

[0146] Furthermore, the following steps are used to calculate the minimum distance between the boundary of the predicted action area and the boundary of the crop safety boundary area. :

[0147] in, Represents any point on the boundary of the prediction area; Represents any point on the boundary of the crop safety boundary area; Point With point The Euclidean distance between them.

[0148] The overlap ratio between the predicted action area and the crop safety boundary area Minimum distance between the boundary of the predicted action area and the boundary of the crop safety boundary area. It is a parameter characterizing the spatial relationship between the prediction area and the crop safety boundary. The smaller the size, the lower the risk of laser weeding accidentally damaging neighboring crops. The larger the laser weeding device, the lower the risk of accidentally damaging neighboring crops.

[0149] Furthermore, a preset predictive action area calculation unit is used to call a preset laser action model. Under the constraint of the target laser execution scheme, the predicted action area is determined based on the identification results of the target weed area and the adjacent crop area in the acquired image, and the third mapping relationship between image coordinates and physical space coordinates.

[0150] Furthermore, the expected risk value is calculated using a preset parameter extraction unit.

[0151] Furthermore, when the expected risk value is between and At this time, the laser's execution method is offset aiming, and it is necessary to determine the offset amount. The offset of the updated laser actuation scheme relative to the target laser actuation scheme can be calculated using the following steps. : 1) The center of the predicted area is denoted as... The boundary point closest to the center in the crop safety boundary area is denoted as... Calculate the unit direction vector from the crop safety boundary to the center. :

[0152] in, express and The Euclidean distance between them; 2) The predicted area is denoted as A, and the adjacent crop area is denoted as C. Calculate the safety boundary area of ​​the adjacent crop area C. :

[0153] in, Indicates the preset safety boundary width; Point to neighboring crop areas The Euclidean distance; 3) Calculate the predicted action area A and the safety boundary area. safety margin :

[0154] in, This represents the prediction area A and the safety boundary area. The area of ​​the intersection region; Indicates the empty set; The minimum distance between the target weedy area and the adjacent crop area; 4) Calculate the offset. :

[0155] in, Here, 'e' represents the preset target safety margin, and 'e' represents the system error. The prediction area A and the safety boundary area are defined as follows. Safety margin; 0 and The maximum value in.

[0156] System error e is the sum of various errors. Error types may include one or more combinations of calibration error, execution control error, mechanical hysteresis (with minimum precision during mechanical movement) and thermal diffusion compensation (systematic error caused by heat transfer of the laser spot).

[0157] After the laser weeding system performs offset aiming, it recalculates the expected risk value and, based on the mapping relationship between the expected risk value and the laser execution measures, re-derives the corresponding laser execution measures. Once offset aiming is complete, the expected risk value decreases to below the first risk layer threshold. In this case, laser weeding is performed directly using the laser scheme after offset aiming.

[0158] The controller in this embodiment is used to execute the aforementioned laser weeding control method; specifically, the controller includes a target identification unit for identifying the target weed area and the adjacent crop area; a predicted action area calculation unit for determining the predicted action area; a parameter extraction unit for calculating the expected risk value; and an execution measure decision unit for determining the laser execution measure.

[0159] Furthermore, the controller also includes a risk level display layer for displaying the risk level; If the expected risk value is less than the threshold of the first risk layer If so, the risk level display layer displays a low risk level; If the expected risk value is greater than or equal to the threshold of the first risk layer And less than the threshold of the third risk layer If so, the risk level display layer displays a risk level of medium. If the expected risk value is greater than the threshold of the third risk layer If so, the risk level display layer will show a high risk level.

[0160] The risk level display layer can intuitively show users of the laser weeding system the risk level of the current target laser execution plan.

[0161] Furthermore, the controller is mounted on the laser weeding system, or the controller is separately connected to the laser weeding system.

[0162] The laser weeding system of the present invention includes: a laser execution unit for performing laser execution measures; an image acquisition unit for acquiring an image of the target weeding area; and the aforementioned controller.

[0163] By employing the controller of this invention, the laser weeding system of this invention can significantly improve crop protection and operational safety while ensuring weeding capacity, with virtually no risk of accidentally damaging neighboring crops. It can be used in smart agriculture.

[0164] like Figure 1-3 As shown, another embodiment of the present invention provides a more detailed laser weeding control method based on risk assessment and crop safety constraints, as well as a corresponding controller and laser weeding system.

[0165] This laser weed control method does not use "directly firing lasers upon identifying weeds" as the default strategy. Instead, it first generates a risk layer based on crop safety constraints and target risk parameters, then selects the corresponding implementation measures according to the risk layer, and further assigns them to three risk levels: low, medium, and high.

[0166] The overall process of this laser weed control method is as follows: (1) Obtain images before execution and identify the target weed area and adjacent crop area; (2) Determine the predicted action area by combining the recognition results, the mapping relationship between the image coordinates in the collected images and the actual physical space coordinates of weeding, and the laser spot model; (3) Generate a risk layer for the current laser execution scheme for the target weeds based on the safe distance between the target weeds and the crop, the stability of the target weeds' posture, the recognition confidence, and the relationship between the predicted action area and the crop's safety boundary; (4) Implement laser-based measures according to the risk layer output; (5) The laser execution measures are further mapped to the risk level expression (so that users can intuitively obtain the risk conclusion) and the laser execution control is completed.

[0167] The hierarchical structure of the laser weeding system is as follows: First layer: Parameter layer The parameter layer describes the basic input quantities upon which the expected risk value determination depends, and includes at least the following four items: (1) Safe distance between weeds and neighboring crops; (2) Postural stability of the target weeds; (3) Identify confidence level; (4) The relationship between the predicted area of ​​action and the crop safety boundary.

[0168] Minimum distance parameter between target weeds and neighboring crops The minimum distance parameter between the target weed and its neighboring crops is used to characterize the spatial proximity between them and serves as one of the basic input parameters for risk level generation. To avoid shape distortion caused by using only the distance to the target center point, the minimum Euclidean distance between the boundary of the target weed area and the boundary of the neighboring crop area is preferably used as the minimum distance parameter.

[0169] After the image acquisition is completed before execution, the image is input into the visual recognition model to perform pixel-level segmentation of weeds and crops in the image to obtain the target category distribution results. Based on the category distribution results, the target weed area to be attacked is determined from the weed category area, and the neighboring crop area that is spatially adjacent to the target weed area is determined from the crop category area.

[0170] Subsequently, the target weed region and the adjacent crop region are represented as binary masks with the same size as the original image, where pixels belonging to the corresponding region are assigned a value of 1, and the remaining pixels are assigned a value of 0. To ensure the stability of subsequent boundary distance calculations, the binary masks are preprocessed with connected component filtering, hole filling, and boundary smoothing to remove isolated noise points and irrelevant small regions, retaining only the main regions related to the current target weed determination.

[0171] Then, based on the processed binary mask, extract the set of boundary points of the target weed area, the set of boundary points of the adjacent crop area, and their respective bounding rectangles. Use the binary mask, the set of boundary points, and the two bounding rectangles as inputs for subsequent calculations of the minimum distance between the target weeds and adjacent crops, calculations of the distance transformation of the local ROI (region of interest), and analysis of the relationship between the predicted area and the crop safety boundary.

[0172] Specifically, firstly, the target weed region and neighboring crop regions are obtained from the current image using object detection, semantic segmentation, or instance segmentation methods, and both are represented as binary regions. Let the target weed region be denoted as... Adjacent crop areas are denoted as Furthermore, the boundary point set of the target weed region and the boundary point set of the adjacent crop region are extracted separately, denoted as... and .

[0173] Set boundary points Its coordinates are represented as

[0174] Boundary points Its coordinates are represented as

[0175] Then point With point The Euclidean distance between them is defined as

[0176] Based on this, the minimum distance between the target weed area and the adjacent crop area is defined as

[0177] Right now

[0178] in: Indicates the target area covered by weeds; Indicates the area adjacent to crops; Represents the set of boundary points of the target weedy region; Represents the set of boundary points of neighboring crop regions; Let represent any point on the boundary of the target weeds, and let its coordinates be denoted as . ; Let represent any point on the boundary of the adjacent crop, and let its coordinates be denoted as . ; Point With point The Euclidean distance between them; This parameter represents the minimum distance between the target weed and its neighboring crops.

[0179] The minimum distance parameter The smaller the value, the closer the target weed is to neighboring crops, and the higher the risk of accidental damage or thermal impact on crops during laser execution; the minimum distance parameter The larger the value, the greater the safety margin around the target weeds, which can provide a more feasible basis for subsequent risk layer determination.

[0180] A two-stage distance extraction mechanism based on coarse screening with circumscribed rectangle and precise calculation of local ROI distance transformation. To address the limitations of edge computing devices in practical applications, which hinder high-frequency pixel-by-pixel traversal calculations of full-frame high-resolution images, a preferred approach is based on "circumscribed rectangular coarse screen—local..." The "distance transformation and fine calculation" two-level distance measurement mechanism aims to reduce the computational load of the system while ensuring measurement accuracy.

[0181] Minimum distance parameter between target weeds and neighboring crops The extraction includes the following two stages: Phase 1: Lightweight coarse screening based on orthogonal circumscribed rectangles In obtaining the target weed area and adjacent crop areas After masking, the orthogonal bounding rectangle of the two is first generated.

[0182] Let the bounding rectangle parameter of the target weed region be denoted as . The bounding rectangle parameter of the adjacent crop region is denoted as . .

[0183] First, calculate the minimum non-negative projection distance between the two rectangles in the horizontal and vertical directions:

[0184]

[0185] This allows us to obtain the shortest geometric distance between the two circumscribed rectangles. :

[0186] Introducing a coarse screening safety blocking threshold .like This indicates that the distance between the target weeds and the crops is far enough that there is no risk of short-term spatial interference. The system directly determines that the distance risk of the current target is extremely low and blocks the subsequent pixel-level distance calculation steps, directly outputting the distance status to the parameter layer to participate in the subsequent comprehensive judgment.

[0187] Phase 2: Pixel-level precision calculation based on local ROI distance transformation when At that time, the system constructs a local area that simultaneously covers the bounding rectangle of the target weeds and the bounding rectangle of neighboring crops. The local The expansion of the boundary outward from the merged outer envelope of the two circumscribed rectangles. get:

[0188]

[0189]

[0190]

[0191] The local This is only used to define the calculation window, which will also include the target weed area. Adjacent crop areas And the background area between them; but It is not used as a distance value object itself. In other words, the system is not part of the entire... Instead of taking the minimum distance inside, it is in After extracting the target weed mask and crop mask, only the boundary point of the target weed is used as the value point.

[0192] Specifically, in local areas Internal to neighboring crop areas The boundary generates a distance field. For any target weed boundary point... Its distance to the adjacent crop boundary is defined as:

[0193] in, Indicates local adjacent crop areas The set of boundary points, express Any point on the target weeds. Then, gather only at the boundary point of the target weeds. The distance field is queried above, and the minimum distance to the image plane is obtained:

[0194] in, This indicates that the target weed mask is in contact with or overlaps with the adjacent crop mask, and there is no usable safe gap between them. Therefore, the minimum distance in the image plane is used. Simply record as .when At that time, the minimum distance is only from the boundary point of the target weeds. Take the value from the top, instead of from the whole Or the pixel value inside the crop.

[0195] Finally, the minimum distance of the image plane is determined through camera calibration relationships. Converted to actual physical distance on the working plane and will The input parameter layer is used as the minimum distance parameter between the target weed and neighboring crops. Through the above processing, local... It only serves to narrow the calculation range, and the distance calculation is still strictly limited to the boundary between the target weed and the boundary of the adjacent crop, thus ensuring both calculation efficiency and the accuracy of the distance definition.

[0196] Dynamic adaptive coarse screening threshold model based on camera parameters and physical height In the first stage of the circumscribed rectangle coarse screening described above, if a globally fixed pixel threshold is used... Due to the perspective projection characteristics of industrial cameras and the radial distortion at the lens edges, the actual physical distance represented by the same pixel distance varies non-linearly in different regions of the image. To prevent premature blocking or missed blocking at the edge of the field of view, this embodiment further proposes a dynamic adaptive coarse screening threshold model based on camera parameters and physical height.

[0197] The dynamic coarse screening safety blocking threshold It is a function of the coordinates of the target weed's location in the image, and its calculation steps are as follows: Step A: Set the basic physical blocking threshold Based on agricultural and agronomic requirements and the maximum thermal diffusion radius of the laser spot, a realistic physical space safety blocking distance is set. Its unit can be, for example, millimeters.

[0198] Step B: Calculate the center reference pixel threshold Assuming the camera's optical axis is perpendicular to the working plane, based on the camera's focal length... and the physical mounting height of the camera Map the physical safety distance to a reference pixel threshold at the optical center of the image. :

[0199] Step C: Extract the location parameters of the target area Get the coordinates of the center point of the bounding rectangle of the target weeds And combined with the optical center coordinates of the image of the target weeding area (including the target weed area and adjacent crop areas). Calculate the normalized image coordinates of both. :

[0200] This leads to the square of the relative radial distance between the target weed and the optical center. :

[0201] Step D: Generate a dynamic adaptive threshold Introducing the radial distortion coefficient of the camera , (This can be obtained using Zhang Zhengyou's calibration method or other conventional camera calibration procedures). Based on the radial distortion model, a nonlinear spatial compensation function with respect to the target location is constructed, ultimately outputting the dynamic coarse screening threshold of the current target weeds. :

[0202] Through this dynamic adaptive adjustment mechanism, the system calculates the shortest geometric distance. It can automatically compensate for image compression or stretching effects at the edges of the field of view. When the target is located at the edge of an image with significant distortion, Automatic scaling ensures that the algorithm maintains strict consistency in the physical criteria for determining the "absolute safe distance" within the global field of view, greatly improving the robustness and spatial distortion resistance of the near-seedling weeding system.

[0203] Target attitude stability parameters The target attitude stability parameter is used to characterize the degree of change in the spatial position and regional morphology of the target weeds during continuous observation, and serves as one of the basic input parameters for risk level generation. The target attitude stability parameter reflects whether the target weeds are in a relatively stable state before laser execution; when the target undergoes significant displacement, swaying, morphological changes, or directional changes within a short period, it indicates poor attitude stability, making it more prone to operational deviation risks during laser execution.

[0204] Specifically, in the continuous process before laser execution In a frame image, the same target weed is continuously detected or segmented to obtain its target region at each time step. Let the first... The target weed area in the frame image is denoted as ,in Further, the target weed area is defined. The geometric center is

[0205] in: Indicates the first The target weed area in the frame image; Indicates the first The geometric center of the target weed region in the frame image; and These represent the x-coordinate and y-coordinate of the geometric center in the image coordinate system, respectively.

[0206] If the first Frame target weed area Depend on It consists of 10 pixels, and the coordinates of the pixels are 100 pixels. ,in Then the geometric center It is obtained by the arithmetic mean of the coordinates of all pixels within the target area, i.e.

[0207] in: in, Indicates the first Target weed area in frame image The number of pixels within; Indicates the first Target weed area in frame image Inner The coordinates of each pixel in the image coordinate system; and They represent the first Target weed area in frame image The x and y coordinates of the geometric center are obtained by averaging the coordinates of all pixels within the area. Based on this, the center displacement between two adjacent frames is defined as...

[0208] in: Indicates the first Frame and the The displacement of the geometric center of the target weeds between frames.

[0209] Can be continuous The average displacement in a frame is defined as the target position change parameter:

[0210] in: This represents the average center displacement of the target weeds within a continuous observation window.

[0211] To further characterize whether the morphology of the target region is stable, let the first... Frame and the The overlap rate of the target weed area in the frame is

[0212] in: This represents the intersection area of ​​target regions in two adjacent frames; This represents the union area of ​​target regions in two adjacent frames; This indicates the overlap rate between target regions in two adjacent frames.

[0213] Accordingly, the average overlap rate within a continuous observation window can be defined.

[0214] in: This represents the average overlap rate of the target area within a continuous observation window.

[0215] Based on the aforementioned position change parameters and region overlap parameters, target attitude stability parameters can be constructed. The target attitude stability parameter is defined as follows:

[0216] Wherein: the Average displacement The weighting coefficients, the Average overlap rate The weighting coefficients; and All are greater than or equal to 0 and less than or equal to 1, and ; Used to characterize the degree of positional change of the target's geometric center between consecutive frames; It is used to characterize the degree of morphological instability of a target region between consecutive frames.

[0217] in, and The value can be set according to different devices, scenarios, or control requirements. For example, it can be adjusted based on crop density, wind conditions, etc. These two parameters are used to adjust the attitude stability parameters. Subject to positional change parameters Overlapping parameters with region The degree of influence; when When the value is large, it indicates that the position change parameter affects the position change parameter. The impact is greater; when A larger value indicates that the region overlap parameter affects... The impact is greater.

[0218] As can be seen from the above formula, when the target's position changes little in consecutive frames of images and the region overlap rate is high, the attitude stability parameter... A smaller value indicates that the target attitude is more stable; when the target undergoes large displacement or the region overlap rate is low in consecutive frames, the attitude stability parameter... A larger value indicates poor target attitude stability.

[0219] Therefore, the target attitude stability parameters It can be used as one of the inputs for risk level generation to characterize the degree to which target weeds can be stabilized before laser execution. Parameters The larger the value, the more unstable the target is within a short observation period, and the higher the corresponding risk of action shift; parameter The smaller the value, the more stable the target's attitude, which is more conducive to performing precise laser actions.

[0220] Identify confidence parameters The identification confidence parameter is used to characterize the reliability of the current target weed identification result and serves as one of the basic input parameters for risk level generation. The identification confidence parameter reflects whether the target weed area is given with high certainty by the identification model; when the confidence of the identification result is low, it indicates that the current target area may have false detections, missed segments, inaccurate boundaries, or uncertain categories, thereby increasing the risk of accidental hits during laser execution.

[0221] Specifically, in the current image, the target weed region is obtained through object detection, semantic segmentation, or instance segmentation methods. And its corresponding recognition results. Let the original confidence level (confidence score) of the recognition model's output for the target weed area be denoted as . Among them, the aforementioned The method of obtaining can be further expressed as follows.

[0222] Let the probability vector of the target weed category output by the recognition model be...

[0223] and satisfy

[0224] If the category index corresponding to the target weed category is Then the original confidence level Defined as

[0225] in, This represents the total number of categories output by the recognition model. Indicates the first The class probability corresponding to the class An index representing the target weed category. Therefore, the... This can be understood as the direct probability output of the identification model that the current target belongs to the target weed category.

[0226] in: This indicates the confidence level of the identification model in that the current target weed area belongs to the target weed category; .

[0227] When the recognition model is a target detection model, the original confidence level This can be represented as the classification probability that the detection box belongs to the target weed category; when the recognition model is a semantic segmentation or instance segmentation model, the original confidence score is... It can represent the average pixel probability that the target weed area belongs to the corresponding weed category.

[0228] To ensure uniform use as a risk input parameter, parameters for identifying uncertainty can be defined. .

[0229] Where: Z represents the uncertainty of the target weed identification result; The larger, The smaller the value, the more reliable the recognition result; The smaller, The larger the value, the less reliable the identification result.

[0230] Average pixel probability that the target weed area belongs to the corresponding weed category Calculated in the following way:

[0231] in, Indicates the number of pixels within the target weed area; Indicates the first [unit] within the target weed area The probability that a pixel belongs to the corresponding weed category.

[0232] Specifically, this invention can utilize the visual recognition model provided by YOLO. .

[0233] Therefore, when the probability of identifying the target weed area is high, the value of parameter Z is small, indicating that the recognition confidence of the current target area is high; when the probability of identifying the target weed area is low, the value of parameter Z is large, indicating that there is a large recognition uncertainty of the current target area.

[0234] Therefore, the uncertainty Z of the target weed identification result can be used as one of the inputs for risk level generation to characterize the unreliability of the current target weed area identification. The larger the value, the more unstable or unreliable the current identification result is, and the higher the corresponding risk of false hits; the smaller the value, the more reliable the current identification result is, and the more beneficial it is for laser actuation control.

[0235] Predicted parameters relating the area of ​​action to the crop safety boundary The parameter representing the relationship between the predicted area of ​​effect and the crop safety boundary is used to characterize the spatial relationship between the current laser execution scheme and the protected area of ​​adjacent crops, and serves as one of the basic input parameters for risk level generation. This parameter reflects whether the theoretical area of ​​effect of the laser approaches, contacts, or intrudes into the crop's safety protection boundary under the current aiming position and range. When the interval between the predicted area of ​​effect and the crop safety boundary is small, or when they overlap, it indicates that the current laser execution scheme has a high risk of accidental strikes.

[0236] Specifically, in the current image, let the target weed area be denoted as... Adjacent crop areas are denoted as Based on the target recognition results, the mapping relationship between image coordinates and physical space coordinates, the laser execution scheme, and the laser action model, the predicted action area of ​​the current laser is determined, denoted as […]. The prediction area is described above. This indicates the local area that the laser will theoretically cover under the current execution parameters.

[0237] Among them, the The method of obtaining can be further expressed as follows.

[0238] Set target weed area It consists of a set of pixels, and its total number of pixels is denoted as . The geometric center of the target weedy area is used as the reference point for action. ,in

[0239] From the geometric center homogeneous coordinates in the image coordinate system By mapping, the predicted center of action in the physical plane is calculated. homogeneous coordinates in the physical plane coordinate system :

[0240] Where H is a 3x3 mapping matrix, which is obtained by calibrating the image plane coordinates and the corresponding physical plane coordinates; To normalize the z-axis coordinate in homogeneous coordinates to 1 using a scaling factor (after mapping via the H mapping matrix, both the x and y coordinates are multiplied by a factor, so a scaling factor needs to be introduced), The normalization factor causes the mapped coordinates to cancel out the multiplication factor. Indicates the center of predictive action Coordinates in the physical plane coordinate system.

[0241] After obtaining the H matrix through calibration, the following can be calculated: ,For example, For any image point to be mapped First calculate:

[0242] In the above formula, it means that can The normalization coefficients, therefore the coordinates of the point in the working plane and the scaling factor are obtained by the following formula:

[0243] In H and Once determined, the geometric center of the target weed area becomes the reference point for action. Coordinates in the physical plane coordinate system It can also be calculated.

[0244] If the theoretical laser spot size on the working plane is of radius... The circular region then predicts the area of ​​effect. Defined as:

[0245] Indicates the distance from point x to the center of prediction. The Euclidean distance; Let be the radius of the theoretically circular laser spot.

[0246] Furthermore, to characterize the protected extent of a crop, in adjacent crop areas... Based on this, a crop safety boundary area is constructed, denoted as The crop safety boundary area From crop region Expand outwards to the preset safe width To obtain, that is

[0247] in: Indicates the crop safety boundary area; Indicates the area adjacent to crops; This represents the width of the safety boundary, which is an empirical parameter that can be set by the user. Point to crop areas The Euclidean distance.

[0248] Therefore, crop safety boundary area This refers to the protected space surrounding adjacent crop areas, the area of ​​laser prediction effect. You should not enter the protected space, or you should try to maintain a sufficient distance from it.

[0249] To quantitatively characterize the relationship between the prediction effect area and the crop safety boundary area, the overlap area between the two is first defined as...

[0250] in: Indicates the area of ​​prediction effect Safety boundary area with crops The overlapping area; This represents the area of ​​the intersection region between the two.

[0251] Furthermore, the overlap ratio parameter is defined as follows:

[0252] in: This indicates the overlap ratio between the predicted area of ​​effect and the crop safety boundary area; Indicates the area of ​​prediction effect The area.

[0253] when When, it indicates that the predicted area of ​​effect has not entered the crop safety boundary area; when When, it indicates that the predicted area of ​​effect has partially entered the crop safety boundary area; when As the value gradually increases, it indicates that the extent to which the predicted area of ​​action encroaches on the crop safety boundary gradually increases.

[0254] In addition to overlapping relationships, the minimum distance between the boundary of the prediction effect area and the boundary of the crop safety boundary area can be further defined. Let the prediction area be defined. The set of boundary points is denoted as Crop safety boundary area The set of boundary points is denoted as The minimum boundary distance between the two is defined as

[0255] in: This represents the minimum distance between the boundary of the prediction area and the boundary of the crop safety boundary area. Represents any point on the boundary of the prediction area; Represents any point on the boundary of the crop safety boundary area; Point With point The Euclidean distance between them.

[0256] Therefore, the relationship parameter between the predicted area and the crop safety boundary can be obtained from the overlap ratio parameter. and minimum boundary distance parameter Characterization. When Larger or When the value is small, it indicates a dangerous relationship between the current prediction area and the crop safety boundary, corresponding to a high risk of false hits; when... and A larger value indicates that there is good spatial isolation between the current prediction area and the crop safety boundary, and the corresponding execution safety is high.

[0257] Therefore, the relationship parameters can be used as one of the inputs for risk level generation to characterize the safety level of the current laser execution scheme relative to the protected area of ​​the crop, and provide a basis for subsequent risk level determination of "can be executed normally", "can be executed with restrictions", "requires delayed re-inspection" or "cannot be executed".

[0258] Second layer: Risk layer The risk layer is used to represent the system's judgment result on the execution permission status of the current target, including the following four categories: normal execution, restricted execution, delayed re-inspection required, and execution prohibited.

[0259] Let the parameter layer input vector be denoted as .

[0260] in: : The minimum distance parameter between the target weed area and the adjacent crop area; Target attitude stability parameters; Uncertainty parameters of target weed identification results; : The overlap ratio parameter between the predicted action area and the crop safety boundary area; : The minimum distance parameter between the boundary of the predicted action area and the boundary of the crop safety boundary area.

[0261] These parameters are used to characterize the spatial safety, orientation stability, identification reliability, and safety of the predicted action plan relative to the protected area of ​​the crop.

[0262] Risk layer Let the output state of the risk layer be denoted as ,in Represents the input vector of the parameter layer. This represents the decision function from the parameter layer to the risk layer. This indicates the risk level status.

[0263] The risk layer status Take one of the following four states:

[0264] in, This indicates that the process can be executed normally. This indicates that execution is restricted. This indicates that a re-inspection needs to be postponed. This indicates that execution is prohibited.

[0265] As a preferred but not limited specific form, the parameter layer input vector can be first... Mapped to expected risk value Then, based on the threshold, Mapped to risk layer state .

[0266] Let the input vector of the parameter layer be...

[0267] in, This parameter represents the minimum distance between the target weedy area and the adjacent crop area. This represents the target attitude stability parameter. The parameter representing the uncertainty of the target weed identification result. This parameter represents the overlap ratio between the predicted area and the crop safety boundary area. This parameter represents the minimum distance between the boundary of the prediction area and the boundary of the crop safety boundary area.

[0268] To unify parameters with different dimensions, corresponding dimensionless risk components can be constructed respectively:

[0269]

[0270]

[0271]

[0272]

[0273] in, This represents the distance normalization reference threshold. This represents the normalized reference threshold for attitude stability. This represents the reference threshold for normalized boundary distance; the three thresholds can be adjusted based on experience or actual circumstances. , , , and They represent respectively by , Z and The dimensionless risk component is constructed.

[0274] Based on this, the expected risk value can be defined. for

[0275] in, , , , and For the weighting coefficients, the preferred one is to satisfy...

[0276] Therefore, the function One specific form can be defined as

[0277] in, , and Define thresholds for the risk layer, and satisfy the following conditions: .

[0278] Therefore, when When the parameter layer input vector is small, It was determined to be "executable"; when As the risk level increases, the output status of the risk layer transitions sequentially to "can be executed with restrictions", "requires delayed review", and "cannot be executed".

[0279] Laser Execution Measures Decision-Making Level Let the output action of the measure layer be denoted as

[0280] in: This represents the mapping function from the risk layer to the measure layer; This indicates the action output by the measures layer.

[0281] The measures layer action Choose one of the following four actions:

[0282] in: Normal strike; Offset aiming; Delayed re-inspection; : It is forbidden to crack down on it.

[0283] The mapping relationship from the risk layer to the measure decision layer is defined as follows:

[0284] In other words, it can be executed normally, corresponding to a normal attack; It can be executed under certain restrictions, corresponding to offset aiming; A delayed re-inspection is required; a delayed re-inspection should be conducted accordingly. Enforcement is prohibited, and correspondingly, crackdowns are prohibited.

[0285] Risk level Let the risk level be denoted as

[0286] in: This represents the mapping function from the risk layer to the risk level layer; Indicates the risk level.

[0287] The risk level Choose one of the following three levels:

[0288] in: Low level; Medium level; High level.

[0289] The mapping relationship from the risk layer to the risk level layer is defined as follows:

[0290] In other words: Normal execution corresponds to low level; restricted execution corresponds to medium level; delayed re-inspection is required, corresponds to medium level; execution is prohibited, corresponds to high level.

[0291] The risk level tiers allow users to easily and intuitively understand the risks of current laser execution solutions.

[0292] like Figure 3 As shown, the following describes several specific laser execution measures: normal strike, offset aiming, delayed re-inspection, and strike prohibition.

[0293] normal strike The target weeds are directly removed using laser laser execution.

[0294] Offset aiming When the risk layer output status is In the case of "limited execution", the system does not directly execute along the original predicted center of action, but instead makes a limited offset to the aiming center, so as to increase the space margin between the system and the crop safety boundary while maintaining the ability to act on the target weeds.

[0295] Let the original predictive effect center be denoted as The boundary point on the crop safety boundary that is closest to the original prediction center is denoted as... Then, a unit direction vector can be defined from the crop safety boundary to the original prediction center. for

[0296] To determine the offset, first define the prediction area. Signed safety margin relative to the crop safety boundary region Bc When the two do not overlap, Equal to the minimum distance between the two boundaries When the two overlap, Take the negative value and convert it to the equivalent intrusion depth using the overlapping area:

[0297] Let the system's required target safety margin be... It can be preset according to the actual situation, taking into account one or more of the following system errors e (e.g., calibration error, execution control error, mechanical hysteresis (minimum accuracy during mechanical movement), and thermal diffusion compensation (system error caused by heat transfer of the laser spot): the theoretically required aiming offset. for:

[0298] in Then the offset aiming center Defined as

[0299] The system uses the offset aiming center Redetermine the prediction area after offset The expected risk value is then recalculated, and based on the mapping relationship between the expected risk value and the laser execution measures, the corresponding laser execution measures are obtained again. After offset aiming, the expected risk value decreases to less than the first risk layer threshold. In this case, laser weeding is performed directly using the laser scheme after offset aiming. The core behavior of offset aiming is to make a limited adjustment to the actual center of laser action without changing the target category determination result, so that the predicted action area moves away from the crop safety boundary.

[0300] Delayed re-inspection When the risk layer output status is In other words, when a "delayed re-inspection" is required, the system will not immediately emit a laser, but will instead wait for a preset delay time. The images were then re-acquired, and the parameter layer inputs were recalculated to determine whether the target weeds had changed from a temporarily unstable state to an executable state.

[0301] Let the parameter layer input vector after this delay be denoted as . Its form can be expressed as

[0302] And recalculate the corresponding risk layer output state:

[0303] If re-evaluated Transform into If so, the system will perform a normal attack; if Transform into If so, the system will perform offset aiming; if Still If so, the delayed re-inspection will continue; Transform into If this occurs, the system will enter a state where attacks are prohibited.

[0304] The core behavior of delayed re-inspection is to re-observe and re-judge the target weeds without immediately emitting laser, and decide whether to continue execution, restrict execution, continue re-inspection, or directly prohibit execution based on the updated parameter layer input results.

[0305] "Delayed re-inspection" is not ordinary waiting, but a restricted execution mechanism designed to address the temporal uncertainty caused by the short-term swaying of living plants and the instantaneous fluctuations in recognition results. Specifically, if the spatial relationship between the target weed and neighboring crops at the current moment has not yet met the conditions for prohibiting execution, but the target's attitude stability parameters... Exceeding the stability threshold, or identifying uncertain parameters. When the threshold is exceeded, the system does not immediately emit a laser. Instead, it re-acquires the image after a preset delay, recalculates the parameter layer input vector, and uses the risk layer output state function to determine whether the current target has entered a state of normal execution, restricted execution, need for further delay and re-inspection, or prohibition of execution.

[0306] The above embodiments are only for illustrating the technical concept and features of the present invention, and are intended to enable those skilled in the art to understand the content of the present invention and implement it accordingly. They should not be construed as limiting the scope of protection of the present invention. All equivalent changes or modifications made in accordance with the spirit and essence of the present invention should be covered within the scope of protection of the present invention.

Claims

1. A method for controlling laser weeding, characterized in that: The control method includes the following steps: S1: Determine the predicted area of ​​action for removing the target weeds based on the target laser execution scheme and the location of the target weeds; S2: Calculate the expected risk value of the target laser execution scheme for the target weed, wherein the expected risk value is determined based on the distance between the target weed and the neighboring crops, the stability of the target weed's posture, the reliability of the target weed identification result, the predicted action area, and the safety boundary of the neighboring crops; S3: Based on the preset mapping relationship between expected risk values ​​and laser execution measures, determine the laser execution measures corresponding to the expected risk values ​​for removing target weeds; the mapping relationship includes: If the expected risk value is less than the threshold of the first risk layer In this case, the laser execution measure is to directly execute according to the target laser execution plan; If the expected risk value is greater than or equal to the threshold of the first risk layer And less than the threshold of the second risk layer The laser execution measure is to offset the target laser execution scheme to obtain an updated laser execution scheme, recalculate the updated expected risk value corresponding to the updated laser execution scheme, and perform step S3 based on the updated expected risk value. If the expected risk value is greater than or equal to the second risk layer threshold And less than the threshold of the third risk layer If the laser execution measure is not to execute the target laser execution plan, and to wait at a preset time interval... Then repeat steps S1-S3; The , satisfy: .

2. The laser weeding control method according to claim 1, characterized in that: The mapping relationship also includes: If the expected risk value is greater than the threshold of the third risk layer If the laser execution measure is to not execute the target laser execution plan, and to perform steps S1-S3 on other target weeds.

3. The laser weeding control method according to claim 1, characterized in that: The expected risk value R is calculated using the following steps: ; in, , , , and Let be the weighting coefficient, and satisfy: All are greater than or equal to 0 and less than or equal to 1, and ; ; ; ; ; ; in, Representing 0 and The maximum value in; This represents the distance normalization reference threshold. This represents the normalized reference threshold for attitude stability. Indicates the reference threshold for normalized boundary distance; The minimum distance between the target weed area and the adjacent crop area. For the stability of the target weed posture, To address the uncertainty in target weed identification results, To predict the overlap ratio between the affected area and the crop safety boundary area, This is the minimum distance between the boundary of the predicted action area and the boundary of the crop safety boundary area.

4. The laser weeding control method according to claim 1, 2, or 3, characterized in that: The control method further includes the following steps: An image of the target weeding area is acquired using a preset image acquisition unit, the target weeding area including the target weed area. and adjacent crop areas ; The target weed areas in the image are identified by a preset target recognition unit. and adjacent crop areas .

5. The laser weeding control method according to claim 4, characterized in that: The The minimum Euclidean distance between the boundary of the target weedy area and the boundary of the adjacent crop area: ; in, Indicates the target area covered by weeds; Indicates the area adjacent to crops; Represents the set of boundary points of the target weedy region; Represents the set of boundary points of neighboring crop regions; Let represent any point on the boundary of the target weeds, and let its coordinates be denoted as . ; Let represent any point on the boundary of the adjacent crop, and let its coordinates be denoted as . .

6. The laser weeding control method according to claim 4, characterized in that: The following steps are used to calculate the minimum distance between the target weed area and the adjacent crop area. : 1) Preprocess the target weed area and the adjacent crop area to obtain the set of boundary points of the target weed area, the set of boundary points of the adjacent crop area, the bounding rectangle of the target weed area, and the bounding rectangle of the adjacent crop area; The bounding rectangle of the target weed area is denoted as . The circumscribed rectangle of the adjacent crop area is denoted as . ; in, Let x be the minimum x-coordinate of the target weedy area. Let be the minimum ordinate of the target weedy area. The x-coordinate of the target weedy area is [value]. The maximum ordinate of the target weedy area; The minimum x-coordinate of the adjacent crop area. The minimum ordinate of the adjacent crop area. The x-coordinate of the adjacent crop area. The maximum ordinate of the adjacent crop area; 2) Calculate the shortest geometric distance between the bounding rectangle of the target weed area and the bounding rectangle of the adjacent crop area. : ; in, ; ; Represents 0, , The maximum value in; Represents 0, , The maximum value in; 3) Determine the shortest geometric distance With respect to the preset safe distance threshold Size relationship: like Then the shortest geometric distance As ; like Then construct a local The local The bounding rectangle of the target weed area and the bounding rectangle of the adjacent crop area are merged, and the boundary is expanded outward by an amount of [missing information]. get: ; ; ; ; in, Indicates local The minimum x-coordinate, Indicates local The maximum x-coordinate, Indicates local The minimum ordinate, Indicates local The maximum ordinate; express The minimum value in; express The maximum value in; express The minimum value in, express The maximum value in; 4) Calculate any point in the set of boundary points of the target weedy region. Distance to the boundary of adjacent crop areas : ; in, Indicates the local adjacent crop areas The set of boundary points, express any point on; 5) Based on the distance , and intersection Is it an empty set? Determine the minimum distance in the image plane : ; 6) Based on the second mapping relationship preset by the image acquisition unit and the... To obtain the true physical distance in physical space and will As .

7. The laser weeding control method according to claim 6, characterized in that: The distance safety threshold Dynamic adaptation can be achieved through the following methods: 1) Based on the preset agricultural requirements and the maximum thermal diffusion radius of the laser spot, set the safe blocking distance in physical space. ; 2) Based on the focal length of the image acquisition unit and its physical installation height Calculate the reference pixel threshold at the optical center of the image. : ; 3) Obtain the coordinates of the center point of the circumscribed rectangle of the target weed area. The optical center coordinates of the image of the target weeding area Calculate the normalized image coordinates of both. : ; This leads to the square of the relative radial distance between the target weed and the optical center. : ; 4) Calculate the distance safety threshold after dynamic adaptation. : ; in, The first radial distortion coefficient of the image acquisition unit, This is the second radial distortion coefficient of the image acquisition unit.

8. The laser weeding control method according to claim 3, characterized in that: The stability of the target weed posture is calculated through the following steps. : 1) Before obtaining the target laser execution plan, the target weeding area is continuously observed within the set continuous observation window. Frame image; 2) Regarding the above Continuous detection or segmentation of the same target weed in the frame image yields the target region of the same target weed at each time step. The target weed area in the frame image is denoted as ,in Then the first Target weed area in frame image The geometric center is ; in, ; in, Indicates the first Target weed area in frame image The number of pixels within; Indicates the first Target weed area in frame image Inner The coordinates of each pixel in the image coordinate system; and They represent the first Target weed area in frame image The x and y coordinates of the geometric center are obtained by averaging the coordinates of all pixels within the area. 3) Calculate the continuous The center displacement between two adjacent frames in a frame image: ; in: Indicates the first Frame image and the first Target weed area between frames The displacement of the geometric center; Then calculate the average displacement of the geometric center of the target weed area within the continuous observation window. : ; 4) Calculate the continuous The first frame of the image Frame image and the first Overlap rate of target weed areas in frame image : ; in, This represents the intersection area of ​​the target weed region in two adjacent image frames; This represents the union area of ​​the target weed regions in two adjacent image frames; Then calculate the average overlap rate of the target weed area within the continuous observation window. : ; 5) Calculate the stability of the target weed posture. : ; Among them, the Average displacement The weighting coefficients, the Average overlap rate The weighting coefficients; and All are greater than or equal to 0 and less than or equal to 1, and .

9. The laser weeding control method according to claim 3, characterized in that: The uncertainty of the target weed identification results =1- ,in The reliability of the target weed identification results is 0 ≤ ≤1.

10. The laser weeding control method according to claim 9, characterized in that: The control method further includes the following steps: An image of the target weeding area is acquired using a preset image acquisition unit, the target weeding area including the target weed area. and adjacent crop areas ; The target weed areas in the image are identified by a preset target recognition unit. and adjacent crop areas ; The recognition model of the target recognition unit is selected from the target detection model, the semantic segmentation model, or the instance segmentation model; When the recognition model is a target detection model, the The probability that the target weed belongs to the corresponding weed category; When the recognition model is a semantic segmentation model or an instance segmentation model, the The average pixel probability that the target weed area belongs to the corresponding weed category is calculated as follows: ; in, Indicates the number of pixels within the target weed area; Indicates the first [unit] within the target weed area The probability that a pixel belongs to the corresponding weed category.

11. The laser weeding control method according to claim 3, characterized in that: The following steps are used to calculate the overlap ratio between the predicted area of ​​action and the crop safety boundary area. : 1) The predicted area of ​​effect is denoted as The adjacent crop area is denoted as Calculate the neighboring crop area security boundary area : ; in, Indicates the preset safety boundary width; Point to neighboring crop areas The Euclidean distance; 2) Calculate the predicted area of ​​effect. and the security boundary area overlapping area : ; in, Indicates the predicted area of ​​effect and the security boundary area The area of ​​the intersection region; 3) Calculate the overlap ratio parameter between the predicted action area and the crop safety boundary area. : ; in, Indicates the predicted area of ​​effect The area.

12. The laser weeding control method according to claim 11, characterized in that: The following steps are used to calculate the minimum distance between the boundary of the predicted action area and the boundary of the crop safety boundary area. : ; in, Represents any point on the boundary of the prediction area; Represents any point on the boundary of the crop safety boundary area; Point With point The Euclidean distance between them.

13. The laser weeding control method according to claim 1, characterized in that: Using a preset prediction area calculation unit, a preset laser action model is invoked. Under the constraint of the target laser execution scheme, the predicted area is determined based on the identification results of the target weed area and adjacent crop area in the acquired image, and the third mapping relationship between image coordinates and physical space coordinates. And / or, the expected risk value is calculated using a preset parameter extraction unit.

14. The laser weeding control method according to claim 1, characterized in that: The following steps are used to calculate the offset of the updated laser actuation scheme relative to the target laser actuation scheme. : 1) The center of the predicted area is denoted as... The boundary point closest to the center in the crop safety boundary area is denoted as... Calculate the unit direction vector from the crop safety boundary to the center. : ; in, express and The Euclidean distance between them; 2) The predicted area of ​​effect is denoted as Adjacent crop areas are denoted as Calculate the neighboring crop area security boundary area : ; in, Indicates the preset safety boundary width; Point to neighboring crop areas The Euclidean distance; 3) Calculate the predicted action area A and the safety boundary area. safety margin : ; in, This represents the prediction area A and the safety boundary area. The area of ​​the intersection region; Indicates the empty set; The minimum distance between the target weedy area and the adjacent crop area; 4) Calculate the offset. : ; in, Here, 'e' represents the preset target safety margin, and 'e' represents the system error. The prediction area A and the safety boundary area are defined as follows. Safety margin; For 0 and The maximum value in.

15. A controller for a laser weeding system, characterized in that: The controller is used to execute the laser weeding control method according to any one of claims 1-14.

16. The controller for a laser weeding system according to claim 15, characterized in that: The controller includes: The target identification unit is used to identify target weed areas and adjacent crop areas; A prediction area calculation unit, used to determine the prediction area; A parameter extraction unit is used to calculate the expected risk value; An execution measure decision unit is used to determine the laser execution measure.

17. The controller for a laser weeding system according to claim 16, characterized in that: The controller also includes a risk level display layer for displaying the risk level; If the expected risk value is less than the threshold of the first risk layer If so, the risk level display layer displays a low risk level; If the expected risk value is greater than or equal to the threshold of the first risk layer And less than the threshold of the third risk layer If so, the risk level display layer displays a risk level of medium. If the expected risk value is greater than the threshold of the third risk layer If so, the risk level display layer will show a high risk level.

18. The controller for a laser weeding system according to claim 15, 16, or 17, characterized in that: The controller is mounted on the laser weeding system, or the controller is separately connected to the laser weeding system.

Citation Information

Patent Citations

  • Robot grabbing method and system based on light field structure complexity driving

    CN121798648A

  • Laser weeding robot weeding method and system based on three-dimensional perception

    CN122030367A