Cultivation quality analysis method and system based on tillage field image recognition

By combining multi-angle cameras with structured light modules and SfM, MVS, and Swin-Unet technologies, high-precision 3D modeling of cultivated fields and sowing quality analysis were achieved. This solved the problem of comprehensive analysis of multiple indicators for sowing quality assessment in existing technologies and improved the comprehensiveness and spatial positioning capabilities of cultivated operation analysis.

CN122156489APending Publication Date: 2026-06-05JIANGDU HIGH-END EQUIP ENG TECH RES INST OF YANGZHOU UNIV +2

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JIANGDU HIGH-END EQUIP ENG TECH RES INST OF YANGZHOU UNIV
Filing Date
2026-04-22
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing technologies are insufficient to achieve comprehensive analysis of the entire process and multiple indicators of sowing quality in complex farmland environments. They lack the ability to integrate and model the three-dimensional structure of the field surface with the dynamic behavior of sowing, resulting in insufficient intuitive visualization and spatial positioning capabilities of quality assessment results.

Method used

Multi-angle cameras and structured light modules are used to simultaneously acquire images of the cultivated area. Sparse point clouds and topological mesh models of the field surface are reconstructed by combining SfM and MVS technologies. Semantic segmentation is performed through the Swin-Unet network to extract the cultivated trajectory and sowing point mask, and three-dimensional spatial coordinate distribution mapping is performed. Combined with roughness calculation and DBSCAN clustering, a sowing density deviation map is constructed. Finally, a spatial structure index system is constructed for full-process quality evaluation.

Benefits of technology

It achieves high-precision perception and modeling of cultivated fields, overcoming the limitations of two-dimensional image analysis and incomplete three-dimensional structure reconstruction. It can accurately map planting points and trajectories to the three-dimensional grid model of the field surface, identify abnormal undulation areas and perform quantitative evaluation, thereby improving the comprehensiveness and spatial positioning capabilities of cultivated operation analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122156489A_ABST
    Figure CN122156489A_ABST
Patent Text Reader

Abstract

The application discloses a cultivation quality analysis method and system based on tillage field image recognition and relates to the technical field of agricultural operation monitoring. The method comprises the following steps: synchronously collecting tillage region images and coded light images by a multi-angle camera and a structured light module, completing camera pose calibration, outputting image sequences and view angle parameters; reconstructing field sparse point cloud P and topological grid model M by SfM and MVS technologies, performing semantic segmentation on the main view image by a Swin-Unet network, extracting tillage trajectories and sowing point masks, and mapping the mask boundary back to the topological grid model by the camera pose. The application realizes high-precision perception and modeling of tillage field sowing trajectories, sowing point distribution and ground structure characteristics, realizes an integrated quality evaluation path from data collection, structure modeling, index extraction to visual heat map output, and significantly improves the comprehensiveness, fineness and spatial positioning capability of tillage operation analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of agricultural operation monitoring technology, and in particular to a method and system for analyzing crop quality based on field image recognition. Background Technology

[0002] With the continuous advancement of agricultural modernization, precision farming management has become an important direction for improving crop yields and ensuring the efficiency of agricultural resource utilization. Traditional methods for assessing the quality of agricultural machinery operations largely rely on human experience or simple position sensing devices, making it difficult to achieve multi-dimensional and high-precision identification and quantification of key elements such as sowing trajectory, uniformity of operations, surface undulation, and sowing stability during the tillage process. In recent years, with the development of computer vision and 3D reconstruction technologies, multi-view image acquisition, SfM (Structure-from-Motion), and MVS (Multi-View Stereo) modeling techniques have been gradually applied in scenarios such as agricultural remote sensing and field operation detection, providing theoretical and tool support for constructing visualized and structured digital models of agricultural machinery operations. At the same time, semantic segmentation networks (such as Swin-Unet) have shown good performance in tasks such as tillage paths, crop distribution, and weed identification in cultivated land images, assisting in the semantic embedding from 2D images to 3D scenes, enhancing the automation and scene adaptability of agricultural operation analysis.

[0003] Despite the progress made in the aforementioned technologies, achieving comprehensive, multi-indicator analysis of sowing quality across the entire process in complex farmland environments remains challenging. Existing technologies primarily focus on quantitative statistics of single dimensions (such as trajectory deviation or planting density), lacking the ability to fuse and model the actual three-dimensional structure of the field surface with dynamic sowing behavior. Secondly, traditional methods often rely on extracting regular areas or traces of manual operations, making it difficult to adapt to the semantic recognition uncertainties caused by soil undulations and vegetation disturbances in real farmland. Furthermore, existing methods often fail to achieve effective clustering and quantitative assessment under terrain disturbances, particularly regarding issues such as localized sowing density and skipping sowing. The lack of a complete image-to-3D model mapping mechanism also limits the intuitive visualization and spatial positioning capabilities of quality assessment results. Therefore, there is an urgent need for a tillage quality analysis scheme that integrates multi-angle visual reconstruction, semantic mask recognition, topological modeling, and indicator evaluation to achieve a complete closed loop from image perception to three-dimensional evaluation. Summary of the Invention

[0004] In view of the aforementioned existing problems, the present invention is proposed.

[0005] Therefore, this invention provides a method and system for analyzing tillage quality based on tillage field image recognition, which solves the problems of incomplete structural modeling and insufficient sowing evaluation accuracy in existing tillage image recognition quality assessment.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0007] In a first aspect, the present invention provides a method for analyzing tillage quality based on tillage field image recognition, comprising,

[0008] The system simultaneously acquires images and coded light maps of the cultivated area using a multi-angle camera and a structured light module, completes camera pose calibration, and outputs image sequences and viewpoint parameters.

[0009] Sparse point cloud P and topological mesh model M on the field surface were reconstructed using SfM and MVS techniques. The main view image was semantically segmented using the Swin-Unet network to extract the tillage trajectory and sowing point mask. The mask boundary was then mapped back to the topological mesh model using the camera pose to obtain the three-dimensional spatial coordinate distribution of the trajectory on the field surface.

[0010] Using the 3D trajectory region as a window, roughness calculation is performed on the point cloud. Seeding point detection and DBSCAN clustering are performed in the roughness anomaly region to construct a seeding density deviation map and identify overly dense and skipped seeding areas.

[0011] Based on the trajectory point set, roughness map and seeding point density map, a spatial structure index system is jointly constructed to conduct full-process quality evaluation.

[0012] As a preferred embodiment of the tillage quality analysis method based on tillage field image recognition described in this invention, the method of reconstructing the sparse point cloud P and topological mesh model M of the field surface using SfM and MVS techniques includes:

[0013] The image data is grouped according to the left and right perspectives. The left view is selected as the main perspective. StereoRectify() is used to perform stereo geometric correction on the left and right images and mean-variance normalization is performed.

[0014] The SIFT algorithm is used to extract key points and surrounding image features of each image, generate normalized descriptor vectors, perform bidirectional matching between descriptors of adjacent images, retain matching point pairs to form a preliminary matching set, and use camera intrinsics to normalize the coordinates of matching points to form a normalized matching point pair set.

[0015] Select the image pair with the most matching points from all image pairs as the initial view, perform triangulation reconstruction using the intrinsic and extrinsic parameters of the initial view, calculate the initial sparse point cloud, determine whether each 3D point has positive depth in the dual view, and retain only the valid points to form the initial sparse point cloud structure.

