A dynamically adaptive vehicle-mounted multispectral farmland weed detection method
By adopting a dynamically adaptive vehicle-mounted multispectral farmland weed detection method, which utilizes the vehicle-mounted platform's speed positioning roughness description module and multispectral imagery, the problems of high computational load and poor environmental adaptability in existing technologies are solved, achieving efficient and accurate weed detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NORTHEAST INST OF GEOGRAPHY & AGRIECOLOGY C A S
- Filing Date
- 2026-02-24
- Publication Date
- 2026-05-08
AI Technical Summary
Existing methods for detecting weeds in farmland are computationally intensive in mobile operation scenarios and are difficult to adapt to changes in the field environment, resulting in low accuracy in weed identification and serious issues of duplicate counting or missed detection.
By introducing a vehicle-mounted platform speed positioning roughness description module, positioning and speed deviation parameters are dynamically output. Combined with multispectral images, a roughness control interval description module and a regional difference description module are constructed. Taking into account the spatial uncertainty and spectral characteristics of weeds, accurate detection is achieved.
It achieves efficient and interference-resistant accurate weed detection on a low-computing-power platform, reducing the amount of computation, improving the accuracy and consistency of detection, and adapting to complex farmland environments.
Smart Images

Figure CN121746933B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of agricultural information technology, and in particular to a dynamically adaptive vehicle-mounted multispectral method for detecting weeds in farmland. Background Technology
[0002] Modern agriculture is transitioning from extensive to precision farming, and accurate weed identification in farmland is a prerequisite for implementing variable-rate spraying and laser weeding, which reduce pesticide use and increase efficiency. In practice, using multispectral sensors on vehicle-mounted platforms such as unmanned vehicles and intelligent tractors for weed detection is a key step in achieving precise positioning. However, the complex and ever-changing field environment presents a significant challenge. Ensuring accurate and unique identification of the same weed in continuously captured images during vehicle movement, avoiding duplicate counting or missed detections, directly impacts the accuracy of subsequent weeding operations and pesticide utilization rates. This is a pressing industry challenge that needs to be addressed.
[0003] Although the weed recognition technology for single-frame images is relatively mature, the existing technical solutions still have significant limitations in vehicle-mounted mobile operation scenarios: (1) The deduplication method based on traditional geometric distance and positioning usually relies on GPS positioning and simple Euclidean distance thresholds to determine whether the weeds in adjacent frames are the same target. However, in actual operations, the farmland ground is uneven, the vehicle platform is difficult to maintain an absolutely uniform speed, and the commonly used GPS / RTK positioning system has a drift error of 0.5-2 meters in dynamic environments. The instantaneous speed fluctuation of the vehicle in a short period of time (0.1-1.5 m / s) will cause the position estimation to fail. This makes it extremely difficult to adapt a fixed distance threshold when processing continuous multi-frame images. If the threshold is too large, a dense group of weeds will be misjudged as a single plant; if the threshold is too small, the same weed will be misjudged as multiple plants due to positioning drift. This "two-way misjudgment" leads to low weed detection accuracy. (2) The feature anchoring method based on hyperspectral fingerprints uses a device with extremely high spectral resolution to extract the "spectral fingerprint" of weeds for unique matching. This method performs reasonably well in laboratory environments with constant illumination, but in outdoor field environments, changes in the sun's angle, cloud cover, and even differences in radiance caused by dust in the air can cause significant shifts in the spectral characteristics of the same weed, resulting in low weed identification accuracy. (3) Advanced vision methods based on 3D reconstruction (such as SLAM) can solve the relocation problem and improve weed identification accuracy by using SLAM technology to restore 3D scenes. However, this method requires extremely high computing resources, resulting in a large amount of computation for weed identification. Moreover, this method usually relies on expensive high-end GPU servers, while the agricultural working environment is harsh, and vehicle terminals are usually low-power embedded devices, which cannot support such a large amount of real-time computation. Therefore, this method is difficult to apply to actual weed detection. Summary of the Invention
[0004] This invention aims to address the problem that existing farmland weed detection methods involve large computational loads and are difficult to apply to actual weed detection, and proposes a dynamically adaptive vehicle-mounted multispectral farmland weed detection method.
[0005] A dynamically adaptive vehicle-mounted multispectral weed detection method for farmland includes the following steps:
[0006] Step 1: Establish the WeedIntervalDescriptionModule, which takes the current longitude CurLon, current latitude CurLat, mean time-dependent velocity variable SXSDJZ, change in time-dependent velocity variable SXSDBH, minimum time-dependent positioning deviation variable SXZXPC, maximum time-dependent positioning deviation variable SXZDPC, and multispectral image MultiSpecImg as input and outputs the coarse control interval description object MSDX.
[0007] Step 2: Call WeedIntervalDescriptionModule and use the coarse control interval description object output by WeedIntervalDescriptionModule to construct the region coarse control interval list CCKKList;
[0008] Step 3: Establish the regional coarse control interval difference description module IntervalDiffModule. The input of IntervalDiffModule is two coarse control interval description objects MSDX1 and MSDX2, and the output is the difference evaluation index DiffScore.
[0009] Step 4: Call IntervalDiffModule to process the elements in the coarse control interval list CCKKList to obtain the farmland weed detection results.
[0010] Furthermore, the mean time-delay speed variable SXSDJZ, the time-delay speed change variable SXSDBH, the time-delay positioning minimum deviation variable SXZXPC, and the time-delay positioning maximum deviation variable SXZDPC are obtained through the following methods:
[0011] S1. System initialization and construction of time-sensitive variables;
[0012] The time-dependent state variables include: the average time-dependent speed variable SXSDJZ, the time-dependent speed change variable SXSDBH, the time-dependent positioning minimum deviation variable SXZXPC, and the time-dependent positioning maximum deviation variable SXZDPC.
[0013] S2. Establish the VehicleRoughnessModule for describing the speed and positioning of the vehicle platform. The input of the VehicleRoughnessModule is the system time and the vehicle GPS location information. The output is the mean speed variable SXSDJZ, the speed change variable SXSDBH, the minimum positioning deviation variable SXZXPC, and the maximum positioning deviation variable SXZDPC.
[0014] S3. Establish an automatic update module for timeliness status. Each time the automatic update module for timeliness status is triggered, it calls the VehicleRoughnessModule of the vehicle platform speed positioning roughness description module to obtain the SXSDJZ, SXSDBH, SXZXPC and SXZDPC corresponding to each trigger.
[0015] Furthermore, the system initialization and construction of time-sensitive variables in S1 specifically involves:
[0016] S101. Construct a list of region coarse control intervals CCKKList and initialize the list of region coarse control intervals CCKKList to an empty list;
[0017] S102. Establish the time control interval duration variable SXSC and set SXSC to the preset value;
[0018] S103. Establish a time-sensitive state variable and initialize the time-sensitive state variable to 0;
[0019] The time-dependent state variables include: the average time-dependent speed variable SXSDJZ, the time-dependent speed change variable SXSDBH, the time-dependent positioning minimum deviation variable SXZXPC, and the time-dependent positioning maximum deviation variable SXZDPC.
[0020] Furthermore, in S2, the VehicleRoughnessModule, which establishes the vehicle platform speed positioning roughness description module, takes system time and vehicle GPS location information as inputs and outputs the time-sensitive average speed variable SXSDJZ, the time-sensitive speed change variable SXSDBH, the time-sensitive positioning minimum deviation variable SXZXPC, and the time-sensitive positioning maximum deviation variable SXZDPC, specifically:
[0021] S201. Establish the VehicleRoughnessModule for vehicle platform speed positioning roughness description, with the input being the system time and the corresponding vehicle GPS location information.
[0022] S202. Store the system time and the vehicle GPS location information corresponding to the system time into the time-stamp-based location queue LocQueue, and at the same time clear the data in LocQueue whose timestamps are earlier than the preset time.
[0023] The preset time is the current time minus the time obtained by SXSC;
[0024] S203. Use the data in LocQueue to obtain the average moving speed of the vehicle platform during the SXSC time period, and set SXSDJZ = the average moving speed of the vehicle platform during the SXSC time period.
[0025] S204. Use the data in LocQueue to obtain the standard deviation of the vehicle platform's speed during the SXSC time period, and set SXSDBH = the standard deviation of the vehicle platform's speed during the SXSC time period.
[0026] S205. Use SXSDJZ and SXSDBH to obtain the minimum deviation variable SXZXPC for time-delayed positioning:
[0027]
[0028] in, It is the basic deviation coefficient. It is the jitter impact coefficient. It is the hyperbolic tangent function;
[0029] S206. Obtain the maximum deviation variable SXZDPC for time-delay positioning using SXSDJZ and SXSDBH, specifically:
[0030]
[0031] S207 outputs SXSDJZ, SXSDBH, SXZXPC and SXZDPC.
[0032] Furthermore, the automatic update module for establishing the timeliness status in S3 calls the VehicleRoughnessModule for speed positioning roughness description on the vehicle platform each time it is triggered, and obtains SXSDJZ, SXSDBH, SXZXPC and SXZDPC corresponding to each trigger, specifically:
[0033] S301. Start the independent system timer RoughnessTimer and set the trigger interval of RoughnessTimer to SXSC;
[0034] S302. When RoughnessTimer is triggered, the VehicleRoughnessModule constructed in S2 is called to obtain SXSDJZ, SXSDBH, SXZXPC and SXZDPC corresponding to each trigger.
[0035] Further, in step one, the WeedIntervalDescriptionModule, which establishes a weed coarse control interval description module, takes the current longitude (CurLon), current latitude (CurLat), mean so-called velocity variable (SXSDJZ), change in so-called velocity variable (SXSDBH), minimum so-called location deviation variable (SXZXPC), maximum so-called location deviation variable (SXZDPC), and multispectral image (MultiSpecImg) as inputs and outputs a coarse control interval description object (MSDX), specifically:
[0036] Step 11: Establish the WeedIntervalDescriptionModule, whose inputs are the current longitude CurLon, current latitude CurLat, SXSDJZ, SXSDBH, SXZXPC, SXZDPC, and multispectral image MultiSpecImg;
[0037] Step 12: Use an image recognition algorithm to determine whether there are weed targets in MultiSpecImg; if no weed targets are identified, output an empty value and end; if weed targets are identified, obtain the pixel coordinates of the weed center on MultiSpecImg, and then use the pixel coordinates of the weed center on MultiSpecImg, CurLon, and CurLat to obtain the geographical center point WeedCenter of the weed.
[0038] Step 13: Construct the coarse core region HXQ using WeedCenter, SXSDJZ, and SXZXPC;
[0039] The HXQ is centered at WeedCenter and has a width of [missing information]. A square;
[0040] The Obtained through the following methods:
[0041]
[0042] in, It is a logarithmic function;
[0043] Step 14: Construct the coarse control interval KKQJ using WeedCenter, SXSDBH, and SXZDPC;
[0044] The coarse control interval KKQJ is a square with WeedCenter as its geometric center and a width of WidthKKQJ;
[0045] The WidthKKQJ is obtained through the following method:
[0046]
[0047] Step 15: Extract the pixel region corresponding to the weeds in MultiSpecImg, and use the average gray value of all pixels in the pixel region corresponding to the weeds in each spectral band to form the weed multispectral description vector MSSL;
[0048] Step 16: Encapsulate CurLon, CurLat, HXQ, KKQJ, and MSSL into a coarse control interval description object MSDX, and output MSDX.
[0049] Further, in steps one and two, the pixel coordinates of the weed center on MultiSpecImg are obtained, and then the geographic center point WeedCenter of the weed is obtained using the pixel coordinates of the weed center on MultiSpecImg, CurLon, and CurLat. Specifically:
[0050] Using the geographic coordinates of the center point of MultiSpecImg Obtain the pixel 2D geographic coordinates of the center point of MultiSpecImg ;
[0051] Then, using Get the pixel coordinates of the center point of the weeds Specifically:
[0052]
[0053]
[0054]
[0055]
[0056] in, It is the horizontal pixel offset of the weed center relative to the center of MultiSpecImg. It is the vertical pixel offset of the weed center relative to the center of MultiSpecImg. These are the pixel coordinates of the center point of the weed target recognition box on MultiSpecImg. It is the width of MultiSpecImg in pixels. It is the width of the ground area covered by MultiSpecImg. It is the height pixel of MultiSpecImg. It is the height of the ground area covered by MultiSpecImg;
[0057] Finally, Convert to geographic coordinates to obtain the geographic coordinates of the center point of the weeds.
[0058] Furthermore, in step two, WeedIntervalDescriptionModule is called, and the coarse control interval description object output by WeedIntervalDescriptionModule is used to construct a list of region coarse control intervals, CCKKList, specifically as follows:
[0059] Step 21: As the vehicle starts moving, initialize the capture loop variable CaptureCounter to 0;
[0060] Step 22: Start the main data collection loop, setting it to execute once every 5 seconds;
[0061] Steps two and three: Obtain the vehicle's current longitude, latitude, and multispectral imagery;
[0062] Step 24: Call WeedIntervalDescriptionModule to obtain the control interval description object Description;
[0063] Step 25: Determine if Description is empty. If Description is empty, proceed to Step 27; if Description is not empty, proceed to Step 26.
[0064] Step 26: Add the Description to the end of CCKKList;
[0065] Step 27: Set CaptureCounter = CaptureCounter + 1;
[0066] Step 28: Determine if the data collection process has ended. If the data collection process has not ended, proceed to Step 22 and wait for the next data collection; otherwise, output CCKKList.
[0067] Furthermore, in step three, the IntervalDiffModule, a module for describing the regional coarse control interval differences, takes two coarse control interval description objects, MSDX1 and MSDX2, as input and outputs the difference evaluation index, DiffScore, specifically:
[0068] Step 3: 1. Establish the regional coarse control interval difference description module IntervalDiffModule. The input of IntervalDiffModule is two coarse control interval description objects MSDX1 and MSDX2.
[0069] Step 3.2: Obtain the spatial distance normalization factor using the Euclidean distance GeoDist and SXSDJZ between the center points of MSDX1 and MSDX2. Specifically:
[0070]
[0071] in, It is a constant;
[0072] Step 3: Obtain the ratio of the intersection area to the union area of MSDX1.HXQ and MSDX2.HXQ. and utilize Obtain the core interval overlap Specifically:
[0073]
[0074] in, It is a rough control interval description object The rough core region, It is a rough control interval description object The rough core region;
[0075] Steps 3 and 4: Obtain the ratio of the intersection area to the union area of MSDX1.KKQJ and MSDX2.KKQJ. and utilize Obtain the overlap of control intervals Specifically:
[0076]
[0077] in, It is a rough control interval description object The rough control interval value, It is a rough control interval description object The rough control interval value;
[0078] Step 35: Obtain the multispectral distance using the cosine distance between MSDX1.MSSL and MSDX2.MSSL. Specifically:
[0079]
[0080] in, It is a rough control interval description object Multispectral description vector of weeds It is a rough control interval description object Multispectral description vector of weeds It is the module length;
[0081] Step 36, Utilize , , and Obtain the difference evaluation metric DiffScore and output DiffScore;
[0082] The difference evaluation index, DiffScore, is obtained using the following formula:
[0083]
[0084] DiffScore is a metric for evaluating differences. , This indicates that the two coarse control interval description objects MSDX1 and MSDX2 are completely identical. This indicates that the two coarse control intervals describing objects MSDX1 and MSDX2 are completely different.
[0085] Furthermore, in step four, the call to the IntervalDiffModule to process the elements in the coarse control interval list CCKKList to obtain the farmland weed detection results is as follows:
[0086] Step 4: 1. Obtain the CCKKList generated in Step 2, and get the total number of elements in the CCKKList, ListLen.
[0087] Step 42: Initialize the outer loop variable OutCounter to 0;
[0088] Step 43: Use the element with index OutCounter in CCKKList as the base object BaseObj;
[0089] Step 4: Initialize the inner loop variable InCounter to OutCounter+1;
[0090] Step 45: If InCounter is greater than or equal to ListLen, proceed to step 40; otherwise, proceed to step 46.
[0091] Step 46: Use the element with index InCounter in CCKKList as the comparison object CompObj;
[0092] Step 47: Call the IntervalDiffModule from Step 3, input BaseObj and CompObj into the IntervalDiffModule, and obtain the DiffScore;
[0093] Step 48: Determine if the DiffScore is less than 0.5. If so, mark CompObj and then proceed to step 49; otherwise, proceed directly to step 49.
[0094] Step 49: Set InCounter = InCounter + 1, then proceed to step 45;
[0095] Step 40: Set OutCounter = OutCounter + 1;
[0096] Step 41: If OutCounter is less than ListLen-1, go to step 43; otherwise, go to step 42.
[0097] Step 42: Traverse CCKKList and delete all marked objects in CCKKList;
[0098] Step 43: Output the CCKKList processed in step 42 as the final weed detection result for farmland.
[0099] The beneficial effects of this invention are as follows:
[0100] To address the problems existing in the prior art, this invention provides a vehicle-mounted multispectral farmland weed detection method based on roughness control intervals. This invention introduces a vehicle-mounted platform speed positioning roughness description module that dynamically outputs positioning and speed deviation parameters reflecting the current environment. Based on the positioning and speed deviation parameters, the weed roughness control interval description module describes the identified weeds as a comprehensive description object of roughness intervals and spectral characteristics. Furthermore, the results of the regional roughness control interval difference description module are used for evaluation and screening to form more accurate detection results.
[0101] This invention introduces the concept of a coarse control interval to dynamically describe the uncertainty range of weed location. By comprehensively considering the real-time mean speed, speed variation variance, and potential positioning errors of the unmanned vehicle, a descriptive operator deeply fused with multispectral features is constructed. This invention can accurately determine whether adjacent objects are the same or different plants within an ambiguous spatiotemporal range through weighted differences, reducing computational load and enabling implementation on low-computing-power platforms. Therefore, this invention can be directly applied to practical weed detection. Furthermore, this invention achieves efficient, interference-resistant, and accurate weed detection and deduplication. Attached Figure Description
[0102] Figure 1 This is a flowchart of the present invention. Detailed Implementation
[0103] Specific implementation method one: as follows Figure 1 As shown in the figure, this embodiment describes a dynamically adaptive vehicle-mounted multispectral weed detection method for farmland. The specific process is as follows:
[0104] S1. The system initializes and constructs time-sensitive variables, specifically:
[0105] S101. Construct a list of region coarse control intervals CCKKList and initialize the list of region coarse control intervals CCKKList to an empty list;
[0106] The regional coarseness control interval list CCKKList is used to store weed interval description objects generated during subsequent detection processes;
[0107] S102. Establish the time control interval duration variable SXSC, and set SXSC to the preset value of 60 seconds;
[0108] The duration variable of the time control interval (SXSC) defines the length of the time sliding window for evaluating the vehicle's motion state;
[0109] S103. Establish time-sensitive state variables and initialize each time-sensitive state variable to 0;
[0110] The time-dependent state variables include: the average time-dependent speed variable SXSDJZ, the time-dependent speed change variable SXSDBH, the time-dependent positioning minimum deviation variable SXZXPC, and the time-dependent positioning maximum deviation variable SXZDPC.
[0111] This step aims to establish a basic data structure for the dynamic monitoring of the vehicle platform and initialize a series of time-sensitive variables to describe the characteristics of vehicle motion, providing a parameter benchmark for subsequent coarse interval calculations.
[0112] S2. Establish a vehicle-mounted platform speed positioning roughness description module (VehicleRoughnessModule). The inputs to VehicleRoughnessModule are system time and vehicle GPS location information, and the outputs are the time-sensitive average speed variable SXSDJZ, the time-sensitive speed change variable SXSDBH, the time-sensitive positioning minimum deviation variable SXZXPC, and the time-sensitive positioning maximum deviation variable SXZDPC. Specifically:
[0113] S201. Establish the VehicleRoughnessModule for vehicle platform speed positioning roughness description, with the input being the system time and the corresponding vehicle GPS location information.
[0114] S202. Store the system time and the vehicle GPS location information corresponding to the system time into the time-stamp-based location queue LocQueue, and at the same time clean up the expired data in LocQueue whose timestamp is earlier than the current time minus SXSC (i.e., 60 seconds ago).
[0115] S203. Use the data in LocQueue to obtain the average moving speed of the vehicle platform during the SXSC time period, and set SXSDJZ = the average moving speed of the vehicle platform during the SXSC time period.
[0116] S204. Use the data in LocQueue to obtain the standard deviation of the vehicle platform's speed during the SXSC time period, and set SXSDBH = the standard deviation of the vehicle platform's speed during the SXSC time period.
[0117] SXSDBH reflects the degree of bumpiness during vehicle travel;
[0118] S205. Simulate the nonlinear effect of velocity on positioning accuracy based on the saturation characteristics of the hyperbolic tangent function (tanh), and obtain the minimum deviation variable SXZXPC for time-dependent positioning using SXSDJZ and SXSDBH:
[0119]
[0120] in, It is the basic deviation coefficient. It is the jitter impact coefficient. It is the hyperbolic tangent function;
[0121] S206. An exponential term is introduced to amplify the deviation prediction under high-speed bumpy conditions. The maximum deviation variable SXZDPC for time-lapse positioning is obtained using SXSDJZ and SXSDBH, specifically:
[0122]
[0123] in, It is the base of the natural logarithm;
[0124] S207 outputs SXSDJZ, SXSDBH, SXZXPC and SXZDPC.
[0125] This step defines a core module that can perceive and quantify the motion uncertainty of the vehicle platform in real time. This module analyzes historical location data and dynamically outputs positioning and speed deviation parameters SXSDJZ, SXSDBH, SXZXPC and SXZDPC that reflect the current environment.
[0126] S3. Establish an automatic update module for timeliness status. Each time the automatic update module is triggered, it calls the VehicleRoughnessModule (VehicleRoughnessModule) of the vehicle platform speed positioning roughness description module to obtain the corresponding SXSDJZ, SXSDBH, SXZXPC, and SXZDPC for each trigger. Specifically:
[0127] S301. Start the independent system timer RoughnessTimer and set the trigger interval of RoughnessTimer to SXSC (i.e., 60 seconds).
[0128] The value of SXSC is set by those skilled in the art based on experience. If higher real-time performance is required, SXSC can be set to 10 seconds.
[0129] S302. When RoughnessTimer is triggered, the VehicleRoughnessModule constructed in S2 is called to obtain SXSDJZ, SXSDBH, SXZXPC and SXZDPC corresponding to each trigger.
[0130] The results of each execution of the VehicleRoughnessModule reflect the vehicle motion characteristics within the most recent time window.
[0131] In this step, a timed task is used to ensure that the motion roughness description of the vehicle platform remains real-time, enabling the algorithm to adapt to speed fluctuations caused by changes in farmland terrain.
[0132] S4. Establish a weed coarseness control interval description module, WeedIntervalDescriptionModule. The input of WeedIntervalDescriptionModule is the current longitude CurLon, the current latitude CurLat, SXSDJZ, SXSDBH, SXZXPC, SXZDPC, and the image MultiSpecImg captured by the multispectral device. The output is the coarseness control interval description object MSDX, specifically:
[0133] S401. Establish a weed coarseness control interval description module WeedIntervalDescriptionModule. The input of WeedIntervalDescriptionModule is the current longitude CurLon, the current latitude CurLat, SXSDJZ, SXSDBH, SXZXPC, SXZDPC and the multispectral image MultiSpecImg taken by the multispectral device.
[0134] S402. Use an image recognition algorithm to process MultiSpecImg and determine whether there is a weed target in MultiSpecImg. If no weed target is identified, output a null value and end. If a weed target is identified, obtain the pixel coordinates of the weed center on MultiSpecImg, and then use the pixel coordinates of the weed center on MultiSpecImg, CurLon, and CurLat to obtain the geographical center point WeedCenter of the weed.
[0135] The image recognition algorithm is the YOLO algorithm;
[0136] The process involves obtaining the pixel coordinates of the weed center on MultiSpecImg, and then using these pixel coordinates, CurLon, and CurLat to obtain the geographic center point of the weed, WeedCenter.
[0137] Geographic coordinates of the center point of MultiSpecImg in the ESPG4326 coordinate system Convert to the ESPG3857 coordinate system to obtain the pixel-level two-dimensional geographic coordinates of the center point of MultiSpecImg. ;
[0138] Then, using Get the pixel coordinates of the center point of the weeds Specifically:
[0139]
[0140]
[0141]
[0142]
[0143] in, It is the horizontal pixel offset of the weed center relative to the center of MultiSpecImg. It is the vertical pixel offset of the weed center relative to the center of MultiSpecImg. These are the pixel coordinates of the center point of the weed target recognition box on MultiSpecImg. It is the width of MultiSpecImg in pixels. It is the width of the ground area covered by MultiSpecImg. It is the height pixel of MultiSpecImg. It is the height of the ground area covered by MultiSpecImg;
[0144] Finally, Convert to the ESPG4326 coordinate system to obtain the geographic coordinates of the center point of the weeds;
[0145] S403. Construct the coarse core region HXQ using WeedCenter, SXSDJZ and SXZXPC;
[0146] The HXQ is centered at WeedCenter and has a width of [missing information]. A square;
[0147] The Determined by the current average speed and minimum deviation, it is obtained in the following way:
[0148]
[0149] in, It is a logarithmic function;
[0150] S404. Construct the coarse control interval KKQJ using WeedCenter, SXSDBH, and SXZDPC;
[0151] The coarse control interval KKQJ is a square with WeedCenter as its geometric center and a width of WidthKKQJ;
[0152] KKQJ is a larger rectangle that wraps around HXQ, and the width of KKQJ, WidthKKQJ, takes into account the maximum deviation and speed jitter.
[0153] The WidthKKQJ is obtained in the following way:
[0154]
[0155] S405. Extract the pixel region corresponding to the weeds from MultiSpecImg, and use the average gray value of all pixels in each spectral band within the pixel region corresponding to the weeds to form the weed multispectral description vector MSSL.
[0156] S406. Encapsulate CurLon, CurLat, HXQ, KKQJ, and MSSL into a coarse control interval description object MSDX, and output MSDX.
[0157] This step defines how to transform the weed identification results in a single frame of imagery into a comprehensive descriptive object that includes spatial uncertainty (coarse range) and spectral features.
[0158] S5. Call WeedIntervalDescriptionModule and use the coarse control interval description object output by WeedIntervalDescriptionModule to construct the region coarse control interval list CCKKList, specifically:
[0159] S501, The vehicle starts moving, and the capture loop variable CaptureCounter is initialized to 0;
[0160] S502. Start the main data acquisition loop, setting it to execute once every 5 seconds;
[0161] S503 acquires the vehicle's current longitude, latitude, and multispectral images captured by the vehicle;
[0162] S504. Call WeedIntervalDescriptionModule to obtain the control interval description object Description;
[0163] S505. Determine if Description is empty. If Description is empty, execute S507; if Description is not empty, execute S506.
[0164] S506. Add the Description to the end of CCKKList;
[0165] S507. Let CaptureCounter=CaptureCounter+1;
[0166] S508. Determine if the data acquisition process has ended. If the data acquisition process has not ended, go to S502 to continue waiting for the next data acquisition; otherwise, output CCKKList.
[0167] This step describes how, during actual vehicle operation, the above modules are called repeatedly to generate a raw data list containing all potential weed targets.
[0168] S6. Establish the regional coarse control interval difference description module IntervalDiffModule. The input of IntervalDiffModule is two coarse control interval description objects MSDX1 and MSDX2, and the output is the difference evaluation index DiffScore, specifically:
[0169] S601. Establish a regional coarse control interval difference description module IntervalDiffModule, the input of which is two coarse control interval description objects MSDX1 and MSDX2;
[0170] S602. Obtain the spatial distance normalization factor using the Euclidean distance GeoDist and SXSDJZ between the center points of MSDX1 and MSDX2. Specifically:
[0171]
[0172] in, It is a small constant to prevent the denominator from being zero;
[0173] S603. Obtain the ratio of the intersection area to the union area of MSDX1.HXQ and MSDX2.HXQ. and to Perform reverse mapping (the greater the overlap, the smaller the difference) to obtain the core interval overlap degree. Specifically:
[0174]
[0175] in, It is a rough control interval description object The rough core region, It is a rough control interval description object The rough core region;
[0176] S604. Obtain the ratio of the intersection area to the union area of MSDX1.KKQJ and MSDX2.KKQJ. and to Perform reverse mapping (the greater the overlap, the smaller the difference) to obtain the control interval overlap degree. Specifically:
[0177]
[0178] in, It is a rough control interval description object The rough control interval value, It is a rough control interval description object The rough control interval value;
[0179] S605. Obtain multispectral distance using the cosine distance between MSDX1.MSSL and MSDX2.MSSL. Specifically:
[0180]
[0181] in, It is a rough control interval description object Multispectral description vector of weeds It is a rough control interval description object Multispectral description vector of weeds It is the module length;
[0182] S606, Utilization , , and Obtain the difference evaluation metric DiffScore and output DiffScore;
[0183] The difference evaluation index, DiffScore, is obtained using the following formula:
[0184]
[0185] DiffScore is a metric for evaluating differences. , This indicates that the two coarse control interval description objects MSDX1 and MSDX2 are completely identical. This indicates that the two coarse control intervals describing objects MSDX1 and MSDX2 are completely different.
[0186] This step defines the core algorithm for determining whether two weed objects are "the same plant," generating a comprehensive evaluation index by integrating spatial distance, interval overlap, and spectral similarity.
[0187] S7. Call IntervalDiffModule to process the elements in the coarse control interval list CCKKList, remove duplicate weeds, and obtain the farmland weed detection results, specifically:
[0188] S701. Get the CCKKList generated by S5, and get the total number of elements in the CCKKList, ListLen.
[0189] S702. Initialize the outer loop variable OutCounter to 0;
[0190] S703, Outer loop begins: Use the element with index OutCounter in CCKKList as the base object BaseObj;
[0191] S704. Initialize the inner loop variable InCounter to OutCounter+1;
[0192] S705. If InCounter is greater than or equal to ListLen, then go to S710 (end the inner loop); otherwise, execute S706.
[0193] S706, Inner loop begins: The element with index InCounter in CCKKList is used as the comparison object CompObj;
[0194] S707: Call the IntervalDiffModule defined in S6, input BaseObj and CompObj into the IntervalDiffModule, and obtain the DiffScore;
[0195] S708. Determine if the DiffScore is less than 0.5 (i.e., the difference is extremely small, indicating it is the same weed). If so, mark CompObj as "deletable" and then execute S709; otherwise, execute S709 directly.
[0196] S709, Set InCounter = InCounter + 1, then go to S705;
[0197] S710, Set OutCounter = OutCounter + 1;
[0198] S711. If OutCounter is less than ListLen-1, go to S703; otherwise, go to S712.
[0199] S712. Traverse CCKKList and delete all objects marked as "deletable" in CCKKList;
[0200] S713. Output the CCKKList processed by S712 as the final weed detection result for farmland.
Claims
1. A dynamically adaptive vehicle-mounted multispectral method for detecting weeds in farmland, characterized in that... The specific process of the method is as follows: Step 1: Establish the WeedIntervalDescriptionModule, which takes the current longitude CurLon, current latitude CurLat, mean time-dependent velocity variable SXSDJZ, change in time-dependent velocity variable SXSDBH, minimum time-dependent positioning deviation variable SXZXPC, maximum time-dependent positioning deviation variable SXZDPC, and multispectral image MultiSpecImg as input and outputs the coarse control interval description object MSDX. The mean time-of-arrival speed variable SXSDJZ, the time-of-arrival speed variation variable SXSDBH, the time-of-arrival positioning minimum deviation variable SXZXPC, and the time-of-arrival positioning maximum deviation variable SXZDPC are obtained through the following methods: S1. System initialization and construction of time-sensitive state variables; The time-dependent state variables include: the average time-dependent speed variable SXSDJZ, the time-dependent speed change variable SXSDBH, the time-dependent positioning minimum deviation variable SXZXPC, and the time-dependent positioning maximum deviation variable SXZDPC. S2. Establish the VehicleRoughnessModule for describing the speed and positioning of the vehicle platform. The input of the VehicleRoughnessModule is the system time and the vehicle GPS location information. The output is the mean speed variable SXSDJZ, the speed change variable SXSDBH, the minimum positioning deviation variable SXZXPC, and the maximum positioning deviation variable SXZDPC. S3. Establish an automatic update module for timeliness status. Each time the automatic update module for timeliness status is triggered, it calls the VehicleRoughnessModule of the vehicle platform speed positioning roughness description module to obtain the SXSDJZ, SXSDBH, SXZXPC and SXZDPC corresponding to each trigger. Step 2: Call WeedIntervalDescriptionModule and use the coarse control interval description object output by WeedIntervalDescriptionModule to construct the region coarse control interval list CCKKList; Step 3: Establish the regional coarse control interval difference description module IntervalDiffModule. The input of IntervalDiffModule is two coarse control interval description objects MSDX1 and MSDX2, and the output is the difference evaluation index DiffScore. Step 4: Call IntervalDiffModule to process the elements in the coarse control interval list CCKKList to obtain the farmland weed detection results.
2. The dynamically adaptable vehicle-mounted multispectral method for detecting weeds in farmland according to claim 1, characterized in that: The system initialization and construction of time-sensitive state variables in S1 are specifically as follows: S101. Construct a list of region coarse control intervals CCKKList and initialize the list of region coarse control intervals CCKKList to an empty list; S102. Establish the time control interval duration variable SXSC and set SXSC to the preset value; S103. Establish a time-sensitive state variable and initialize the time-sensitive state variable to 0; The time-dependent state variables include: the average time-dependent speed variable SXSDJZ, the time-dependent speed change variable SXSDBH, the time-dependent positioning minimum deviation variable SXZXPC, and the time-dependent positioning maximum deviation variable SXZDPC.
3. The dynamically adaptable vehicle-mounted multispectral method for detecting weeds in farmland according to claim 2, characterized in that: The VehicleRoughnessModule, established in S2, takes system time and vehicle GPS location information as inputs and outputs the mean speed variable SXSDJZ, the speed change variable SXSDBH, the minimum positioning deviation variable SXZXPC, and the maximum positioning deviation variable SXZDPC. Specifically: S201. Establish the VehicleRoughnessModule for vehicle platform speed positioning roughness description, with the input being the system time and the corresponding vehicle GPS location information. S202. Store the system time and the vehicle GPS location information corresponding to the system time into the time-stamp-based location queue LocQueue, and at the same time clear the data in LocQueue whose timestamps are earlier than the preset time. The preset time is the current time minus the time obtained by SXSC; S203. Use the data in LocQueue to obtain the average moving speed of the vehicle platform during the SXSC time period, and set SXSDJZ = the average moving speed of the vehicle platform during the SXSC time period. S204. Use the data in LocQueue to obtain the standard deviation of the vehicle platform's speed during the SXSC time period, and set SXSDBH = the standard deviation of the vehicle platform's speed during the SXSC time period. S205. Use SXSDJZ and SXSDBH to obtain the minimum deviation variable SXZXPC for time-delayed positioning: in, It is the basic deviation coefficient. It is the jitter impact coefficient. It is the hyperbolic tangent function; S206. Obtain the maximum deviation variable SXZDPC for time-delay positioning using SXSDJZ and SXSDBH, specifically: S207 outputs SXSDJZ, SXSDBH, SXZXPC and SXZDPC.
4. The dynamically adaptable vehicle-mounted multispectral weed detection method for farmland according to claim 3, characterized in that: The automatic update module for the establishment of timeliness status in S3 calls the VehicleRoughnessModule for the vehicle platform speed positioning roughness description module each time it is triggered, and obtains SXSDJZ, SXSDBH, SXZXPC and SXZDPC corresponding to each trigger. Specifically: S301. Start the independent system timer RoughnessTimer and set the trigger interval of RoughnessTimer to SXSC; S302. When RoughnessTimer is triggered, the VehicleRoughnessModule constructed in S2 is called to obtain SXSDJZ, SXSDBH, SXZXPC and SXZDPC corresponding to each trigger.
5. The dynamically adaptable vehicle-mounted multispectral method for detecting weeds in farmland according to claim 4, characterized in that: The WeedIntervalDescriptionModule, established in step one, takes the current longitude (CurLon), current latitude (CurLat), mean so-called velocity variable (SXSDJZ), change in so-called velocity variable (SXSDBH), minimum so-called location deviation variable (SXZXPC), maximum so-called location deviation variable (SXZDPC), and multispectral image (MultiSpecImg) as input. Its output is the coarse control interval description object (MSDX), specifically: Step 11: Establish the WeedIntervalDescriptionModule, whose inputs are the current longitude CurLon, current latitude CurLat, SXSDJZ, SXSDBH, SXZXPC, SXZDPC, and multispectral image MultiSpecImg; Step 1 and 2: Use an image recognition algorithm to determine whether there are weed targets in MultiSpecImg; if no weed targets are identified, output an empty value and end the process. If weeds are identified, the pixel coordinates of the weed center on MultiSpecImg are obtained, and then the geographic center point WeedCenter of the weed is obtained using the pixel coordinates of the weed center on MultiSpecImg, CurLon, and CurLat. Step 13: Construct the coarse core region HXQ using WeedCenter, SXSDJZ, and SXZXPC; The HXQ is centered at WeedCenter and has a width of [missing information]. A square; The Obtained through the following methods: in, It is a logarithmic function; Step 14: Construct the coarse control interval KKQJ using WeedCenter, SXSDBH, and SXZDPC; The coarse control interval KKQJ is a square with WeedCenter as its geometric center and a width of WidthKKQJ; The WidthKKQJ is obtained through the following method: Step 15: Extract the pixel region corresponding to the weeds in MultiSpecImg, and use the average gray value of all pixels in the pixel region corresponding to the weeds in each spectral band to form the weed multispectral description vector MSSL; Step 16: Encapsulate CurLon, CurLat, HXQ, KKQJ, and MSSL into a coarse control interval description object MSDX, and output MSDX.
6. The dynamically adaptable vehicle-mounted multispectral method for detecting weeds in farmland according to claim 5, characterized in that: In steps one and two, the pixel coordinates of the weed center on MultiSpecImg are obtained, and then the geographic center point WeedCenter of the weed is obtained using the pixel coordinates of the weed center on MultiSpecImg, CurLon, and CurLat. Specifically: Using the geographic coordinates of the center point of MultiSpecImg Obtain the pixel 2D geographic coordinates of the center point of MultiSpecImg ; Then, using Get the pixel coordinates of the center point of the weeds Specifically: in, It is the horizontal pixel offset of the weed center relative to the center of MultiSpecImg. It is the vertical pixel offset of the weed center relative to the center of MultiSpecImg. These are the pixel coordinates of the center point of the weed target recognition box on MultiSpecImg. It is the width of MultiSpecImg in pixels. It is the width of the ground area covered by MultiSpecImg. It is the height pixel of MultiSpecImg. It is the height of the ground area covered by MultiSpecImg; Finally, Convert to geographic coordinates to obtain the geographic coordinates of the center point of the weeds.
7. The dynamically adaptable vehicle-mounted multispectral method for detecting weeds in farmland according to claim 6, characterized in that: In step two, WeedIntervalDescriptionModule is called, and the coarse control interval description object output by WeedIntervalDescriptionModule is used to construct a list of coarse control intervals for the region, CCKKList. Specifically: Step 21: As the vehicle starts moving, initialize the capture loop variable CaptureCounter to 0; Step 22: Start the main data collection loop, setting it to execute once every 5 seconds; Steps two and three: Obtain the vehicle's current longitude, latitude, and multispectral imagery; Step 24: Call WeedIntervalDescriptionModule to obtain the control interval description object Description; Step 25: Determine if Description is empty. If Description is empty, proceed to Step 27; if Description is not empty, proceed to Step 26. Step 26: Add the Description to the end of CCKKList; Step 27: Set CaptureCounter = CaptureCounter + 1; Step 28: Determine if the data collection process has ended. If the data collection process has not ended, proceed to Step 22 and wait for the next data collection; otherwise, output CCKKList.
8. The dynamically adaptable vehicle-mounted multispectral method for detecting weeds in farmland according to claim 7, characterized in that: In step three, the IntervalDiffModule is established to describe the regional coarse control interval differences. The IntervalDiffModule takes two coarse control interval description objects, MSDX1 and MSDX2, as input and outputs the difference evaluation index, DiffScore. Specifically: Step 3:
1. Establish the regional coarse control interval difference description module IntervalDiffModule. The input of IntervalDiffModule is two coarse control interval description objects MSDX1 and MSDX2. Step 3.2: Obtain the spatial distance normalization factor using the Euclidean distance GeoDist and SXSDJZ between the center points of MSDX1 and MSDX2. Specifically: in, It is a constant; Step 3: Obtain the ratio of the intersection area to the union area of MSDX1.HXQ and MSDX2.HXQ. and utilize Obtain the core interval overlap Specifically: in, It is a rough control interval description object The rough core region, It is a rough control interval description object The rough core region; Steps 3 and 4: Obtain the ratio of the intersection area to the union area of MSDX1.KKQJ and MSDX2.KKQJ. and utilize Obtain the overlap of control intervals Specifically: in, It is a rough control interval description object The rough control interval value, It is a rough control interval description object The rough control interval value; Step 35: Obtain the multispectral distance using the cosine distance between MSDX1.MSSL and MSDX2.MSSL. Specifically: in, It is a rough control interval description object Multispectral description vector of weeds It is a rough control interval description object Multispectral description vector of weeds It is the module length; Step 36, Utilize , , and Obtain the difference evaluation metric DiffScore and output DiffScore; The difference evaluation index, DiffScore, is obtained using the following formula: DiffScore is a metric for evaluating differences. , This indicates that the two coarse control interval description objects MSDX1 and MSDX2 are completely identical. This indicates that the two coarse control intervals describing objects MSDX1 and MSDX2 are completely different.
9. The dynamically adaptable vehicle-mounted multispectral method for detecting weeds in farmland according to claim 8, characterized in that: Step four, which involves calling the IntervalDiffModule to process the elements in the coarse control interval list CCKKList to obtain the farmland weed detection results, specifically involves: Step 4:
1. Obtain the CCKKList generated in Step 2, and get the total number of elements in the CCKKList, ListLen. Step 42: Initialize the outer loop variable OutCounter to 0; Step 43: Use the element with index OutCounter in CCKKList as the base object BaseObj; Step 4: Initialize the inner loop variable InCounter to OutCounter+1; Step 45: If InCounter is greater than or equal to ListLen, proceed to step 40; otherwise, proceed to step 46. Step 46: Use the element with index InCounter in CCKKList as the comparison object CompObj; Step 47: Call the IntervalDiffModule from Step 3, input BaseObj and CompObj into the IntervalDiffModule, and obtain the DiffScore; Step 48: Determine if the DiffScore is less than 0.
5. If so, mark CompObj and then proceed to step 49; otherwise, proceed directly to step 49. Step 49: Set InCounter = InCounter + 1, then proceed to step 45; Step 40: Set OutCounter = OutCounter + 1; Step 41: If OutCounter is less than ListLen-1, go to step 43; otherwise, go to step 42. Step 42: Traverse CCKKList and delete all marked objects in CCKKList; Step 43: Output the CCKKList processed in step 42 as the final weed detection result for farmland.
Citation Information
Patent Citations
Farmland early weed identification method based on unmanned vehicle-mounted remote sensing detection
CN120635723A