A computer vision-based field seed spacing detection system and method

CN120852957BActive Publication Date: 2026-08-14HEILONGJIANG PROV AGRI MACHINERY ENG SCI INST
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-31
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0004]本申请提供一种基于计算机视觉的田间播种粒距检测系统及方法,以解决现有技术中检测误差率高、检测算法单一、数据关联性差等问题

Benefits of technology

本申请实施例通过4KRGB与近红外多模态图像采集结合自适应光控单元,有效应对田间光照突变、土壤反光等干扰,配合图像处理模块的自适应直方图均衡化与小波变换去噪,提升复杂畦面环境下的图像清晰度与种子特征辨识度;依托改进的YOLOv5算法与注意力机制,精准区分杂草与种子,在种子叠压、部分土壤覆盖等场景下强化目标特征提取,提升粒距偏差计算精度,同时,北斗RTK与视觉里程计的融合定位,结合高精度农田地表高程模型,对种子经纬度与埋深坐标进行时空映射,为后续田间管理提供精准数据;动态调控执行机构通过PID算法与排种间隙自适应调节,可实时响应粒距偏差并修正播种参数提升机械调控响应速度,有效避免因滞后导致的连续粒距偏差,控制播种粒距误差率,提升作物出苗整齐度与光能利用率,降低后期田间管理成本。由此,解决现有技术中检测误差率高、检测算法单一、数据关联性差等问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120852957B_ABST
    Figure CN120852957B_ABST
Patent Text Reader

Abstract

This invention relates to the field of agricultural intelligent equipment technology, specifically to a field seed spacing detection system and method based on computer vision. The system includes: an image acquisition module that acquires 4K RGB and near-infrared data of the seeding area; an image processing module that processes and corrects the acquired images in real time; a seed spacing feature deep learning analyzer based on an improved YOLOv5 algorithm that enhances seed feature extraction through an attention mechanism, accurately distinguishing weeds from seeds, and calculating the center-to-center distance deviation between adjacent seeds based on a preset target seed spacing; a positioning fusion module that integrates BeiDou positioning data and visual odometry trajectories, using a high-precision farmland surface elevation model to generate seed latitude, longitude, and burial depth coordinates and mapping them to an electronic farmland map; and a dynamic control actuator that adjusts the seeder speed or seed spacing according to the seed spacing deviation value and a priority strategy to dynamically correct the seed spacing. This solves the problems of high detection error rate, single detection algorithm, and poor data correlation in existing technologies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of agricultural intelligent equipment technology, specifically to a field seeding spacing detection system and method based on computer vision. Background Technology

[0002] Against the backdrop of the accelerated global transformation towards precision farming, the requirements for uniform grain spacing in large-scale field sowing are continuously increasing. Coupled with rising labor costs and the growing demand for intensive land use, accurate detection of sowing grain spacing has become a crucial link in ensuring uniform crop emergence, efficient light utilization, and consistent subsequent growth. In this context, the construction of a computer vision-based field sowing grain spacing detection system is particularly necessary. This system can perform real-time visual monitoring and dynamic analysis of grain spacing during the sowing process, and rely on multi-source data fusion algorithms to accurately identify grain spacing deviations, thereby meeting the core needs of improving sowing standardization and reducing manual inspection costs.

[0003] However, current traditional seed spacing detection mainly relies on manual sampling or simple mechanical probes. This is problematic because manual detection is inefficient and subjective, leading to insufficient data representativeness. Mechanical devices also fail due to complex terrain such as soil clumping and uneven seedbeds, resulting in a particularly high error rate. Furthermore, traditional detection systems are limited by data fragmentation, making it difficult to correlate and dynamically integrate seed spacing data with key parameters such as seeder speed and seed metering speed. In addition, the simplistic detection algorithms create blind spots in scenarios such as seed overlap, soil covering of some seeds, or alternating light intensity in the field, leading to frequent missed seed spacing deviations. This negatively impacts crop emergence rate, uniform plant growth, and overall planting efficiency. Summary of the Invention

[0004] This application provides a field seeding spacing detection system and method based on computer vision to solve the problems of high detection error rate, single detection algorithm and poor data correlation in the prior art.

[0005] The first aspect of this application provides a field seeding spacing detection system based on computer vision, comprising: an image acquisition module, an image processing module, a seed spacing feature deep learning analyzer, a positioning fusion module, and a dynamic control execution mechanism; wherein, the image acquisition module is used to acquire 4K RGB and near-infrared data of the seeding area; the image processing module is used to process and correct the acquired images in real time; the seed spacing feature deep learning analyzer is based on an improved YOLOv5 algorithm, which enhances seed feature extraction through an attention mechanism, accurately distinguishes weeds from seeds, and calculates the center-to-center distance deviation value of adjacent seeds based on a preset target seed spacing; the positioning fusion module is used to fuse BeiDou RTK positioning data and visual odometry trajectory, and uses a high-precision farmland surface elevation model to generate seed latitude, longitude, and burial depth coordinates and map them onto an electronic farmland map; the dynamic control execution mechanism is used to adjust the seeder rotation speed or seed spacing according to a priority strategy based on the seed spacing deviation value, and dynamically correct the seed spacing.

[0006] Preferably, the image acquisition module includes a tri-lens synchronous camera group and an adaptive light control unit, wherein the tri-lens synchronous camera group is used to acquire visible light, near-infrared and depth images; and the adaptive light control unit automatically adjusts the power of the supplementary light according to the light intensity to suppress soil reflection interference.

[0007] Preferably, the image processing module includes an image processing unit and a dynamic correction unit, wherein the image processing unit uses adaptive histogram equalization for illumination compensation and combines wavelet transform to remove soil texture noise; the dynamic correction unit is used to correct image distortion caused by the seeder's bumps in real time.

[0008] Preferably, the grain spacing feature deep learning analyzer includes a seed identification unit, a three-dimensional coordinate calculation module, and a statistical analysis unit. The seed identification unit is based on an improved YOLOv5 algorithm and enhances seed feature extraction through an attention mechanism to accurately distinguish between weeds and seeds. The three-dimensional coordinate calculation module converts pixel coordinates into field three-dimensional coordinates through binocular parallax matching and the PnP algorithm. The statistical analysis unit is used to calculate the spacing between adjacent grains and the row spacing deviation value, and triggers a calibration command when the grain spacing in multiple places exceeds a preset threshold.

[0009] Preferably, the positioning fusion module includes a dual-frequency BeiDou RTK unit, a visual SLAM module, and a coordinate mapping engine. The dual-frequency BeiDou RTK unit is used to provide accurate positioning and stable output frequency. The visual SLAM module is used to construct a three-dimensional map of the sowing path using the ORB-SLAM3 algorithm to maintain positioning accuracy in weak signal areas. The coordinate mapping engine is used to map the seed pixel coordinates to the farmland UTM coordinate system coordinates and associate them with the electronic map in real time.

[0010] Preferably, the dynamic control actuator includes a servo drive module, a seeding gap adjustment unit, and a feedback controller. The servo drive module controls the seeder speed through a high-precision encoder. The seeding gap adjustment unit dynamically adjusts the seeding frequency and gap according to soil moisture and grain size. The feedback controller uses a PID algorithm to dynamically correct the control parameters based on the grain spacing deviation.

[0011] The second aspect of this application provides a computer vision-based method for detecting seed spacing in field sowing, comprising: acquiring image data after field sowing; performing dynamic illumination compensation and dynamic threshold segmentation on the image data after field sowing, identifying seed targets using an improved YOLOv5 algorithm and outputting two-dimensional pixel coordinates, performing dynamic distortion correction using attitude sensor data, converting the corrected seed pixel coordinates into three-dimensional spatial coordinates based on binocular parallax matching and PnP algorithm, and calculating the actual spacing between adjacent seeds; based on the three-dimensional spatial coordinates and the actual spacing between seeds, fusing BeiDou RTK positioning and visual SLAM trajectory, constructing a three-dimensional map of the sowing path using the ORB-SLAM3 algorithm, mapping the seed three-dimensional coordinates to the farmland UTM coordinate system, and real-time associating with an electronic map to generate a seed spacing distribution heatmap; according to the seed spacing distribution heatmap, when a seed spacing deviation exceeding a target value is detected, adjusting the seeder speed and seed spacing gap using a servo motor, real-time controlling the seed spacing and recording the control parameters, and generating a sowing quality assessment report.

[0012] A third aspect of this application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the program to implement a computer vision-based field seeding spacing detection method as described in the above embodiments.

[0013] A fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which is executed by a processor to implement a computer vision-based field seeding spacing detection method as described in the above embodiments.

[0014] A fifth aspect of this application provides a computer program product, including a computer program or instructions, for implementing a computer vision-based field seeding spacing detection method as described in the above embodiments.

[0015] Therefore, this application has the following beneficial effects: This application embodiment utilizes 4K RGB and near-infrared multimodal image acquisition combined with an adaptive light control unit to effectively address interference from sudden changes in field lighting and soil reflection. Combined with adaptive histogram equalization and wavelet transform denoising in the image processing module, it improves image clarity and seed feature recognition in complex seedbed environments. Leveraging an improved YOLOv5 algorithm and attention mechanism, it accurately distinguishes between weeds and seeds, enhancing target feature extraction in scenarios with seed overlap and partial soil coverage, thus improving the accuracy of grain spacing deviation calculation. Simultaneously, the fusion positioning of BeiDou RTK and visual odometry, combined with a high-precision farmland surface elevation model, performs spatiotemporal mapping of seed latitude, longitude, and burial depth coordinates, providing accurate data for subsequent field management. The dynamic control actuator, through PID algorithm and adaptive adjustment of seed spacing intervals, can respond to grain spacing deviations in real time and correct sowing parameters, improving the mechanical control response speed. This effectively avoids continuous grain spacing deviations caused by lag, controls the sowing grain spacing error rate, improves crop emergence uniformity and light energy utilization, and reduces subsequent field management costs. This solves the problems of high detection error rate, single detection algorithm, and poor data correlation in existing technologies.