[0016] Traverse unregistered images, project the current point cloud onto the candidate image plane, filter candidate images based on the number of projection points, extract the current observable points for each candidate image to construct a PnP model, and obtain the extrinsic pose of the candidate image through RANSAC-EPnP optimization.

[0017] By combining the matching points of newly registered images with existing views, linear triangulation is performed using the relative poses of the camera to supplement new 3D points. Depth screening is then performed on the new points, and the legal 3D points are added to the point cloud. The visible view relationship is updated, and image registration is completed. The image registration and triangulation process is repeated to gradually expand the 3D point cloud and image set, and finally generate a complete sparse point cloud structure of the field surface.

[0018] For each input image, brightness normalization and color enhancement are performed. The image is converted to HSV space to extract the brightness channel. Low brightness pixels are selected as ground candidates. Then, the difference between the green and red channels is extracted in RGB space to identify vegetation pixels with green features. Pixels that meet both low brightness and color difference conditions are assigned a value of 1 to generate a preliminary ground mask.

[0019] By combining the projected coordinates of each 3D point in the sparse point cloud in the image, it is determined whether it falls into the ground mask area, and candidate 3D points on the ground are obtained. The least squares method is used to perform plane fitting on these points.

[0020] Define the reprojection error objective function using the current sparse point cloud and camera pose as initial variables. The Levenberg-Marquardt algorithm is used for joint optimization, outputting a globally consistent sparse 3D structure and camera pose, and constructing a disparity candidate space for each image. The minimum and maximum disparity values ​​are calculated based on the focal length and depth range of the image. Color similarity and gradient consistency are fused to construct a matching cost map. The PatchMatch-Stereo algorithm is used for disparity propagation and perturbation optimization, and backprojection generates an initial dense point set.

[0021] Extract feature vectors from local regions of the image, input them into a consistency discrimination network to calculate the matching credibility of point pairs, and retain pixels with credibility higher than a threshold to generate a credible dense point set;

[0022] For each dense point, a neighborhood plane fitting is performed to estimate the normal vector, while the normal vector is smoothed by Laplacian regularization constraints to obtain a dense point set with enhanced normal vectors. ;

[0023] The dense point set and its normal are input into the Poisson surface reconstruction algorithm to solve the isosurface and generate an initial triangular mesh. The mesh boundary is then topologically consistent to identify crack and hole regions. The missing parts are restored through edge interpolation, closed connections, and normal continuity to generate a topological mesh model.

[0024] As a preferred embodiment of the tillage quality analysis method based on tillage field image recognition described in this invention, the following steps are performed: semantic segmentation of the main view image is performed using a Swin-Unet network, and the tillage trajectory and sowing point mask are extracted. The main view image is then normalized, and the normalized main view image is input into a pre-trained Swin-Unet model. The model performs semantic parsing of the image through a hierarchical Transformer structure and a U-Net-style upsampling module, and finally outputs a two-dimensional semantic mask image of the same size as the input image, including the sowing trajectory region and the sowing point region. A connected component extraction algorithm is used to extract two pixel sets belonging to the "sowing trajectory" and "sowing point" from the mask image.

[0025] As a preferred embodiment of the tillage quality analysis method based on tillage field image recognition described in this invention, the following steps are taken: mapping the mask boundary back to the topological mesh model through camera pose to obtain the three-dimensional spatial coordinate distribution of the trajectory on the field surface involves traversing the pixel coordinate set of the sowing trajectory boundary and the sowing point point by point, calling the disparity map of the main view to obtain the effective disparity value, combining the camera intrinsic parameters to back-project to the camera coordinate system through the pinhole model, and then using the extrinsic parameter pose to transform it to the three-dimensional spatial position in the world coordinate system, matching all reconstructed points with the dense point cloud mesh, performing geometric consistency verification and binding them to the field mesh surface, removing abnormal points of normal deviation, and finally forming the three-dimensional spatial distribution set of the sowing trajectory and the sowing point respectively.

[0026] As a preferred embodiment of the tillage quality analysis method based on tillage field image recognition described in this invention, the following steps are performed: roughness calculation is performed on the point cloud, sowing point detection and DBSCAN clustering are performed in the roughness anomaly area, a sowing density deviation map is constructed, each trajectory point in the three-dimensional point set of the sowing trajectory is traversed, a three-dimensional sliding window with a fixed radius is established with the trajectory point as the center, and local point sets falling within the window range are extracted from the global dense point cloud, the elevation values ​​in the point set are statistically analyzed, the local average elevation and the relative deviation of each point are calculated, the surface roughness value corresponding to the current trajectory point is obtained, and all roughness values ​​are sorted according to the trajectory number to form a continuous roughness map.

[0027] Based on the global mean of the roughness map, a threshold is set to filter out trajectory points with roughness higher than the mean. The camera intrinsic matrix and pose parameters are called to back-project the corresponding 3D trajectory points back to the main view, obtaining the image coordinate set of the abnormal region. The image coordinates of the seeding points falling into the abnormal region are extracted in the seeding point semantic mask to form an abnormal seeding point set. DBSCAN spatial clustering is performed on the abnormal seeding point set to divide the seeding point clustering region. An image grid is constructed for each clustering region and the number of seeding points and the coverage area are counted. The seeding density per unit area is calculated. The density results of all seeding regions are summarized to obtain the global mean and standard deviation.

[0028] The difference between the density value of each cluster and the global average is normalized and converted into the deviation in standard deviation units. The location coordinates of the cluster and the corresponding deviation value are mapped to color gradients and superimposed on a unified image plane to generate a seeding density deviation map.

[0029] As a preferred embodiment of the tillage quality analysis method based on tillage field image recognition described in this invention, the method of jointly constructing a spatial structure index system based on the trajectory point set, roughness map and sowing point density map, and conducting full-process quality evaluation refers to the overall fitting of the three-dimensional point set of the sowing trajectory, using the least squares method to fit a sowing center curve in the surface projection plane to represent the ideal trajectory path, traversing all trajectory points, calculating the lateral Euclidean distance from each point to the fitted center line, and then using the average deviation of the three-dimensional point set of the sowing trajectory as the sowing stability index.

[0030] The 3D seeding trajectory is back-projected back into image space. Using the intrinsic matrix and pose parameters of the main view camera, the 3D point coordinates of the trajectory are mapped to image pixel coordinates. Corresponding image patches are extracted from the original image and the seeding point region map, respectively. For each pair of image patches, a local normalized cross-correlation coefficient is calculated to measure the image consistency loss. The obtained sowing stability index, roughness map mean, sowing density standard deviation and image consistency loss are normalized and then weighted and fused to construct a unified tillage quality scoring tensor. The scoring results are then mapped back to the image and the surface model according to the sowing trajectory sequence position to generate a trajectory scoring map.

[0031] As a preferred embodiment of the tillage quality analysis method based on tillage field image recognition described in this invention, the method involves simultaneously acquiring images and coded light maps of the tillage area using a multi-angle camera and a structured light module, completing camera pose calibration, and outputting image sequences and viewing angle parameters. This means installing two RGB cameras (left and right) at the front end of the tillage machinery, setting the left and right viewing angle baselines and elevation angles, and simultaneously integrating a structured light projection module.

[0032] Acquire left and right RGB images and structured light encoded images, and record the image acquisition timestamps and heading angle information provided by the inertial navigation device to construct a complete time-series image dataset;

