A method for measuring cross-sectional parameters of a watermelon fruit profile based on deep learning
By using deep learning technology and 3D point cloud processing, watermelon fruit parameters can be measured automatically, solving the problems of low efficiency, reliance on manual labor, and high cost of traditional methods, and achieving high-precision and low-cost fruit parameter measurement.
Patent Information
- Application Number
- CN202510707807.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-29
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2045-05-29
AI Technical Summary
Traditional methods for measuring watermelon fruit parameters are inefficient, rely on manual operation, have poor versatility, and are costly, making it difficult to meet the high-throughput measurement needs of modern agriculture.
A deep learning-based approach was adopted to acquire cross-sectional images of watermelons using a left imager, a right imager, and an infrared projector. These images were then converted into 3D point cloud images, and illumination correction and compensation were performed. A pre-trained U-Net improved model was used for segmentation, and the cross-sectional area of the fruit was calculated by combining Delaunay triangulation and Heron's formula.
It has enabled automated measurement of watermelon fruit parameters, improving measurement accuracy and efficiency, adapting to different fruit shapes, and reducing manual intervention and equipment costs.
Smart Images

Figure CN120580281B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of fruit parameter measurement, in particular to a watermelon fruit profile cross-section parameter measurement method based on deep learning. BACKGROUND
[0002] The measurement of watermelon fruit parameters has traditionally relied on manual operation or simple image processing techniques. These methods have developed certain application foundations over time: manual measurement methods: the long diameter, short diameter and surface area of the fruit are measured manually using tools such as a tape measure and a caliper; two-dimensional image processing techniques: fruit images are captured using an ordinary camera, and fruit parameters are calculated through image edge detection and geometric shape fitting; three-dimensional modeling techniques: in recent years, three-dimensional laser scanning and structured light technology have been used for fruit phenotype measurement, which can accurately restore the three-dimensional structure of the fruit and improve measurement accuracy.
[0003] However, manual measurement and two-dimensional image processing techniques are inefficient in large-scale fruit sample processing, making it difficult to meet the needs of modern agriculture for high-throughput measurement; manual measurement is susceptible to operator error; two-dimensional image processing techniques cannot accurately restore the three-dimensional characteristics of the fruit, especially when the fruit profile is irregular or there is occlusion, the error is more significant, and the measurement results are easily affected by light, background and fruit morphology, lacking stability; existing technologies generally rely on manual intervention, including manual adjustment of measurement position or parameters, and lack automated data processing and storage functions; many systems can only accommodate specific types of fruit, and have poor versatility; high-precision devices such as three-dimensional laser scanning and structured light are expensive and complex to operate, limiting their application in actual production. SUMMARY
[0004] To overcome the shortcomings of the prior art, the present application aims to provide a watermelon fruit profile cross-section parameter measurement method based on deep learning, which solves the problems of low efficiency and accuracy of traditional methods, reliance on manual operation, poor versatility and high cost.
[0005] To achieve the above-mentioned purpose, the present application provides the following solutions:
[0006] A watermelon fruit profile cross-section parameter measurement method based on deep learning, comprising:
[0007] Using a left imager, a right imager and an infrared projector to capture a watermelon cross-section image of a target watermelon for detection;
[0008] Mapping the watermelon cross-section image into a three-dimensional point cloud image;
[0009] Performing illumination correction and compensation on the three-dimensional point cloud image to obtain a point cloud enhanced image;
[0010] Watermelon cross-section segmentation was performed using a pre-trained U-Net model with embedded DCA modules to obtain a watermelon planar point cloud model.
[0011] The watermelon planar point cloud model is downsampled under a preset voxel grid side length standard to obtain a sparse point cloud model.
[0012] Outlier removal is performed on the sparse point cloud model under preset nearest neighbor values and outlier thresholds to obtain a noise-removed point cloud model.
[0013] The noise-removed cloud model is smoothed using the moving least squares method to obtain a smoothed point cloud model.
[0014] The smooth point cloud model is subjected to Delaunay triangulation under the preset maximum side length, maximum angle, and minimum angle of the triangle to obtain triangular facets;
[0015] The cross-sectional area of the watermelon fruit is obtained by calculating and summing the areas of the triangular facets using Heron's formula.
[0016] Preferably, the watermelon cross-sectional image has a resolution of 848×480 and a bit depth of 24.
[0017] Preferably, the illumination compensation includes logarithmic transformation and exponential transformation.
[0018] Preferably, the standard side length of the voxel grid is 1.00 mm.
[0019] Preferably, the nearest neighbor value is 50; the outlier threshold is 1.0.
[0020] Preferably, the maximum side length of the triangle is 2.00 mm; the maximum angle is 120°; and the minimum angle is 10°.
[0021] Preferably, the mapping formula for the watermelon cross-sectional image includes:
[0022] xw = d / 1000
[0023] yw=d(u-cx) / 1000fx and
[0024] zw = d(v-cy) / 1000fy;
[0025] Where xw, yw, and zw are the abscissa, ordinate, and ordinate of the three-dimensional point cloud image, respectively; d is the depth value; u and v are the U-axis and V-axis coordinates of the pixels in the watermelon cross-section image, respectively; cx and cy are the abscissa and ordinate of the principal point of the depth camera, respectively; and fx and fy are the focal lengths of the depth camera in the X-axis and Y-axis directions, respectively.
[0026] Preferably, the expression of the light correction is:
[0027]
[0028] wherein, is the mapping output of the i-th target component x i ; β i is the i-th correction coefficient; n is the number of components; β0 is the base component.
[0029] The following technical effects are disclosed in the present application:
[0030] The present application provides a watermelon fruit profile cross-section parameter determination method based on deep learning, which automatically segments through a U-Net improved model, solves the defects of traditional manual measurement relying on manual operation and a large amount of manual correction and adjustment required by two-dimensional image processing, and realizes automatic measurement of fruit parameters; by converting the watermelon cross-section image into a three-dimensional point cloud image, the problem of inaccurate measurement caused by perspective error is solved, and the measurement accuracy is improved. BRIEF DESCRIPTION OF DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0032] Figure 1 A watermelon fruit profile segmentation process schematic diagram based on deep learning is provided for the embodiments of the present application;
[0033] Figure 2 A watermelon fruit profile segmentation process flowchart based on deep learning is provided for the embodiments of the present application. DETAILED DESCRIPTION
[0034] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0035] The purpose of the present application is to provide a watermelon fruit profile cross-section parameter determination method based on deep learning, which solves the problems of low efficiency and accuracy, dependence on manual operation, poor universality and high cost of traditional methods.
[0036] In order to make the above objectives, characteristics and advantages of the present application more obvious and easy to understand, the present application will be further described in detail below with reference to the drawings and specific embodiments.
[0037] Figure 1 A deep learning-based watermelon fruit contour segmentation process schematic diagram provided by an embodiment of the present application, Figure 2 A deep learning-based watermelon fruit contour segmentation process diagram provided by an embodiment of the present application, as shown in Figure 1 and Figure 2 The present application provides a deep learning-based watermelon fruit contour cross-sectional parameter measurement method, comprising:
[0038] Step 100: using the left imager, the right imager and the infrared projector to collect a watermelon cross-sectional image of a target watermelon for detection;
[0039] Step 200: mapping the watermelon cross-sectional image into a three-dimensional point cloud image;
[0040] Step 300: performing illumination correction and illumination compensation on the three-dimensional point cloud image to obtain a point cloud enhanced image;
[0041] Step 400: using a pre-trained embedded DCA module U-Net improved model to perform watermelon cross-sectional segmentation to obtain a watermelon planar point cloud model;
[0042] Step 500: performing down-sampling operation on the watermelon planar point cloud model under a preset voxel grid edge length standard to obtain a sparse point cloud model;
[0043] Step 600: performing outlier rejection on the sparse point cloud model under a preset number of adjacent points and an outlier threshold to obtain a noise-removed point cloud model;
[0044] Step 700: using a moving least squares method to perform smoothing processing on the noise-removed point cloud model to obtain a smoothed point cloud model;
[0045] Step 800: performing Delaunay triangulation on the smoothed point cloud model under a preset maximum triangle edge length, maximum angle and minimum angle to obtain a triangular facet;
[0046] Step 900: using the Heron formula to perform area calculation and accumulation on the triangular facet to obtain a watermelon fruit cross-sectional area.
[0047] Preferably, the resolution of the watermelon cross-sectional image is 848x480, and the bit depth is 24.
[0048] Specifically, the illumination compensation comprises logarithmic transformation and exponential transformation.
[0049] Preferably, the voxel grid side length standard is 1.00mm.
[0050] Optionally, the number of near points is 50; and the outlier point threshold is 1.0.
[0051] Preferably, the maximum side length of the triangle is 2.00mm; the maximum angle is 120°; and the minimum angle is 10°.
[0052] Specifically, the mapping relationship of the watermelon cross-sectional image comprises:
[0053] xw=d / 1000,
[0054] yw=d(u-cx) / 1000fx, and
[0055] zw=d(v-cy) / 1000fy.
[0056] wherein xw, yw, zw are the horizontal coordinate, vertical coordinate and vertical coordinate of the three-dimensional point cloud image respectively; d is the depth value; u, v are the U-axis coordinate and V-axis coordinate of the pixel in the watermelon cross-sectional image respectively; cx, cy are the horizontal coordinate and vertical coordinate of the depth camera principal point respectively; fx, fy are the focal length of the depth camera in the X-axis and Y-axis directions respectively.
[0057] Further, the expression of the light correction is:
[0058]
[0059] wherein, is the mapping output of the i-th target component x i ; β i is the i-th correction coefficient; n is the component number; β0 is the basic component.
[0060] Specifically, RealSense D455 depth camera, including a left imager, right imager and an infrared projector. The infrared projector projects an invisible static infrared pattern to improve the depth accuracy of low-texture scenes. Left and right imagers capture the scene and send imager data to the depth imaging (vision) processor, which calculates the depth distance of each pixel in the image by correlating points on the left image with the right image and calculating the parallax by the distance of movement between points on the left image and the right image, thereby inferring the depth information of each pixel point. A depth frame is generated by processing the depth pixel value, and subsequent depth frames will create a depth video stream; a three-dimensional point cloud is generated by the depth map taken by the camera, which needs to construct the mapping relationship between the pixel point and the position in the space. This relationship needs to be determined by the intrinsic and extrinsic parameters of the depth camera. The process of solving these two parameters is camera calibration. According to the camera imaging principle of RealSense, the infrared image and the depth image have unified perspective and resolution. In this embodiment, the infrared image taken at multiple angles and distances is used instead of the depth image as the object of calibration, and the calibration box provided by MATLAB software is used for calibration. The D455 camera is used to take the cross-sectional picture of the cut watermelon in the watermelon greenhouse with a resolution of 848x480 and a bit depth of 24, and the cross-sectional picture of the watermelon is saved as a watermelon cross-sectional dataset.
[0061] Further preparation work:
[0062] 1) Install Anaconda (Anaconda3-2021.04), CUDA (cuda_11.7.1_516.94), Pycarm;
[0063] 2) Create a virtual environment: condacreate-nvisual_intelpython=3.10;
[0064] 3) Activate the virtual environment: condactivatevisual_intel;
[0065] 4) Install dependent packages: torch (1.13.1+cu117-cp310), torchaudio (0.13.1+cu117-cp310), torchvision (0.14.1+cu117-cp310), opencv-python (4.10.0.84), pyrealsense2 (2.55.16486), numpy (2.1.0);
[0066] Specifically, generate a three-dimensional point cloud: the depth map is mapped to the world coordinate system through the pixel coordinate system to convert it into a three-dimensional point cloud. The conversion formula of the coordinates (xw, yw, zw) is as follows:
[0067] xw = d / 1000
[0068] yw = d(u-cx) / 1000fx
[0069] zw = d(v-cy) / 1000fy
[0070] Given the intrinsic and extrinsic parameters of the camera, the above formula is combined to convert the points in the depth map whose pixel value is not 0, generate a three-dimensional point cloud, and save it in a pcd file in the format of PointXYZ. If color coding information is added to the corresponding point position, the point cloud data contains three-dimensional coordinate information and RGB color information, forming a color point cloud, and the point cloud format is PointXYZRGB.
[0071] Preferably, the illumination correction and compensation technology of the stripe image:
[0072] Generally, color correction involves color balance, color temperature adjustment, curve adjustment, etc. The color correction method selected in this embodiment is a color correction method based on polynomial fitting; a polynomial can be used to approximate the mapping relationship from the source space to the target space. A certain output component can be represented by the following polynomial:
[0073]
[0074] In the RGB device color space, x i The original value of the red channel, the original value of the green channel, the original value of the blue channel, the square of the red channel value, the square of the green channel value, the square of the blue channel value, the product of the red channel value and the green channel value, the product of the red channel value and the blue channel value, the product of the green channel value and the blue channel value, etc. Sample the source space, and then obtain the corresponding value of the sample point in the target space. Using mathematical methods, usually least squares method to fit the coefficients in the polynomial, the color correction can be completed.
[0075] Further, the non-linear transformation is a method of gray scale transformation, which can be described as follows: Let the gray scale of a monochrome image f(x, y) be r, and after a certain non-linear transformation function s = T(r), it becomes another image g(x, y), whose gray scale is s, and the histograms of the two are p(r) and p(s) respectively. The new histogram p(s) should be determined according to the human visual perception model, and as computer vision requires that the visual acuity response curve of the visual sensor matches the histogram p(x, y) of g(x, y), so as to achieve the best visual effect. There are data that the subjective brightness is the logarithmic function of the incident light intensity (illumination) of the eye. The logarithmic transformation form is as follows:
[0076] g(x, y) = a + ln(f(x, y) + 1) / blnc
[0077] where parameters a, b, c are introduced to adjust the position and shape of the curve. The f(x, y) + 1 in the formula is to ensure that the logarithm is taken for numbers greater than zero. When selecting parameters, experiments show that a = 0, b = 1 / (255*ln1.2), and c = 255 can obtain better light compensation effect. The image after logarithmic transformation is soft, and the image levels are more clear, which conforms to the human visual characteristics, and has good light compensation effect on dark or biased light images. However, for over-bright images, the edges are not clear after logarithmic transformation, and the edge information cannot be extracted, while exponential transformation can solve this problem.
[0078] Specifically, the form of exponential transformation is as follows:
[0079] X_train_log = np.log(X_train + 1) X_test_log = np.log(X_test + 1)
[0080] where X_train is the feature matrix of the training data set; X_test is the feature matrix of the test data set; np.log(·) is the natural logarithm function in the NumPy library, and 1 is added to prevent 0 from appearing in the original data, so 1 is added first and then the logarithm is taken. After a large number of experiments and comparisons, it is found that a = 0, c = 1 / 255, the original gray f(x, y) is converted to the interval [0, 1], and b is 255, to obtain the image g(x, y) with a gray range of [0, 255], which has the opposite effect of the logarithm, which gives a larger expansion to the high gray area of the image and compresses the low gray area. Exponential transformation has a good light compensation effect on over-bright facial images.
[0081] Further, the photographed watermelon cross-section picture data set is expanded by data enhancement (corresponding to the aforementioned Gaussian blur, rotation, brightness adjustment, etc.), and then the improved U-Net neural network training model is used to accurately obtain the long and short diameters, and the point cloud data of all the edges of the watermelon cross-section segmented by the U-Net is obtained, the Euclidean distance of all two points is calculated, and the longest and shortest, i.e. the long and short diameters of the watermelon, are obtained. In this embodiment, the double cross-attention module (DCA) is selected to improve the U-Net structure.
[0082] Specifically, the DCA in the skip connection: the shallow features (more spatial information) in the encoder are directly connected with the deep features (rich semantic information) of the decoder. The DCA module replaces the traditional simple splicing operation, enhancing the interaction between shallow and deep features. The DCA in the bridge layer: located in the bottleneck part between the encoder and the decoder, capturing global context and multi-scale information, enhancing the network's understanding of details and overall structure.
[0083] Further, the encoder outputs: X, which generally represents low-level, high spatial resolution feature maps, with C1 channels and size HxW. The decoder inputs: Y, which represents high-level, strong semantic information feature maps, with C2 channels and size HxW.
[0084] Specifically, the DCA module processes the input features by the following steps:
[0085] 1) Feature transformation:
[0086] Linear transformation is performed on X and Y to generate query vector (Query), key vector (Key) and value vector (Value). This is done through learnable weight matrices, each of which learns different feature subspaces independently. For example, for X, the transformation weights for generating query vector Q, key vector K and value vector V are WQ, WK and WV, respectively.
[0087] 2) Cross-attention computation:
[0088] The encoder feature X and the decoder feature Y are input to each other to extract cross information.
[0089] 3) Attention weight: Similarity is calculated based on the query of X and the key of Y, and the weight is normalized by the softmax function to control the contribution of the value vector.
[0090] 4) Weighted operation: The value vector is weighted with the attention weight to extract the most relevant features.
[0091] 5) Feature fusion: The result after interaction is added to the original feature through residual connection to retain the original feature information and enhance the new feature expression.
[0092] Further, the feature mapping module converts the input features X and Y into a high-dimensional feature space through linear transformation, so that different feature subspaces can interact through attention mechanism. This provides a basis for subsequent cross-attention computation and maps spatial information and semantic information into a unified representation.
[0093] Specifically, the attention mechanism module inputs: the encoder feature as the query and the decoder feature as the key and value (or vice versa). It assigns attention weights according to the similarity of the query and the key, captures the long-distance dependency relationship between the encoder and the decoder features, extracts the part with high information relevance from the decoder feature, and injects it into the encoder feature. The fusion module inputs: the feature obtained by cross-attention computation and the original feature, which ensures the integrity of the information through residual connection. The fused feature contains complementary information of the encoder and decoder features, providing richer semantic guidance for the decoder.
[0094] Further, the cross-attention mechanism realizes feature interaction and information fusion through the following process: the query vector represents the feature demand to be searched. The key and the query measure the relevance of the two features. The value provides specific feature information, and finally the attention weight is selectively fused.
[0095] Specifically, the traditional skip connection directly splices the features, while the DCA module aligns the features of different levels through the attention mechanism, making the shallow features and deep features more accurate in information interaction and reducing the interference of irrelevant information. The DCA module keeps the original information from being lost through the residual connection, and the design of the shared weight matrix reduces the parameter amount, thereby improving the calculation efficiency.
[0096] Preferably, the DCA solves the semantic gap between the encoder features and the decoder features by sequentially capturing the channel and spatial dependencies between the multi-scale encoder features:
[0097] Firstly, the channel cross-attention (CCA) extracts global channel dependencies by utilizing cross-attention of cross-channel tokens of multi-scale encoder features.
[0098] Then, the spatial cross-attention (SCA) module performs cross-attention operation to capture spatial dependencies across spatial tokens.
[0099] Finally, these fine-grained encoder features are upsampled and connected to the corresponding decoder part to form a skip-connection scheme.
[0100] Further, the DCA can be divided into two main stages and three steps:
[0101] The first stage is composed of a multi-scale patch embedding module to obtain encoder tokens.
[0102] The second stage uses channel cross-attention (CCA) and spatial cross-attention (SCA) modules on these encoder tokens to realize DCA to capture long-range dependencies.
[0103] Finally, layer normalization and GeLU are used to serialize and upsample these tokens, and they are connected to the corresponding part of the decoder.
[0104] Specifically, patch extraction in the multi-scale encoder stage:
[0105] Firstly, patches are extracted from N multi-scale encoder stages.
[0106] Given s encoder stages of different scales, the output feature map whose width and height are
[0107] Define block size where s = 1, 2, …, N.
[0108] Use average pooling with size and stride both P s to extract patches and map on flattened two-dimensional patches using 1 x 1 one-dimensional separable convolution (DConv1D) as follows:
[0109] T s = DConv1D(Reshape(AvgPool2D(E s ))
[0110] where, denotes the patch sequence extracted by the s-th encoder stage, P denotes the number of patches in each T s , and is unified for all scales, so that the interaction between these tokens can be directly utilized.
[0111] Specifically, CCA is used to process each token T: The channel cross-attention module (CCA) is a key component of the double cross-attention module (DCA) in the U-Net improved structure, and its design purpose is to enhance the feature expression ability of the network by capturing the inter-channel dependency of the input features. CCA receives multiple input features, normalizes the features through layer normalization (LayerNorm) to eliminate the scale difference, and then unifies the channel number of the features through independent projection operations to generate projection features with a shape of P x Cc. The projected features are integrated into a unified representation through concatenation, and then further generate Query (Q), Key (K) and Value (V) to build an inter-channel attention mechanism. The inter-channel correlation matrix is calculated by transposing Q and K (KT), and the weight matrix is obtained by Softmax normalization, which is used to weight the Value to generate weighted features that combine inter-channel dependencies. Finally, through projection and adjustment, the weighted features are restored to the same shape as the input to facilitate subsequent network processing. CCA module improves the network's ability to capture global and local features by explicitly modeling the interaction between channels, thereby significantly enhancing the performance of U-Net in segmentation tasks. First, each T is subjected to layer normalization (LN), then T s is concatenated along the channel dimension to obtain T c , and T c further generates Query and Value. Depth separable convolution is introduced into self-attention to capture local information and reduce computational complexity.
[0112] Further, according to the watermelon plane point cloud model segmented in the foregoing, the area is calculated. In order to ensure the effect of Delaunay triangulation and the accuracy of watermelon phenotype measurement, the following steps are made:
[0113] 1) The downsampling operation of the original point cloud graph point cloud is performed, the number of point clouds is sparsified, but the shape contour of the watermelon fruit is still maintained, and the voxel grid length is set to 1.00mm;
[0114] 2) The leaf point cloud is subjected to statistical filtering, parameters (the number of adjacent points for statistical filtering query is 50, and the outlier threshold is 1.0) are set, and the outliers are removed;
[0115] 3) The mobile least square method is used to smooth the data points, and the leaf point cloud is fitted into a relatively good three-dimensional curved surface effect;
[0116] 4) Delaunay triangulation is performed, parameters (the maximum side length of the triangle is 2.00mm, the maximum angle is 120°, and the minimum angle is 10°) are set, and the triangular facets of the plane are obtained.
[0117] The area of the triangular facet can be calculated by using the Heron formula, that is, by traversing all the triangular facets in the cross section of the watermelon fruit, the area S is obtained after summation, and the formula is as follows:
[0118] sq=pq(pq-a)(pq-b)(pq-c)
[0119] pq=(a+b+c) / 2
[0120] S=∑sq
[0121] Wherein, sq is the area of the qth triangle, a, b and c are the side lengths of the triangle.
[0122] The beneficial effects of the present application are as follows:
[0123] (1) The present application uses a deep learning model to automatically segment the watermelon fruit contour, replaces the traditional manual annotation or a method depending on a simple threshold, and realizes automatic measurement. In addition, the RealSense D455 camera collects three-dimensional data of the fruit in real time through point cloud technology, and the manual measurement and tedious data preprocessing steps are omitted. The entire measurement process is highly automated, and the acquisition time of the fruit parameters is greatly shortened.
[0124] (2) The present application precisely models the fruit cross section through three-dimensional point cloud data, effectively avoids inaccurate measurement caused by viewing angle error. At the same time, based on the fruit segmentation technology of deep learning, the complex background and different fruit shapes can be processed, the extracted contour is real and reliable, and the accuracy of parameter calculation is further improved.
[0125] (3) The present application strictly calibrates the RealSense D455 depth camera, ensuring the continuity and consistency of the measurement data. In addition, the present application reduces errors caused by fluctuations in the acquisition environment or equipment through point cloud data compensation and optimization algorithms, so that the measurement results of different samples and different batches remain highly consistent.
[0126] (4) The present application directly and automatically saves the measured long diameter, short diameter and area results, reducing the workload of manual recording and managing data. Combined with the associated storage of image and point cloud results, it is also convenient for subsequent analysis, optimizing the operation process of researchers.
[0127] (5) The present application can adapt to the measurement needs of watermelons of different sizes and shapes through the generalization ability of the deep learning model and the flexible adaptation of the point cloud technology. At the same time, the system has high expansibility and can be applied to the parameter measurement of other fruits or crops.
[0128] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be mutually referred to.
[0129] In this embodiment, specific examples are used to illustrate the principles and implementation methods of the present application. The above description of the embodiments is only to help understand the method of the present application and its core idea; at the same time, for those skilled in the art, according to the idea of the present application, the specific implementation method and application range will also be changed. In summary, the content of the specification should not be understood as a limitation of the present application.
Claims
1. A method for determining the cross-sectional parameters of a watermelon fruit profile based on deep learning, characterized in that, include: The cross-sectional images of the watermelon target, a watermelon, were acquired using a left imager, a right imager, and an infrared projector. The watermelon cross-section image is mapped to a three-dimensional point cloud image; The three-dimensional point cloud image is subjected to illumination correction and illumination compensation to obtain an enhanced point cloud image; Watermelon cross-section segmentation was performed using a pre-trained U-Net model with embedded DCA modules to obtain a watermelon planar point cloud model. The watermelon planar point cloud model is downsampled under a preset voxel grid side length standard to obtain a sparse point cloud model. Outlier removal is performed on the sparse point cloud model under preset nearest neighbor values and outlier thresholds to obtain a noise-removed point cloud model. The noise-removed point cloud model is smoothed using the moving least squares method to obtain a smoothed point cloud model. The smooth point cloud model is subjected to Delaunay triangulation under the preset maximum side length, maximum angle, and minimum angle of the triangle to obtain triangular facets; The cross-sectional area of the watermelon fruit is obtained by calculating and summing the areas of the triangular facets using Heron's formula. The mapping relationship of the watermelon cross-section image includes: xw=d / 1000 yw=d(u−cx) / 1000fx and zw = d(v−cy) / 1000fy; Where xw, yw, and zw are the abscissa, ordinate, and ordinate of the three-dimensional point cloud image, respectively; d is the depth value; u and v are the U-axis and V-axis coordinates of the pixels in the watermelon cross-section image, respectively; cx and cy are the abscissa and ordinate of the principal point of the depth camera, respectively; and fx and fy are the focal lengths of the depth camera in the X-axis and Y-axis directions, respectively.
2. The method for determining the cross-sectional parameters of a watermelon fruit profile based on deep learning according to claim 1, characterized in that, The watermelon cross-section image has a resolution of 848×480 and a bit depth of 24.
3. The method for determining the cross-sectional parameters of a watermelon fruit profile based on deep learning according to claim 1, characterized in that, The illumination compensation includes logarithmic transformation and exponential transformation.
4. The method for determining the cross-sectional parameters of a watermelon fruit profile based on deep learning according to claim 1, characterized in that, The standard side length of the voxel grid is 1.00 mm.
5. The method for determining the cross-sectional parameters of a watermelon fruit profile based on deep learning according to claim 1, characterized in that, The nearest neighbor value is 50; the outlier threshold is 1.
0.
6. The method for determining the cross-sectional parameters of a watermelon fruit profile based on deep learning according to claim 1, characterized in that, The maximum side length of the triangle is 2.00 mm; the maximum angle is 120°; and the minimum angle is 10°.
7. The method for determining the cross-sectional parameters of a watermelon fruit profile based on deep learning according to claim 1, characterized in that, The expression for illumination correction is: ; in, For the i-th target component The mapping output; This is the i-th correction coefficient; For the number of components; The basic component.
Citation Information
Patent Citations
Rice quality detection method and device based on three-dimensional image processing and electronic equipment
CN115496756A
Method for estimating weight of cut watermelon in image recognition based on ellipsoid missing model
CN118261962A