[0016] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0017] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 This is a schematic diagram of a field seeding spacing detection system based on computer vision, according to an embodiment of this application. Figure 2 This is a schematic diagram of an image acquisition module provided according to an embodiment of this application; Figure 3 This is a schematic diagram of an image processing module provided according to an embodiment of this application; Figure 4 This is a schematic diagram of a particle size feature deep learning analyzer provided according to an embodiment of this application; Figure 5 This is a schematic diagram of a positioning fusion module provided according to an embodiment of this application; Figure 6 This is a schematic diagram of a dynamic control actuator provided according to an embodiment of this application; Figure 7 This is a schematic diagram of a computer vision-based field seeding spacing detection system provided according to an embodiment of this application; Figure 8 This is a flowchart illustrating a computer vision-based field seeding spacing detection method according to an embodiment of this application. Figure 9 This is a schematic diagram of a field seeding spacing detection method based on computer vision according to an embodiment of this application; Figure 10 This is a schematic diagram of the structure of an electronic device provided according to an embodiment of this application. Detailed Implementation

[0018] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0019] The following description, with reference to the accompanying drawings, illustrates a computer vision-based field seeding spacing detection system and method according to embodiments of this application. Addressing the high detection error rate mentioned in the background section, this application provides a computer vision-based field seeding spacing detection system. In this system, 4K RGB and near-infrared multimodal image acquisition combined with an adaptive light control unit effectively addresses interference from sudden changes in field light intensity and soil reflection. Furthermore, adaptive histogram equalization and wavelet transform denoising in the image processing module improve image clarity and seed feature recognition in complex seedbed environments. Utilizing an improved YOLOv5 algorithm and attention mechanism, it accurately distinguishes between weeds and seeds, addressing issues such as seed overlap and partial soil cover. In this scenario, enhanced target feature extraction improves the accuracy of grain spacing deviation calculation. Simultaneously, the fusion positioning of BeiDou RTK and visual odometry, combined with a high-precision farmland surface elevation model, performs spatiotemporal mapping of seed latitude, longitude, and burial depth coordinates, providing accurate data for subsequent field management. The dynamic control actuator, through PID algorithm and adaptive adjustment of seed spacing intervals, can respond to grain spacing deviations in real time and correct sowing parameters, improving the mechanical control response speed. This effectively avoids continuous grain spacing deviations caused by lag, controls the sowing grain spacing error rate, improves crop emergence uniformity and light energy utilization, and reduces subsequent field management costs. Therefore, it solves the problems of high detection error rate, single detection algorithm, and poor data correlation in existing technologies.

[0020] Figure 1 This is a schematic diagram of a field seeding spacing detection system based on computer vision, provided in an embodiment of this application.

[0021] This application provides a computer vision-based field seeding spacing detection system, the system 10 comprising: Image acquisition module 100, image processing module 200, particle size feature deep learning analyzer 300, positioning fusion module 400, and dynamic control actuator 500.

[0022] The system includes an image acquisition module 100 for acquiring 4K RGB and near-infrared data of the sowing area; an image processing module 200 for processing and real-time correction of the acquired images; a particle spacing feature deep learning analyzer 300 based on an improved YOLOv5 algorithm, which enhances seed feature extraction through an attention mechanism to accurately distinguish between weeds and seeds, and calculates the center-to-center distance deviation value of adjacent seeds based on a preset target particle spacing; a positioning fusion module 400 for fusing BeiDou RTK positioning data with visual odometry trajectories, using a high-precision farmland surface elevation model to generate seed latitude, longitude, and burial depth coordinates and mapping them to an electronic farmland map; and a dynamic control actuator 500 for adjusting the seeder speed or seed spacing according to a priority strategy based on the particle spacing deviation value, dynamically correcting the particle spacing.

[0023] It is understood that in this embodiment, the combination of 4K RGB and near-infrared multimodal image acquisition with an adaptive light control unit effectively addresses interference from sudden changes in field light and soil reflection. Combined with adaptive histogram equalization and wavelet transform denoising in the image processing module, it improves image clarity and seed feature recognition in complex seedbed environments. Relying on the improved YOLOv5 algorithm and attention mechanism, it accurately distinguishes between weeds and seeds, enhancing target feature extraction in scenarios such as seed overlap and partial soil coverage, thus improving the accuracy of particle size deviation calculation. Simultaneously, the fusion positioning of BeiDou RTK and visual odometry, combined with a high-precision farmland surface elevation model, performs spatiotemporal mapping of seed latitude, longitude, and burial depth coordinates, providing accurate data for subsequent field management. The dynamic control actuator, through PID algorithm and adaptive adjustment of seed spacing intervals, can respond to particle size deviations in real time and correct sowing parameters, improving the mechanical control response speed. This effectively avoids continuous particle size deviations caused by lag, controls the sowing particle size error rate, improves crop emergence uniformity and light energy utilization, and reduces subsequent field management costs. This solves the problems of high detection error rate, single detection algorithm, and poor data correlation in existing technologies.

[0024] In this embodiment of the application, the image acquisition module 100 further includes: Figure 2 As shown, a tri-lens synchronous camera group and an adaptive light control unit.

[0025] Among them, the three-lens synchronous camera group is used to acquire visible light, near-infrared and depth images; the adaptive light control unit automatically adjusts the power of the supplementary light according to the light intensity to suppress soil reflection interference.

[0026] It is understood that the three-lens synchronous camera group in this application can capture seed morphological characteristics, vegetation spectral differences and spatial location information in all directions by synchronously acquiring visible light, near infrared and depth images, providing multi-dimensional data for subsequent seed and weed differentiation and three-dimensional particle distance calculation; the adaptive light control unit can dynamically adjust the power of the supplementary light according to the field light intensity, effectively suppress soil reflection interference, and ensure stable image quality under complex lighting conditions such as strong light, backlight or cloudy days, thereby improving the comprehensiveness, accuracy and anti-interference ability of field image acquisition.

[0027] It should be noted that the adaptive light control unit collects field light intensity data in real time by integrating a high-sensitivity photosensitive sensor (such as a silicon-based photodiode), with a sampling frequency of up to 100Hz, ensuring a rapid response to instantaneous changes in light (such as cloud cover or switching from direct sunlight). Based on a preset light-power mapping model (generated through field multi-scene calibration), the output power of the supplemental light is dynamically adjusted: when a strong midday light scene is detected (light intensity > 80,000 lux), and the soil surface produces strong reflections due to direct sunlight, the supplemental light power is automatically reduced to 30%-50% of the rated power to avoid the artificial light source and ambient light superimposing to form a high-reflection area, preventing the seed outline from being "washed out" by strong light; when in a low-light environment (light intensity < 10,000 lux) with cloudy skies, evening light, or crop shading, the supplemental light power is increased to 60%-100%, enhancing the gray difference between the seeds and the soil through directional supplemental lighting, preventing seed features from being submerged in darkness due to insufficient light.

[0028] Light-power mapping model formula:

[0029] in, Light intensity; This refers to the output power of the fill light; This is the critical value between low and medium light; This is the critical value between medium and high light. The slope represents the photoelectric conversion efficiency. As a reference for dark current compensation; This is the saturation effect coefficient. Power offset in the saturation region; The heat loss coefficient is... This is the maximum output reference.

[0030] For example, during field sowing operations, when the midday sun causes the soil light intensity to surge to 90,000 lux, the adaptive light control unit quickly captures this change through a photosensitive sensor. Based on the light-power mapping model, it reduces the supplemental light power from 80% to 40% of the rated value to avoid strong light reflection and the formation of high-light areas. On cloudy days when the light intensity drops to 8,000 lux, the unit automatically increases the power to 90% to enhance the grayscale contrast between the seeds and the soil. In the face of localized specular reflections on wet seedbeds, it uses PWM technology to fine-tune the supplemental light frequency to 80Hz to weaken glare interference. This series of dynamic adjustments ensures that seed images maintain clear outlines and stable contrast under different lighting conditions, providing reliable visual data for subsequent grain spacing detection.

[0031] In this embodiment of the application, the image processing module 200 includes: Figure 3 As shown, there is an image processing unit and a dynamic correction unit.

[0032] The image processing unit uses adaptive histogram equalization for illumination compensation and combines wavelet transform to remove soil texture noise; the dynamic correction unit is used to correct image distortion caused by the seeder's bumps in real time.

[0033] It is understood that the image processing unit in this embodiment can dynamically adjust the local contrast of the image through adaptive histogram equalization, improving the difference in brightness caused by uneven lighting in the field, and making the grayscale levels of seeds and soil background clearer. Combined with wavelet transform, it accurately separates soil texture noise and seed detail features, preserving seed edge information while denoising, thus improving the image signal-to-noise ratio. The dynamic correction unit corrects the geometric distortion caused by the seeder's bumps in real time, eliminating seed position offset errors caused by mechanical vibration, ensuring the spatial consistency of seed coordinates in the image, providing geometrically accurate image data for subsequent grain spacing feature analysis, and improving grain spacing detection accuracy.

[0034] It should be noted that the specific formula for adaptive histogram equalization is as follows:

[0035]

[0036] in, For the row and column indexes of the sub-block; Grayscale; The total number of pixels in a single sub-block; This represents the number of rows in the sub-block. Number of sub-blocks; For the first In the sub-block, the gray level is The number of pixels; For the sub-block in row i and column j, the grayscale value Pixel percentage; Histogram of the sub-block in row i and column j After cropping, the grayscale level is The number of pixels; Set a contrast limit threshold.

[0037] Wavelet transform denoising formula:

[0038] in, For signal x at scale Translation Wavelet coefficients at; The original signal; Scale factor; The translation factor; The complex conjugate of the mother wavelet function; For integration variables; This is a wavelet scaling and translation.