[0033] The Zhang Zhengyou method calibration operation was performed on the left and right cameras respectively. A group of images were acquired on a standard chessboard calibration board. Corner points were extracted using an open-source image processing library and the camera intrinsic parameters were calibrated. The intrinsic parameter matrices and distortion coefficients of the left and right cameras were obtained. The rotation matrix and translation vector between the left and right cameras were estimated to obtain the complete relative pose parameters. The calibration parameters and image data were organized into a structured dataset.

[0034] Secondly, the present invention provides a tillage quality analysis system based on tillage field image recognition, comprising,

[0035] The multi-view image acquisition module is responsible for simultaneously acquiring left and right view images and structured light encoded images of the cultivated area, and completing the relative pose calibration of the camera participants, and outputting structured image data and view parameters.

[0036] The 3D reconstruction and topology modeling module is used to reconstruct sparse point clouds and topology mesh models using SfM and MVS methods, perform camera pose optimization and surface completion, and generate high-precision 3D models of field surfaces.

[0037] The semantic recognition and 3D projection module is used to extract the seeding trajectory and seeding point mask through the Swin-Unet network and project them onto the 3D model to obtain spatial distribution information.

[0038] The seeding density assessment module is used to detect seeding points in rough and abnormal areas, calculate the seeding density per unit area and generate a seeding density deviation map to identify seeding balance problems.

[0039] The end-to-end quality evaluation module integrates sowing stability, roughness, density standard deviation, and image consistency to generate a tillage quality score tensor and output trajectory score maps and heatmap visualization results.

[0040] Thirdly, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, wherein when the computer program is executed by the processor, it implements any step of the method for analyzing tillage quality based on tillage field image recognition as described in the first aspect of the present invention.

[0041] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the method for analyzing tillage quality based on tillage field image recognition as described in the first aspect of the present invention.

[0042] The beneficial effects of this invention are as follows: By integrating multiple key technologies such as multi-view image acquisition, SfM and MVS 3D reconstruction, semantic segmentation and topological mapping, this invention achieves high-precision perception and modeling of sowing trajectories, sowing point distribution and surface structure features in cultivated fields. It overcomes the problems of limited dimensionality in 2D image analysis, incomplete 3D structure reconstruction and one-sided sowing quality evaluation in existing methods. It can accurately map sowing points and trajectories to a 3D grid model of the field surface, identify abnormal undulation areas by combining surface roughness analysis, and further perform spatial clustering and quantitative evaluation of areas with excessively high sowing density and skipped sowing. By constructing a quality scoring tensor that integrates sowing stability, terrain disturbance and image consistency, it realizes an integrated quality assessment path from data acquisition, structural modeling, index extraction to visualization heat map output, which significantly improves the comprehensiveness, precision and spatial positioning capability of cultivated operation analysis. Attached Figure Description

[0043] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0044] Figure 1 This is a flowchart of the tillage quality analysis method based on tillage field surface image recognition in Example 1.

[0045] Figure 2 This is a structural diagram of the tillage quality analysis system based on tillage field image recognition in Example 1.

[0046] Figure 3 This is a flowchart illustrating the 3D reconstruction and topology modeling process in Example 1.

[0047] Figure 4 This is a schematic diagram of the process for evaluating sowing density and quality in Example 1. Detailed Implementation

[0048] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0049] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0050] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0051] Example 1, referring to Figures 1-4 This is the first embodiment of the present invention, which provides a method for analyzing tillage quality based on tillage field surface image recognition, including the following steps:

[0052] S1. Simultaneously acquire images and coded light maps of the cultivated area through a multi-angle camera and a structured light module, complete camera pose calibration, and output image sequences and viewpoint parameters.

[0053] Specifically, images and coded light maps of the cultivated area are simultaneously acquired by multi-angle cameras and structured light modules, and camera pose calibration is completed. The output image sequence and viewing angle parameters are then generated by installing two RGB cameras on the left and right sides at the front of the tillage machinery, setting the left and right viewing baselines and elevation angles, and simultaneously integrating a structured light projection module to project stripe structure patterns to help improve the image depth perception accuracy. All devices are synchronized with the GNSS / IMU clock to ensure spatiotemporal consistency of the acquisition.

[0054] Before the operation begins, a static acquisition operation is performed to control the mechanical state to be stationary. Three sets of static image sequences are acquired from the front, left front, and right front angles. Each set of images includes a left-view RGB image, a right-view RGB image, and a structured light coded image.

[0055] During the mechanical movement, dynamic image acquisition is continuously performed. Left and right RGB images and structured light coded images are acquired synchronously at a frequency of three frames per second. The image acquisition timestamp and heading angle information provided by the inertial navigation equipment are recorded to construct a complete time-series image dataset.

[0056] Zhang Zhengyou's calibration operation was performed on the left and right cameras respectively. A group of images were acquired on the standard chessboard calibration board. Corner points were extracted and camera intrinsic parameter calibration was completed using an open-source image processing library (such as OpenCV). The intrinsic parameter matrices and distortion coefficients of the left and right cameras were obtained. Then, stereo calibration was performed to estimate the rotation matrix and translation vector between the left and right cameras and obtain the complete relative pose parameters.

[0057] The calibration parameters and image data are organized into a structured dataset, including the intrinsic parameter matrices, distortion coefficients, and relative pose information of the left and right cameras, as well as the image data and pose records of all time-series frames.

[0058] By integrating multi-angle cameras and structured light modules, and simultaneously using GNSS / IMU to achieve a high-precision spatiotemporal aligned image acquisition and calibration mechanism, the geometric consistency and depth perception capabilities of cultivated area images are significantly improved. Structured light assists in enhancing texture features, solving the depth estimation problem of traditional stereo vision on low-texture fields; static and dynamic dual-stage acquisition ensures terrain integrity and operational continuity; and the camera model jointly constructed using Zhang Zhengyou's method and stereo calibration guarantees the accuracy of 3D reconstruction.

[0059] S2. Reconstruct the sparse point cloud P and topological mesh model M of the field surface using SfM and MVS techniques. Perform semantic segmentation on the main view image using the Swin-Unet network to extract the tillage trajectory and sowing point mask. Map the mask boundary back to the topological mesh model through camera pose to obtain the three-dimensional spatial coordinate distribution of the trajectory on the field surface.

[0060] Specifically, the reconstruction of sparse point cloud P and topological mesh model M of field surface using SfM and MVS techniques includes:

[0061] All acquired images are grouped and processed. The left view is taken as the main view image. The stereo correction function stereoRectify() is used to perform stereo geometric correction on the left and right images so that the same physical point corresponds to the same row in the left and right images, so as to improve the accuracy of subsequent disparity estimation and 3D point cloud generation. Mean-variance normalization is performed on the images to enhance the consistency of image brightness and reduce the impact of illumination differences on features.

[0062] For each image, the SIFT algorithm is used to extract the coordinate set of key points. With each key point as the center, a fixed-scale window (e.g., 32*32 pixels) is cropped around it to form a local image patch. Image gradient calculation is performed on each image patch to obtain gradient magnitude and direction information. Based on the preset number of angle partitions (e.g., 8 directions), the gradient information is statistically converted into a direction histogram. The obtained gradient direction histogram is vectorized and normalized by L2 norm to obtain a descriptor at the standard scale. Each image finally outputs N key points and corresponding normalized descriptor vectors.

