Plant image processing method, device and equipment based on three-dimensional phenotypic modeling
Through technologies such as feature extraction, sparse point cloud processing, and SAM model segmentation, the problem of poor modeling of complex plant images is solved, accurate three-dimensional rendering and grid processing are achieved, and plant morphological analysis is supported.
Patent Information
- Application Number
- CN202410906783.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-07-08
AI Technical Summary
Existing three-dimensional modeling methods are difficult to accurately analyze and process complex plant images, resulting in poor three-dimensional phenotype modeling results.
Using a plant image processing method based on three-dimensional phenotypic modeling, through feature extraction, sparse point cloud data processing, SAM model for foreground segmentation, edge refinement, spatial alignment, removal of incomplete features, Gaussian reconstruction and rendering, and finally meshing 3D patch processing to generate 3D mesh patch images that can be used for plant morphological analysis.
It achieves accurate three-dimensional modeling and rendering of complex plant images, improves the accuracy and measurability of three-dimensional phenotype modeling, and supports detailed analysis of plant morphology.
Smart Images

Figure CN118447047B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a plant image processing method, device and equipment based on three-dimensional phenotypic modeling. Background Art
[0002] The methods for analyzing plant images for 3D modeling currently include traditional modeling and deep learning-based modeling. Traditional modeling methods mainly include COLMAP and OpenMVS. These methods have the problems of long time and poor reconstruction effect in the process of fine-grained modeling of 3D phenotypes. The methods based on deep learning modeling are mainly divided into convolutional neural network models (such as DeepVO, BA-Net, CNN-SLAM) and methods based on neural radiation fields. These technologies have good reconstruction effects on various types of fruits and vegetables with simple shapes, but they are not good for modeling plants with more complex shapes such as wheat, corn, and tobacco.
[0003] The existing technologies are effective in analyzing specific objects or plants with simple shapes. However, for various plant images, since the analysis of most plant images requires precise scales, these models in the existing technologies cannot accurately analyze and process plant images to obtain refined three-dimensional phenotypic modeling. Summary of the invention
[0004] In view of this, the purpose of the present application is to propose a plant image processing method, device and equipment based on three-dimensional phenotypic modeling, so as to solve the problem that the current image processing model cannot accurately analyze and process plant images.
[0005] Based on the above objectives, the present application provides a plant image processing method based on three-dimensional phenotypic modeling, comprising:
[0006] Perform feature extraction processing on the initial image sequence of the plant at multiple viewing angles to obtain extracted feature points;
[0007] Determine the camera position corresponding to the feature point, and process the corresponding feature point according to the camera position using triangulation to obtain sparse point cloud data of the plant;
[0008] The initial image sequences under multiple viewing angles are input into the SAM model in the tracking network, and the SAM model is used to perform foreground segmentation processing on the initial image sequence under each viewing angle to obtain initial segmented plant foreground data;
[0009] For the initial segmented plant foreground data at each viewing angle, edge thinning is performed using the corresponding initial image to obtain an intermediate segmented plant foreground corresponding to each viewing angle;
[0010] Perform spatial alignment processing on the middle segmented plant foregrounds corresponding to each viewing angle to obtain aligned feature data;
[0011] Inputting the aligned feature data into the tracking network, using the similarity algorithm in the tracking network to analyze and remove incomplete features, and obtaining the segmentation results of the plant foreground at each viewing angle;
[0012] Determine initial Gaussian points according to the sparse point cloud data, and perform Gaussian reconstruction and visualization rendering processing on the segmented plant foreground results of each viewing angle based on the initial Gaussian points to obtain three-dimensional plant rendering results of each viewing angle;
[0013] The three-dimensional plant rendering result of each viewing angle is subjected to gridding three-dimensional surface processing to generate a plant three-dimensional grid surface image corresponding to each viewing angle for plant morphological analysis based on the plant three-dimensional grid surface image.
[0014] A plant image processing device based on three-dimensional phenotypic modeling, characterized by comprising:
[0015] A feature extraction module is configured to perform feature extraction processing on an initial image sequence of the plant at multiple viewing angles to obtain extracted feature points;
[0016] A sparse point cloud module is configured to determine the camera position corresponding to the feature point, and process the corresponding feature point according to the camera position using triangulation to obtain sparse point cloud data of the plant;
[0017] An initial segmentation module is configured to input the initial image sequences under multiple viewing angles into the SAM model in the tracking network, and use the SAM model to perform foreground segmentation processing on the initial image sequence under each viewing angle to obtain initial segmented plant foreground data;
[0018] The intermediate segmentation module is configured to perform edge thinning processing on the initial segmented plant foreground data at each viewing angle using the corresponding initial image to obtain an intermediate segmented plant foreground corresponding to each viewing angle;
[0019] An alignment processing module is configured to perform spatial alignment processing on the middle segmented plant foregrounds corresponding to each viewing angle to obtain aligned feature data;
[0020] An omnidirectional segmentation module is configured to input the aligned feature data into the tracking network, use the similarity algorithm in the tracking network to analyze and remove incomplete features, and obtain segmented plant foreground results at various viewing angles;
[0021] A Gaussian rendering module is configured to determine initial Gaussian points according to the sparse point cloud data, and perform Gaussian reconstruction and visualization rendering processing on the segmented plant foreground results of each viewing angle based on the initial Gaussian points to obtain three-dimensional plant rendering results of each viewing angle;
[0022] The surface block processing module is configured to perform gridded three-dimensional surface processing on the three-dimensional plant rendering results of each viewing angle to generate a plant three-dimensional grid surface image corresponding to each viewing angle; so as to perform plant morphological analysis based on the plant three-dimensional grid surface image.
[0023] Based on the same inventive concept, the present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements the method as described above when executing the computer program.
[0024] From the above, it can be seen that the plant image processing method, device and equipment based on three-dimensional phenotypic modeling provided by the present application may be multi-perspective plant images captured by a general camera, so the initial image sequence features of the plant under multiple perspectives will be extracted, and the camera position of the feature points will be determined, so as to facilitate the determination of the point cloud by triangulation according to the camera position, and obtain sparse point cloud data of the plant; this scheme introduces an improved tracking network combined with the SAM model, so that the tracking network can be used to perform foreground segmentation on the initial image sequence under each perspective, and then obtain the initial segmented plant foreground data of only the plant part, avoiding interference from background content, In order to improve the accuracy of the initial segmented plant foreground data, its edges will be refined, and each perspective will be spatially aligned. The aligned feature data will be used again using a tracking network to remove incomplete features to obtain accurate segmented plant foreground results for each perspective. The segmented plant foreground results for each perspective are processed by Gaussian reconstruction and visualization rendering to obtain a three-dimensional plant rendering result. However, the three-dimensional plant rendering result may not be directly used for plant morphological analysis, and it is necessary to perform gridded three-dimensional surface processing on it to obtain a three-dimensional grid surface image of the plant at each perspective, so that better plant morphological analysis can be performed based on the three-dimensional grid surface image of the plant. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the present application or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0026] Figure 1 A flow chart of a plant image processing method based on three-dimensional phenotypic modeling according to an embodiment of the present application;
[0027] Figure 2 A schematic diagram of the process of three-dimensional digital visualization of plants according to an embodiment of the present application;
[0028] Figure 3 A schematic diagram of plant image acquisition according to an embodiment of the present application;
[0029] Figure 4 A schematic diagram of the process of foreground segmentation in an embodiment of the present application;
[0030] Figure 5 A schematic diagram of a process of performing foreground segmentation at each viewing angle in an embodiment of the present application;
[0031] Figure 6 A schematic diagram of the process of Gaussian rendering and face extraction in an embodiment of the present application;
[0032] Figure 7 This is a schematic diagram of a plant foreground segmentation result of an embodiment of the present application;
[0033] Figure 8 A schematic diagram of foreground segmentation in a single view and multiple views according to an embodiment of the present application;
[0034] Fig. 9 A schematic diagram of a Gaussian rendering result of an embodiment of the present application;
[0035] Fig.10 It is a structural block diagram of a plant image processing device based on three-dimensional phenotypic modeling according to an embodiment of the present application;
[0036] Fig.11 A schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0037] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0038] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should be the usual meanings understood by people with ordinary skills in the field to which the present application belongs. The "first", "second" and similar words used in the embodiments of the present application do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing in front of the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0039] Glossary:
[0040] PnP: Perspective-n-Point, PnP algorithm.
[0041] SAM: segment anything model, large image segmentation model.
[0042] SFM: switch fabric module, a cross-matrix structure consisting of multiple channels interlaced horizontally and vertically.
[0043] TAM: track anything model, tracking model.
[0044] XMem: An Atkinson-Shiffrin memory model-based architecture for long-term video object segmentation.
[0045] ICP: Iterative Closest Point, matching algorithm is a method of point cloud registration (Point Cloud Registration).
[0046] MLP: Multilayer Perceptron, multilayer perceptron.
[0047] This application is dedicated to developing a plant image processing method based on three-dimensional phenotypic modeling. By applying 3D Gaussian Splatting technology for the first time, a breakthrough in the comprehensive and refined three-dimensional visualization modeling of plants has been achieved. Faced with the limitations of traditional Gaussian reconstruction technology in dealing with complex backgrounds, the SAM (Segment Anything Model) + long video segmentation XMem algorithm was introduced to achieve the goal of accurately segmenting the target plant contour from the image sequence. In addition, in order to address the problem of the non-direct measurability of Gaussian rendering results, a new patching method is used to convert the image processing results of a single plant into directly measurable patching data, providing a new technical approach for the accurate three-dimensional reconstruction of plant phenotypes.
[0048] Before starting to describe the solution of this application, the solution ideas of this application are described in detail:
[0049] The exploration of 3D digital visualization of plants at any time and any place is mainly divided into four steps: plant image acquisition and background segmentation, camera pose estimation and sparse point cloud reconstruction, digital plant visualization rendering, and patch result extraction, such as Figure 2 As shown. In order to ensure that the experiment can be conducted on any plant at any time and place, a multi-scale feature fusion method is introduced based on the improved trackanything model (TAM) method (SAM+XMem), and the plant image streams under different perspectives are respectively input into the model as different prompts (features) to finely segment the all-round plant foreground. For the results before segmentation, sparse point cloud reconstruction and camera pose estimation are performed based on the SFM method to ensure the accuracy of the initial point cloud and camera pose. Then, the sparse point cloud, camera pose, and plant foreground image are input into the Gaussian model for Gaussian splashing, and a tiled-based rasterizer is used to obtain a three-dimensional plant rendering result that is very close to the real one. Finally, in order to facilitate the measurability of the traditional plant three-dimensional point cloud, the three-dimensional plant rendering result is retrained and faceted to obtain a measurable plant three-dimensional mesh facet image.
[0050] In addition, the scheme of this application is carried out under the Ubuntu 20.4 operating system, the processor model is Intel(R)Core (TM) i5-13500HX CPU @ 2.50 GHz, and the graphics card is Nvidia GeForce RTX 3090. The deep learning framework uses PyTorch 2.0, the programming platform is PyCharm, the programming language is Python 3.10, and all comparison algorithms are run in the same environment. The programming language for data acquisition and image processing is C++, the interface is designed using QT 6.5.1, the image is processed using OpenCV4.7.0, and the program debugging platform is Visual Studio 2022.
[0051] Before the plant image is processed in the solution of this embodiment, the collection of the plant image specifically includes:
[0052] Image data of various plants were collected in three environments: indoor potted plants, outdoor potted plants, and outdoor fields, and in three time periods: morning, noon, and night. Figure 3 The collection process includes two stages: preliminary rough collection of plant surfaces and detailed morphological collection of different parts of the plant (such as the canopy, side, and bottom). Different brands of mobile phones are used for image collection to ensure the diversity of plant images.
[0053] The collected plants include: wheat in different growth stages, tobacco in different growth stages, corn, and various indoor potted plants. Among them, tobacco images were collected from June to July 2023, and 3 plants in three growth stages were selected, totaling 9 groups, from 10:00 to 15:00, and the collection location was Yangling, Shaanxi, and the experimental scene was an outdoor field; corn images were collected from January to February 2024, totaling N groups, and the collection location was Sanya, Hainan, and the experimental scenes included outdoor and indoor; various indoor potted plant images were collected from August 2023 to May 2024, totaling N groups, and the collection locations included Sanya, Hainan, Taizhou, Jiangsu, and Yangling, Shaanxi, and the experimental scene was indoors; wheat is the key research object, and the images include the three-leaf period, heading period, flowering period, and maturity period, totaling N groups, and the collection location was Yangling, Shaanxi, and the experimental scenes included indoor potted plants, outdoor potted plants, and outdoor fields.
[0054] To ensure the universality of the experiment, the acquisition device is a mobile phone, camera, tablet or other electronic device with a camera. The video resolution is any resolution below 2k, and the frame rate is 30 or 60Hz. After collecting the plant video, the video is preprocessed, including video stitching, image frame extraction, and deleting blurred images.
[0055] The embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0056] The plant image processing method based on three-dimensional phenotypic modeling in the embodiment of the present application is as follows: Figure 1 As shown, including:
[0057] Step 101 , performing feature extraction processing on an initial image sequence of a plant at multiple viewing angles to obtain extracted feature points.
[0058] Step 102, determining the camera position corresponding to the feature point, and processing the corresponding feature point according to the camera position using a triangulation method to obtain sparse point cloud data of the plant.
[0059] Step 103, inputting the initial image sequences under multiple viewing angles into the SAM model in the tracking network, and performing foreground segmentation processing on the initial image sequence under each viewing angle using the SAM model to obtain initial segmented plant foreground data.
[0060] Step 104 , performing edge thinning processing on the initial segmented plant foreground data at each viewing angle using the corresponding initial image to obtain an intermediate segmented plant foreground corresponding to each viewing angle.
[0061] Step 105 , spatially aligning the middle segmented plant foregrounds corresponding to each viewing angle to obtain aligned feature data.
[0062] Step 106, inputting the aligned feature data into the tracking network, using the similarity algorithm in the tracking network to analyze and remove incomplete features, and obtaining the results of segmenting the plant foreground at each viewing angle.
[0063] Step 107, determining initial Gaussian points according to the sparse point cloud data, and performing Gaussian reconstruction and visualization rendering processing on the segmented plant foreground results of each viewing angle based on the initial Gaussian points to obtain three-dimensional plant rendering results of each viewing angle.
[0064] Step 108, gridding the 3D plant rendering results of each viewing angle to generate a plant 3D grid surface image corresponding to each viewing angle, so as to perform plant morphological analysis based on the plant 3D grid surface image.
[0065] According to the above scheme, the plant images collected by a general camera may be multi-perspective, so the features of the initial image sequence of the plant under multiple perspectives will be extracted, and the camera position of the feature point will be determined, so as to facilitate the determination of the point cloud by triangulation according to the camera position, and then obtain the sparse point cloud data of the plant; this scheme introduces a tracking network improved in combination with the SAM model, so that the initial image sequence under each perspective can be segmented by using the tracking network, and then the initial segmented plant foreground data of only the plant part is obtained to avoid the interference of the background content, and in order to improve the accuracy of the initial segmented plant foreground data, the edge will be refined, and the various perspectives will be spatially aligned, and the aligned feature data will be used to remove incomplete features by the tracking network to obtain accurate segmented plant foreground results of each perspective; the segmented plant foreground results of each perspective are processed by Gaussian reconstruction and visual rendering to obtain a three-dimensional plant rendering result, but the three-dimensional plant rendering result may not be directly used for plant morphological analysis, and it is necessary to perform gridded three-dimensional surface processing to obtain a three-dimensional grid surface image of the plant under each perspective, so that the plant morphological analysis can be better performed based on the three-dimensional grid surface image of the plant.
[0066] In some embodiments, step 101 includes:
[0067] Step 1011, determining the grayscale value of the initial image sequence corresponding to each viewing angle.
[0068] In specific implementation, the first choice is to collect the initial image sequence of plants in various viewing angles in a specific scene, wherein the specific scene may be a scene formed by different locations and / or different times and / or different plants.
[0069] Step 1012, using the scale-invariant feature transformation method of each viewing angle, using a Gaussian function to extract features from the grayscale values of the initial image sequence of the corresponding viewing angle, to obtain extracted feature points.
[0070] The global scale-invariant feature transform (SIFT) is used to extract features from all initial image sequences. The SIFT algorithm can find key points in different scale spaces and calculate their directions and descriptors, providing a reliable basis for subsequent feature point matching. The feature extraction representation of SIFT is shown in Formula 1.
[0071] , Formula 1.
[0072] in, is in scale The pixel points in the initial image sequence The gray value of the position, is a Gaussian function, which is used to simulate the smoothing effect of images at different scales. It represents the intensity of feature points in the scale space, i.e. the extracted feature points.
[0073] In some embodiments, step 102 includes:
[0074] Step 1021 , matching the extracted feature points according to the fast nearest neighbor search library by minimizing the Euclidean distance to obtain a feature point matching result.
[0075] In the specific implementation, the extracted feature points are matched based on the FLANN (Fast Library for Approximate Nearest Neighbors) fast neighbor search library method to estimate the camera pose. In particular, the feature points of each group of images in the three initial image sequences are matched between each other, but not across groups, to ensure the accuracy and efficiency of the matching. Feature point matching can be achieved by minimizing the Euclidean distance between feature points, as shown in Formula 2.
[0076] , Formula 2.
[0077] in, Respectively represent the positions of two feature points in their respective initial image sequences, Represents the distance between the two points. By calculating the distances of all feature point pairs and selecting the minimum value, the best matching pair can be determined and the feature point matching result can be obtained.
[0078] Step 1022: Perform pose matching using a PnP algorithm based on the feature point matching result to determine the camera position of the feature point.
[0079] In specific implementation, the camera position is calculated using the PnP (Perspective-n-Point) algorithm based on the feature point matching results, as shown in Formula 3. When the positions of the matching points in a certain world coordinate system are known, the camera position corresponding to each feature point can be calculated more accurately.
[0080] , Formula 3.
[0081] Where (u, v) is a point in the image coordinate system, K is the camera intrinsic matrix, R and t represent the rotation and translation of the camera relative to the world coordinate system, respectively. (X, Y, Z) is a point in the world coordinate system, and s is the scaling factor.
[0082] Step 1023, according to the camera position and the position of the feature point, the coordinates of the feature point in the three-dimensional space are calculated by using triangulation method, and the sparse point cloud data of the plant is determined according to the coordinates.
[0083] In specific implementation, based on the known camera position and the positions of the feature points in the initial image sequence, the coordinates of the feature points in three-dimensional space can be calculated through triangulation, thereby obtaining sparse point cloud data (a point cloud is a collection of a series of three-dimensional points in space).
[0084] Assume that in the images of the two initial image sequences, there are feature points and , and the corresponding camera pose and , the coordinates in three-dimensional space can be obtained by solving the following set of equations :
[0085] ,in, and is the scaling factor.
[0086] In some embodiments, step 103 includes:
[0087] like Figure 4 The flowchart of foreground segmentation shown in FIG. 1 determines the initial image sequence according to the input video, for each of the multiple perspectives:
[0088] Step 1031, determine the user's selected target point for the initial image sequence under the viewing angle, input the selected target point and the initial image sequence under the viewing angle into the SAM model in the tracking network, perform image standardization processing, and obtain standardized data.
[0089] In specific implementation, the Track Anything Model (TAM) is a video segmentation model that combines the latest and most effective image segmentation model segment anything model (SAM).
[0090] The plant image sequence obtained by extracting frames from the initial image sequence of the viewpoint is input into the tracking network. The user selects a plant image under a specific viewpoint from the plant image sequence, and then manually selects the target point in the foreground area of the plant image. These selected target points and the plant image sequence obtained by extracting frames are input into the SAM model for processing.
[0091] In the Vision Transformer processing stage, the input plant image sequence is normalized.
[0092] Step 1032, using the multi-head attention mechanism in the SAM model to perform residual connection and a second normalization on the normalized data to obtain the second normalized data.
[0093] In specific implementation, the multi-head attention mechanism enables the SAM model to process plant images in parallel in different representation spaces, as shown in Formula 4.
[0094] , Formula 4.
[0095] Among them, Q, K, V are query, key and value matrices respectively. is the dimension of the key vector.
[0096] After adding the multi-head attention mechanism, residual connection and secondary normalization are performed to obtain the data after secondary normalization.
[0097] Step 1033, using the multi-layer perceptron MLP in the SAM model to process the data after the secondary normalization processing, adding the output result of the multi-layer perceptron MLP to the data after the secondary normalization processing to form a residual connection, and obtaining the embedding result of the image.
[0098] In specific implementation, the multi-head attention mechanism in the SAM model is connected to the multi-layer perceptron MLP, which consists of two fully connected layers and a ReLU activation function, as shown in Formula 5:
[0099] , Formula 5.
[0100] Where x is the vector of input data after secondary normalization, W1 is the weight matrix of the first layer, b1 is the bias vector of the first layer; W2 is the weight matrix of the second layer, and b2 is the bias vector of the second layer.
[0101] The entire MLP process consists of two fully connected layers and a ReLu activation function. The fully connected layer includes a weight matrix and a bias vector.
[0102] In the first layer, the input x is weighted and summed by the weight matrix W1 and the bias b1 is added; the calculation result is nonlinearly transformed by the ReLU activation function.
[0103] Then enter the second layer, the output of ReLU is weighted summed by the second layer weight matrix W2, and the bias b2 is added.
[0104] The output of the MLP is added to the result before being input into the MLP to form a residual connection to enhance the model’s ability to learn about plants at different scales.
[0105] After deep feature extraction in the vision transformer stage, image embeddings are generated.
[0106] Step 1034, performing position coding processing on the selected target point to obtain a position coding result.
[0107] The selected target point selected by the user is sent to the position encoding part to help the SAM model understand the location of the foreground features. Position encoding uses changes in sine and cosine functions, as shown in Formula 6 and Formula 7.
[0108] , Formula 6.
[0109] , Formula 7.
[0110] Among them, pos is the position index, i is the dimension index, and d model is the dimension of the encoding.
[0111] Step 1035, using the self-attention mechanism in the SAM model to analyze the relationship between the various parts of the image based on the embedding result of the image and the position encoding result, and using the cross-attention mechanism in the SAM model to strengthen the correlation between the specific part of the image and the selected target point based on the embedding result of the image and the position encoding result.
[0112] In the mask decoder stage, the self-attention mechanism and the cross-attention mechanism are used to process the image embedding results and position encoding results. The self-attention mechanism helps the SAM model better understand the relationship between the parts of the image, while the cross-attention mechanism is used to strengthen the correlation between the specific parts of the image and the input points, thereby improving the accuracy of plant foreground segmentation.
[0113] Step 1036, based on the relationship between the various parts of the image and the correlation between the specific part of the image and the selected target point, foreground segmentation processing is performed to obtain initial segmented plant foreground data.
[0114] Based on the improved tracking network, combined with the pre-trained Segment Anything Model (SAM) and XMem video tracking and segmentation algorithm, it is possible to accurately segment the foreground of plants in a continuous initial image sequence in any scene, significantly improving the accuracy and efficiency of foreground segmentation.
[0115] like Figure 5 As shown, it is a schematic diagram of the process of foreground segmentation for each perspective.
[0116] In some embodiments, step 104 includes:
[0117] For each of the multiple perspectives:
[0118] Step 1041 , inputting the initial image sequence and initial segmented plant foreground data under the viewing angle into the tracking network.
[0119] Step 1042 , using the XMem model in the tracking network, semi-supervised (VOS) processing is performed based on the initial segmented plant foreground data to obtain optimized initial segmented plant foreground data.
[0120] Step 1043, using the SAM model in the tracking network, based on the initial image sequence at the viewing angle, edge refinement processing is performed on the optimized initial segmented plant foreground data to obtain the intermediate segmented plant foreground corresponding to the viewing angle.
[0121] Through the above scheme, the purpose of tracking the target plants in the image can be achieved, and the segmentation effect of the plant foreground can be further improved.
[0122] In some embodiments, step 105 includes:
[0123] Step 1051 , extracting multi-scale features from the middle segmented plant foreground corresponding to each viewing angle.
[0124] Step 1052, using the ICP registration algorithm to spatially align the intermediate segmented plant foregrounds of each perspective according to the multi-scale features, and perform feature weighted averaging processing on the intermediate segmented plant foregrounds after spatial alignment to obtain aligned feature data.
[0125] Among them, the ICP matching algorithm is a method of point cloud registration. It inputs two point clouds and then obtains an R&T matrix, which can make one point cloud overlap with the other point cloud as much as possible after R&T changes.
[0126] Then, execute step 106 of "inputting the aligned feature data into the tracking network, using the similarity algorithm in the tracking network to analyze and remove incomplete features, and obtaining the segmented plant foreground results of each viewing angle" to complete the foreground segmentation process.
[0127] Figure 6 A schematic diagram of the process of Gaussian rendering and face extraction is shown.
[0128] In some embodiments, step 107 includes:
[0129] Step 1071, determine initial Gaussian points according to the sparse point cloud data, perform clustering mean processing on the initial Gaussian points based on the K-Means clustering algorithm, and obtain the mean result of the Gaussian points.
[0130] In specific implementation, the initial Gaussian points can be obtained from the sparse point cloud. The mathematical representation of each Gaussian point in the initial Gaussian points is shown in Formula 8.
[0131] , Formula 8.
[0132] Among them, x is any point in the space of sparse point cloud data, μ is the mean of Gaussian distribution, that is, the center position of each Gaussian point in the initial Gaussian point, is the three-dimensional covariance matrix that controls the shape and direction of the Gaussian distribution.
[0133] The input sparse point cloud data contains background and plant foreground. In order to improve the efficiency of subsequent plant foreground rendering, the mean μ of Gaussian points is initialized based on K-Means clustering. Assume that the input sparse point cloud data is , P i is a point in the point cloud, and the cluster center is μ j , then update each cluster center as shown in Formula 9.
[0134] , Formula 9.
[0135] Among them, C j is the set of points in the jth cluster, It is C j The number of midpoints, C j The sum of the position vectors of all points in .
[0136] Step 1072: Determine an initialized three-dimensional covariance matrix using the scaling transformation and the rotation transformation matrix, and perform a two-dimensional projection calculation based on the three-dimensional covariance matrix to obtain a two-dimensional covariance matrix.
[0137] Define scaling and rotation transformation matrices to initialize parameters , as shown in Formula 10.
[0138] , Formula 10.
[0139] Among them, R(q) is the rotation transformation expressed by the quaternion q, and S(s) is the scaling transformation, represented by a 3D vector s.
[0140] From 3D Gaussian Splatting to a plane, and then through Tiled-basedRasterizer, we get the 3D digital plant rendering result.
[0141] The so-called three-dimensional rendering is actually to show users plant pictures from various angles in real time during the dragging process. Therefore, to achieve three-dimensional rendering, it is necessary to calculate the two-dimensional projection results of the 3D points at each viewing angle. In the above embodiment, the 3D Gaussian points are initialized and optimized. In this step, the 3D Gaussian points need to be projected onto a two-dimensional plane for rendering.
[0142] The purpose of calculating the projected two-dimensional covariance matrix is to project the Gaussian points in the three-dimensional space onto the two-dimensional image plane and render them on the image plane. By calculating the projected two-dimensional covariance matrix, the shape and distribution of each Gaussian point on the image plane can be accurately represented, thereby achieving high-quality rendering.
[0143] Use the Gaussian splatting method for rendering (splatting). Calculate the two-dimensional covariance matrix of the projection according to formula 11.
[0144] , Formula 11.
[0145] Among them, J represents the Jacobian Matrix, which describes the partial derivatives of each variable in the projection transformation for different coordinates, and W represents the rotation and translation matrix (corresponding to the previous camera pose ).
[0146] Step 1073: Multiply the mean value of the Gaussian points by the two-dimensional covariance matrix and perform Gaussian processing to obtain the image intensity.
[0147] Step 1074, determining the opacity of each Gaussian point, and determining the image color according to the opacity.
[0148] Rendering is performed based on the Tiled-based Rasterizer method. After projection transformation (the projection transformation here refers to multiplying the 3D Gaussian point by the above covariance matrix), the opacity of each Gaussian point is calculated using formula 12, and the final image is synthesized.
[0149] , Formula 12.
[0150] in, α is the opacity of the three-dimensional Gaussian point, and α' is the opacity of the projected two-dimensional Gaussian point.
[0151] C is the image color, and the final color of the overall image is calculated by mixing alpha synthesis, as shown in the formula:
[0152]
[0153] in, is the color learned by the model, and The calculated opacity.
[0154] Step 1075, based on the image intensity and the image color obtained by the Gaussian processing, a Gaussian rendering model is used for processing, and a loss function of the Gaussian rendering model is determined. After optimizing the parameters of the loss function, the Gaussian rendering model is back-propagated, so that the Gaussian rendering model can be used to perform color rendering on the segmented plant foreground result based on the image intensity and the image color obtained by the Gaussian processing, and obtain three-dimensional plant rendering results from various perspectives.
[0155] In the specific implementation, after the projection process, the loss function of the Gaussian rendering model is defined to update and optimize the parameters and back propagate. Since only the plant foreground is concerned during the visualization rendering process, a higher weight is assigned to the plant foreground pixels, and the loss function is shown in Formula 13.
[0156] , Formula 13.
[0157] in, is the weight for each pixel, N is the number of pixels in the target data, is the image intensity rendered by the current Gaussian parameters, For the actual image The strength of the place.
[0158] The parameters are updated by the gradient descent method to reduce the loss function value, as shown in Formula 14.
[0159] , Formula 14.
[0160] Among them, β is the learning rate, which controls the step size of parameter update.
[0161] According to the calculated color and opacity, each Gaussian point can be rendered on the image plane at each angle to synthesize the image. Under any user's observation angle (camera angle), the corresponding projection image can be calculated to obtain a full range of 3D plant rendering results from various angles.
[0162] In some embodiments, step 108 includes:
[0163] Although the three-dimensional (3D) Gaussian rendering representation method is a new 3D representation method, traditional 3D measurement methods still mainly rely on meshed 3D surfaces for calculation.
[0164] For each of the multiple perspectives:
[0165] Step 1081, using the regularization algorithm to optimize the loss function of the Gaussian rendering model, and using the three-dimensional plant rendering result of the viewing angle to perform secondary training processing on the Gaussian model to obtain a Gaussian distribution image that fits the plant surface.
[0166] In the specific implementation, the loss function is optimized by introducing the regularization term, and the Gaussian model is trained twice based on the Gaussian rendering results to obtain a Gaussian distribution image (3D Gaussian distribution) that closely fits the plant surface.
[0167] The method mainly consists of three steps, namely (1) calculating the SDF value to make the Gaussian closer to the plant surface; (2) optimizing the density function in combination with the depth map mapping method to increase the overlap between 3D Gaussians; and (3) reducing the scaling factor of the 3D Gaussian to make it smoother and fit the plant surface.
[0168] Through the new regularization term optimization method, it is possible to train a 3D Gaussian distribution that mostly overlaps and completely fits the plant surface.
[0169] Step 1082 , performing upsampling processing based on the density of the Gaussian distribution image that fits the plant surface to obtain dense plant feature points.
[0170] Step 1083, determine the 3D network model by using Poisson reconstruction, bind the dense plant feature points to the 3D network model, and obtain the plant three-dimensional mesh patch image corresponding to the viewing angle.
[0171] In the specific implementation, the SDF method is further combined in the process of mesh reconstruction to optimize the mesh quality. Finally, the 3D Gaussian is re-bound on the mesh surface to obtain a more refined plant 3D mesh patch image.
[0172] The processing results of this application scheme are analyzed in detail below.
[0173] like Figure 7 As shown, this is the plant foreground segmentation result, which can accurately segment the plant foreground.
[0174] like Figure 8 As shown in the figure, it is a schematic diagram of foreground segmentation of single view and multi-view. Figure 8 The foreground segmentation results of multiple views can be accurately obtained.
[0175] like Fig. 9 As shown, it is the three-dimensional Gaussian visualization rendering result, which can obtain accurate visualization rendering results.
[0176] Pure three-dimensional rendering is difficult to bring out more possibilities in actual agricultural production. Therefore, a method of converting the three-dimensional visualization results of plants into real measurable 3D points. After three-dimensional Gaussian sputtering optimization, the Gaussian distribution is not an ordered structure and does not correspond well to the actual surface of the scene. Therefore, a method of extracting accurate faces from 3D Gaussian results is explored. Based on the method of this application, accurate plant faces are successfully extracted, and their height, volume, leaf area, stem-leaf angle and other properties can be directly measured, or new models can be built to perform detailed point cloud processing such as leaf segmentation and plant characteristic analysis.
[0177] It is worth mentioning that although the measurable patches are extracted from the plant rendering results to facilitate subsequent calculations through traditional point cloud processing, the 3D Gaussian representation, as an efficient means of combining new scene representation with traditional rendering methods, is more importantly, its own explicit function representation (different from Nerf's implicit neural network), which is enough to cause a revolution in the field of three-dimensional phenotypic measurement. This application can easily import the 3D Gaussian representation into common software such as Unity for secondary editing through the corresponding plug-in.
[0178] It should be noted that the method of the embodiment of the present application can be performed by a single device, such as a computer or server. The method of this embodiment can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present application, and the multiple devices will interact with each other to complete the described method.
[0179] It should be noted that the above describes some embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0180] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a plant image processing device based on three-dimensional phenotypic modeling.
[0181] refer to Fig.10 , a plant image processing device based on three-dimensional phenotypic modeling, comprising:
[0182] The feature extraction module 201 is configured to perform feature extraction processing on the initial image sequence of the plant at multiple viewing angles to obtain extracted feature points;
[0183] The sparse point cloud module 202 is configured to determine the camera position corresponding to the feature point, and process the corresponding feature point according to the camera position using triangulation to obtain sparse point cloud data of the plant;
[0184] The initial segmentation module 203 is configured to input the initial image sequences under multiple viewing angles into the SAM model in the tracking network, and perform foreground segmentation processing on the initial image sequence under each viewing angle using the SAM model to obtain initial segmented plant foreground data;
[0185] The intermediate segmentation module 204 is configured to perform edge thinning processing on the initial segmented plant foreground data at each viewing angle using the corresponding initial image to obtain the intermediate segmented plant foreground corresponding to each viewing angle;
[0186] The alignment processing module 205 is configured to perform spatial alignment processing on the middle segmented plant foregrounds corresponding to each viewing angle to obtain aligned feature data;
[0187] The omnidirectional segmentation module 206 is configured to input the aligned feature data into the tracking network, and use the similarity algorithm in the tracking network to analyze and remove incomplete features, so as to obtain the segmentation results of the plant foreground at each viewing angle;
[0188] The Gaussian rendering module 207 is configured to determine initial Gaussian points according to the sparse point cloud data, and perform Gaussian reconstruction and visualization rendering processing on the segmented plant foreground results of each viewing angle based on the initial Gaussian points to obtain three-dimensional plant rendering results of each viewing angle;
[0189] The surface block processing module 208 is configured to perform gridded 3D surface processing on the 3D plant rendering results of each viewing angle to generate a plant 3D grid surface image corresponding to each viewing angle; so as to perform plant morphological analysis based on the plant 3D grid surface image.
[0190] In some embodiments, the feature extraction module 201 is specifically configured to:
[0191] Determine the grayscale value of the initial image sequence corresponding to each viewing angle;
[0192] By utilizing the scale-invariant feature transformation method of each viewing angle, a Gaussian function is used to extract features from the grayscale values of the initial image sequence of the corresponding viewing angle to obtain the extracted feature points.
[0193] In some embodiments, the sparse point cloud module 202 is specifically configured to:
[0194] According to the fast nearest neighbor search library, the feature points extracted are matched by minimizing the Euclidean distance to obtain a feature point matching result;
[0195] Based on the feature point matching result, a PnP algorithm is used to perform posture matching to determine the camera position of the feature point;
[0196] According to the camera position and the position of the feature point, the coordinates of the feature point in the three-dimensional space are calculated using triangulation, and the sparse point cloud data of the plant is determined according to the coordinates.
[0197] In some embodiments, the initial segmentation module 203 is specifically configured to:
[0198] For each of the multiple perspectives:
[0199] Determine the target point selected by the user for the initial image sequence under the viewing angle, input the selected target point and the initial image sequence under the viewing angle into the SAM model in the tracking network, perform image standardization processing, and obtain standardized data;
[0200] Performing residual connection and second normalization on the normalized data using the multi-head attention mechanism in the SAM model to obtain second normalized data;
[0201] The data after the secondary normalization processing is processed by using the multi-layer perceptron MLP in the SAM model, and the output result of the multi-layer perceptron MLP is added to the data after the secondary normalization processing to form a residual connection to obtain an embedding result of the image;
[0202] Performing position coding processing on the selected target point to obtain a position coding result;
[0203] Using the self-attention mechanism in the SAM model to analyze the relationship between the parts of the image according to the embedding result of the image and the position encoding result, and using the cross-attention mechanism in the SAM model to strengthen the correlation between the specific part of the image and the selected target point according to the embedding result of the image and the position encoding result;
[0204] Based on the relationship between the various parts of the image and the correlation between the specific part of the image and the selected target point, foreground segmentation processing is performed to obtain initial segmented plant foreground data.
[0205] In some embodiments, the middle segmentation module 204 is specifically configured to:
[0206] For each of the multiple perspectives:
[0207] Input the initial image sequence and initial segmented plant foreground data under the viewing angle into the tracking network;
[0208] Using the XMem model in the tracking network, semi-supervised processing is performed based on the initial segmented plant foreground data to obtain optimized initial segmented plant foreground data;
[0209] The SAM model in the tracking network is used to perform edge refinement processing on the optimized initial segmented plant foreground data based on the initial image sequence at the viewing angle to obtain the intermediate segmented plant foreground corresponding to the viewing angle.
[0210] In some embodiments, the alignment processing module 205 is specifically configured to:
[0211] Extract multi-scale features for the intermediate segmented plant foreground corresponding to each perspective;
[0212] The ICP registration algorithm is used to spatially align the intermediate segmented plant foregrounds of each viewing angle according to the multi-scale features, and feature weighted averaging is performed on the intermediate segmented plant foregrounds after spatial alignment to obtain aligned feature data.
[0213] In some embodiments, the Gaussian rendering module 207 is specifically configured to:
[0214] Determine initial Gaussian points according to the sparse point cloud data, perform clustering mean processing on the initial Gaussian points based on the K-Means clustering algorithm, and obtain a mean result of the Gaussian points;
[0215] The initialization of the three-dimensional covariance matrix is determined by using the scaling transformation and the rotation transformation matrix, and the two-dimensional covariance matrix is obtained by performing a two-dimensional projection calculation based on the three-dimensional covariance matrix;
[0216] Multiplying the mean result of the Gaussian points by the two-dimensional covariance matrix to perform Gaussian processing to obtain image intensity;
[0217] Determine the opacity of each Gaussian point, and determine the image color according to the opacity;
[0218] Based on the image intensity and the image color obtained by the Gaussian processing, a Gaussian rendering model is used for processing, and a loss function of the Gaussian rendering model is determined. After optimizing the parameters of the loss function, the Gaussian rendering model is back-propagated, so that the Gaussian rendering model can be used to perform color rendering on the segmented plant foreground result based on the image intensity and the image color obtained by the Gaussian processing, and obtain three-dimensional plant rendering results from various perspectives.
[0219] In some embodiments, the face block processing module 208 is specifically configured to:
[0220] For each of the multiple perspectives:
[0221] The loss function of the Gaussian rendering model is optimized using the regularization algorithm, and the Gaussian model is trained again using the three-dimensional plant rendering results of this perspective to obtain a Gaussian distribution image that fits the plant surface.
[0222] Perform upsampling processing based on the density of the Gaussian distribution image that fits the plant surface to obtain dense plant feature points;
[0223] The 3D network model is determined by using a Poisson reconstruction method, and the dense plant feature points are bound to the 3D network model to obtain a three-dimensional mesh patch image of the plant corresponding to the viewing angle.
[0224] For the convenience of description, the above device is described in terms of functions divided into various modules. Of course, when implementing the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0225] The device of the above embodiment is used to implement the corresponding method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0226] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in any of the above embodiments when executing the program.
[0227] Fig.11 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.
[0228] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0229] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.
[0230] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0231] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0232] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010 , the memory 1020 , the input / output interface 1030 , and the communication interface 1040 ).
[0233] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.
[0234] The electronic device of the above embodiment is used to implement the corresponding method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0235] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments, the present application also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the method described in any of the above embodiments.
[0236] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0237] The computer instructions stored in the storage medium of the above embodiments are used to enable the computer to execute the method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0238] Based on the same concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a computer program product, including computer program instructions. When the computer program instructions are run on a computer, the computer executes the method described in any of the above embodiments, which has the beneficial effects of the corresponding method embodiments and will not be repeated here.
[0239] It is understandable that before using the technical solutions of each embodiment of the present disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved will be informed to the user in an appropriate manner, and the user's authorization will be obtained.
[0240] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly remind the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can independently choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0241] As an optional but non-limiting implementation, in response to receiving the user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0242] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0243] A person skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.
[0244] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present application difficult to understand, the known power / ground connections to the integrated circuit (IC) chip and other components may or may not be shown in the provided drawings. In addition, the device may be shown in the form of a block diagram to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the embodiments of the present application are to be implemented (that is, these details should be fully within the scope of understanding of those skilled in the art). Where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present application, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details or with changes in these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0245] Although the present application has been described in conjunction with specific embodiments of the present application, many alternatives, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the discussed embodiments.
[0246] The embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the scope of protection of the present application.
Claims
1. A plant image processing method based on three-dimensional phenotypic modeling, characterized in that: include: Perform feature extraction processing on the initial image sequence of the plant at multiple viewing angles to obtain extracted feature points; Determine the camera position corresponding to the feature point, and process the corresponding feature point according to the camera position using triangulation to obtain sparse point cloud data of the plant; The initial image sequences under multiple viewing angles are input into the SAM model in the tracking network, and the SAM model is used to perform foreground segmentation processing on the initial image sequence under each viewing angle to obtain initial segmented plant foreground data; For the initial segmented plant foreground data at each viewing angle, edge thinning is performed using the corresponding initial image to obtain an intermediate segmented plant foreground corresponding to each viewing angle; Perform spatial alignment processing on the middle segmented plant foregrounds corresponding to each viewing angle to obtain aligned feature data; Inputting the aligned feature data into the tracking network, using the similarity algorithm in the tracking network to analyze and remove incomplete features, and obtaining the segmentation results of the plant foreground at each viewing angle; Determine initial Gaussian points according to the sparse point cloud data, and perform Gaussian reconstruction and visualization rendering processing on the segmented plant foreground results of each viewing angle based on the initial Gaussian points to obtain three-dimensional plant rendering results of each viewing angle; Performing gridding 3D surface processing on the 3D plant rendering result of each viewing angle to generate a 3D plant grid surface image corresponding to each viewing angle, so as to perform plant morphological analysis based on the 3D plant grid surface image; The spatial alignment of the intermediate segmented plant foregrounds corresponding to each viewing angle to obtain aligned feature data includes: Extract multi-scale features for the intermediate segmented plant foreground corresponding to each perspective; The ICP registration algorithm is used to spatially align the intermediate segmented plant foregrounds of each viewing angle according to the multi-scale features, and feature weighted averaging is performed on the intermediate segmented plant foregrounds after spatial alignment to obtain aligned feature data.
2. The method according to claim 1, characterized in that The feature extraction process is performed on the initial image sequence of the plant at multiple viewing angles to obtain the extracted feature points, including: Determine the grayscale value of the initial image sequence corresponding to each viewing angle; By utilizing the scale-invariant feature transformation method of each viewing angle, a Gaussian function is used to extract features from the grayscale values of the initial image sequence of the corresponding viewing angle to obtain the extracted feature points.
3. The method according to claim 1, characterized in that The determining of the camera position corresponding to the feature point and processing the corresponding feature point according to the camera position by using triangulation to obtain sparse point cloud data of the plant includes: According to the fast nearest neighbor search library, the feature points extracted are matched by minimizing the Euclidean distance to obtain a feature point matching result; Based on the feature point matching result, a PnP algorithm is used to perform posture matching to determine the camera position of the feature point; According to the camera position and the position of the feature point, the coordinates of the feature point in the three-dimensional space are calculated using triangulation, and the sparse point cloud data of the plant is determined according to the coordinates.
4. The method according to claim 1, characterized in that: The initial image sequences under multiple viewing angles are input into the SAM model in the tracking network, and the SAM model is used to perform foreground segmentation processing on the initial image sequence under each viewing angle to obtain initial segmented plant foreground data, including: For each of the multiple perspectives: Determine the target point selected by the user for the initial image sequence under the viewing angle, input the selected target point and the initial image sequence under the viewing angle into the SAM model in the tracking network, perform image standardization processing, and obtain standardized data; Performing residual connection and second normalization on the normalized data using the multi-head attention mechanism in the SAM model to obtain second normalized data; The data after the secondary normalization processing is processed by using the multi-layer perceptron MLP in the SAM model, and the output result of the multi-layer perceptron MLP is added to the data after the secondary normalization processing to form a residual connection to obtain an embedding result of the image; Performing position coding processing on the selected target point to obtain a position coding result; Using the self-attention mechanism in the SAM model to analyze the relationship between the parts of the image according to the embedding result of the image and the position encoding result, and using the cross-attention mechanism in the SAM model to strengthen the correlation between the specific part of the image and the selected target point according to the embedding result of the image and the position encoding result; Based on the relationship between the various parts of the image and the correlation between the specific part of the image and the selected target point, foreground segmentation processing is performed to obtain initial segmented plant foreground data.
5. The method according to claim 1, characterized in that The initial segmented plant foreground data at each viewing angle is subjected to edge thinning processing using the corresponding initial image to obtain the intermediate segmented plant foreground corresponding to each viewing angle, including: For each of the multiple perspectives: Input the initial image sequence and initial segmented plant foreground data under the viewing angle into the tracking network; Using the XMem model in the tracking network, semi-supervised processing is performed based on the initial segmented plant foreground data to obtain optimized initial segmented plant foreground data; The SAM model in the tracking network is used to perform edge refinement processing on the optimized initial segmented plant foreground data based on the initial image sequence at the viewing angle to obtain the intermediate segmented plant foreground corresponding to the viewing angle.
6. The method according to claim 1, characterized in that The initial Gaussian points are determined according to the sparse point cloud data, and Gaussian reconstruction and visualization rendering are performed on the segmented plant foreground results of each viewing angle based on the initial Gaussian points to obtain three-dimensional plant rendering results of each viewing angle, including: Determine initial Gaussian points according to the sparse point cloud data, perform clustering mean processing on the initial Gaussian points based on the K-Means clustering algorithm, and obtain a mean result of the Gaussian points; The initialization of the three-dimensional covariance matrix is determined by using the scaling transformation and the rotation transformation matrix, and the two-dimensional covariance matrix is obtained by performing a two-dimensional projection calculation based on the three-dimensional covariance matrix; Multiplying the mean result of the Gaussian points by the two-dimensional covariance matrix to perform Gaussian processing to obtain image intensity; Determine the opacity of each Gaussian point, and determine the image color according to the opacity; Based on the image intensity and the image color obtained by the Gaussian processing, a Gaussian rendering model is used for processing, and a loss function of the Gaussian rendering model is determined. After optimizing the parameters of the loss function, the Gaussian rendering model is back-propagated, so that the Gaussian rendering model can be used to perform color rendering on the segmented plant foreground result based on the image intensity and the image color obtained by the Gaussian processing, and obtain three-dimensional plant rendering results from various perspectives.
7. The method according to claim 6, characterized in that The three-dimensional plant rendering result of each viewing angle is subjected to gridding three-dimensional surface processing to generate a three-dimensional grid surface image of the plant corresponding to each viewing angle, including: For each of the multiple perspectives: The loss function of the Gaussian rendering model is optimized using the regularization algorithm, and the Gaussian model is trained again using the three-dimensional plant rendering results of this perspective to obtain a Gaussian distribution image that fits the plant surface. Perform upsampling processing based on the density of the Gaussian distribution image that fits the plant surface to obtain dense plant feature points; The 3D network model is determined by using a Poisson reconstruction method, and the dense plant feature points are bound to the 3D network model to obtain a three-dimensional mesh patch image of the plant corresponding to the viewing angle.
8. A plant image processing device based on three-dimensional phenotypic modeling, characterized in that: include: A feature extraction module is configured to perform feature extraction processing on an initial image sequence of the plant at multiple viewing angles to obtain extracted feature points; A sparse point cloud module is configured to determine the camera position corresponding to the feature point, and process the corresponding feature point according to the camera position using triangulation to obtain sparse point cloud data of the plant; An initial segmentation module is configured to input the initial image sequences under multiple viewing angles into the SAM model in the tracking network, and use the SAM model to perform foreground segmentation processing on the initial image sequence under each viewing angle to obtain initial segmented plant foreground data; The intermediate segmentation module is configured to perform edge thinning processing on the initial segmented plant foreground data at each viewing angle using the corresponding initial image to obtain an intermediate segmented plant foreground corresponding to each viewing angle; An alignment processing module is configured to perform spatial alignment processing on the middle segmented plant foregrounds corresponding to each viewing angle to obtain aligned feature data; An omnidirectional segmentation module is configured to input the aligned feature data into the tracking network, use the similarity algorithm in the tracking network to analyze and remove incomplete features, and obtain segmented plant foreground results at various viewing angles; A Gaussian rendering module is configured to determine initial Gaussian points according to the sparse point cloud data, and perform Gaussian reconstruction and visualization rendering processing on the segmented plant foreground results of each viewing angle based on the initial Gaussian points to obtain three-dimensional plant rendering results of each viewing angle; A surface block processing module is configured to perform gridding 3D surface processing on the 3D plant rendering result of each viewing angle, and generate a 3D grid surface image of the plant corresponding to each viewing angle; so as to perform plant morphological analysis based on the 3D grid surface image of the plant; The alignment processing module is specifically configured as follows: Extract multi-scale features for the intermediate segmented plant foreground corresponding to each perspective; The ICP registration algorithm is used to spatially align the intermediate segmented plant foregrounds of each viewing angle according to the multi-scale features, and feature weighted averaging is performed on the intermediate segmented plant foregrounds after spatial alignment to obtain aligned feature data.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.