[0039] Geometric distortion correction formula:

[0040]

[0041] in, , These are the coordinates of the original point; , Here are the coordinates of the transformed point; here are the homogeneous coordinates. , , , This is a rotation and scaling matrix; , This represents the translation component.

[0042] For example, in the corn planting process, the system integrates image recognition sensors to monitor the planting status in real time. When missed planting or abnormal spacing is detected, the dynamic correction unit immediately analyzes soil moisture, meteorological data, and agricultural machinery operation parameters to automatically adjust the seed metering speed and planting path. For instance, when encountering changes in soil hardness or differences in seed size, the system responds quickly through edge computing nodes and generates a variable operation prescription map based on a cloud calibration model, improving planting uniformity to over 98% and reducing the missed planting rate to below 1.83%. This dynamic correction mechanism not only reduces seed waste but also increases corn yield per acre by 10%-15% through real-time feedback. It also supports centimeter-level path accuracy for unmanned tractors, completely changing the traditional extensive management model that relies on experience in agriculture.

[0043] In this embodiment of the application, the particle size feature deep learning analyzer 300 includes: as follows Figure 4 As shown, there are seed identification unit, three-dimensional coordinate calculation module, and statistical analysis unit.

[0044] The seed identification unit is based on the improved YOLOv5 algorithm, which enhances seed feature extraction through an attention mechanism to accurately distinguish between weeds and seeds; the three-dimensional coordinate calculation module converts pixel coordinates into field three-dimensional coordinates through binocular parallax matching and the PnP algorithm; the statistical analysis unit is used to calculate the distance between adjacent grains and the row spacing deviation value, and triggers a calibration command when the grain distance in multiple places exceeds the preset threshold.

[0045] It is understood that the embodiments of this application use a seed identification unit based on an improved YOLOv5 algorithm, which enhances the extraction of key seed features through an attention mechanism and accurately removes weed interference to ensure the purity of identification. The three-dimensional coordinate calculation module uses binocular parallax matching and the PnP algorithm to complete the conversion of pixels to three-dimensional coordinates in the field, providing a spatial positioning benchmark for grain spacing analysis. The statistical analysis unit calculates the deviation of grain spacing and row spacing in real time, and triggers a calibration command in real time when the deviation exceeds the standard to achieve a closed-loop response, thereby improving the identification accuracy, coordinate calculation accuracy and deviation response timeliness. The structured data output provides reliable data for the dynamic control of sowing quality and reduces the probability of missed sowing and mis-sowing.

[0046] It should be noted that the YOLOv5 algorithm has been improved:

[0047]

[0048] in, This represents the loss value for target detection; This is the intersection-union ratio (IoU) between the predicted bounding box and the ground truth bounding box. Center point of the prediction box Center point of the real frame The Euclidean distance; The length of the diagonal of the smallest bounding rectangle between the predicted bounding box and the ground truth bounding box; These are the weighting coefficients; Aspect ratio consistency parameter; For query vector; The key vector; It is a value vector; The dimension of the key vector; This is a similarity matrix; This is the normalization function.

[0049] Binocular disparity matching calculation formula:

[0050] in, The three-dimensional spatial position of seeds in the field; The physical parameters determined for camera calibration; The horizontal distance between the optical centers of the left and right lenses; For parallax.

[0051] PnP algorithm formula:

[0052] in, , The location of the seed in the image; The seed's three-dimensional coordinates in the camera coordinate system; , A pixelated representation of the camera's focal length; , The parameters are used to calibrate the origin of the image coordinate system.

[0053] Formulas for calculating the distance between adjacent kernels and the deviation of row spacing:

[0054] in, The Euclidean distance between two points in three-dimensional space; , , The three-dimensional coordinates of the first seed; , , The coordinates of the second seed are 3D.

[0055] The preset threshold is a qualified range of grain spacing dynamically set in combination with crop type (such as 20-30 cm for corn, 10-15 cm for vegetables), planting density and agricultural standards. It is used to define the boundary between normal and abnormal sowing. When the grain spacing in multiple places exceeds the range, the triggered calibration instructions usually include adjusting the speed of the seed metering device to correct the grain delivery frequency, fine-tuning the travel path of the sowing machinery or the row spacing parameters, so as to correct the grain spacing deviation in real time and bring the sowing status back to the preset standard.

[0056] For example, in field inspection scenarios after corn planting, the seed identification unit plays a crucial role. Faced with complex background interference such as weeds, crop residues, and soil clods, it relies on the improved YOLOv5 algorithm to accurately focus on the core features of corn seeds, such as their elliptical shape and yellow-white sheen, through an attention mechanism. Simultaneously, it suppresses irrelevant information such as soil texture and weed leaves, achieving efficient identification of scattered seeds. Even when seeds are partially covered or closely adjacent to weeds, it can still distinguish target seeds from interference with an accuracy rate of over 98%, outputting pure seed location marker data. This process not only provides accurate identification objects for subsequent 3D coordinate calculation but also avoids deviations in grain spacing analysis caused by misidentifying weeds as seeds, ensuring the reliability of planting quality inspection from the source.

[0057] In this embodiment of the application, the positioning fusion module 400 includes, as follows: Figure 5 As shown, the components include a dual-frequency BeiDou RTK unit, a visual SLAM module, and a coordinate mapping engine.

[0058] Among them, the dual-frequency Beidou RTK unit is used to provide accurate positioning and stable output frequency; the visual SLAM module is used to construct a three-dimensional map of the sowing path through the ORB-SLAM3 algorithm to maintain positioning accuracy in weak signal areas; and the coordinate mapping engine is used to map the seed pixel coordinates to the farmland UTM coordinate system coordinates and associate them with the electronic map in real time.

[0059] It is understood that the embodiments of this application provide precise positioning and stable output frequency through dual-frequency Beidou RTK units, laying a high-precision spatial reference for sowing operations; the visual SLAM module constructs a three-dimensional sowing path map with the help of the ORB-SLAM3 algorithm, which can still maintain sub-meter positioning accuracy in areas with weak signals such as tree shade and building shielding, filling the satellite signal blind spots; the coordinate mapping engine converts the seed pixel coordinates into farmland UTM coordinates, realizing real-time linkage with the electronic map, and performing uninterrupted high-precision positioning for the entire scene. By unifying coordinates, it connects image data and geographic information, providing precise spatial anchors for sowing trajectory backtracking, regional deviation analysis and global dynamic calibration, improving the reliability and intelligence level of sowing position control.

[0060] It should be noted that the ORB-SLAM3 algorithm formula is as follows:

[0061]

[0062]

[0063]

[0064]

[0065]

[0066] in, For ORB feature descriptors; For the i-th bit of the descriptor; This represents the number of feature points; Let Hamming distance function be used. For reference frame feature descriptors; This is the feature descriptor for the current frame; Let k be the camera pose. The camera pose at time k+1; Mapping to Lie group exponents; Let ω be the angular velocity at time t. Zero bias for the gyroscope; For time differentiation; To optimize total energy; For robust kernel functions; This refers to visual reprojection error; The visual covariance matrix; This refers to the IMU pre-integration error; The IMU covariance matrix; The visual residual vector; For the observed pixel coordinates; For camera projection functions; The camera pose to be optimized; Points in a 3D point cloud; For pose set; For a set of coordinates; Let i be the pose of the i-th keyframe; Let j be the coordinates of the j-th map point; These are the actual observed pixel coordinates; For keyframe indexing; Indexes the map points.

[0067] For example, in farmland sowing operations, the visual SLAM module uses a wide-angle camera and multispectral sensor mounted on the top of the agricultural machinery to collect environmental images such as crop residues, soil textures, and field ridge outlines at a frequency of 30 frames per second. Relying on the ORB-SLAM3 algorithm, thousands of rotation-invariant ORB feature points are extracted from each frame of the image. These feature points act as "visual anchor points." By matching between frames, the camera's motion trajectory is calculated, and a dense map of the sowing path containing three-dimensional coordinate information is constructed simultaneously. When agricultural machinery moves through farmland under orchards, the dense shade created by the intertwined branches and leaves causes the BeiDou satellite signal to drop sharply to the loss-of-lock threshold. At this point, the module activates a dual mechanism of "repositioning-map matching": on the one hand, it estimates the real-time displacement by tracking the optical flow of feature points in consecutive frames; on the other hand, it calls upon the constructed 3D map to perform loop closure detection and eliminate accumulated errors. Even when passing through clusters of houses on the edge of villages, where building walls block satellite signals and greatly increase the risk of positioning drift, the module can still control the positioning accuracy within 0.8 meters by stably matching static features such as field ridges and utility poles, seamlessly connecting with centimeter-level positioning in areas with good BeiDou RTK signal. This dynamic compensation capability not only ensures that the sowing trajectory remains linear and regular on shady slopes and in small plots of farmland surrounded by houses, but also provides a spatial reference for subsequent seed sowing depth adjustment and row spacing calibration through real-time output of 3D coordinates, reducing the sowing deviation rate of the entire farmland to below 3%.

[0068] In this embodiment of the application, the dynamic control actuator 500 includes, for example: Figure 6As shown, the components include a servo drive module, a seeding gap adjustment unit, and a feedback controller.

[0069] The servo drive module controls the seeder speed through a high-precision encoder; the seeding gap adjustment unit dynamically adjusts the seeding frequency and gap according to soil moisture and grain size; and the feedback controller uses a PID algorithm to dynamically correct the control parameters based on the grain spacing deviation.

[0070] It is understood that the servo drive module in this application embodiment precisely controls the seeder speed through a high-precision encoder to ensure a stable seeding rhythm; the seeding gap adjustment unit flexibly adjusts the seeding frequency and gap according to soil moisture and seed size to adapt to various seeding conditions; the feedback controller uses a PID algorithm to correct control parameters in real time based on the grain spacing deviation value, performs dynamic error correction, ensures the accuracy of seeding amount and grain spacing, adapts to different field environments and seed characteristics, reduces the probability of missed seeding and reseeding, and improves the stability and intelligence level of seeding operations.