[0063] For each adjacent frame pair in the image sequence (e.g., image pairs determined by shooting order or similarity of viewpoint), a feature matching candidate set is constructed sequentially, including for each keypoint. Using its corresponding descriptor vector as a reference, in another image The nearest neighbor feature search is performed in the middle to initially establish a set of matching pairs based on minimizing the Euclidean distance and to perform reverse matching operation. The point pairs that match in both directions are retained as the initial candidate set. The coordinates of the matching pixel point pairs in each image pair are normalized to unit coordinates in the camera coordinate system using camera intrinsic parameters to obtain the normalized coordinate point pair set M.

[0064] Select the image pair with the most matching points. Using the initial base view as a reference, and based on the known intrinsic and extrinsic parameters of the left and right view cameras, the coordinates of the corresponding 3D points are reconstructed point by point. Specifically, it includes:

[0065] Calculate the normalized line-of-sight vector for each pair of matching points:

[0066] , ,

[0067] In the formula, and These are the normalized pixel coordinates of the left and right cameras, respectively. and It is the intrinsic parameter matrix of the left and right cameras. and These are the rotation matrices of the left and right cameras relative to the world coordinate system, obtained through a two-camera calibration method. and These are the j-th matching points in the left camera (view 0) and the right camera (view 1), respectively. and The corresponding unit direction vector in the world coordinate system;

[0068] Construct a model that minimizes the distance error and solve for the scaling factor simultaneously. and :

[0069]

[0070] In the formula, and It is a scaling factor, representing the distance scaling factor of a 3D point along the ray direction, which is solved by the least squares closed-form solution (conventional linear least squares model). It is the translation vector of the right camera relative to the left camera;

[0071] Calculate the world coordinate position of a 3D point and eliminate the deviation between the two rays using a two-way midpoint method:

[0072]

[0073] In the formula, These are the spatial coordinates of the j-th three-dimensional point;

[0074] Will Project back respectively and In the camera coordinate system, the depth value of the 3D point in the two camera coordinate systems is calculated. The positive or negative value of the depth value indicates whether the point is in front of or behind the camera. If the 3D point has a positive depth in both views (i.e., it is in the visible area of ​​both cameras at the same time), the point is considered a valid point and is retained and included in the initial sparse point cloud set. Otherwise, it is removed to avoid geometric anomalies or the accumulation of reconstruction errors. Finally, all points that meet the conditions are used to form the initial sparse point cloud set.

[0075] Traverse all unregistered images, project all 3D points in the current point cloud set onto the unregistered image plane, count the number of 2D points that can be projected onto the image by the 3D points in the current 3D point cloud (unregistered image frame), and if the projected point falls within the image boundary, it is considered a valid overlapping point. Select images with a number of overlapping points greater than a preset threshold Q (based on experience) as candidate images.

[0076] Extract the 3D-2D correspondence set between candidate images and observable points in the current point cloud, construct a PnP optimization model, and aim to minimize the reprojection error objective function of all points:

[0077]

[0078] In the formula, These are three-dimensional point coordinates, defined in the world coordinate system. It is a three-dimensional point Pixel coordinates in the candidate image It is the rotation matrix of the current image. It is the translation vector of the current image. This is the current image intrinsic parameter matrix, and π() is the projection function, which performs the mapping from camera coordinates to pixel coordinates, specifically expressed as:

[0079]

[0080] In the formula, u is the x-coordinate value mapped to the image plane, v is the y-coordinate value mapped to the image plane, and w is the homogeneous scaling factor, which is usually equivalent to the Z-axis value of the 3D point in the current camera coordinate system.

[0081] The outliers are removed using RANSAC-EPnP, specifically by obtaining the optimized camera rotation matrix and translation vector.

[0082] RANSAC parameters are set, including sampling 4 point pairs per round, setting the reprojection error threshold to 2 pixels based on experience, and setting the maximum number of iterations to 200. In each iteration, 4 sets of 3D-2D point pairs are randomly selected from the set of all matching points. The EPnP algorithm is used to quickly solve the camera pose of the current image. The EPnP method obtains a closed pose estimate without the need for initial values ​​by reconstructing 3D points into a linear combination of control points.

[0083] After each round of pose estimation, all point pairs are substituted into the current EPNP algorithm to calculate the reprojection error. It is determined whether the deviation between the projection result and the original image coordinates is less than the preset threshold W (set by statistical analysis of historical deviation data). If it is satisfied, it is recorded as an inlier. The number of inliers is recorded in each iteration. Finally, the group with the most inliers is selected as the optimal estimate.

[0084] To further improve attitude accuracy, after obtaining the maximum set of inliers, the attitude parameters of the inliers are re-optimized using the nonlinear least squares method to reduce local projection errors and output the final camera rotation matrix and translation vector.

[0085] Traverse all registered images, find image frames that have valid pixel matching with unregistered images, extract pixel matching point pairs between each pair of images, and for each matching point pair, perform linear triangulation operation using the known camera intrinsic matrix and relative pose parameters to calculate the corresponding 3D spatial point coordinates. To ensure the validity of the triangulation results, perform depth determination on all reconstructed points and retain only 3D points that are in front in both camera views.

[0086] After the screening of reconstructed points is completed, all legal 3D points are immediately added to the current point cloud set, and the images in which each 3D point is observed are recorded, that is, a visual index is built for it. Then, the current candidate image is moved from the "pending registration" state to the "registered" image set, indicating that its pose determination and structure association have been completed. The whole process is iterated, and each time the next image with the highest overlap with the existing point cloud is selected for processing, until all images have completed registration, pose estimation and 3D point expansion, forming a complete sparse point cloud structure and camera view integration relationship;

[0087] The registered image refers to the image whose camera pose has been calculated and aligned with the point cloud structure, and can be used for triangulation and joint optimization. The unregistered image refers to the image that has not yet been included in the current 3D model, whose pose parameters are unknown, and which has not yet participated in the triangulation process.

[0088] For each image, brightness normalization and color enhancement processing are performed to strengthen the color features and boundary distinction of the field area. The input image is converted from RGB space to HSV color space to obtain the brightness value of each pixel. A brightness threshold E is set (based on experience). If the brightness of a pixel is less than the threshold E, the pixel is regarded as a low-brightness area and recorded as a candidate ground pixel. In RGB space, the difference between the green channel and the red channel in the image is extracted. If the difference is greater than the preset threshold R (based on experience), the pixel is considered to have green vegetation features and is a potential marker of a typical cultivated area.

[0089] Pixels that simultaneously satisfy both low brightness and color difference are assigned a value of 1, while the remaining pixels are assigned a value of 0, thus forming a preliminary image-level ground mask.

[0090] Based on the projected coordinates of each 3D point in the known sparse point cloud in each view image, it is determined whether the point is within the ground mask. If the condition is met, it is marked as a ground candidate point, and a ground point set is constructed. The least squares method is used to perform plane fitting on the ground point set. This fitting aims to determine a plane parameter, including the plane normal vector n and a constant term d, such that the sum of the squares of the perpendicular distances from all ground points to this plane is minimized.

[0091] Define the reprojection error of 3D points in an image :

[0092]

[0093] In the formula, These are the spatial coordinates of the j-th 3D point. It is the rotation matrix corresponding to the k-th image. Let π be the camera center translation vector for the k-th image, and let π() be the projection function. These are the observed 2D coordinates of the j-th 3D point on the registered image;

[0094] Construct the joint objective function:

[0095]

[0096] In the formula, n is the unit normal vector of the ground fitting plane, and e is the constant term of the ground plane equation. It is a pixel-to-meter scaling factor, obtained from camera intrinsics or pixel density estimation, such as sensor size divided by image resolution. It is the adjustment weight of the ground regularization term in the pixel domain, which is set based on experience;

[0097] The former ensures the accuracy of the projection of the 3D structure in image observation, while the latter ensures the geometric consistency between the point cloud structure and the terrain. The values ​​of each variable are initialized to the current sparse point coordinates and camera pose parameters. The joint objective function is nonlinearly minimized using the Levenberg-Marquardt method. Each iteration includes: calculating the error term based on the current estimate during each iteration, and adjusting the pose of each camera and the position of the midpoint of the point cloud until the optimization converges to within the set error threshold (set in the experimental tuning).

[0098] Finally, the globally consistent optimized sparse 3D structure and the camera pose parameters corresponding to each image were obtained. This result not only ensured the consistency of projection in the image, but also guaranteed the geometric consistency between the entire point cloud structure and the actual terrain, laying a high-quality foundation for the next stage of dense point cloud reconstruction and 3D mesh modeling.

[0099] Using sparse point clouds and camera pose as input, a multi-scale disparity candidate space is constructed on each image. A matching cost function is established for each image pixel. This function integrates two indicators: color similarity and gradient consistency. The ratio of the two is adjusted by a weight factor to form an initial matching cost map (constructed by calculating the cost value for each disparity layer d at each pixel position p and storing it in a three-dimensional cost volume).

[0100]

[0101] In the formula, C(p,d) is the comprehensive cost of pixel p under the assumed disparity d. These are weighting coefficients that control the weighting of color consistency and gradient consistency. They are set through experimental tuning. It is the color consistency cost, representing the color difference between the current pixel p in the reference image and the source image. It is the gradient consistency cost, which represents the difference between the image gradient direction and magnitude of the current pixel under parallax projection. It is calculated after extracting the edge gradient using the Sobel or Scharr operator.

[0102] The construction of a multi-scale disparity candidate space on each image specifically includes extracting the projection of sparse 3D point cloud into the current view from each image, calculating its depth value in the camera coordinate system, and calculating the minimum depth corresponding to the image. With maximum depth Select the M neighboring images that overlap with the current image viewpoint the most, calculate the baseline distance between the neighboring images and the current image, and take the average of all baselines as the reference baseline distance B of the current image.

[0103] Subsequently, based on the camera focal length f and depth range Z, the minimum disparity corresponding to the current image is calculated. and maximum parallax :

[0104] ,

[0105] Set the number of disparity discrete layers Constructing a candidate set of disparity using linear interpolation In the formula It is the i-th disparity candidate value, which serves as the search space for the subsequent PatchMatch disparity estimation stage;

[0106] Based on the cost map, the PatchMatch-Stereo algorithm is used to quickly propagate and perturbate the pixel disparity. Specifically, it involves randomly initializing a disparity value for each pixel in the image, and then quickly approximating the optimal disparity through iterative propagation and perturbation optimization. Specifically, in each iteration, the algorithm scans the image in a certain order (e.g., from top left to bottom right). For the current pixel, it attempts to use the current best disparity of its neighboring pixels (e.g., top, left, right, bottom) as a candidate and compares their cost function values. If the new disparity cost is smaller, the disparity of the current pixel is updated. Subsequently, a small perturbation is applied to the current disparity value (e.g., randomly sampling a new disparity within ±Δl of the current value, where Δl represents the small disparity perturbation range). If the perturbed disparity can further reduce the cost function, it is also updated. This propagation and perturbation process alternates in multiple iterations, which can efficiently optimize the pixel disparity estimation of the entire image and output a pixel-by-pixel dense disparity map. For each pixel, the disparity value corresponding to the minimum cost is selected. With the help of the camera intrinsic parameter matrix and the known pose, the pixel coordinates and their disparity values ​​are back-projected into three-dimensional points to generate an initial dense point set. This point set has a richer structure density than sparse point clouds;

[0107] To ensure the accuracy of the generated point cloud, local region feature vectors are extracted from the images and input into a trained consensus discriminant neural network (MLP). The network calculates the matching confidence score for each point across images, and only points with a consensus score higher than a set threshold (set in the experiment) are retained to form a reliable dense point set. ;

[0108] To optimize the coherence of the point cloud boundaries and the stability of the normal vectors, a neighborhood plane fitting is performed for each dense point to estimate the normal vector. Simultaneously, the normal vectors are smoothed using Laplacian regularization constraints, ultimately yielding a dense point set with enhanced normal vectors. ;

[0109] Dense point set The algorithm for reconstructing a Poisson surface by normal input constructs the Poisson equation and solves the isosurface to generate a triangular mesh model. It performs topological consistency analysis on the boundary of the generated mesh to identify areas with structural defects such as cracks and holes. At the defects, it repairs the boundary by using edge point interpolation, mesh closure connection and normal continuity constraints to generate a closed and coherent topological model.

[0110] First, the `stereoRectify()` function is a crucial step in stereo correction, aligning the epipolar lines of the left and right views. This ensures that the same physical point is aligned on the same line in the image, improving the accuracy of disparity estimation and providing a rigorous geometric foundation for 3D reconstruction. Combined with mean-variance normalization, it eliminates interference from brightness variations, enhances image consistency, and ensures the stability of feature matching.

[0111] In the feature extraction stage, the SIFT (Scale Invariant Feature Transform) algorithm is used to generate stable keypoint descriptors, which are highly robust and particularly suitable for farmland images under different scales and rotations. By matching Euclidean distance between descriptors and applying reverse consistency constraints, high-quality pixel pairs can be constructed, minimizing the propagation of 3D errors caused by mismatched pairs.

[0112] During the 3D reconstruction process, the calculation of the angle between the two line-of-sight vectors and the scaling factor in normalized coordinates ensured the rationality of the initial 3D point cloud positions. By using positive depth constraints to eliminate points behind the two cameras, the introduction of pseudo-3D structures was effectively avoided. This sparse point cloud set provides the foundation for subsequent full-image registration and global optimization.

[0113] To address the image registration problem, this scheme employs the RANSAC-EPnP algorithm in conjunction with a 3D-2D point pair set for camera pose estimation. EPnP can efficiently construct a closed-form pose solution without initial values, while the RANSAC mechanism ensures robustness against outliers. Subsequently, Levenberg-Marquardt nonlinear minimization is performed to construct a joint objective function for projection error and ground fitting error, achieving dual optimization of image structure alignment and terrain consistency, thereby improving the realism and geometric accuracy of the final point cloud structure.

[0114] In the dense reconstruction part, the PatchMatch-Stereo algorithm is introduced. This algorithm combines neighborhood propagation and disparity perturbation to accelerate the optimization search and significantly improve the efficiency of pixel-level disparity estimation without sacrificing accuracy. A weighted combination of color similarity and gradient consistency is introduced into the disparity cost function, which can maintain robust matching under conditions of illumination variation and sparse texture.

[0115] To further improve point cloud quality, a trained consensus discriminant neural network (MLP) is used to score the confidence of cross-image point pairs, retaining only high-confidence points to form the final dense point cloud, effectively suppressing matching noise. Normal estimation and Laplacian regular smoothing are performed on the dense point set to further enhance the geometric continuity of the point cloud and ensure the smoothness and closure of the subsequent surface fitting process.