[0071] It should be noted that the PID algorithm formula is as follows:

[0072] in, To adjust the speed of the seeding motor or the opening of the seed metering valve; This is the proportional gain coefficient; The error is for time t; This is the integral gain coefficient; This is the cumulative sum of deviations from 0 to the current time t; The differential gain coefficient; The rate of change of the particle spacing deviation at time t; It is an integral dummy variable.

[0073] For example, when the seeder enters a clay loam soil area, the soil moisture sensor detects a moisture content of 28% and the diameter of the soybean seeds being sown is about 8 mm. The seed spacing adjustment unit immediately activates: the servo motor drives the gap adjustment rod to reduce the gap between the seed metering wheel and the seed guide tube from the original 20 mm to 15 mm, while reducing the seed metering frequency from 12 times per second to 9 times per second to prevent the seeds from sticking to the wet soil and causing blockage. When the machine moves into a sandy soil area and the soil moisture drops to 12%, and the seeding frequency is changed to 18 times per second, the unit quickly adjusts the gap to 10 mm and increases the frequency to 18 times per second to ensure that the seeds fall evenly without jamming. Ultimately, the seed spacing deviation in both types of soil is controlled within ±3 cm, significantly improving the sowing consistency under different soil and seed types.

[0074] This application proposes a field seed spacing detection system based on computer vision. By combining 4K RGB and near-infrared multimodal image acquisition with an adaptive light control unit, it effectively addresses interference from sudden changes in field light and soil reflection. The system, coupled with adaptive histogram equalization and wavelet transform denoising in the image processing module, improves image clarity and seed feature recognition in complex seedbed environments. Utilizing an improved YOLOv5 algorithm and attention mechanism, it accurately distinguishes between weeds and seeds. In scenarios with seed overlap and partial soil coverage, it enhances target feature extraction, improving the accuracy of seed spacing deviation calculation. Simultaneously, the fusion positioning of BeiDou RTK and visual odometry, combined with a high-precision farmland surface elevation model, performs spatiotemporal mapping of seed latitude, longitude, and burial depth coordinates, providing accurate data for subsequent field management. The dynamic control actuator, through PID algorithm and adaptive adjustment of seed spacing intervals, can respond to seed spacing deviations in real time and correct sowing parameters, improving the mechanical control response speed. This effectively avoids continuous seed spacing deviations caused by lag, controls the seed spacing error rate, improves crop emergence uniformity and light energy utilization, and reduces subsequent field management costs. This solves the problems of high detection error rate, single detection algorithm, and poor data correlation in existing technologies.

[0075] The following will illustrate a computer vision-based field seeding spacing detection system through a specific embodiment, such as... Figure 7 As shown, it includes: When deployed in the winter wheat planting area of ​​the North China Plain, the system is integrated into the middle of the crossbeam of the 2BXF-12 wheat seeder to reduce the transmission of high-frequency vibrations during the seeder's movement, taking into account the complex field environment (such as windy conditions in spring and high temperatures in summer). A DC-DC voltage regulator module (input 9-16V, output 12V±0.2V) is added to the 12V vehicle power supply circuit, equipped with a 20000μF electrolytic capacitor to suppress voltage fluctuations, ensuring stable operation of core components such as the camera and computing unit even during voltage dips (such as when the motor starts). Total power consumption is controlled within 350W (60W for the camera assembly, 30W for the supplementary light, 10W for the Jetson Nano, 15W for the Beidou unit, and 235W for the drive module), meeting the battery life requirements for 8 hours of continuous operation per day. The system response latency is ≤200ms, encompassing image acquisition (30ms), transmission (10ms), processing (120ms), and control command output (40ms). Particle size detection accuracy reaches ±3mm, and it can adapt to seeder speeds of 0-15km / h (corresponding to a typical winter wheat sowing speed of 4-8km / h; frame rate adaptive adjustment ensures no frame loss during high-speed operation). The tri-lens synchronous camera group uses a Baslerac A2440-75uc industrial camera, comprising three synchronously triggered imaging units, achieving microsecond-level time synchronization (trigger latency ≤5μs) via a 12V synchronous trigger line. The visible light channel uses a 1 / 1.8-inch CMOS sensor with a resolution of 2448×2048 and a frame rate of 30fps. The lens is an 8mm fixed-focus lens (aperture F1.8, depth of field 1-3m), ensuring that the shooting range covers two rows of seeding strips (each row is 15cm wide) at a 45° angle. The near-infrared channel is equipped with an 850nm narrowband filter (half-bandwidth 10nm), which can effectively filter out visible light below 700nm and capture images in the 400-900nm band. It can still keep the seed outline clear even in hazy weather (visibility <50m). The depth channel uses an imaging module based on the time-of-flight (ToF) principle, with a measurement range of 0.5-5m and an accuracy of ±2%. It can still detect the position of seeds when they are covered by a thin layer of soil (thickness <3mm). Three cameras are fixed 30cm directly behind the seeder's seed metering device using an aluminum alloy mechanical bracket (weighing ≤1.5kg). The lens optical axis forms a 45° angle with the ground. A level adjustment knob is installed at the bottom of the bracket, and the system is calibrated using a bubble level to control the error within ±0.5°, avoiding perspective distortion caused by tilt (if the tilt exceeds the tolerance, the system automatically activates a perspective correction algorithm to compensate, and the distortion rate after correction is ≤1%). The adaptive light control unit consists of a BH1750 light sensor (sampling frequency 10Hz, measurement range 0-100000 lux) and a 12V adjustable power LED supplemental light.The fill light uses four high-brightness LEDs (two white LEDs and two infrared LEDs, wavelength 850nm) arranged in a 2×2 matrix with a 60° beam angle, ensuring no shadows in the covered shooting area. When the light intensity is below 3000 lux, the fill light automatically turns on, with power infinitely adjustable from 5W to 30W (achieved through PWM duty cycle 0-100%). At midday when soil reflection is strong (light intensity > 50000 lux), PWM pulse width modulation technology (frequency 1kHz) suppresses high-light reflection, stabilizing the image grayscale value in the 120-180 range (8-bit grayscale image). For example, on sunny summer days around noon, the light intensity often reaches over 80,000 lux. At this time, the supplemental light power is reduced to 5W, only used to supplement the brightness of the seed's shaded area (the gray value of the shaded area is increased by 20-30). On cloudy days or at dusk, when the light intensity drops to 2,000 lux, the supplemental light power is increased to 25W, and all LEDs are turned on to ensure that the seed texture (such as the ventral groove of wheat seeds) is clearly visible. At dawn or dusk (light intensity 500-1000 lux), the power is increased to 30W and the exposure time is extended (from 10ms to 30ms). At the same time, the frame accumulation algorithm (3 frames superimposed) is enabled to improve the image signal-to-noise ratio to over 30dB.

[0076] The image processing unit uses an NVIDIA Jetson Nano development board (4-core Cortex-A57, 4GB LPDDR4) as its computing core, equipped with a 64GB eMMC storage module to store temporary image data, runs the OpenCV 4.5.5 open-source library and enables CUDA acceleration (improving the image processing frame rate to 25fps). To adapt to the high temperatures in the field (ambient temperatures can reach 45℃), the development board is equipped with an aluminum heatsink (100cm² area) and a small axial fan (3000rpm speed, 5CFM airflow) to ensure that the core temperature is ≤65℃ and avoid overheating and frequency throttling. The adaptive histogram equalization algorithm sets cliplimit to 3.0, dividing the image into 8×8 pixel sub-blocks for local contrast enhancement. When the grayscale difference between soil and seeds is small (e.g., wheat seeds in light yellow soil), the sub-blocks are automatically adjusted to 4×4 pixels to improve local details. Wavelet transform uses the db4 wavelet basis and performs a 3-level decomposition. High-frequency noise coefficients are processed with a hard threshold set to 1.5 times the noise standard deviation (obtained statistically from the first 100 frames), effectively removing salt-and-pepper noise generated by soil particle texture. In clay soil areas (soil particle diameter > 2mm), where soil particles are larger and texture is coarser, the system automatically determines the soil type through image texture feature recognition (based on LBP texture histogram), increasing the noise threshold after wavelet transform to 2.0 times the standard deviation to improve denoising while preserving seed edge features. The dynamic correction unit integrates an MPU6050 six-axis sensor (accelerometer range ±8g, gyroscope range ±500° / s) to collect angular velocity and acceleration data generated by the seeder's vibrations. The sampling rate is 100Hz, and the data is transmitted to the processing unit via an I²C bus (delay <1ms). Zero-drift calibration is performed before each day's operation (30 seconds of static data acquisition, zero-position error ≤0.5° / s), and the data is stored in EEPROM and automatically loaded upon startup. When the detected vibration amplitude exceeds ±3°, the camera's intrinsic parameter matrix is ​​updated in real-time using the Zhang Zhengyou calibration method (calibration period 50ms), and image distortion correction is performed, keeping the image distortion rate below 1%. When operating in hilly areas, the seeder's vibration frequency can reach 5-8Hz. In this case, the dynamic correction unit activates a high-frequency compensation mode, updating parameters every 50ms. When the vibration frequency exceeds 10Hz (e.g., when passing through gravelly terrain), a low-pass filter (cutoff frequency 8Hz) is activated to filter out high-frequency noise and avoid over-correction.