[0116] Finally, the point cloud and normal fields of the input Poisson reconstruction module are used to solve the isosurface to construct a triangular mesh. Combined with topological consistency analysis, boundary interpolation, mesh closure and normal continuity repair are performed in the crack and hole areas. The output is a high-fidelity terrain topology model with coherent structure and complete topology, which provides accurate 3D support for subsequent cultivation trajectory recognition and roughness modeling.

[0117] Furthermore, semantic segmentation of the main view image is performed using the Swin-Unet network to extract the tillage trajectory and sowing point mask. The main view image is then resampled and color normalized to unify the image resolution to a preset standard size (e.g., 512×512 pixels). Mean and variance normalization are performed on each channel to adapt to the input requirements of the Swin-Unet network. The normalized main view image is then input into the pre-trained Swin-Unet model. The model performs semantic parsing of the image through a hierarchical Transformer structure and a U-Net-style upsampling module. Finally, a two-dimensional semantic mask map of the same size as the input image is output, including the sowing trajectory region and the sowing point region, which are presented in different category encoding forms.

[0118] The Flood Fill algorithm is used to extract two sets of pixels belonging to the "seeding trajectory" and "seeding point" from the mask image. To enhance the integrity of the trajectory structure, only the main trajectory region with a pixel count greater than an empirically set threshold is retained, and noise or edge residue is removed.

[0119] Swin-Unet integrates local and global perception capabilities, improving robustness under conditions of complex field textures and uneven lighting, ensuring the accuracy of sowing area identification. Image normalization and standardization preprocessing enhance the model's adaptability in multiple scenarios, resulting in more stable and consistent output results. The Flood Fill algorithm automatically extracts connected regions, eliminating errors caused by human intervention, effectively supporting subsequent quality evaluation tasks such as 3D trajectory mapping and sowing density analysis, thereby significantly improving the automation and intelligence level of tillage quality assessment.

[0120] Furthermore, by mapping the mask boundary back to the topological mesh model through the camera pose, the three-dimensional spatial coordinate distribution of the trajectory on the field surface is obtained. This involves traversing the extracted set of boundary pixels and seeding point pixels of the trajectory region point by point, calling the disparity map corresponding to the main view, finding the disparity value corresponding to each boundary pixel coordinate, and calculating the depth value of each point based on the disparity value. Specifically, this includes multiplying the camera baseline and focal length and dividing by the disparity value, combining the image coordinates of the trajectory boundary and seeding point pixels with their depth values, and combining the camera intrinsic parameter matrix. Then, a three-dimensional back projection is performed through the pinhole camera model to obtain the three-dimensional spatial position of the trajectory point set and the seeding point set in the world coordinate system. That is, for each pixel, its image coordinates are first normalized to a unit vector in the camera coordinate system, and then multiplied by the depth value to obtain its spatial position in the camera coordinate system. The pose parameters (rotation matrix and translation vector) of the main view image are used to transform the boundary pixels from the camera coordinate system to the world coordinate system, thereby obtaining the corresponding coordinate points of the seeding trajectory pixel and the seeding point pixel in the three-dimensional world.

[0121] Geometric consistency verification is performed on all obtained 3D trajectory points. Specifically, this involves establishing nearest-neighbor binding relationships between each trajectory point and seed point and a triangular facet in the closed mesh model, calculating the projected positions of the trajectory points and seed points on the mesh surface, and checking the angles between the trajectory points and seed points and the facet normals. If the angle deviation exceeds a set threshold (empirically set), the point is considered to potentially have occlusion or abrupt changes and is discarded. All trajectory points and seed points that pass the geometric consistency verification are retained, ultimately forming a stable set of seeded trajectory 3D points and a stable set of seeded 3D points.

[0122] By combining the masked area and disparity map of the main view image with the pose parameters involved in the camera, pixel-level 3D backprojection is performed using a pinhole model to accurately obtain the spatial position of the sowing trajectory boundary and sowing points in the world coordinate system. Furthermore, a geometric consistency verification mechanism is introduced. By judging the binding relationship between trajectory points and the topological mesh and the normal angle, abnormal points caused by occlusion or jumps are eliminated, ensuring the spatial continuity and geometric stability of the sowing trajectory and point set. This operation not only significantly improves the spatial reconstruction accuracy of the sowing path but also provides reliable 3D input for subsequent roughness calculation, density clustering, and quality scoring, effectively enhancing the accuracy, robustness, and practicality of the entire tillage quality analysis method.

[0123] S3. Using the 3D trajectory region as a window, perform roughness calculation on the point cloud, detect seeding points and perform DBSCAN clustering in the roughness anomaly region, construct a seeding density deviation map, and identify overly dense seeding and skipped seeding areas.

[0124] Specifically, roughness calculation is performed on the point cloud. Seeding point detection and DBSCAN clustering are conducted within roughness anomaly regions to construct a seeding density deviation map. This involves traversing each trajectory point in the 3D point set of the seeding trajectory, establishing a 3D sliding window with a fixed radius centered on that point, and selecting all points falling within the window range from the global dense point cloud to form a local point cloud subset U corresponding to that trajectory point. The elevation values ​​(i.e., the z-component in 3D coordinates) of all points in point set U are extracted, and the average elevation of the region is calculated. The elevation deviation of each point is calculated sequentially and averaged to obtain the roughness value corresponding to the trajectory point. :

[0125]

[0126] In the formula, It is the average elevation of all points within the sliding window w. It is a set of points covered by a sliding window extracted from a 3D point cloud, centered on a certain seeding trajectory point; it is a local subset of the point cloud. It represents a set The number of midpoints, i.e., the number of points within the sliding window. It is the elevation value of point v, i.e., a three-dimensional point. The z-coordinate;

[0127] A continuous roughness value sequence is generated for all points according to the trajectory number to form a complete roughness map. Thresholding is performed based on the mean of the global roughness map to extract the set of trajectory points with roughness greater than the mean roughness. The three-dimensional trajectory points are projected back to the main view image plane through the camera intrinsic parameter matrix and pose parameters to obtain a set of abnormal region coordinates in the image space.

[0128] By combining the semantic mask image of the seeding points, seeding points falling within the coordinate set of the abnormal region are selected, forming the image coordinate set of seeding points within the abnormal region. The DBSCAN algorithm based on the radius ϵ and the minimum number of points MinPts is used to spatially cluster the seeding point coordinate set S, identifying multiple seeding point clusters. For each cluster, a corresponding image grid region is constructed, and the number of seeding points contained in it is counted. and actual coverage area Calculate the seeding density per unit area :

[0129]

[0130] All sowing densities are summarized, and their global average and standard deviation are calculated. The difference between the density value of each region and the global average density is calculated to obtain the deviation, which is then normalized to the standard deviation unit. The position coordinates of each region and their corresponding standard deviation are mapped to a color gradient and plotted on a unified image plane to generate a sowing density deviation map.

[0131] By integrating 3D point cloud roughness analysis with semantic mask recognition, joint modeling of surface undulation features and sowing behavior patterns was achieved, enabling precise localization of areas with abnormal sowing quality. A continuous roughness map was constructed by extracting elevation changes near sowing trajectory points using a sliding window, aiding in the identification of uneven sowing caused by uneven terrain. Combining image semantic segmentation results with backprojection of rough areas, abnormal sowing points were further filtered, and overly dense or skipped sowing areas were identified through DBSCAN clustering. Finally, a sowing density deviation map was generated, achieving spatial visualization assessment of sowing quality. This method enhances the sensitivity and diagnostic capability for spatial heterogeneity of tillage quality, providing high-resolution evidence for precision agriculture decision-making.

[0132] S4. Based on the trajectory point set, roughness map and seeding point density map, a spatial structure index system is jointly constructed to conduct a full-process quality evaluation.

[0133] Specifically, based on the trajectory point set, roughness map, and sowing point density map, a spatial structure index system is jointly constructed for full-process quality evaluation. This involves fitting the three-dimensional point set of the sowing trajectory as a whole, using the least squares method to fit a sowing center curve on the surface projection plane to represent the ideal trajectory path, traversing all trajectory points, calculating the lateral Euclidean distance from each point to the fitted center line, and then using the average deviation of the three-dimensional point set of the sowing trajectory as the sowing stability index.

[0134]

[0135] In the formula, G represents the lateral deviation of the trajectory, and G is the number of trajectory points. It is the lateral distance from the f-th trajectory point to the fitted center line. It is the average distance of all trajectory points;

[0136] The 3D seeding trajectory is back-projected back into image space. Using the intrinsic matrix and pose parameters of the main view camera, the 3D point coordinates of the trajectory are mapped to image pixel coordinates. Corresponding image patches are extracted from the original image and the seeding point region map, respectively. For each pair of image patches, a local normalized cross-correlation coefficient is calculated to measure the image consistency loss. :

[0137]

[0138] In the formula, It is the value of the o-th pixel in image X. Represents the image Y with The pixel value at the corresponding location in space. and These are the mean values ​​of all pixels in the x and y regions, respectively. and It is the standard deviation of all pixel values ​​in x and y within the region, and O is the number of pixels;

[0139] The obtained sowing stability index, roughness map mean, sowing density standard deviation and image consistency loss are normalized and then weighted and fused to construct a unified tillage quality scoring tensor.

[0140] The scoring results are mapped back to the image and the surface model according to the position of the sowing trajectory sequence to generate a trajectory scoring map. The sowing density deviation map is superimposed on the original image in the form of a heat map to form a sowing balance heat map.

[0141] By constructing a multi-dimensional spatial structure index system covering sowing trajectory stability, surface roughness, sowing density consistency, and image semantic matching, a comprehensive and refined evaluation of tillage quality was achieved for the first time. The stability of the operation path was accurately measured by fitting the sowing center curve using the least squares method and calculating the lateral deviation. Image consistency loss was determined by combining local normalized cross-correlation coefficients, improving the semantic accuracy of sowing point detection. Simultaneously, the mean roughness and standard deviation of density were integrated to comprehensively characterize sowing uniformity. Finally, a scoring tensor was constructed through multi-index normalized weighting and mapped to the image and surface model, enabling visualization of trajectory scoring maps and density heatmaps. This significantly enhanced the spatial location capability and explanatory power of tillage quality anomalies.

[0142] This embodiment also provides a tillage quality analysis system based on tillage field image recognition, including:

[0143] The multi-view image acquisition module is responsible for simultaneously acquiring left and right view images and structured light encoded images of the cultivated area, and completing the relative pose calibration of the camera participants, and outputting structured image data and view parameters.

[0144] The 3D reconstruction and topology modeling module is used to reconstruct sparse point clouds and topology mesh models using SfM and MVS methods, perform camera pose optimization and surface completion, and generate high-precision 3D models of field surfaces.

[0145] The semantic recognition and 3D projection module is used to extract the seeding trajectory and seeding point mask through the Swin-Unet network and project them onto the 3D model to obtain spatial distribution information.

[0146] The seeding density assessment module is used to detect seeding points in rough and abnormal areas, calculate the seeding density per unit area and generate a seeding density deviation map to identify seeding balance problems.

[0147] The end-to-end quality evaluation module integrates sowing stability, roughness, density standard deviation, and image consistency to generate a tillage quality score tensor and output trajectory score maps and heatmap visualization results.

[0148] This embodiment also provides a computer device applicable to the method of analyzing crop quality based on cultivated field surface image recognition, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the crop quality analysis method based on cultivated field surface image recognition as proposed in the above embodiment.

[0149] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.

[0150] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements the method for analyzing crop quality based on farmland surface image recognition as proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0151] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for analyzing tillage quality based on tillage field image recognition, characterized in that: include, The system simultaneously acquires images and coded light maps of the cultivated area using a multi-angle camera and a structured light module, completes camera pose calibration, and outputs image sequences and viewpoint parameters. Sparse point cloud P and topological mesh model M on the field surface were reconstructed using SfM and MVS techniques. The main view image was semantically segmented using the Swin-Unet network to extract the tillage trajectory and sowing point mask. The mask boundary was then mapped back to the topological mesh model using the camera pose to obtain the three-dimensional spatial coordinate distribution of the trajectory on the field surface. Using the 3D trajectory region as a window, roughness calculation is performed on the point cloud. Seeding point detection and DBSCAN clustering are performed in the roughness anomaly region to construct a seeding density deviation map and identify overly dense and skipped seeding areas. Based on the trajectory point set, roughness map and seeding point density map, a spatial structure index system is jointly constructed to conduct full-process quality evaluation.

2. The method for analyzing tillage quality based on tillage field image recognition as described in claim 1, characterized in that: The reconstruction of the sparse point cloud P and topological mesh model M of the field surface using SfM and MVS techniques includes: The image data is grouped according to the left and right perspectives. The left view is selected as the main perspective. StereoRectify() is used to perform stereo geometric correction on the left and right images and mean-variance normalization is performed. The SIFT algorithm is used to extract key points and surrounding image features of each image, generate normalized descriptor vectors, perform bidirectional matching between descriptors of adjacent images, retain matching point pairs to form a preliminary matching set, and use camera intrinsics to normalize the coordinates of matching points to form a normalized matching point pair set. Select the image pair with the most matching points from all image pairs as the initial view, perform triangulation reconstruction using the intrinsic and extrinsic parameters of the initial view, calculate the initial sparse point cloud, determine whether each 3D point has positive depth in the dual view, and retain only the valid points to form the initial sparse point cloud structure. Traverse unregistered images, project the current point cloud onto the candidate image plane, filter candidate images based on the number of projection points, extract the current observable points for each candidate image to construct a PnP model, and obtain the extrinsic pose of the candidate image through RANSAC-EPnP optimization. By combining the matching points of newly registered images with existing views, linear triangulation is performed using the relative poses of the camera to supplement new 3D points. Depth screening is then performed on the new points, and the legal 3D points are added to the point cloud. The visible view relationship is updated, and image registration is completed. The image registration and triangulation process is repeated to gradually expand the 3D point cloud and image set, and finally generate a complete sparse point cloud structure of the field surface. For each input image, brightness normalization and color enhancement are performed. The image is converted to HSV space to extract the brightness channel. Low brightness pixels are selected as ground candidates. Then, the difference between the green and red channels is extracted in RGB space to identify vegetation pixels with green features. Pixels that meet both low brightness and color difference conditions are assigned a value of 1 to generate a preliminary ground mask. By combining the projected coordinates of each 3D point in the sparse point cloud in the image, it is determined whether it falls into the ground mask area, and candidate 3D points on the ground are obtained. The least squares method is used to perform plane fitting on these points. Define the reprojection error objective function using the current sparse point cloud and camera pose as initial variables. The Levenberg-Marquardt algorithm is used for joint optimization, outputting a globally consistent sparse 3D structure and camera pose, and constructing a disparity candidate space for each image. The minimum and maximum disparity values ​​are calculated based on the focal length and depth range of the image. Color similarity and gradient consistency are fused to construct a matching cost map. The PatchMatch-Stereo algorithm is used for disparity propagation and perturbation optimization, and backprojection generates an initial dense point set. Extract feature vectors from local regions of the image, input them into a consistency discrimination network to calculate the matching credibility of point pairs, and retain pixels with credibility higher than a threshold to generate a credible dense point set; For each dense point, a neighborhood plane fitting is performed to estimate the normal vector, while the normal vector is smoothed by Laplacian regularization constraints to obtain a dense point set with enhanced normal vectors. ; The dense point set and its normal are input into the Poisson surface reconstruction algorithm to solve the isosurface and generate an initial triangular mesh. The mesh boundary is then topologically consistent to identify crack and hole regions. The missing parts are restored through edge interpolation, closed connections, and normal continuity to generate a topological mesh model.