[0077] The seed recognition unit is based on an improved YOLOv5s model, embedding a CBAM attention mechanism (channel attention + spatial attention) into the C3 module of the CSPDarknet53 backbone network to enhance the extraction of seed edge and texture features. The model's input image size is 640×640 pixels, and the inference time is ≤80ms (on Jetson Nano), meeting the system response requirements. The training dataset contains 100,000 field images, covering common crop seeds such as wheat (seed length 6-8mm), corn (seed length 8-12mm), and soybean (seed diameter 8-10mm), as well as 20 kinds of field weeds such as barnyard grass (seed length 1-2mm) and lambsquarters (seed diameter 1-1.5mm). Data augmentation (rotation ±15°, scaling 0.8-1.2 times, brightness ±20%, contrast ±15%, and adding Gaussian noise σ=0.01) improves the model's generalization ability. The recognition accuracy on the validation set reaches 98.3%, and the weed false recognition rate is ≤1.2%. The model was trained using an NVIDIA RTX 3090 graphics card (24GB VRAM), converging after 120 epochs (processing 800 images per epoch, approximately 45 minutes). TensorRT quantization (INT8 precision) compressed the model to 50MB, reducing memory usage. For different crops, rapid adaptation can be achieved through model fine-tuning. For example, when switching to corn seed detection, only 5000 corn seed images need to be added for 10 epochs of fine-tuning, achieving an accuracy of over 97.5%. The 3D coordinate calculation module uses the binocular disparity matching algorithm SGBM (semi-global block matching), with the disparity search range set to 0-128 pixels, a block size of 9×9 pixels, P1=8×3×16², and P2=32×3×16², improving the smoothness of the disparity map. The EPnP algorithm converts pixel coordinates to field 3D coordinates (with the camera's optical center as the origin), with an X-axis (travel direction) measurement error ≤5mm and a Y-axis (row spacing direction) error ≤4mm. When soil moisture is high (>70%RH) causing seed surface reflectivity, the module automatically activates a sub-pixel matching algorithm (bilinear interpolation), improving matching accuracy from 1 pixel to 0.1 pixels, and reducing Y-axis error to ≤2mm. The statistical analysis unit presets the target grain spacing for winter wheat to 10cm±2cm (corresponding to a sowing rate of 15kg per mu), and supports users to input the sowing rate (10-25kg / mu) via the touchscreen to automatically adjust the target grain spacing (15cm-6cm). When the grain spacing deviation at three consecutive detection points exceeds ±3cm, a calibration command is triggered. The system generates a grain spacing statistical report every 0.5 seconds, including parameters such as average grain spacing, standard deviation (≤2cm is acceptable), and deviation rate (the proportion of single grains with a deviation >±3cm), and stores nearly 1000 records (approximately 8 minutes of data) for subsequent analysis.During sowing operations, if the deviation rate exceeds 5% for three consecutive times, the system will issue an audible and visual alarm (buzzer frequency 1kHz, red light flashing) on ​​the 7-inch TFT display screen (resolution 1024×600) in the driver's cab, and simultaneously display an image of the deviation area, prompting the operator to check the status of the seed metering device (such as seed jamming, gear wear, etc.).

[0078] The dual-frequency BeiDou RTK unit uses the Huace T300 receiver, supporting BDSB1I / B2I dual-frequency signals and compatible with GPS L1 / L2. Static positioning accuracy is ±2.5mm +1ppm for plane and ±5mm +1ppm for elevation. The dynamic output frequency is 10Hz, maintaining a 95% fixed resolution (PDOP≤3) even in obstructed field environments (such as forest edges). The receiver operates in a temperature range of -30℃ to +70℃, adapting to the temperature differences in North China during winter and spring (-10℃ to 35℃). The antenna is mounted at the highest point of the seeder (1.2m above the body), using a mushroom-shaped antenna (5dBi gain) to minimize crop straw obstruction. When passing through forest edges, a multipath suppression algorithm (based on wavelet threshold denoising) reduces signal reflection interference, resulting in a positioning accuracy loss of ≤10mm. The visual SLAM module employs the ORB-SLAM3 algorithm, combined with a fisheye camera with a 160° field of view (1280×800 resolution, 20fps) to collect environmental feature points (≥500 ORB feature points extracted per frame). When the BeiDou signal is lost for more than 3 seconds, it automatically switches to visual odometry positioning, with a position drift rate ≤0.5% / s (e.g., drift ≤5cm over a 10m distance). In scenarios with no satellite signal, such as greenhouses, centimeter-level positioning can be achieved using pre-built maps (constructed via offline SLAM), with continuous operation time up to 15 minutes (after which the drift rate increases to 1% / s). The coordinate mapping engine converts the seed's 3D coordinates to the UTM50N coordinate system and associates them with a 1:2000 scale farmland electronic map (including field boundaries and elevation data). The map data is acquired through aerial photography using a DJI M300 drone (equipped with an RTK module), with a resolution of 10cm, elevation accuracy of ±5cm, and seed burial depth calculation error ≤2cm. The map data is updated monthly via a 4G module and linked to field fertilization (N / P / K application rate) and irrigation (water volume and time) records to form a data chain covering the entire sowing-growth cycle, supporting subsequent yield analysis.

[0079] The servo drive module uses a Panasonic MHMJ042G1U servo motor (rated power 400W, rated speed 3000rpm), paired with a 1024-line incremental encoder (accuracy ±0.036°). The seeder speed is adjustable within the range of 30-150r / min via a reduction gearbox (reduction ratio 1:20), with a speed control accuracy of ±1r / min. The motor operates at DC24V, converted from a 12V vehicle power supply via a DC-DC converter (efficiency ≥90%). The encoder signal uses differential transmission (A / B phase + Z phase), improving anti-interference capabilities and avoiding counting errors caused by electromagnetic interference in the field (such as motor startup). When the seeder's travel speed increases from 5km / h to 10km / h (obtained via Beidou speed information or wheel speed sensor), the servo motor completes the speed adjustment from 60r / min to 120r / min within 0.8 seconds (acceleration 50r / min / ms), ensuring stable grain spacing. The seed metering gap adjustment unit uses a 28BYJ-48 stepper motor (reduction ratio 1:64, step angle 5.625° / 64) to drive the eccentric wheel mechanism. Each step corresponds to a gap change of 0.01mm, enabling fine-tuning of the gap from 0.1-1mm, with a response time ≤500ms (from command issuance to completion). A soil moisture sensor (model SHT30, measurement range 0-100%RH, accuracy ±2%) is installed 5cm below the seed meterer, with a sampling rate of 5Hz. When humidity >60%, it automatically increases the gap by 0.2mm (to prevent seeds from sticking to wet soil). The system has a built-in crop parameter library; for example, the initial gap for corn seeds (5-8mm diameter) is 1.2mm, and for soybean seeds (8-10mm diameter) it is 1.5mm. Users can manually fine-tune the gap via the touchscreen (0.05mm step). The feedback controller employs a PID algorithm with a proportional gain Kp = 1.2, integral time Ti = 0.5s, derivative time Td = 0.1s, and a control output range of 0-100% (corresponding to motor speed or gap adjustment). The system features self-tuning capabilities. Upon initial installation, it automatically calculates initial PID parameters through a step response test (20% change in setpoint), and then optimizes based on data from three operation runs (each soil type) to improve adaptability. The controller communicates with the seeder control system via the Modbus RTU protocol (9600 baud rate, 8 data bits, 1 stop bit, no parity check). When the seed spacing deviation is >5cm, it prioritizes adjusting the speed (the adjustment amount is proportional to the deviation); when the deviation is <5cm, it only adjusts the seed spacing. When operating in sandy soil (resistance coefficient < 0.3), the controller automatically reduces the Kp value to 0.9 and increases Ti to 0.8s to avoid overshoot due to low soil resistance; when operating in heavy clay soil (resistance coefficient > 0.6), Kp increases to 1.5 and Ti decreases to 0.3s to accelerate the response speed.

[0080] In summary, the embodiments of this application, through targeted anti-vibration and voltage stabilization, multispectral imaging, and adaptive light control mechanisms, can stably cope with the complex environment of the winter wheat planting area in the North China Plain, including windy and high-temperature conditions, haze, and soil variations. Combined with a high-temperature heat dissipation solution, continuous and reliable operation is achieved. Relying on high-precision dynamic correction, a seed recognition model embedded with an attention mechanism, and three-dimensional coordinate calculation, a grain spacing detection accuracy of ±3mm and a fast response of ≤200ms are achieved. Combined with dual-frequency BeiDou and visual SLAM fusion positioning and PID self-tuning control, it can flexibly adapt to different crops, soil types, and travel speeds, precisely controlling grain spacing and seed spacing. Simultaneously, a full-cycle data chain from sowing to growth is constructed, effectively improving the accuracy and efficiency of sowing operations, reducing manual intervention costs, and providing strong support for subsequent yield analysis and field management.

[0081] Next, referring to the accompanying drawings, a field seeding spacing detection method based on computer vision is described according to an embodiment of this application.

[0082] like Figure 8 As shown, this computer vision-based field seeding spacing detection method includes the following steps: In step S101, image data after field sowing is acquired.

[0083] It is understood that the embodiments of this application acquire image data after field sowing as the basic input for subsequent grain spacing detection. Through the coordinated acquisition of visible light, near-infrared data and depth channels, it can comprehensively capture seed characteristics under different environments. It can preserve clear seed outlines and textures under complex conditions such as light changes and hazy weather, and accurately acquire spatial location information when seeds are covered by a thin layer of soil. This provides high-quality raw data for subsequent seed identification, positioning and three-dimensional coordinate calculation, and improves the adaptability to diverse field environments and the accuracy of grain spacing calculation.

[0084] In step S102, dynamic illumination compensation and dynamic threshold segmentation are performed on the image data after field sowing. The improved YOLOv5 algorithm is used to identify seed targets and output two-dimensional pixel coordinates. Dynamic distortion correction is performed in combination with attitude sensor data. Based on binocular parallax matching and PnP algorithm, the corrected seed pixel coordinates are converted into three-dimensional spatial coordinates, and the actual distance between adjacent seeds is calculated.

[0085] Dynamic thresholding is an image processing method that dynamically adjusts the segmentation threshold based on the grayscale features of local image regions to achieve accurate separation of the target from the background.

[0086] It is understood that the embodiments of this application, by employing dynamic threshold segmentation, can accurately separate seed targets from soil backgrounds by adjusting the segmentation threshold in real time according to the gray-scale characteristics of local areas of the image, in response to the complex situation of uneven field lighting and variable gray-scale characteristics of soil and seeds. This effectively avoids oversegmentation or undersegmentation problems that may occur under static thresholds, providing clearer target outlines and less background interference for subsequent improvements to the YOLOv5 algorithm for seed recognition, and improving the accuracy of seed two-dimensional pixel coordinate extraction.

[0087] It should be noted that the dynamic illumination compensation and dynamic threshold segmentation of the image data after field sowing first involves real-time acquisition of ambient light intensity by a light sensor, combined with image grayscale features, adaptively adjusting the power of the supplementary light, exposure time, and enabling the frame accumulation algorithm to balance the image brightness and contrast under different lighting conditions; then, the compensated image is divided into sub-blocks of adaptive size, and the segmentation threshold is dynamically calculated based on the local grayscale distribution features of each sub-block, combined with local contrast and edge information optimization, to achieve accurate separation of the seed target from the soil background.

[0088] Frame accumulation algorithm:

[0089]

[0090] in, To output the image in coordinates Pixel value at; The location of the target point in the image; The total number of images participating in the fusion; For frame indexing; This represents the original pixel value at coordinates (x, y) in the i-th frame; The signal-to-noise ratio of the fused multi-frame image; The square root of the frame number; This represents the signal-to-noise ratio of a single frame of the image.

[0091] When using the improved YOLOv5 algorithm to identify seed targets and output 2D pixel coordinates, the image, after dynamic illumination compensation and dynamic threshold segmentation, is first input. This algorithm embeds a CBAM attention mechanism into the original YOLOv5 backbone network—focusing on the differences between seeds and backgrounds (such as soil and weeds) in feature channels through channel attention, strengthening the weights of seed-specific textures (such as the grooves on wheat seeds) and edge features, and then highlighting the spatial location information of the seed area in the image through spatial attention, reducing interference from soil particles, shadows, etc. The algorithm is trained on 100,000 images covering various crop seeds (wheat, corn, etc.), weeds, and different field environments (light variations, thin soil cover, haze), and its generalization ability is improved through data augmentation (rotation, scaling, brightness adjustment, etc.). During the recognition process, the algorithm selects the seed target in the image, accurately locating its position, and finally outputs the 2D pixel coordinates containing the vertices and center of the seed bounding box. This provides a precise 2D position reference for subsequent dynamic distortion correction and 3D spatial coordinate transformation using attitude sensor data, ensuring the accuracy of seed target recognition.

[0092] CBAM attention mechanism:

[0093]

[0094]

[0095]

[0096]

[0097] in, Input feature map; For global average pooling; This is for global max pooling; To learn the nonlinear relationships between channels; Use the Sigmoid activation function; Channel attention weights; These are the characteristics after channel weighting; Spatial attention weights; It is a 7×7 convolutional layer; Channel average pooling; Max pooling of channels; These are the spatially weighted features.

[0098] For example, in field seed spacing detection, dynamic illumination compensation is first applied to the post-sowing image data to overcome interference from complex field lighting conditions, allowing the seed area to be presented more clearly in the image. Then, dynamic threshold segmentation is used, adaptively determining the segmentation threshold based on the characteristics of different image regions to accurately separate the seed target from the background such as soil and stubble. Next, an improved YOLOv5 algorithm is used to identify the segmented seed target, quickly and accurately outputting the two-dimensional pixel coordinates of the seed. Then, combined with real-time equipment posture data acquired by an attitude sensor, dynamic distortion correction is performed on the image to eliminate pixel coordinate deviations caused by factors such as equipment shaking. Afterwards, disparity information is obtained through binocular disparity matching, and the corrected two-dimensional seed pixel coordinates are converted into three-dimensional spatial coordinates using the PnP algorithm. Finally, the actual distance between adjacent seeds is calculated based on the three-dimensional coordinates, achieving effective detection of field seed spacing.

[0099] In step S103, based on the three-dimensional spatial coordinates and the actual spacing between seeds, the BeiDou RTK positioning and visual SLAM trajectory are fused, and a three-dimensional map of the sowing path is constructed using the ORB-SLAM3 algorithm. The three-dimensional coordinates of the seeds are mapped to the UTM coordinate system of the farmland, and the electronic map is linked in real time to generate a heat map of the seed spacing distribution.

[0100] Among them, the ORB-SLAM3 algorithm is a SLAM algorithm based on ORB features, which supports multi-sensor fusion and can realize camera localization and 3D map construction in real time.

[0101] It is understood that the embodiments of this application utilize the ORB-SLAM3 algorithm, leveraging the characteristics of multi-sensor fusion, to efficiently integrate high-precision positioning information from BeiDou RTK with visual SLAM trajectory data. Even in complex farmland environments, it can stably achieve real-time camera positioning and accurate construction of a 3D map of the sowing path. Its rapid matching capability based on ORB features ensures the real-time performance and robustness of map construction, providing a reliable spatial reference for the accurate mapping of seed 3D coordinates to the farmland UTM coordinate system, while also supporting real-time association with electronic maps. This overcomes the limitations of single sensors in farmland scenarios, improves the integrity and accuracy of the 3D map, ensures that the grain spacing heatmap accurately reflects the sowing situation, and provides timely and reliable spatial data support for sowing quality assessment and refined farmland management.

[0102] It should be noted that, based on three-dimensional spatial coordinates and the actual spacing between seeds, a three-dimensional map of the sowing path is constructed by fusing BeiDou RTK positioning and visual SLAM trajectories using the ORB-SLAM3 algorithm. First, BeiDou RTK positioning is used to obtain spatial coordinates (including three-dimensional position information) to provide a global reference, but this is susceptible to interference in occluded environments. Simultaneously, visual SLAM uses cameras to capture field environmental features and generate relative motion trajectories, maintaining positioning continuity in areas with weak BeiDou signals, but accumulating errors. The ORB-SLAM3 algorithm, as the core fusion tool, efficiently extracts environmental ORB feature points, accurately matches visual frames with BeiDou RTK positioning data, corrects visual trajectory drift through fusion strategies such as Kalman filtering, and uses visual information to fill positioning gaps when BeiDou signals are interrupted, forming a three-dimensional motion trajectory with both absolute accuracy and continuous stability. Based on this, by combining the actual seed spacing (such as plant spacing, row spacing, and other agricultural production parameters) and three-dimensional spatial coordinates (including sowing depth reference in the height dimension), a three-dimensional path map is finally constructed that conforms to both the actual geographical coordinates of the farmland and strictly adheres to sowing density requirements.

[0103] For example, in farmland sowing scenarios, the ORB-SLAM3 algorithm demonstrates strong environmental adaptability: the binocular camera on the seeder first captures static features such as the outline of the field ridges, the texture of crop residues, and the edges of irrigation ditches. It then quickly generates an initial visual trajectory through ORB feature point matching, while simultaneously receiving centimeter-level absolute coordinates from BeiDou RTK in real time, forming a dual constraint of "visual relative trajectory + BeiDou absolute positioning." When the protective forest along the field blocks the BeiDou signal, the algorithm automatically switches to a vision-dominated mode, relying on a pre-built field feature library (such as the positions of fixed utility poles and irrigation valves) to calibrate trajectory drift. Even when encountering gusts of wind... Camera shake and direct sunlight causing overexposure can be corrected by integrating IMU inertial data to correct attitude deviations. It can even identify and remove dynamic interference features such as birds and weeds. Finally, by combining the preset seed spacing parameters of 20 cm plant spacing and 50 cm row spacing, the three-dimensional spatial coordinates (including the z-axis height difference caused by terrain undulations) are transformed into executable sowing path nodes. The generated three-dimensional map not only marks the precise landing coordinates of each seed, but also provides real-time feedback on the deviation value between the seeder and the path (controlled within ±3 cm), ensuring that the sowing depth is automatically adjusted according to the terrain, avoiding water accumulation and seed rot in low-lying areas, and preventing shallow sowing on slopes from affecting germination.

[0104] In step S104, based on the grain spacing distribution heatmap, when the grain spacing deviation is detected to exceed the target value, the seeder speed and seeding gap are adjusted by the servo motor to control the grain spacing in real time and record the control parameters, thereby generating a seeding quality assessment report.

[0105] It is understood that, in this embodiment of the application, after capturing areas with excessive particle size deviation in real time through a particle size distribution heat map, the seeder speed and seed spacing are precisely adjusted using a servo motor to correct the particle size deviation in real time and ensure uniform seed distribution. At the same time, the control parameters are recorded and a sowing quality assessment report is generated, providing a dynamic optimization basis for the current sowing operation, reducing crop growth differences caused by uneven particle size, reviewing the seeder performance through historical data, providing data support for subsequent agricultural machinery debugging and planting plan improvement, and improving sowing accuracy and crop yield stability.

[0106] It should be noted that the target grain spacing is preset based on parameters such as crop variety and planting density, and is usually 5-25 cm (e.g., about 15-25 cm for corn and about 5-10 cm for vegetables). When the actual grain spacing is detected to deviate from the target value by more than ±1-2 cm, the servo motor will adjust the seeder speed and seed spacing to bring the grain spacing back to the preset target range.

[0107] According to the embodiments of this application, a field sowing seed spacing detection method based on computer vision is proposed. This method utilizes 4K RGB and near-infrared multimodal image acquisition combined with an adaptive light control unit to effectively address interference from sudden changes in field light intensity and soil reflection. The image processing module employs adaptive histogram equalization and wavelet transform denoising to improve image clarity and seed feature recognition in complex seedbed environments. Leveraging an improved YOLOv5 algorithm and attention mechanism, it accurately distinguishes between weeds and seeds. In scenarios involving seed overlap and partial soil coverage, it enhances target feature extraction, improving the accuracy of seed spacing deviation calculation. Simultaneously, the fusion positioning of BeiDou RTK and visual odometry, combined with a high-precision farmland surface elevation model, performs spatiotemporal mapping of seed latitude, longitude, and burial depth coordinates, providing accurate data for subsequent field management. The dynamic control actuator, through PID algorithm and adaptive adjustment of seed spacing intervals, can respond to seed spacing deviations in real time and correct sowing parameters, improving the mechanical control response speed. This effectively avoids continuous seed spacing deviations caused by lag, controls the seed spacing error rate, improves crop emergence uniformity and light energy utilization, and reduces subsequent field management costs. This solves the problems of high detection error rate, single detection algorithm, and poor data correlation in existing technologies.

[0108] The following will illustrate a computer vision-based field seeding spacing detection method through a specific embodiment, such as... Figure 9 As shown, it includes: During spring planting operations at a sandy loam corn planting base in the North China Plain (the day's temperature was 18-25℃, southeast wind level 2-3, soil moisture content 18%±2%, surface residual wheat straw coverage of about 30%, straw length 10-15cm, and some areas with 5-8cm deep ruts formed by agricultural machinery), the seeder was equipped with a Hikvision MV-CA020-10GM binocular camera (2 megapixels, 16mm fixed-focus lens, baseline distance 12cm, frame rate...). The camera operates at 30fps, with the lens tilted downwards at 15° and mounted 80cm above the ground at the front of the frame. The outer cover is a transparent polycarbonate shield (3mm thick, 92% light transmittance, with an anti-fog coating). It is equipped with two miniature air pumps (0.4MPa working pressure, 2L / min airflow) that spray air for 0.5 seconds every 30 minutes for cleaning. In areas with dense straw debris (such as bends in the field), additional cleaning is automatically triggered (interval shortened to 10 minutes) to ensure the lens transmittance remains ≥85%. The camera synchronization module achieves microsecond-level time synchronization with BeiDou RTK via GPS timestamps. Even when the lens vibrates by ±2° due to agricultural machinery vibrations, the timing deviation between image acquisition and positioning data remains <5ms.

[0109] To address the drastic changes between early morning backlight (light intensity 3000-5000 lux, backlight ratio 4:1, accompanied by dew reflection) and midday strong light (20000-30000 lux, front lighting conditions, surface temperature rises to 32℃), an improved multi-scale Retinex algorithm was employed: after separating the brightness channels in the HSV color space, the illumination component was blurred using an adaptive Gaussian kernel (σ dynamically adjusted with light intensity; σ=30 for backlight to enhance smoothness, σ=15 for front lighting to preserve details). The reflection component was enhanced with details through non-linear stretching of the S-curve (slope 1.2-1.8, dynamically corrected according to the proportion of straw shadows), increasing the contrast of seed features between the shaded areas of the field ridges and the sunny areas from 30% to over 70% in the original image. Dynamic threshold segmentation uses a 16×16 pixel grid partitioning, combined with the Otsu algorithm and local entropy calculation (areas with entropy values ​​> 1.5 are judged as complex backgrounds such as straw accumulation). The soil threshold in the shaded area is reduced to 100-180 (grayscale value), and in the bright light area it is increased to 150-220. With the morphological opening operation of 3×3 rectangular structuring elements, soil particle noise with a diameter < 2mm is removed. The final seed and background separation accuracy reaches 95%, and the recognition rate of half-exposed seeds (covering 1 / 2) is improved to 88% (72% in the original YOLOv5). For seeds with straw occlusion > 50%, the recognition rate is improved from 60% to 75% by the contour completion algorithm (based on the prediction of adjacent seed positions).

[0110] The improved YOLOv5 algorithm, pre-trained on the COCO dataset, incorporates 5000 additional field-specific scene samples (including seeds stuck in mud and water, seeds obscured by straw, and different varieties of maize seeds (Zhengdan 958, 330g per thousand seeds, 8mm diameter; Xianyu 335, 380g per thousand seeds, 9mm diameter)) for transfer learning. A BiFPN feature fusion module is added to the Neck layer to enhance feature extraction capabilities for small targets (such as semi-buried seeds). The backbone network C3 module embeds a CoordinateAttention mechanism, which strengthens seed edge contour features through weighted horizontal and vertical coordinate channels (x-axis weight 1.2, y-axis weight 0.8). It achieves an inference speed of 35fps on an NVIDIA Jetson AGXXavier edge computing unit (32 TOPS computing power, 30W power consumption). When outputting the two-dimensional pixel coordinates of the seed (e.g., (850, 420)), a confidence score is attached (>0.85 is considered a valid target). For targets with a confidence score of 0.7-0.85, a secondary detection is initiated (adding 3 candidate boxes). The attitude sensor MPU9250 (sampling rate 100Hz, angular velocity measurement range ±2000° / s, zero bias stability 0.05° / h) calculates the pitch angle (±5°) and roll angle (±3°) of the seeder in real time. The Brown-Conrady distortion model (radial distortion coefficients k1=-0.3, k2=0.1, tangential distortion coefficients p1=0.002, p2=-0.001) is used to correct the image. The distortion parameters are automatically calibrated once per hour (by photographing the target board) to ensure that the coordinate deviation is ≤1 pixel (approximately 0.5mm) when the machine body is tilted by 3°.

[0111] Binocular disparity matching employs an improved SGBM algorithm (window size 9×9, minimum disparity 0, maximum disparity 64), generating disparity maps with GPU (NVIDIA Tegra Xavier) acceleration (average processing time 12ms). For depth jumps in rut regions, disparity smoothing constraints (disparity between adjacent pixels ≤ 3) reduce errors. Combining the camera intrinsic parameter matrix (fx=1200, fy=1200, cx=640, cy=360, baseline distance 0.12m), depth is calculated using the triangulation formula: z = (fx × baseline distance) / disparity. For example, with a disparity of 30 pixels, z = (1200 × 0.12) / 30 = 4.8m, achieving a depth accuracy of ±2cm within the range of 0.5-5m. The PnP algorithm uses three cement boundary markers (pre-buried at a depth of 0.5m, with ARUCO codes embedded on top, and corner positioning accuracy ±0.5mm) as world coordinate references (e.g., marker 1: (0,0,0), marker 2: (10,0,0), marker 3: (0,10,0)). It solves the pose matrix using the LM optimization algorithm, converting pixel coordinates into three-dimensional spatial coordinates (x=12.56m, y=34.21m, z=-0.05m), with a z-axis accuracy of ±0.01m (calibrated every 10cm using a seeding depth sensor (ultrasonic + infrared dual-mode)). When calculating the spacing between adjacent seeds, outliers with a spacing <5cm (considered as reseeding) and outliers >30cm (considered as missed seeding) are automatically removed. Valid data is retained and compared with the target seed spacing of 20cm ±1cm. The accuracy of missed seeding identification reaches 90% (verified through subsequent image backtracking).

[0112] The positioning fusion uses the Huace Navigation T300 Beidou RTK module (supporting BDSB3I+GPSL1 / L2, cold start time <30s, built-in anti-multipath antenna) to provide absolute coordinates with a 10Hz update rate in open fields. The base station is set up at a high point 3km away from the field (elevation 120m) and transmits differential signals through a 4G network, with an integer ambiguity fixation rate >99%. The ORB-SLAM3 algorithm runs on the edge computing unit to extract static features such as field ridge edges (approximately 20 feature points per meter, using FAST corner detection) and utility poles (SIFT feature descriptor matching, matching distance threshold 0.7) to construct a keyframe map (one frame is saved every 5m). When traversing a 30m long poplar forest belt, the signal-to-noise ratio of the BeiDou signal dropped from 45dB to 18dB (the loss-of-lock threshold is 25dB). The algorithm switched to a vision-IMU tightly coupled mode. The IMU (shared with the MPU9250) output 100Hz acceleration (±16g) and angular velocity (±2000° / s) data. The trajectory was predicted through pre-integration processing (the error model includes Gaussian noise and random walk). Loop closure detection was performed by combining the forest feature database (containing 200 tree trunk positions with coordinate accuracy ±10cm) (using the DBoW2 bag-of-words model). The final root mean square error (RMSE) of the trajectory was ≤5cm. The seed's three-dimensional coordinates are transformed using seven parameters (ΔX=123.45m, ΔY=67.89m, ΔZ=12.34m, εx=0.002°, εy=0.003°, εz=0.001°, scale factor 1.00002) and mapped to the UTM50N coordinate system. This is then linked to an ArcGIS electronic map (including plot slope of 0.5°, soil organic matter content of 1.2%, and previous crop yield data) to generate a grain spacing heatmap. This heatmap is then pushed in real-time to a 10.1-inch touchscreen in the cab (1920×1080 resolution, 500cd / m² brightness, resistant to direct sunlight) via a 4G module (upload speed 2Mbps). The latency is <1s. The screen can switch between three views: "Real-time Grain Spacing," "Historical Trajectory," and "Equipment Status," and supports gesture zoom (2-finger zoom ratio 1-10 times).

[0113] When the heatmap shows a particle size of 17cm (deviation -3cm) across three consecutive grids (1.5m road section), the STM32H743 microcontroller (480MHz main frequency, 2MB on-chip Flash) initiates PID control: proportional coefficient Kp=0.5 (dynamically adjusted according to soil moisture, increasing to 0.6 when moisture content > 20%), integral coefficient Ki=0.1, derivative coefficient Kd=0.05. After calculating the adjustment amount, it outputs a pulse signal (frequency 500Hz, duty cycle 50%) to drive the Delta ASD-A2 servo motor (rated power 400W, encoder resolution 17-bit). The motor is connected to the seed metering device via a synchronous belt (5mm tooth pitch, 50N tension). The rotational speed increases from 30r / min to 32r / min (corresponding to a seed metering wheel linear speed of 0.251m / s → 0.268m / s). Simultaneously, the ball screw (5mm lead, positioning accuracy ±0.01mm) drives the seed metering gap to increase from 2mm to 2.2mm (a 21% increase in seed channel cross-sectional area). For the larger particle size of Xianyu 335, an additional 0.1mm compensation is triggered (gap reaches 2.3mm). The single-seed dispensing time interval is extended from 0.2s to 0.213s, and the seed spacing recovers to 20cm ±0.5cm within 3 adjustment cycles (approximately 5m travel distance). During the adjustment process, the seed metering resistance is monitored by a torque sensor (measurement range 0-10N・m). When the resistance > 5N・m (e.g., straw blockage), the motor automatically reverses 0.5 revolutions to clear the obstruction. The system generates an hourly CSV format control log (including UTC time, UTM coordinates, motor speed, gap value, measured particle size, and soil resistance), which is stored on a 128GB industrial SD card (resistant to -40~85℃, MTBF 100,000 hours) and can be downloaded remotely via an FTP server.

[0114] After the operation was completed, the quality report (PDF format, automatically generated charts) showed that the average particle spacing of the 200-mu plot was 20.1cm. In the eastern area, which had more sand (soil bulk density 1.3g / cm³), the deviation rate was 4.5% due to its high fluidity; in the western area, which had more clay (soil bulk density 1.5g / cm³), the deviation rate was 2.1%. Regarding different varieties, Zhengdan 958 had an average deviation of 2.3% due to its smaller particle size, while Xianyu 335 had a deviation of 1.9%. The servo motor was adjusted a total of 18 times per 100m, with a single adjustment energy consumption of 0.02kWh, saving 40% energy compared to traditional hydraulic adjustment. Compared to traditional seeders in 2024, the uniformity of corn plant spacing after emergence increased by 35% (based on drone aerial image analysis), and the expected yield per mu increased by 5% (approximately 30kg / mu). Based on the local purchase price of 2.8 yuan / kg, this translates to an increase in income of approximately 252,000 yuan. Based on the report, the technician preset the initial sowing speed for the next day to 31 r / min, planned a replanting route for the blue area (oversparse) on the heat map, and set a replanting density of 2 plants / m², using seedlings of the same variety for transplanting (10 days old). In addition, the system automatically generated equipment maintenance suggestions: the camera housing surface has a scratch rate of 15% (light transmittance reduced to 88%), and it is recommended to replace it after 3 operating cycles; the servo motor's maximum operating temperature is 65℃ (threshold 70℃), and the bearing vibration value is 0.02 mm / s (normal range <0.05 mm / s), requiring no maintenance; the RTK module battery has 35% remaining power and needs to be charged promptly.

[0115] In summary, the embodiments of this application significantly improve seed recognition accuracy in complex field environments (overall separation accuracy of 95%, with a substantial increase in the recognition rate of partially exposed and straw-covered seeds) through improved image recognition and algorithm optimization. Combined with high-precision positioning and navigation (RMSE ≤ 5cm for complex scene trajectories), precise seed positioning is achieved. Through intelligent PID control and adaptive adjustment, stable seed spacing is ensured under different soil types and varieties (average 20.1cm, low deviation rate), and the adjustment is fast and efficient. Compared with traditional technologies, energy saving is 40%, plant spacing uniformity is improved by 35%, and the expected yield per mu is increased by 5%, resulting in an additional income of approximately 252,000 yuan for a 200-mu plot. At the same time, it realizes automatic recording of operation data, automatic generation of quality reports and maintenance suggestions, greatly improving sowing quality, operation efficiency and economic benefits, and has the advantages of strong environmental adaptability and intelligent management.

[0116] Figure 10 A schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device may include: The memory 1001, the processor 1002, and the computer program stored on the memory 1001 and capable of running on the processor 1002.

[0117] When the processor 1002 executes the program, it implements a field seeding spacing detection method based on computer vision provided in the above embodiments.

[0118] Furthermore, electronic devices also include: Communication interface 1003 is used for communication between memory 1001 and processor 1002.

[0119] The memory 1001 is used to store computer programs that can run on the processor 1002.

[0120] The memory 1001 may include high-speed RAM (Random Access Memory) and may also include non-volatile memory, such as at least one disk storage.

[0121] If the memory 1001, processor 1002, and communication interface 1003 are implemented independently, then the communication interface 1003, memory 1001, and processor 1002 can be interconnected via a bus to complete communication between them. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 10 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0122] Optionally, in a specific implementation, if the memory 1001, processor 1002, and communication interface 1003 are integrated on a single chip, then the memory 1001, processor 1002, and communication interface 1003 can communicate with each other through an internal interface.

[0123] The processor 1002 may be a CPU (Central Processing Unit), an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of this application.

[0124] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described computer vision-based field seeding spacing detection method.

[0125] Furthermore, this application also provides a computer program product, including a computer program or instructions, which, when executed, implement the above-described computer vision-based field seeding spacing detection method.

[0126] In the description of this specification, the references to "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0127] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0128] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.

[0129] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware as in another embodiment, it can be implemented using any of the following techniques known in the art, or a combination thereof: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0130] Those skilled in the art will understand that all or part of the steps of the methods described in the above embodiments can be implemented by a program instructing related hardware, and the program can be stored in a computer-readable storage medium. When executed, the program includes one or a combination of the steps of the method embodiments.