3. The method for analyzing tillage quality based on tillage field image recognition as described in claim 2, characterized in that: The process involves semantic segmentation of the main view image using the Swin-Unet network, extracting the tillage trajectory and sowing point mask, normalizing the main view image, and inputting the normalized main view image into a pre-trained Swin-Unet model. The model performs semantic parsing of the image through a hierarchical Transformer structure and a U-Net-style upsampling module, and finally outputs a two-dimensional semantic mask map of the same size as the input image, including the sowing trajectory region and the sowing point region. A connected component extraction algorithm is used to extract two pixel sets belonging to the "sowing trajectory" and "sowing point" from the mask map.

4. The method for analyzing tillage quality based on tillage field image recognition as described in claim 3, characterized in that: The process involves mapping the mask boundary back to the topological mesh model using camera pose to obtain the three-dimensional spatial coordinate distribution of the trajectory on the field surface. This involves traversing the pixel coordinate set of the sowing trajectory boundary and the sowing point point by point, calling the disparity map of the main view to obtain the effective disparity value, combining the camera intrinsic parameters to back-project to the camera coordinate system through the pinhole model, and then using the extrinsic parameter pose to transform it to the three-dimensional spatial position in the world coordinate system. All reconstructed points are matched with the dense point cloud mesh, geometric consistency verification is performed and they are bound to the field mesh surface. Abnormal points with normal deviation are removed, and finally, three-dimensional spatial distribution sets of sowing trajectory and sowing point are formed respectively.

5. The method for analyzing tillage quality based on tillage field image recognition as described in claim 4, characterized in that: The roughness calculation is performed on the point cloud. Seeding point detection and DBSCAN clustering are performed in the roughness anomaly area to construct a seeding density deviation map. The process involves traversing each trajectory point in the three-dimensional point set of the seeding trajectory, establishing a three-dimensional sliding window with a fixed radius centered on the trajectory point, and extracting local point sets that fall within the window range from the global dense point cloud. The elevation values ​​in the point set are statistically analyzed, and the local average elevation and the relative deviation of each point are calculated to obtain the surface roughness value corresponding to the current trajectory point. All roughness values ​​are organized according to the trajectory number to form a continuous roughness map. Based on the global mean of the roughness map, a threshold is set to filter out trajectory points with roughness higher than the mean. The camera intrinsic matrix and pose parameters are called to back-project the corresponding 3D trajectory points back to the main view, obtaining the image coordinate set of the abnormal region. The image coordinates of the seeding points falling into the abnormal region are extracted in the seeding point semantic mask to form an abnormal seeding point set. DBSCAN spatial clustering is performed on the abnormal seeding point set to divide the seeding point clustering region. An image grid is constructed for each clustering region and the number of seeding points and the coverage area are counted. The seeding density per unit area is calculated. The density results of all seeding regions are summarized to obtain the global mean and standard deviation. The difference between the density value of each cluster and the global average is normalized and converted into the deviation in standard deviation units. The location coordinates of the cluster and the corresponding deviation value are mapped to color gradients and superimposed on a unified image plane to generate a seeding density deviation map.

6. The method for analyzing tillage quality based on tillage field image recognition as described in claim 5, characterized in that: Based on the trajectory point set, roughness map and sowing point density map, a spatial structure index system is jointly constructed for full-process quality evaluation. This involves fitting the three-dimensional point set of the sowing trajectory as a whole, using the least squares method to fit a sowing center curve in the surface projection plane to represent the ideal trajectory path, traversing all trajectory points, calculating the lateral Euclidean distance from each point to the fitted center line, and then using the average deviation of the three-dimensional point set of the sowing trajectory as the sowing stability index. The 3D seeding trajectory is back-projected back into image space. Using the intrinsic matrix and pose parameters of the main view camera, the 3D point coordinates of the trajectory are mapped to image pixel coordinates. Corresponding image patches are extracted from the original image and the seeding point region map, respectively. For each pair of image patches, a local normalized cross-correlation coefficient is calculated to measure the image consistency loss. The obtained sowing stability index, roughness map mean, sowing density standard deviation and image consistency loss are normalized and then weighted and fused to construct a unified tillage quality scoring tensor. The scoring results are then mapped back to the image and the surface model according to the sowing trajectory sequence position to generate a trajectory scoring map.

7. The method for analyzing tillage quality based on tillage field image recognition as described in claim 6, characterized in that: The process involves simultaneously acquiring images and coded light maps of the cultivated area using multi-angle cameras and a structured light module, completing camera pose calibration, and outputting image sequences and viewing angle parameters. This includes installing two RGB cameras (left and right) at the front end of the tillage machinery, setting the left and right viewing baselines and elevation angles, and simultaneously integrating a structured light projection module. Acquire left and right RGB images and structured light encoded images, and record the image acquisition timestamps and heading angle information provided by the inertial navigation device to construct a complete time-series image dataset; The Zhang Zhengyou method calibration operation was performed on the left and right cameras respectively. A group of images were acquired on a standard chessboard calibration board. Corner points were extracted using an open-source image processing library and the camera intrinsic parameters were calibrated. The intrinsic parameter matrices and distortion coefficients of the left and right cameras were obtained. The rotation matrix and translation vector between the left and right cameras were estimated to obtain the complete relative pose parameters. The calibration parameters and image data were organized into a structured dataset.

8. A tillage quality analysis system based on tillage field image recognition, based on the tillage quality analysis method based on tillage field image recognition according to any one of claims 1 to 7, characterized in that: include, The multi-view image acquisition module is responsible for simultaneously acquiring left and right view images and structured light encoded images of the cultivated area, and completing the relative pose calibration of the camera participants, and outputting structured image data and view parameters. The 3D reconstruction and topology modeling module is used to reconstruct sparse point clouds and topology mesh models using SfM and MVS methods, perform camera pose optimization and surface completion, and generate high-precision 3D models of field surfaces. The semantic recognition and 3D projection module is used to extract the seeding trajectory and seeding point mask through the Swin-Unet network and project them onto the 3D model to obtain spatial distribution information. The seeding density assessment module is used to detect seeding points in rough and abnormal areas, calculate the seeding density per unit area and generate a seeding density deviation map to identify seeding balance problems. The end-to-end quality evaluation module integrates sowing stability, roughness, density standard deviation, and image consistency to generate a tillage quality score tensor and output trajectory score maps and heatmap visualization results.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the method for analyzing the quality of cultivated land based on image recognition of cultivated field as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the method for analyzing the quality of cultivated land based on image recognition of cultivated fields as described in any one of claims 1 to 7.