[0131] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.

Claims

1. A field seeding spacing detection system based on computer vision, characterized in that, include: The system comprises an image acquisition module, an image processing module, a particle size feature deep learning analyzer, a localization fusion module, and a dynamic control actuator; among which, The image acquisition module is used to acquire 4K RGB and near-infrared data of the sowing area; The image processing module is used to process and correct the acquired images in real time. The grain spacing feature deep learning analyzer is based on an improved YOLOv5 algorithm. It enhances seed feature extraction through an attention mechanism, accurately distinguishing weeds from seeds. It calculates the center-to-center distance deviation between adjacent seeds based on a preset target grain spacing. The analyzer includes a seed recognition unit, a 3D coordinate calculation module, and a statistical analysis unit. The seed recognition unit, based on the improved YOLOv5 algorithm, enhances seed feature extraction through an attention mechanism, accurately distinguishing weeds from seeds. The 3D coordinate calculation module converts pixel coordinates into field 3D coordinates using binocular parallax matching and the PnP algorithm. The statistical analysis unit calculates the distance between adjacent grains and the row spacing deviation, triggering a calibration command when multiple grain spacings exceed a preset threshold. The positioning fusion module is used to fuse BeiDou RTK positioning data and visual odometry trajectory, and uses a high-precision farmland surface elevation model to generate seed latitude, longitude, and burial depth coordinates and map them onto an electronic farmland map. The positioning fusion module includes a dual-frequency BeiDou RTK unit, a visual SLAM module, and a coordinate mapping engine. The dual-frequency BeiDou RTK unit provides accurate positioning and a stable output frequency. The visual SLAM module constructs a 3D map of the sowing path using the ORB-SLAM3 algorithm to maintain positioning accuracy in weak signal areas. The coordinate mapping engine maps seed pixel coordinates to farmland UTM coordinates and correlates them with the electronic map in real time. The dynamic control actuator is used to adjust the seeder speed or seed spacing according to the grain spacing deviation value and priority strategy, and dynamically correct the grain spacing. The dynamic control actuator includes a servo drive module, a seed spacing adjustment unit, and a feedback controller. The servo drive module controls the seeder speed through a high-precision encoder. The seed spacing adjustment unit dynamically adjusts the seeding frequency and spacing according to soil moisture and grain size. The feedback controller uses a PID algorithm to dynamically correct the control parameters according to the grain spacing deviation value.

2. The field seeding spacing detection system based on computer vision according to claim 1, characterized in that, The image acquisition module includes a tri-lens synchronous camera group and an adaptive light control unit. The tri-lens synchronous camera group is used to acquire visible light, near-infrared, and depth images. The adaptive light control unit automatically adjusts the power of the supplementary light according to the light intensity to suppress soil reflection interference.

3. The field seeding spacing detection system based on computer vision according to claim 1, characterized in that, The image processing module includes an image processing unit and a dynamic correction unit. The image processing unit uses adaptive histogram equalization for illumination compensation and combines wavelet transform to remove soil texture noise. The dynamic correction unit is used to correct image distortion caused by the shaking of the seeder in real time.

4. A method for applying a computer vision-based field seeding spacing detection system according to any one of claims 1-3, characterized in that, include: Acquire image data after field sowing; Dynamic illumination compensation and dynamic threshold segmentation are performed on the image data after field sowing. The improved YOLOv5 algorithm is used to identify seed targets and output two-dimensional pixel coordinates. Dynamic distortion correction is performed in combination with attitude sensor data. Based on binocular parallax matching and PnP algorithm, the corrected seed pixel coordinates are converted into three-dimensional spatial coordinates, and the actual distance between adjacent seeds is calculated. Based on the three-dimensional spatial coordinates and the actual spacing between the seeds, the BeiDou RTK positioning and visual SLAM trajectory are integrated, and a three-dimensional map of the sowing path is constructed through the ORB-SLAM3 algorithm. The three-dimensional coordinates of the seeds are mapped to the UTM coordinate system of the farmland, and the electronic map is linked in real time to generate a heat map of the seed spacing distribution. Based on the aforementioned grain spacing distribution heatmap, when a grain spacing deviation exceeding the target value is detected, the seeder speed and seed spacing are adjusted via a servo motor to control the grain spacing in real time and record the control parameters, thereby generating a seeding quality assessment report.

5. An electronic device, characterized in that, include: The system includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the field seeding spacing detection method based on computer vision as described in claim 4.

6. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed, they implement the field seeding spacing detection method based on computer vision as described in claim 4.

7. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed, they implement the field seeding spacing detection method based on computer vision as described in claim 4.

Citation Information

Patent Citations

  • Rice hole sowing and seed metering performance detection method based on improved Yolov5 network

    CN117636163A