Method and device for determining phenotypic parameters of lentinula edodes
Patent Information
- Application Number
- CN202611279878.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-21
- Publication Date
- 2026-10-16
AI Technical Summary
[0004]本发明提供一种香菇的表型参数确定方法和装置,用以解决现有技术中通过SFM-MVS算法重构出香菇完整的三维点云,再基于色彩进行菌菇子实体分割,并在此基础上进行香菇个体空间几何尺寸计算,然而现有香菇三维点云的重建虽能恢复菌菇立体结构,但在弱纹理环境中重建效果差、计算资源消耗大;基于色彩的菌菇分割模型难以准确分割成簇生长的香菇子实体
[0019]The present invention provides a method and apparatus for determining phenotypic parameters of shiitake mushrooms. The method involves acquiring target image data of the mushroom log from multiple viewpoints using a preset camera; determining foreground point cloud data for each viewpoint based on the intrinsic parameter matrix of the preset camera and the target image data; extracting features from the foreground point cloud data for each viewpoint to obtain a fast point feature histogram; performing feature matching based on the fast point feature histogram to obtain multiple corresponding feature point pairs; determining the three-dimensional Euclidean distance between each feature point pair; and setting the threshold where the three-dimensional Euclidean distance in the fast point feature histogram is greater than a certain distance threshold. Feature point pairs are removed to obtain the first feature map corresponding to the viewpoint. For each feature point pair in the first feature map corresponding to the viewpoint, the line segments between the feature point pairs are determined. The difference between the line segments between the feature points and the corresponding line segments in the first feature maps of other viewpoints is determined. Feature point pairs with differences greater than the line segment threshold are removed from all first feature maps to obtain the second feature maps corresponding to each viewpoint. All second feature maps are iteratively fused based on the rigid transformation matrix and the iterative nearest point algorithm to obtain the three-dimensional point cloud data corresponding to the mushroom log. The phenotypic parameters corresponding to multiple shiitake mushrooms on the mushroom log are determined based on the three-dimensional point cloud data. The technical solution of this application acquires target image data from multiple viewpoints through a preset camera, and then recovers the three-dimensional point cloud data representing the structure of substrate-cultivated shiitake mushrooms through multi-view registration, i.e., the removal of outliers, which enhances the construction effect of three-dimensional point cloud data in weak texture environments and reduces resource consumption. Furthermore, the phenotypic measurement of shiitake mushrooms is carried out through a target detection model, which improves the accuracy and efficiency of phenotypic measurement.
Smart Images

Figure CN122929095A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of agricultural product measurement technology, and in particular to a method and apparatus for determining the phenotypic parameters of shiitake mushrooms. Background Technology
[0002] Shiitake mushrooms are the most produced edible fungus in China, boasting extremely high nutritional value. Their flesh is thick and delicate, with a delicious flavor and unique aroma. They are used both as food and medicine, containing abundant nutrients and active substances, making them a favorite among consumers and a leading variety in the edible fungus market. The cap is not only rich in protein, dietary fiber, and various trace elements, possessing extremely high nutritional value, but also has higher protein, carbohydrate, and fat content than the stem, making it the most nutritionally concentrated part of the shiitake mushroom. The diameter, area, and morphological characteristics of the cap directly reflect the growth status and quality grade of the shiitake mushroom, serving as the most important and intuitive basis for consumers to select high-quality products and for breeders to assess phenotypic-genotypic relationships. Achieving high-throughput, non-destructive measurement of shiitake mushroom phenotypic parameters can provide data support for edible fungus breeding screening and cultivation production. The phenotypic parameters of the shiitake mushroom cap are the core basis for quality evaluation and breeding screening.
[0003] Existing technologies reconstruct a complete 3D point cloud of shiitake mushrooms using a Structure-from-Motion with Multi-View Stereo (SFM-MVS) algorithm based on multi-view stereo vision. Then, color-based segmentation of the mushroom fruiting bodies is performed, followed by calculation of the individual mushroom's spatial geometric dimensions. However, while existing 3D point cloud reconstruction methods can restore the mushroom's 3D structure, they suffer from poor reconstruction results and high computational resource consumption in weakly textured environments. Furthermore, color-based mushroom segmentation models struggle to accurately segment clustered shiitake mushroom fruiting bodies. Consequently, the accuracy and efficiency of shiitake mushroom phenotypic measurements are low. Summary of the Invention
[0004] This invention provides a method and apparatus for determining the phenotypic parameters of shiitake mushrooms. It addresses the shortcomings of existing technologies that reconstruct a complete 3D point cloud of shiitake mushrooms using the SFM-MVS algorithm, then segment the fruiting bodies based on color, and finally calculate the spatial geometric dimensions of individual mushrooms. While existing 3D point cloud reconstruction methods can restore the mushroom's three-dimensional structure, they suffer from poor reconstruction results and high computational resource consumption in weakly textured environments. Furthermore, color-based mushroom segmentation models struggle to accurately segment clustered shiitake mushroom fruiting bodies. This results in low accuracy and efficiency in shiitake mushroom phenotypic measurements. The present invention addresses these shortcomings by acquiring multi-view target image data using a pre-set camera and then recovering the 3D point cloud data characterizing the structure of substrate-cultivated shiitake mushrooms through multi-view registration (i.e., outlier removal). This enhances the construction effect of 3D point cloud data in weakly textured environments and reduces resource consumption. Finally, a target detection model is used for shiitake mushroom phenotypic measurement, improving both the accuracy and efficiency of the phenotypic measurement.
[0005] This invention provides a method for determining the phenotypic parameters of shiitake mushrooms, comprising the following steps.
[0006] The target image data of the mushroom sticks are acquired from multiple perspectives using a preset camera. For each of the aforementioned viewpoints, the foreground cloud data corresponding to the viewpoint is determined based on the intrinsic parameter matrix corresponding to the preset camera and the target image data corresponding to the viewpoint. For each of the aforementioned viewpoints, feature extraction is performed on the foreground point cloud data to obtain a fast point feature histogram corresponding to the viewpoint; feature matching is performed based on the fast point feature histogram to obtain multiple corresponding feature point pairs; for each of the aforementioned feature point pairs, the three-dimensional Euclidean distance of the feature point pair is determined; feature point pairs in the fast point feature histogram whose three-dimensional Euclidean distance is greater than a distance threshold are removed to obtain a first feature map corresponding to the viewpoint. For each pair of feature points in the first feature map corresponding to the viewpoint, the line segment between the feature points is determined; the difference between the line segment between the feature points and the corresponding line segment between the feature points in the first feature map of other viewpoints besides the viewpoint is determined; feature point pairs with a difference greater than the line segment threshold are removed from all the first feature maps to obtain the second feature map corresponding to each viewpoint. Based on the rigid transformation matrix and the iterative nearest point algorithm, all the second feature maps are iteratively fused to obtain the three-dimensional point cloud data corresponding to the mushroom stick; Based on the three-dimensional point cloud data, the phenotypic parameters corresponding to the multiple shiitake mushrooms on the mushroom stick are determined.
[0007] According to a method for determining phenotypic parameters of shiitake mushrooms provided by the present invention, the step of determining the foreground point cloud data corresponding to the viewpoint based on the intrinsic parameter matrix corresponding to the preset camera and the target image data corresponding to the viewpoint includes: The original point cloud data corresponding to the viewpoint is determined based on the intrinsic parameter matrix and the target image data corresponding to the viewpoint. The original point cloud data corresponding to the viewpoint is filtered to obtain the foreground point cloud data corresponding to the viewpoint.
[0008] According to a method for determining phenotypic parameters of shiitake mushrooms provided by the present invention, the step of filtering the original point cloud data corresponding to the viewpoint to obtain the foreground point cloud data corresponding to the viewpoint includes: The median of the data was determined based on all the original point cloud data described above. The upper and lower threshold values of the point cloud are determined based on the median of the data. For each of the aforementioned viewpoints, the original point cloud data corresponding to the viewpoint is filtered based on the upper limit threshold and the lower limit threshold of the point cloud to obtain the first point cloud data corresponding to the viewpoint; the first point cloud data is then filtered based on a statistical filtering method to obtain the foreground point cloud data corresponding to the viewpoint.
[0009] According to the method for determining phenotypic parameters of shiitake mushrooms provided by the present invention, the step of extracting features from the foreground point cloud data to obtain a fast point feature histogram corresponding to the viewpoint includes: The local normal vector corresponding to the foreground cloud data is determined based on the preset covariance matrix and the foreground cloud data corresponding to the viewpoint. Based on the local normal vector, feature extraction is performed on the foreground point cloud data to obtain a fast point feature histogram corresponding to the viewpoint.
[0010] According to a method for determining phenotypic parameters of shiitake mushrooms provided by the present invention, the step of determining the phenotypic parameters corresponding to multiple shiitake mushrooms on the substrate based on the three-dimensional point cloud data includes: The 3D point cloud data is input into the target detection model to obtain the 3D bounding box output by the target detection model; the target detection model is trained based on the sample point cloud data and corresponding labels. Based on the three-dimensional bounding box and the three-dimensional point cloud data, determine the point cloud of the mushroom cap corresponding to each of the mushrooms; For each of the shiitake mushrooms, the phenotypic parameters corresponding to the shiitake mushrooms are determined based on the point cloud of the shiitake mushroom cap.
[0011] According to a method for determining phenotypic parameters of shiitake mushrooms provided by the present invention, the step of inputting the three-dimensional point cloud data into a target detection model to obtain a three-dimensional bounding box output by the target detection model includes: The three-dimensional point cloud data is input into the columnar feature encoder in the target detection model to obtain the pseudo-image feature map output by the columnar feature encoder. The pseudo-image feature map is input into the backbone network of the target detection model to obtain the dense bird's-eye view features output by the backbone network; the backbone network includes a spatial pyramid pooling module, which is used to obtain multi-scale information of the pseudo-image feature map; The dense bird's-eye view features are input into the convolutional block attention module in the target detection model to obtain the purified dense bird's-eye view features output by the convolutional block attention module; the convolutional block attention module is used to perform attention purification on the dense bird's-eye view features; The purified dense bird's-eye view features are input into the detection head of the target detection model to obtain the three-dimensional bounding box output by the detection head.
[0012] According to a method for determining phenotypic parameters of shiitake mushrooms provided by the present invention, the step of determining the shiitake mushroom cap point cloud corresponding to each shiitake mushroom based on the three-dimensional bounding box and the three-dimensional point cloud data includes: For each of the shiitake mushrooms, an initial single mushroom point cloud is determined based on the three-dimensional bounding box and the three-dimensional point cloud data; The initial single-mushroom point cloud is denoised to obtain the first denoised single-mushroom point cloud; Statistical filtering is performed on the first single mushroom point cloud to obtain the filtered second single mushroom point cloud; Remove the stipe dot cloud from the second single mushroom dot cloud to obtain the third single mushroom dot cloud; The pose normalization of the third single mushroom point cloud was performed based on principal component analysis to obtain the mushroom cap point cloud corresponding to the mushroom.
[0013] According to the method for determining phenotypic parameters of shiitake mushroom provided by the present invention, the step of removing the stipe point cloud from the second single mushroom point cloud to obtain the third single mushroom point cloud includes: The pose normalization of the second single mushroom point cloud is performed based on principal component analysis to obtain the normalized single mushroom point cloud corresponding to the second single mushroom point cloud. For each data point in the normalized single mushroom point cloud, determine the unit normal vector corresponding to the data point; determine the horizontal distance of the data point to the Z-axis of the coordinate system; The data point is determined to be a stipe point cloud based on a horizontal distance threshold, an angle threshold, the unit normal vector, and the horizontal distance; wherein, if the angle between the unit normal vector and the direction unit vector of the Z-axis of the coordinate system is greater than the angle threshold, and the horizontal distance is less than the horizontal distance threshold, the data point is determined to be a stipe point cloud. The third single mushroom point cloud is obtained by removing each of the stipe point clouds from the second single mushroom point cloud.
[0014] According to the present invention, a method for determining phenotypic parameters of shiitake mushrooms includes cap thickness, maximum cap diameter, cap roundness, and cap surface area.
[0015] The present invention also provides a device for determining the phenotypic parameters of shiitake mushrooms, comprising the following modules: The acquisition module is used to acquire target image data of the mushroom sticks from multiple perspectives using a preset camera. The first determining module is used to determine the foreground cloud data corresponding to each of the aforementioned viewpoints based on the intrinsic parameter matrix corresponding to the preset camera and the target image data corresponding to the viewpoint. The first elimination module is used to extract features from the foreground point cloud data for each of the aforementioned viewpoints to obtain a fast point feature histogram corresponding to the viewpoint; perform feature matching based on the fast point feature histogram to obtain multiple corresponding feature point pairs; determine the three-dimensional Euclidean distance of each feature point pair; and eliminate feature point pairs in the fast point feature histogram whose three-dimensional Euclidean distance is greater than a distance threshold to obtain a first feature map corresponding to the viewpoint. The second elimination module is used to determine the line segments between feature point pairs in the first feature map corresponding to the viewpoint; determine the difference between the line segments between the feature points and the corresponding line segments between the feature points in the first feature map of other viewpoints besides the viewpoint; and eliminate feature point pairs whose difference is greater than the line segment threshold in all the first feature maps to obtain the second feature map corresponding to each viewpoint. The fusion module is used to iteratively fuse all the second feature maps based on the rigid transformation matrix and the iterative nearest point algorithm to obtain the three-dimensional point cloud data corresponding to the mushroom stick. The second determining module is used to determine the phenotypic parameters corresponding to multiple shiitake mushrooms on the mushroom stick based on the three-dimensional point cloud data.
[0016] The present invention 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 executes the computer program to implement the phenotypic parameter determination method of shiitake mushroom as described above.
[0017] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for determining the phenotypic parameters of shiitake mushrooms as described above.
[0018] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the phenotypic parameter determination method for shiitake mushrooms as described above.
[0019] The present invention provides a method and apparatus for determining phenotypic parameters of shiitake mushrooms. The method involves acquiring target image data of the mushroom log from multiple viewpoints using a preset camera; determining foreground point cloud data for each viewpoint based on the intrinsic parameter matrix of the preset camera and the target image data; extracting features from the foreground point cloud data for each viewpoint to obtain a fast point feature histogram; performing feature matching based on the fast point feature histogram to obtain multiple corresponding feature point pairs; determining the three-dimensional Euclidean distance between each feature point pair; and setting the threshold where the three-dimensional Euclidean distance in the fast point feature histogram is greater than a certain distance threshold. Feature point pairs are removed to obtain the first feature map corresponding to the viewpoint. For each feature point pair in the first feature map corresponding to the viewpoint, the line segments between the feature point pairs are determined. The difference between the line segments between the feature points and the corresponding line segments in the first feature maps of other viewpoints is determined. Feature point pairs with differences greater than the line segment threshold are removed from all first feature maps to obtain the second feature maps corresponding to each viewpoint. All second feature maps are iteratively fused based on the rigid transformation matrix and the iterative nearest point algorithm to obtain the three-dimensional point cloud data corresponding to the mushroom log. The phenotypic parameters corresponding to multiple shiitake mushrooms on the mushroom log are determined based on the three-dimensional point cloud data. The technical solution of this application acquires target image data from multiple viewpoints through a preset camera, and then recovers the three-dimensional point cloud data representing the structure of substrate-cultivated shiitake mushrooms through multi-view registration, i.e., the removal of outliers, which enhances the construction effect of three-dimensional point cloud data in weak texture environments and reduces resource consumption. Furthermore, the phenotypic measurement of shiitake mushrooms is carried out through a target detection model, which improves the accuracy and efficiency of phenotypic measurement. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0021] Figure 1 This is a flowchart illustrating the method for determining the phenotypic parameters of shiitake mushrooms provided by the present invention.
[0022] Figure 2 This is a schematic diagram of the scene setting of the preset camera and mushroom sticks provided by the present invention.
[0023] Figure 3 This is a comparative diagram of the original point cloud data and the foreground point cloud data provided by the present invention.
[0024] Figure 4 This is a schematic diagram of the process for obtaining three-dimensional point cloud data through fusion, as provided by the present invention.
[0025] Figure 5This is a schematic diagram of the sample point cloud data and corresponding labels provided by the present invention.
[0026] Figure 6 This is a schematic diagram of the measurement of cap thickness provided by the present invention.
[0027] Figure 7 This is a schematic diagram of the measurement of the maximum diameter of the cap provided by the present invention.
[0028] Figure 8 This is a schematic diagram illustrating the measurement of cap roundness provided by the present invention.
[0029] Figure 9 This is a schematic diagram of the measurement of the cap surface area provided by the present invention.
[0030] Figure 10 This is a comparative diagram of three-dimensional point cloud data under different viewpoints provided by the present invention.
[0031] Figure 11 This is a comparative schematic diagram of the ablation experiment of the target detection model provided by the present invention.
[0032] Figure 12 This is a schematic diagram comparing the phenotypic parameters provided by this invention with manually measured values.
[0033] Figure 13 This is a schematic diagram of the phenotypic parameter determination device for shiitake mushrooms provided by the present invention.
[0034] Figure 14 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0035] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0036] To address the aforementioned problems in the prior art, the present invention provides a method for determining the phenotypic parameters of shiitake mushrooms. The executing entity of the method of the present invention can be a computer control system or other electronic devices, and the embodiments of the present invention do not impose specific limitations. Figure 1 This is a flowchart illustrating the method for determining phenotypic parameters of shiitake mushrooms provided by the present invention, as shown below. Figure 1 As shown, the method includes the following steps 110 to 160.
[0037] Step 110: Acquire target image data of the mushroom sticks from multiple perspectives using a preset camera.
[0038] Specifically, the mushroom logs can be cultivated in a temperature-controlled environment of 5–25℃ under conditions of darkness and high humidity. After the shiitake mushroom fruiting bodies germinate, the outer packaging film of the logs is removed. Subsequently, the logs are placed on an electrically controlled rotating platform throughout the entire life cycle of the mycelium (fruiting period, growth period, and maturity period) to continuously acquire target image data. The target image data can be data collected continuously over multiple days and at multiple time periods, or data collected continuously at the same time period on a single day. This application does not impose specific limitations on this embodiment.
[0039] Optionally, because the surface of shiitake mushroom logs has similar colors and lacks significant texture, the binocular stereo vision scheme is prone to depth holes due to stereo matching failure. Furthermore, significant changes in lighting conditions between morning and evening will further affect the imaging stability of the binocular vision. The preset camera in this application can be a Kinect V2 camera (a second-generation depth camera from a certain company) based on the Time-of-Flight (TOF) principle. This camera can output depth images and has stronger robustness to scenes with weak textures and changing lighting. It is easy to understand that other depth cameras can also be used as the preset camera, and this preset camera needs to have the ability to simultaneously capture infrared images and depth maps. Figure 2 This is a schematic diagram of the scene setup of the preset camera and mushroom sticks provided by the present invention, such as... Figure 2 As shown, the mushroom log can be fixed to an electrically controlled rotating platform, while the Kinect V2 camera is mounted on a fixed bracket 70 cm away from the mushroom log (this distance is chosen considering the Kinect V2 camera's minimum working distance of approximately 50 cm), achieving high spatial resolution. The electrically controlled rotating platform rotates at a fixed angle via a programmable control method. Each rotation activates a preset camera to acquire target image data. Considering that excessively large sampling intervals would lead to reduced overlap between adjacent point clouds, loss of local geometric structures, and easy accumulation of global registration errors and stitching discontinuities, while denser sampling could improve the overlap rate, it would increase computational costs. Therefore, a fixed sampling interval of 10° is preferred, resulting in target image data from 36 perspectives. It is easy to understand that sampling can also be performed at other angle intervals to obtain target image data from any number of perspectives; this embodiment does not impose specific limitations on this.
[0040] Step 120: For each of the aforementioned viewpoints, determine the foreground cloud data corresponding to the viewpoint based on the intrinsic parameter matrix corresponding to the preset camera and the target image data corresponding to the viewpoint.
[0041] Specifically, for each viewpoint, the foreground cloud data corresponding to that viewpoint can be determined based on the preset intrinsic parameter matrix of the camera and the target image data corresponding to that viewpoint. The intrinsic parameter matrix can be determined based on the Zhang Zhengyou calibration method; for example, the intrinsic parameter matrix can be represented as follows: ,in, This represents the elements in the intrinsic parameter matrix. and Represents the coordinates of the optical center. and These represent the normalized focal lengths along the x-axis and y-axis, respectively. For example, this is obtained after calibrating a Kinect V2 camera. Pixels Pixels Pixels Pixel.
[0042] In one embodiment, determining the foreground cloud data corresponding to the viewpoint based on the intrinsic parameter matrix corresponding to the preset camera and the target image data corresponding to the viewpoint includes: The original point cloud data corresponding to the viewpoint is determined based on the intrinsic parameter matrix and the target image data corresponding to the viewpoint. The original point cloud data corresponding to the viewpoint is filtered to obtain the foreground point cloud data corresponding to the viewpoint.
[0043] Specifically, the target image data may include infrared images and depth maps. The infrared images carry visual texture information, while the depth maps record the distance values of each pixel to the camera.
[0044] Therefore, pixel coordinates in infrared images can be transformed based on depth maps to obtain their corresponding spatial coordinates in the 3D camera coordinate system. All points corresponding to these spatial coordinates can then constitute the original point cloud data. Pixel coordinates Spatial coordinates obtained through coordinate transformation The coordinates of each axis point can be expressed by the following formula: in, Representing spatial coordinates Z-axis coordinate, Represents pixel coordinates The corresponding depth data can be read from the depth map. The scaling factor representing the depth dimension (can be preset, for example, 1000). Representing spatial coordinates X-axis coordinate; Representing spatial coordinates The Y-axis coordinate.
[0045] Furthermore, the original point cloud data corresponding to this viewpoint can be filtered to obtain the foreground point cloud data corresponding to this viewpoint.
[0046] For example, Figure 3 This is a comparative diagram of the original point cloud data and the foreground point cloud data provided by the present invention. Figure 3 (a) is a schematic diagram of the original point cloud data. Figure 3 (b) is a schematic diagram of the foreground cloud data.
[0047] In the above embodiments, the original point cloud data corresponding to the viewpoint is determined based on the intrinsic parameter matrix and the target image data corresponding to the viewpoint. This can accurately determine the three-dimensional point cloud distribution of the mushroom sticks. Furthermore, filtering the original point cloud data improves the accuracy of the point cloud data.
[0048] In one embodiment, filtering the original point cloud data corresponding to the viewpoint to obtain the foreground point cloud data corresponding to the viewpoint includes: The median of the data was determined based on all the original point cloud data described above. The upper and lower threshold values of the point cloud are determined based on the median of the data. For each of the aforementioned viewpoints, the original point cloud data corresponding to the viewpoint is filtered based on the upper limit threshold and the lower limit threshold of the point cloud to obtain the first point cloud data corresponding to the viewpoint; the first point cloud data is then filtered based on a statistical filtering method to obtain the foreground point cloud data corresponding to the viewpoint.
[0049] Specifically, this application can use the median of the data as a central reference value and use the Median Absolute Deviation (MAD) to measure the dispersion of the point cloud data. Therefore, the median of the data can be determined based on all the original point cloud data, that is, the median of the X-axis coordinate, the median of the Y-axis coordinate, and the median of the Z-axis coordinate are determined separately, and the combined three-dimensional coordinates are the median of the data.
[0050] Furthermore, the upper and lower threshold values of the point cloud can be determined based on the median of the data. This process can be expressed by the following formula: in, This represents the lower limit threshold of the point cloud. This represents the median of the data. Represents the sensitivity coefficient. This represents the robust standard deviation estimate. This represents the upper limit threshold of the point cloud. It's easy to understand that... and Also in three-dimensional coordinate form, the above formula... Subtract / add to the coordinates of each axis in the middle get and , and It can be preset, and the embodiments of the present invention do not impose specific limitations here.
[0051] Furthermore, for each viewpoint, the original point cloud data corresponding to that viewpoint can be filtered based on the upper and lower thresholds of the point cloud to obtain the first point cloud data corresponding to that viewpoint. This means removing data points in the original point cloud data whose axes exceed either the upper or lower threshold. Then, the first point cloud data can be filtered using statistical filtering methods to obtain the foreground point cloud data corresponding to that viewpoint. In the statistical filtering method, the number of neighborhood sampling points can be set to 200, and the standard deviation factor to 2.0. A neighborhood of 200 points is sufficient to cover the statistical characteristics of the local point cloud distribution while avoiding misidentification of outliers due to an excessively large neighborhood. A standard deviation factor of 2.0 conforms to the statistical criterion that points within approximately 95% confidence intervals under a Gaussian distribution are retained, effectively removing discontinuous sparse noise points while preserving the geometric integrity of the fine structure on the surface of the mushroom.
[0052] In the above embodiments, filtering based on the median of the data removes data points with a high degree of dispersion. Statistical filtering can perform fine noise reduction on sparse outliers in the foreground region, effectively removing discontinuous sparse noise points while preserving the geometric integrity of the fine structure on the mushroom surface. This dual filtering ensures that the point cloud corresponding to the background region is removed to the maximum extent from the foreground point cloud data.
[0053] Step 130: For each of the aforementioned viewpoints, perform feature extraction on the foreground point cloud data to obtain a fast point feature histogram corresponding to the viewpoint; perform feature matching based on the fast point feature histogram to obtain multiple corresponding feature point pairs; for each of the aforementioned feature point pairs, determine the three-dimensional Euclidean distance of the feature point pair; remove feature point pairs in the fast point feature histogram whose three-dimensional Euclidean distance is greater than a distance threshold to obtain the first feature map corresponding to the viewpoint.
[0054] Specifically, for each viewpoint, features can be extracted from the foreground point cloud data to obtain a fast point feature histogram corresponding to that viewpoint. Feature matching can also be performed based on the fast point feature histogram to obtain multiple feature point pairs corresponding to the fast point feature histogram. It's easy to understand that each feature point pair includes two feature points.
[0055] For each feature point pair, the three-dimensional Euclidean distance between the two feature points in the pair can be determined. Feature point pairs with a three-dimensional Euclidean distance greater than a distance threshold are then removed, resulting in the first feature map corresponding to that viewpoint. The distance threshold can be set as needed, and this embodiment does not impose specific limitations.
[0056] In one embodiment, the step of extracting features from the foreground point cloud data to obtain a fast point feature histogram corresponding to the viewpoint includes: The local normal vector corresponding to the foreground cloud data is determined based on the preset covariance matrix and the foreground cloud data corresponding to the viewpoint. Based on the local normal vector, feature extraction is performed on the foreground point cloud data to obtain a fast point feature histogram corresponding to the viewpoint.
[0057] Specifically, the local normal vector of the foreground cloud data can be estimated based on a preset covariance matrix and the foreground cloud data corresponding to the viewpoint. Then, feature extraction can be performed on the foreground cloud data based on the local normal vector to obtain a fast point feature histogram corresponding to that viewpoint.
[0058] In the above embodiments, the determination of the fast point feature histogram lays the foundation for subsequent registration.
[0059] Step 140: For each pair of feature points in the first feature map corresponding to the viewpoint, determine the line segment between the feature points; determine the difference between the line segment between the feature points and the corresponding line segment between the feature points in the first feature map of other viewpoints besides the viewpoint; remove the feature point pairs whose difference is greater than the line segment threshold in all the first feature maps to obtain the second feature map corresponding to each viewpoint.
[0060] Specifically, for each pair of feature points in the first feature map corresponding to the viewpoint, the line segments between the feature points are determined. Then, the difference between the line segments between the feature points and the corresponding line segments in the first feature maps of other viewpoints is determined. Feature point pairs with differences greater than the line segment threshold are removed from all first feature maps to obtain the second feature maps corresponding to each viewpoint. Steps 130 and 140 above can be regarded as a coarse registration process.
[0061] For example, in the first feature map corresponding to 10°, feature points A1 and B1 are a pair of feature points, and the line segment I1 between them is determined; in the first feature map corresponding to 20°, feature points A2 and B2 are a pair of feature points, and A2 corresponds to A1, and B2 corresponds to B1, and the line segment I2 between A2 and B2 is determined; in the first feature map corresponding to 30°, feature points A3 and B3 are a pair of feature points, and A3 corresponds to A1 and A2, and B3 corresponds to B1 and B2, and the line segment I3 between A3 and B3 is determined; then for I1, the difference between I1 and I2 and the difference between I1 and I3 are calculated. If the difference between I1 and I2 is greater than the line segment threshold, then the feature point pair corresponding to A1 and B1 is removed from all first feature maps, thereby obtaining the second feature map corresponding to each viewpoint.
[0062] Step 150: Iteratively fuse all the second feature maps based on the rigid transformation matrix and the iterative nearest point algorithm to obtain the three-dimensional point cloud data corresponding to the mushroom stick.
[0063] Specifically, all second feature maps can be iteratively fused based on a rigid transformation matrix and an iterative nearest-point algorithm to obtain the 3D point cloud data corresponding to the mushroom stick. The rigid transformation matrix can be estimated in random sampling; the iterative nearest-point algorithm can achieve fine alignment of the two second feature maps by iteratively minimizing the Euclidean distance between data points, under the dual convergence criteria of adaptive distance threshold and maximum number of iterations.
[0064] Iterative fusion involves fusing the second feature map from one viewpoint to another. For example, Figure 4 This is a schematic diagram of the process for obtaining three-dimensional point cloud data through fusion provided by the present invention, as shown below. Figure 4 As shown, the second feature map from the first viewpoint is fused with the second feature map from the second viewpoint, and then the feature map obtained by fusing the first and second viewpoints is fused with the second feature map from the third viewpoint, ultimately obtaining 3D point cloud data through gradual fusion. It is easy to understand that... Figure 4 The feature map obtained by fusing the three perspectives is not shown in the figure. It can be further fused with the second feature map of the fourth perspective, and then gradually fused with the feature maps of other subsequent perspectives. Each fusion process is a fusion of two feature maps.
[0065] Step 160: Determine the phenotypic parameters corresponding to the multiple shiitake mushrooms on the mushroom stick based on the three-dimensional point cloud data.
[0066] Specifically, the phenotypic parameters corresponding to multiple shiitake mushrooms on the substrate can be determined based on three-dimensional point cloud data.
[0067] In one embodiment, determining the phenotypic parameters corresponding to multiple shiitake mushrooms on the mushroom log based on the three-dimensional point cloud data includes: The 3D point cloud data is input into the target detection model to obtain the 3D bounding box output by the target detection model; the target detection model is trained based on the sample point cloud data and corresponding labels. Based on the three-dimensional bounding box and the three-dimensional point cloud data, determine the point cloud of the mushroom cap corresponding to each of the mushrooms; For each of the shiitake mushrooms, the phenotypic parameters corresponding to the shiitake mushrooms are determined based on the point cloud of the shiitake mushroom cap.
[0068] Specifically, three-dimensional point cloud data can be input into the object detection model to obtain the three-dimensional bounding box output by the object detection model; wherein, the object detection model is trained based on sample point cloud data and corresponding labels.
[0069] Preferably, the baseline detection model of the target detection model in this application can adopt the PointPillars model. PointPillars is an efficient 3D target detection method based on point clouds. Its core idea is to convert disordered 3D point cloud data into regular pillar pseudo-image representations, thereby enabling efficient feature extraction of pseudo-images using 2D convolutional neural networks to ensure detection accuracy. This model has the following adaptability in the shiitake mushroom detection task: First, it maintains high spatial resolution in the direction of cap extension (e.g., defined as the horizontal direction) to distinguish dense individuals. Shiitake mushroom caps are close to each other and even adhere to each other. PointPillars can perform fine-grained mesh division in this direction to effectively distinguish adjacent caps that are mutually occluded and have blurred boundaries, meeting the requirements for dense target detection. Second, it solves the computational explosion problem by feature aggregation in the height direction of the cap. If a three-dimensional mesh division is directly used in 3D space, the high resolution will cause the number of meshes to increase cubically with length × width × height, resulting in excessive computation. PointPillars, through feature aggregation in the thickness direction of the cap, compresses highly redundant features while retaining key undulation information, encoding 3D features into 2D pseudo-images. This ensures effective representation of the cap's surface morphology while avoiding the computational explosion problem caused by 3D meshes. Third, efficient feature extraction can be achieved using mature 2D convolutional networks. After conversion to pseudo-images, pre-trained 2D convolutional networks can be directly used for feature learning. Compared to 3D sparse convolutional methods, this approach offers more stable training and faster inference speeds, making it suitable for subsequent high-throughput phenotyping scenarios.
[0070] For example, the training process of the object detection model can be described as follows: First, sample point cloud data can be acquired, and a 3D point cloud annotation tool can be used to annotate the sample point cloud data with 3D bounding boxes to obtain corresponding labels. The annotation content can include: bounding box center coordinates; bounding box dimensions (length, width, height): the horizontal projection diameter and vertical thickness of the corresponding cap; orientation angle: the yaw angle around the Z-axis, defined as the direction of the major axis of the cap ellipse. A total of 1280 shiitake mushroom instances were annotated and randomly divided into training, validation, and test sets in a ratio of 7:2:1. Figure 5 This is a schematic diagram of sample point cloud data and corresponding labels provided by the present invention. Part of the sample point cloud data and corresponding labels can be as follows: Figure 5 As shown. The object detection model can employ a multi-task joint loss function, comprising three parts: classification loss, localization / regression loss, and orientation loss. Multi-task joint loss function It can be expressed by the following formula: in, Represents classification loss. Focal Loss (a loss function specifically designed to address class imbalance) can be used to alleviate the imbalance between positive and negative samples and focus on difficult-to-classify samples. This represents the localization regression loss, which uses Smooth L1 Loss (a smoothed version of the L1 loss function) for the center coordinates and dimensions (length, width, and height) of the bounding box. The orientation loss is represented by a Softmax (a normalized exponential function) classification loss, which discretizes the orientation angle into two bins (0° to 180°) to avoid ambiguity related to periodic angles in the regression. The weight coefficients of each loss are determined using a grid search on the validation set, for example... The hyperparameters of the object detection model during training can be configured as follows: the optimizer is AdamW (a commonly used optimization algorithm in deep learning), the initial learning rate is set to 0.0001, the weight decay is set to 0.001, the batch size is set to 4, the training epochs are set to 50, the point cloud range is set to [0, 3.2] meters, [-1.2, 1.2] meters, [0, 1.5] meters, and the cylinder size is set to (0.16m, 0.16m). To improve the model's generalization ability, the following data augmentations are implemented online during training: global random flipping: randomly flipping the point cloud along the X-axis with a probability of 0.5; global random rotation: randomly rotating around the Z-axis within a range of ±15°; global random scaling: uniformly sampling the scaling factor within the interval [0.95, 1.05]; random point cloud discarding: randomly discarding some points with a probability of 0.1 to simulate occlusion and sensor noise. All augmentation operations are applied simultaneously to the point cloud and its corresponding 3D bounding box to ensure the consistency of spatial transformation.
[0071] Furthermore, after obtaining the 3D bounding box, the point cloud of the mushroom cap corresponding to each shiitake mushroom can be determined based on the 3D bounding box and the 3D point cloud data. Then, for each shiitake mushroom, the corresponding phenotypic parameters can be determined based on the corresponding shiitake mushroom cap point cloud.
[0072] Shiitake mushroom fruiting bodies grow concentrated on the surface of the substrate, often crowding and obscuring each other. Furthermore, the color of the substrate changes over time, resulting in minimal color difference between the mushroom and the substrate. Existing color-based mushroom segmentation models struggle to accurately segment shiitake mushroom fruiting bodies. In the above embodiment, a pre-trained target detection model can perform target detection on 3D point cloud data, extracting the point cloud of the shiitake mushroom cap corresponding to a single mushroom, thus laying the foundation for measuring shiitake mushroom phenotypic parameters.
[0073] In one embodiment, the step of inputting the 3D point cloud data into a target detection model to obtain the 3D bounding box output by the target detection model includes: The three-dimensional point cloud data is input into the columnar feature encoder in the target detection model to obtain the pseudo-image feature map output by the columnar feature encoder. The pseudo-image feature map is input into the backbone network of the target detection model to obtain the dense bird's-eye view features output by the backbone network; the backbone network includes a spatial pyramid pooling module, which is used to obtain multi-scale information of the pseudo-image feature map; The dense bird's-eye view features are input into the convolutional block attention module in the target detection model to obtain the purified dense bird's-eye view features output by the convolutional block attention module; the convolutional block attention module is used to perform attention purification on the dense bird's-eye view features; The purified dense bird's-eye view features are input into the detection head of the target detection model to obtain the three-dimensional bounding box output by the detection head.
[0074] Specifically, 3D point cloud data can be input into the Pillar Feature Encoder (PFE) in the object detection model to obtain a pseudo-image feature map output by the Pillar Feature Encoder. The Pillar Feature Encoder divides the 3D point cloud data into an equally spaced columnar grid and extracts features from points within each non-empty column. For each point, it encodes its offset relative to the column center, its offset relative to the mean of all points, and its original reflection intensity. Then, a simplified network in the style of PointNet (a deep learning model used to directly process 3D point cloud data) is used to generate a fixed-dimensional columnar feature vector, with the final output being of size [size missing]. The pseudo-image feature map, where, Indicates the number of channels; Indicates altitude; Indicates the width.
[0075] The pseudo-image feature map can then be input into the backbone network (BN) of the object detection model to obtain dense bird's-eye-view features output by the backbone network. The backbone network includes a spatial pyramid pooling module, which is used to acquire multi-scale information from the pseudo-image feature map. The backbone network is constructed using conventional two-dimensional convolutions, where the convolution kernels assign equal weights to each input channel and spatial location, and the receptive field is determined by the fixed kernel size. The backbone network progressively downsamples the pseudo-image feature map through stride convolutions to obtain high-level semantic features. These high-level semantic features are then input into the spatial pyramid pooling module, which extracts features in parallel through multiple dilated convolutions with different dilation rates to obtain multi-scale information. The larger the dilation rate, the larger the receptive field, and the more contextual features can be captured. In this invention, ASPP is placed after the deepest downsampled features (highest semantic features) of the backbone network and before upsampling and feature fusion. The feature map at this location has low resolution but strong semantic information. ASPP can effectively aggregate receptive field information at different scales here, enhancing the model's adaptability to differences in the size of individual shiitake mushrooms. The output of the spatial pyramid pooling module is upsampled at multiple scales by the backbone network through deconvolution, and the features at different levels are stitched together after unifying the resolution to generate a fused dense bird's-eye view feature.
[0076] The dense bird's-eye view features can then be input into the Convolutional Block Attention Module (CBAM) in the object detection model to obtain the purified dense bird's-eye view features output by the CBAM. The CBAM is used to refine the dense bird's-eye view features through attention. CBAM sequentially performs channel attention and spatial attention recalibration on the dense bird's-eye view features to identify important feature channels and locate key spatial regions. This invention places CBAM after the BN output and before the detection head, performing attention refinement on the dense bird's-eye view features in the later stage of feature representation to suppress false detections.
[0077] Furthermore, the purified dense bird's-eye view features can be input into the detection head of the object detection model to obtain the 3D bounding box output by the detection head. The detection head can perform dense prediction on the purified dense bird's-eye view features based on preset 3D anchor boxes to obtain classification confidence, 3D bounding box offset, and orientation angle. Then, the 3D bounding box can be determined based on the 3D bounding box offset and the preset 3D anchor boxes.
[0078] Existing object detection models have two limitations: first, they treat the weights of each channel and spatial location equally, making it difficult to focus on the local key areas where individual shiitake mushrooms are located; second, the fixed receptive field is difficult to adapt to the problems of large differences in individual scale (young and mature mushrooms), occlusion, and uneven edge distribution in the shiitake mushroom spawn scene. In the above embodiment, the receptive field is expanded by setting the spatial pyramid pooling module, which can capture a wider range of features, while the convolutional block attention module can focus the features on the local key areas where individual shiitake mushrooms are located.
[0079] In one embodiment, determining the mushroom cap point cloud corresponding to each of the shiitake mushrooms based on the three-dimensional bounding box and the three-dimensional point cloud data includes: For each of the shiitake mushrooms, an initial single mushroom point cloud is determined based on the three-dimensional bounding box and the three-dimensional point cloud data; The initial single-mushroom point cloud is denoised to obtain the first denoised single-mushroom point cloud; Statistical filtering is performed on the first single mushroom point cloud to obtain the filtered second single mushroom point cloud; Remove the stipe dot cloud from the second single mushroom dot cloud to obtain the third single mushroom dot cloud; The pose normalization of the third single mushroom point cloud was performed based on principal component analysis to obtain the mushroom cap point cloud corresponding to the mushroom.
[0080] Specifically, for each shiitake mushroom, the initial single mushroom point cloud can be determined based on the three-dimensional bounding box and three-dimensional point cloud data.
[0081] Furthermore, since the stems of shiitake mushrooms are mostly obscured by the caps, the point cloud density of the main body of the shiitake mushroom exhibits significant spatial non-uniformity: the caps and background form a bimodal high-density distribution, while the transition region between them (the stem region) contains only sparse noise points, forming a distinct density valley band. To address this distribution characteristic, a density peak inverse tracking method is used to automatically estimate the segmentation threshold. First, the histogram distribution of the initial single-mushroom point cloud along the Z-axis is statistically analyzed to locate the upper quartile peak region. Then, a fixed tolerance is applied towards the lower density direction to determine the optimal segmentation plane, and the first single-mushroom point cloud after noise removal is extracted.
[0082] Furthermore, statistical filtering can be applied to the first single-mushroom point cloud to obtain the filtered second single-mushroom point cloud. Specifically, this involves the first single-mushroom point cloud... Points You can query this point. Nearest neighbor set Therefore, it can be calculated using the following formula. Corresponding mean and Corresponding standard deviation: in, express The corresponding mean, express The first in One point, express The number of midpoints express The corresponding standard deviation.
[0083] Furthermore, the mean of the global neighborhood distance can be calculated. Standard deviation of distance from global neighborhood ,in, This indicates calculating the average value. This indicates the calculation of the standard deviation. Therefore, points that satisfy the following conditions can be retained (it's easy to understand that points that do not satisfy these conditions will be removed from the first single-mushroom point cloud, and the retained points will form the second single-mushroom point cloud): in, express of The geometric center (centroid) of the nearest neighbor. This represents the standard deviation multiplier. Preferably, You can choose 18. A value of 1.5 can be chosen. Experiments have verified that this parameter combination achieves the best balance between removing discrete noise and preserving edge details. The large neighborhood radius and relaxed statistical threshold ensure a gentle denoising strategy that preserves the target geometric details to the maximum extent while removing discrete noise.
[0084] Furthermore, the stipe dot cloud in the second single mushroom dot cloud can be removed to obtain the third single mushroom dot cloud.
[0085] Then, the pose normalization of the third mushroom point cloud can be performed based on principal component analysis to obtain the mushroom cap point cloud corresponding to the shiitake mushroom. Since the third mushroom point cloud exhibits diverse growth poses, direct measurement would be affected by the pose. Therefore, principal component analysis (PCA) is used to normalize the pose of the third mushroom point cloud: first, the centroid of the third mushroom point cloud is translated to the origin; then, eigenvalue decomposition is performed on the covariance matrix, and the eigenvector corresponding to the smallest eigenvalue is obtained. The eigenvectors corresponding to the maximum and intermediate eigenvalues along the Z-axis (thickness direction) and The determined plane is the XY plane (horizontal projection plane), and a rotation matrix is constructed. Perform a rotation transformation on the point cloud, where, This indicates transpose. Finally, due to the ambiguity of the direction of eigenvectors in principal component analysis (PCA)... and (All samples meet the orthogonality condition) and require orientation consistency correction. A geometric prior-based orientation strategy is adopted: since the cap has a convex structure and the upper surface usually faces upward, the projection distribution of the point cloud along the Z-axis is calculated to ensure that the upper surface of the cap faces the +Z direction. After attitude normalization, all cap samples are in a unified standard coordinate system, eliminating the differences in the point cloud of the third single mushroom, and laying the foundation for accurate measurement of parameters such as thickness, diameter, roundness, and surface area.
[0086] In the above embodiments, the accuracy of the mushroom cap point cloud was improved by operations such as noise reduction, filtering, removal of stipe point cloud, and pose normalization.
[0087] In one embodiment, removing the stipe point cloud from the second single mushroom point cloud to obtain the third single mushroom point cloud includes: The pose normalization of the second single mushroom point cloud is performed based on principal component analysis to obtain the normalized single mushroom point cloud corresponding to the second single mushroom point cloud. For each data point in the normalized single mushroom point cloud, determine the unit normal vector corresponding to the data point; determine the horizontal distance of the data point to the Z-axis of the coordinate system; The data point is determined to be a stipe point cloud based on a horizontal distance threshold, an angle threshold, the unit normal vector, and the horizontal distance; wherein, if the angle between the unit normal vector and the direction unit vector of the Z-axis of the coordinate system is greater than the angle threshold, and the horizontal distance is less than the horizontal distance threshold, the data point is determined to be a stipe point cloud. The third single mushroom point cloud is obtained by removing each of the stipe point clouds from the second single mushroom point cloud.
[0088] Specifically, the pose normalization of the second single-mushroom point cloud can be performed based on principal component analysis to obtain the normalized single-mushroom point cloud corresponding to the second single-mushroom point cloud. The operation of principal component analysis can be referred to the description in the previous embodiment, and will not be repeated in this embodiment.
[0089] For each data point in a normalized single mushroom point cloud, the unit normal vector corresponding to that data point can be determined. , with that point Nearest neighbor set The set fits the local tangent plane, and the eigenvector corresponding to the minimum eigenvalue is obtained through principal component analysis, which is then used as the unit normal vector at that point. It can be expressed by the following formula: Among them, it means The independent variable that minimizes the objective function is Represents the neighborhood centroid. The optimization variable is a unit vector representing a candidate direction.
[0090] Because the stipe extends along the central axis of symmetry of the cap, its projection onto the horizontal plane is concentrated in the central region. This also allows for the determination of data points. The horizontal distance to the Z-axis of the coordinate system can be expressed by the following formula: in, Representing data points The horizontal distance to the Z-axis of the coordinate system. Representing data points X-axis coordinates Representing data points The Y-axis coordinate.
[0091] Furthermore, based on horizontal distance thresholds, angle thresholds, unit normal vectors, and horizontal distance, it can be determined whether a data point is a stipe point cloud. The geometric characteristics of the stipe are: a local surface approximately cylindrical, a normal vector roughly horizontal (with an angle close to 90° to the Z-axis); and it is located near the central axis of the cap, with a small horizontal projection radius. Therefore, data points that meet the following conditions can be identified as stipe point clouds: in, . Indicates the angle threshold. This represents the horizontal distance threshold. Ensure the normal vector deviates from the Z-axis by more than (i.e., close to horizontal) Limit the horizontal distance to avoid accidentally deleting points on the side edge of the cap (although their normal vector is horizontal, ...). (Larger). The angle threshold can be preset as needed, for example, set to 75°. This application embodiment does not impose a specific limitation here. An adaptive strategy can be used to determine and extract the two-dimensional convex hull of the XY plane, which can then be used to calculate the maximum diameter. , It can be expressed by the following formula: in, This represents the proportionality coefficient. Based on the predetermined geometric ratio between the stipe and the cap, the stipe radius is typically 1 / 4 to 1 / 3 of the maximum cap radius; preferably, it is... To cover the main body of the stem without damaging the cap.
[0092] After determining all stipe point clouds, each stipe point cloud in the second single mushroom point cloud can be removed to obtain the third single mushroom point cloud.
[0093] Even after density segmentation and statistical filtering, a small amount of stipe point cloud may still remain. The stipe has a columnar structure and extends vertically. In the above embodiment, based on the horizontal distance threshold, angle threshold, unit normal vector, and horizontal distance, the stipe point cloud can be accurately removed while the cap point cloud is preserved.
[0094] In one embodiment, the phenotypic parameters include cap thickness, maximum cap diameter, cap roundness, and cap surface area.
[0095] Specifically, the phenotypic parameters include cap thickness, maximum cap diameter, cap roundness, and cap surface area.
[0096] The cap thickness is equal to the perpendicular distance between the parallel planes circumscribed along the thickness direction of the cap. The shiitake mushroom cap point cloud is located in a standard coordinate system, with its centroid at the origin and the Z-axis aligned with the thickness direction. Based on this, a three-dimensional minimum bounding rectangle is constructed for the shiitake mushroom cap point cloud; the side length of this rectangle along the Z-axis is the cap thickness. For example... Figure 6 This is a schematic diagram of the measurement of cap thickness provided by the present invention. The result of measuring the cap thickness of a certain shiitake mushroom cap dot cloud is as follows. Figure 6 As shown, Figure 6 The yellow line segment represents the side length (cap thickness) of the rectangle along the Z-axis. Figure 6 The cap thickness shown is 2.54 mm.
[0097] The cap of the mushroom exhibits central symmetry, and its horizontal projected profile can be considered as an approximate circle centered at the intersection of the axis of symmetry and the horizontal plane. The theoretical maximum diameter is the diameter of the circumcircle of this projected profile. In actual measurement, the point cloud of the shiitake mushroom cap is first projected onto the XY plane, and the convex hull of the two-dimensional point set is extracted to determine the outer contour boundary of the cap. The convex hull is the smallest convex polygonal outer contour of the point set. Subsequently, all vertices of the convex hull are traversed, and the Euclidean distance between each pair of vertices is calculated. The maximum value is taken as the maximum diameter. This parameter is sensitive to the irregularity of the cap shape and can capture the dimensional characteristics of the widest part of the cap. Figure 7 This is a schematic diagram of the measurement of the maximum diameter of the cap provided by the present invention, as shown in the figure. Figure 7 As shown, the maximum diameter of the cap of a certain shiitake mushroom is 95.20 mm.
[0098] The cap has central symmetry. First, taking the intersection of the cap's central symmetry axis and the horizontal plane as the center, theoretically, the horizontal projection of the cap is a perfect circle centered at this point; according to the roundness formula... The roundness value of a perfect circle can be calculated to be 1, where, Represents pi (π). Represents the area of a circle. This represents the circumference of a circle. In actual measurement, based on two-dimensional convex hull calculations, the roundness formula is used. The closer the cap outline is to a perfect circle, the closer this ratio is to 1. Figure 8 This is a schematic diagram of the measurement of cap roundness provided by the present invention. The cap roundness of a certain shiitake mushroom cap dot cloud is shown in the figure. Figure 8 As shown.
[0099] The cap of a mushroom is typically approximated as a surface of revolution or a thin-shell structure. In theoretical measurements, a suitable geometric model (such as a spherical cap or ellipsoid) is first established, and then its surface area is calculated using surface integrals as the theoretical true value of the cap's surface area. In practical measurements, the Poisson surface reconstruction method is used. This method, based on implicit function representation, can generate a continuous, smooth triangular mesh surface from a disordered point cloud, overcoming the difficulty of directly calculating the point cloud surface area due to the lack of topological connectivity information. First, the normals of the shiitake mushroom cap point cloud are estimated and Poisson reconstruction is performed. Then, isosurfaces are extracted to generate a triangular mesh that fits the cap's shape, thereby constructing the final smooth surface model. Finally, the total surface area is obtained by summing the areas of all triangular facets in the final smooth surface model. Figure 9 This is a schematic diagram of the measurement of the cap surface area provided by the present invention. The triangular grid corresponding to the point cloud of a certain shiitake mushroom cap is shown in the figure. Figure 9 As shown in (a), the final smooth surface model corresponding to the point cloud of the shiitake mushroom cap is as follows: Figure 9 As shown in (b).
[0100] In the above embodiments, the phenotypic parameters of shiitake mushrooms can be accurately reflected by the cap thickness, maximum cap diameter, cap roundness, and cap surface area.
[0101] The present invention provides a method for determining the phenotypic parameters of shiitake mushrooms. This method involves acquiring target image data of the mushroom log from multiple viewpoints using a preset camera; for each viewpoint, determining the foreground point cloud data based on the intrinsic parameter matrix of the preset camera and the target image data corresponding to that viewpoint; extracting features from the foreground point cloud data for each viewpoint to obtain a fast point feature histogram; performing feature matching based on the fast point feature histogram to obtain multiple corresponding feature point pairs; determining the three-dimensional Euclidean distance between each feature point pair; and selecting points in the fast point feature histogram whose three-dimensional Euclidean distance is greater than a distance threshold. Feature point pairs are removed to obtain the first feature map corresponding to the viewpoint. For each feature point pair in the first feature map corresponding to the viewpoint, the line segments between the feature point pairs are determined. The difference between the line segments between the feature points and the corresponding line segments in the first feature maps of other viewpoints is determined. Feature point pairs with differences greater than the line segment threshold are removed from all first feature maps to obtain the second feature maps corresponding to each viewpoint. All second feature maps are iteratively fused based on the rigid transformation matrix and the iterative nearest point algorithm to obtain the three-dimensional point cloud data corresponding to the mushroom log. The phenotypic parameters corresponding to multiple shiitake mushrooms on the mushroom log are determined based on the three-dimensional point cloud data. The technical solution of this application acquires target image data from multiple viewpoints through a preset camera, and then recovers the three-dimensional point cloud data representing the structure of substrate-cultivated shiitake mushrooms through multi-view registration, i.e., the removal of outliers, which enhances the construction effect of three-dimensional point cloud data in weak texture environments and reduces resource consumption. Furthermore, the phenotypic measurement of shiitake mushrooms is carried out through a target detection model, which improves the accuracy and efficiency of phenotypic measurement.
[0102] The effects of the technical solution of the present invention will be illustrated by several experimental examples below.
[0103] (1) To optimize the accuracy and efficiency of phenotypic reconstruction of mushroom spawn, this paper uses sampling intervals of 30°, 15°, and 10° to evaluate the accuracy of the 3D point cloud data determined from different viewpoints. The accuracy can be evaluated using four metrics: overlap rate, RANdom Sampling Consensus (RANSAC) success rate (i.e., coarse registration success rate), iterative nearest point algorithm success rate, and root mean square error (RMSE). The overlap rate represents the proportion of areas covered by point clouds from two adjacent viewpoints, defined as the ratio of the number of neighboring points in the source point cloud that co-occur in the target point cloud to the smaller set of the two viewpoint point clouds. The RANSAC success rate is defined as the proportion of registration pairs that successfully estimate the effective rigid transformation matrix out of the total number of pairs. The iterative nearest point algorithm success rate is defined as the proportion of registration pairs that successfully converge and stop iterating under a given maximum number of iterations and a convergence threshold out of the total number of pairs. The root mean square error of registration is used to quantify the vertical distance deviation between each point in the source point cloud and the local tangent plane of the target point cloud after registration. Three-dimensional point cloud data were constructed for 50 mushroom logs, covering the growth and maturity stages (considering that the fruiting bodies of shiitake mushrooms in the fruiting stage are too small to effectively evaluate the registration effect, they were not included in this stage of evaluation), and the evaluation values were taken as the average value. Experiments showed that with a sampling interval of 30° and 12 viewing angles, the overlap rate was 31.2%, the RANSAC success rate was 71.0%, the Iterative Closest Point Algorithm success rate was 85.0%, the root mean square error of registration was 0.68 mm, the single-sample processing time in the growth phase was 1.5 minutes, and the single-sample processing time in the mature phase was 2.1 minutes. With a sampling interval of 15° and 24 viewing angles, the overlap rate was 52.3%, the RANSAC success rate was 89.0%, the Iterative Closest Point Algorithm success rate was 94.0%, the root mean square error of registration was 0.49 mm, the single-sample processing time in the growth phase was 2.6 minutes, and the single-sample processing time in the mature phase was 3.4 minutes. With a sampling interval of 10° and 36 viewing angles, the overlap rate was 67.8%, the RANSAC success rate was 96.0%, the Iterative Closest Point Algorithm success rate was 98.5%, the root mean square error of registration was 0.42 mm, the single-sample processing time in the growth phase was 3.5 minutes, and the single-sample processing time in the mature phase was 4.9 minutes. The above times are the average results after independent evaluation of each growth stage and maturity stage. During the maturity stage, due to the expansion of the cap and the increase in morphological complexity, the reconstruction time of a single sample increased by about 40% compared with the growth stage. The experimental results show that when the number of viewing angles is 36, the overlap rate of adjacent point clouds reaches 67.8%, the coarse registration success rate is 96%, and the RMSE is 0.42mm. Compared with 12 and 24 viewing angles, 36 viewing angles are the best in terms of registration accuracy, stability, and overlap rate, and the RMSE meets the accuracy requirements for phenotypic parameter measurement. Figure 10 This is a comparative diagram of 3D point cloud data with different numbers of viewpoints provided by the present invention. Figure 10 (a) represents the 3D point cloud data corresponding to 12 viewpoints. Figure 10 (b) represents the 3D point cloud data corresponding to 24 viewpoints. Figure 10 (c) represents the three-dimensional point cloud data corresponding to the 36-view perspective. The morphology of mushroom fruiting bodies is smoother under the 36-view perspective. Although the time consumption per sample increases, it is still within an acceptable range. Therefore, the present invention can preferably use the 36-view perspective.
[0104] (2) Five metrics can be used to evaluate object detection models: F1 score, Average Precision (AP), Mean Average Center Error (mATE), Mean Average Dimension Error (mASE), and Mean Average Orientation Error (mAOE). The F1 score is the harmonic mean of precision and recall, used to comprehensively reflect the stability and balance of detection. Precision measures the proportion of true positives among predicted positives, while recall measures the proportion of true positives correctly detected. Average precision is the core metric for measuring detection accuracy, defined as the area under the precision-recall curve. Mean Center Error measures the Euclidean distance between the center of the predicted bounding box and the center of the true bounding box. Mean Average Dimension Error measures the difference between the size of the predicted bounding box and the size of the true bounding box. Mean Average Orientation Error measures the minimum yaw angle difference between the predicted orientation and the true orientation. Analysis of the detection accuracy of the object detection model: With an intersection-union ratio (IU) of 0.25, the AP of the object detection model is 0.9179 and the F1-score is 0.9572, corresponding to a precision of 95.4% and a recall of 95.9%. This indicates that the object detection model has good false detection control in dense mushroom scenes while maintaining a high recall level. When the IU is set to 0.50, the AP and F1-score drop to 0.9018 and 0.9480, respectively, with a precision of 95.4% and a recall of 90.2%. The performance degradation is relatively small (AP decreases by 1.61 percentage points), indicating that the object detection model has good robustness for fine-grained bounding box localization. Analysis of the target detection model's localization accuracy: mATE = 0.001: small center position deviation, accurate spatial positioning, meeting the requirements for measuring the spatial coordinates of shiitake mushrooms; mASE = 0.053 to 0.054: size prediction deviation is controlled within a small range, meeting the requirements for measuring the three-dimensional phenotypic parameters of the cap diameter and height; mAOE = 0.006: low rotation angle prediction deviation, good attitude perception capability. In summary, the PointPillars model improved by ASPP and CBAM demonstrates good detection and localization accuracy in the 3D target detection task of shiitake mushrooms. It can efficiently identify targets under a relaxed threshold and maintain a low localization deviation and false detection rate even under a strict threshold, meeting the requirements for measuring the three-dimensional phenotypic parameters of shiitake mushroom caps.
[0105] To verify the effectiveness of CBAM and ASPP for shiitake mushroom detection, ablation experiments were conducted on the same test set. The experiments employed a controlled variable method, keeping the backbone network structure and other hyperparameters constant. Starting with the baseline model PointPillar, CBAM and ASPP were gradually introduced. After introducing CBAM alone on top of the baseline model, AP (intersection over union ratio of 0.25) increased from 0.8854 to 0.9055 (an improvement of 2.27%), AP (intersection over union ratio of 0.5) increased from 0.8751 to 0.8968 (an improvement of 2.48%), and F1 (intersection over union ratio of 0.5) increased from 0.9314 to 0.9453. This indicates that CBAM, through feature recalibration in both channel and spatial dimensions, effectively enhances the network's ability to focus on key shiitake mushroom region features, reducing false positives and false negatives caused by background noise. Furthermore, mATE decreased from 0.002 to 0.001, demonstrating that the attention mechanism helps to more accurately locate the target center point. After introducing the ASPP module alone on top of the baseline model, the AP (intersection over union ratio of 0.25) reached 0.9102, the AP (intersection over union ratio of 0.5) reached 0.8983, and the F1 (intersection over union ratio of 0.5) reached 0.9460. ASPP expands the receptive field through multi-scale dilated convolution, enabling the network to better handle the scale changes of shiitake mushrooms due to different growth stages, thereby improving the recall rate. Simultaneously introducing CBAM and ASPP, the model achieved optimal performance: AP (intersection over union ratio of 0.25) reached 0.9179, AP (intersection over union ratio of 0.5) reached 0.9018, and F1 (intersection over union ratio of 0.5) reached 0.9480, all the highest values among the four configurations. This indicates that ASPP's multi-scale contextual information extraction capability and CBAM's attention recalibration mechanism are complementary: ASPP is responsible for capturing global contextual information of shiitake mushrooms at different scales, while CBAM focuses on local key features; their synergistic effect achieves optimal detection performance. From the analysis of positioning accuracy, the joint model's mATE remained at a low level of 0.001, and the mAOE significantly decreased from 0.017 when using ASPP alone to 0.006, indicating that the combined use of the two modules can provide richer geometric constraint information for orientation angle prediction. To more intuitively compare the impact of each module on the detection performance, Figure 11 This is a comparative schematic diagram of the ablation experiment of the target detection model provided by this invention. For example... Figure 11 As shown in (a), the baseline model (PointPillar) exhibits significant false negatives in densely packed small mushroom scenes, failing to effectively detect some smaller mushrooms. After introducing a single CBAM module, as shown... Figure 11 (b) The model's ability to focus on key areas of shiitake mushrooms is enhanced, and the number of missed detections is reduced, but a small number of edge targets are still not recalled. After introducing a single ASPP module, as... Figure 11(c) Thanks to the expanded receptive field brought about by multi-scale dilated convolution, the model has better detection capabilities for both small and large shiitake mushrooms, resulting in a significant improvement in recall. For example... Figure 11 As shown in (d), when CBAM and ASPP are used together, the model achieves optimal detection performance in all scenarios: the number of missed detections is minimized, the detection boxes fit the actual mushroom contour better, and the orientation angle prediction is more accurate (corresponding to a decrease in mAOE from 0.017 to 0.006). Furthermore, from... Figure 11 (c) and Figure 11 The comparison in (d) shows that while ASPP alone can capture multi-scale information, some detection boxes exhibit slight shifts. However, the joint model, with the feature recalibration effect of CBAM, further improves the detection box localization accuracy, verifying the synergistic effectiveness of the attention mechanism and multi-scale contextual information. In summary, this demonstrates the positive contributions and synergistic enhancement effect of CBAM and ASPP modules in the mushroom detection task.
[0106] (3) To systematically evaluate the accuracy of the phenotypic parameters extracted by this invention, this invention, in order to balance verification efficiency and statistical representativeness, stratified random sampling was conducted from approximately 500 samples according to growth stage (growth period, maturity period) and size distribution. 152 samples were selected as verification samples, and the phenotypic parameters automatically extracted by the algorithm were compared one by one with the actual values obtained by manual measurement. The verification indicators covered phenotypic parameters (thickness, maximum diameter, roundness, surface area). The root mean square error (RMSE), normalized root mean square error (nRMSE), mean absolute percentage error (MAPE), and coefficient of determination (R²) were used to evaluate the accuracy of the phenotypic parameters extracted by this invention. 2Quantitative evaluation of algorithm accuracy. Root mean square error (RMSE) reflects the overall dispersion level between the algorithm-extracted values and manually measured values. This indicator retains the original dimensions, intuitively representing the actual error magnitude, and is sensitive to large error samples; the smaller the RMSE value, the higher the overall algorithm accuracy. Normalized root mean square error (nRMSE) is a dimensionless indicator obtained by normalizing the root mean square error to the mean of manually measured values. This indicator eliminates the influence of dimensions and parameter scale, facilitating accuracy comparison between different phenotypic parameters. nRMSE < 10% is generally considered high accuracy, and nRMSE between 10% and 20% is acceptable. Mean absolute percentage error (MAPE) characterizes the average deviation of the algorithm-extracted values from the true values. This indicator intuitively presents the average error level as a percentage. It is less sensitive to outliers than RMSE. MAPE < 5% is excellent, MAPE between 5% and 10% is good, and MAPE > 20% indicates insufficient algorithm reliability. The coefficient of determination (R²) characterizes the linear correlation between the algorithm-extracted values and manually measured values. It is calculated using univariate linear regression goodness of fit, with a value range of 0 to 1. 2 The closer the result is to 1, the stronger the algorithm's ability to explain the variation in the true value, and the better the linear consistency between the two. Figure 12 This is a schematic diagram comparing the phenotypic parameters provided by this invention with manually measured values, such as... Figure 12 As shown, based on the comparative verification of 152 shiitake mushroom samples, the phenotypic parameters calculated in this application showed varying degrees of consistency with the manually measured values. Figure 12 The black dots represent scattered data points. Each black dot represents a shiitake mushroom verification sample. The horizontal axis represents the manually measured value of that sample, and the vertical axis represents the value automatically calculated / extracted by the method in this application. There are 152 black dots for 152 samples. The closer the distribution of the dots is to the diagonal, the higher the accuracy of the method in this application. The red dashed line represents the univariate linear regression fitting line (trend line), and the function corresponding to the red dashed line is represented by y in the graph.
[0107] The phenotypic parameter determination device for shiitake mushrooms provided by the present invention will be described below. The phenotypic parameter determination device for shiitake mushrooms described below can be referred to in correspondence with the phenotypic parameter determination method for shiitake mushrooms described above.
[0108] Figure 13 This is a schematic diagram of the phenotypic parameter determination device for shiitake mushrooms provided by the present invention, as shown below. Figure 13 As shown, the phenotypic parameter determination device 1300 for this shiitake mushroom includes the following modules: The acquisition module 1310 is used to acquire target image data of the mushroom stick from multiple perspectives through a preset camera; The first determining module 1320 is used to determine the foreground cloud data corresponding to each of the aforementioned viewpoints based on the intrinsic parameter matrix corresponding to the preset camera and the target image data corresponding to the viewpoint. The first elimination module 1330 is used to extract features from the foreground point cloud data for each of the aforementioned viewpoints to obtain a fast point feature histogram corresponding to the viewpoint; perform feature matching based on the fast point feature histogram to obtain multiple corresponding feature point pairs; determine the three-dimensional Euclidean distance of each feature point pair; and eliminate feature point pairs in the fast point feature histogram whose three-dimensional Euclidean distance is greater than a distance threshold to obtain a first feature map corresponding to the viewpoint. The second elimination module 1340 is used to determine the line segments between the feature points in each feature point pair in the first feature map corresponding to the viewpoint; determine the difference between the line segments between the feature points and the corresponding line segments between the feature points in the first feature map of other viewpoints besides the viewpoint; and eliminate feature point pairs whose difference is greater than the line segment threshold in all the first feature maps to obtain the second feature map corresponding to each viewpoint. The fusion module 1350 is used to iteratively fuse all the second feature maps based on the rigid transformation matrix and the iterative nearest point algorithm to obtain the three-dimensional point cloud data corresponding to the mushroom stick. The second determining module 1360 is used to determine the phenotypic parameters corresponding to multiple shiitake mushrooms on the mushroom stick based on the three-dimensional point cloud data.
[0109] In one embodiment, the first determining module 1320 is specifically used for: The original point cloud data corresponding to the viewpoint is determined based on the intrinsic parameter matrix and the target image data corresponding to the viewpoint. The original point cloud data corresponding to the viewpoint is filtered to obtain the foreground point cloud data corresponding to the viewpoint.
[0110] In one embodiment, the first determining module 1320 is further configured to: The median of the data was determined based on all the original point cloud data described above. The upper and lower threshold values of the point cloud are determined based on the median of the data. For each of the aforementioned viewpoints, the original point cloud data corresponding to the viewpoint is filtered based on the upper limit threshold and the lower limit threshold of the point cloud to obtain the first point cloud data corresponding to the viewpoint; the first point cloud data is then filtered based on a statistical filtering method to obtain the foreground point cloud data corresponding to the viewpoint.
[0111] In one embodiment, the first rejection module 1330 is specifically used for: The local normal vector corresponding to the foreground cloud data is determined based on the preset covariance matrix and the foreground cloud data corresponding to the viewpoint. Based on the local normal vector, feature extraction is performed on the foreground point cloud data to obtain a fast point feature histogram corresponding to the viewpoint.
[0112] In one embodiment, the second determining module 1360 is specifically used for: The 3D point cloud data is input into the target detection model to obtain the 3D bounding box output by the target detection model; the target detection model is trained based on the sample point cloud data and corresponding labels. Based on the three-dimensional bounding box and the three-dimensional point cloud data, determine the point cloud of the mushroom cap corresponding to each of the mushrooms; For each of the shiitake mushrooms, the phenotypic parameters corresponding to the shiitake mushrooms are determined based on the point cloud of the shiitake mushroom cap.
[0113] In one embodiment, the second determining module 1360 is further configured to: The three-dimensional point cloud data is input into the columnar feature encoder in the target detection model to obtain the pseudo-image feature map output by the columnar feature encoder. The pseudo-image feature map is input into the backbone network of the target detection model to obtain the dense bird's-eye view features output by the backbone network; the backbone network includes a spatial pyramid pooling module, which is used to obtain multi-scale information of the pseudo-image feature map; The dense bird's-eye view features are input into the convolutional block attention module in the target detection model to obtain the purified dense bird's-eye view features output by the convolutional block attention module; the convolutional block attention module is used to perform attention purification on the dense bird's-eye view features; The purified dense bird's-eye view features are input into the detection head of the target detection model to obtain the three-dimensional bounding box output by the detection head.
[0114] In one embodiment, the second determining module 1360 is further configured to: For each of the shiitake mushrooms, an initial single mushroom point cloud is determined based on the three-dimensional bounding box and the three-dimensional point cloud data; The initial single-mushroom point cloud is denoised to obtain the first denoised single-mushroom point cloud; Statistical filtering is performed on the first single mushroom point cloud to obtain the filtered second single mushroom point cloud; Remove the stipe dot cloud from the second single mushroom dot cloud to obtain the third single mushroom dot cloud; The pose normalization of the third single mushroom point cloud was performed based on principal component analysis to obtain the mushroom cap point cloud corresponding to the mushroom.
[0115] In one embodiment, the second determining module 1360 is further configured to: The pose normalization of the second single mushroom point cloud is performed based on principal component analysis to obtain the normalized single mushroom point cloud corresponding to the second single mushroom point cloud. For each data point in the normalized single mushroom point cloud, determine the unit normal vector corresponding to the data point; determine the horizontal distance of the data point to the Z-axis of the coordinate system; The data point is determined to be a stipe point cloud based on a horizontal distance threshold, an angle threshold, the unit normal vector, and the horizontal distance; wherein, if the angle between the unit normal vector and the direction unit vector of the Z-axis of the coordinate system is greater than the angle threshold, and the horizontal distance is less than the horizontal distance threshold, the data point is determined to be a stipe point cloud. The third single mushroom point cloud is obtained by removing each of the stipe point clouds from the second single mushroom point cloud.
[0116] In one embodiment, the phenotypic parameters include cap thickness, maximum cap diameter, cap roundness, and cap surface area.
[0117] The phenotypic parameter determination device for shiitake mushrooms provided by this invention acquires target image data of the mushroom log from multiple viewpoints using a preset camera; for each viewpoint, it determines the foreground point cloud data corresponding to the viewpoint based on the intrinsic parameter matrix corresponding to the preset camera and the target image data corresponding to the viewpoint; for each viewpoint, it extracts features from the foreground point cloud data to obtain a fast point feature histogram corresponding to the viewpoint; it performs feature matching based on the fast point feature histogram to obtain multiple corresponding feature point pairs; for each feature point pair, it determines the three-dimensional Euclidean distance between the feature point pairs; and it selects points from the fast point feature histogram whose three-dimensional Euclidean distance is greater than a distance threshold. Feature point pairs are removed to obtain the first feature map corresponding to the viewpoint. For each feature point pair in the first feature map corresponding to the viewpoint, the line segments between the feature point pairs are determined. The difference between the line segments between the feature points and the corresponding line segments in the first feature maps of other viewpoints is determined. Feature point pairs with differences greater than the line segment threshold are removed from all first feature maps to obtain the second feature maps corresponding to each viewpoint. All second feature maps are iteratively fused based on the rigid transformation matrix and the iterative nearest point algorithm to obtain the three-dimensional point cloud data corresponding to the mushroom log. The phenotypic parameters corresponding to multiple shiitake mushrooms on the mushroom log are determined based on the three-dimensional point cloud data. The technical solution of this application acquires target image data from multiple viewpoints through a preset camera, and then recovers the three-dimensional point cloud data representing the structure of substrate-cultivated shiitake mushrooms through multi-view registration, i.e., the removal of outliers, which enhances the construction effect of three-dimensional point cloud data in weak texture environments and reduces resource consumption. Furthermore, the phenotypic measurement of shiitake mushrooms is carried out through a target detection model, which improves the accuracy and efficiency of phenotypic measurement.
[0118] Figure 14 This is a schematic diagram of the structure of the electronic device provided by the present invention, such as... Figure 14As shown, the electronic device may include: a processor 1410, a communications interface 1420, a memory 1430, and a communication bus 1440, wherein the processor 1410, the communications interface 1420, and the memory 1430 communicate with each other via the communication bus 1440. The processor 1410 can call logical instructions in the memory 1430 to execute a method for determining the phenotypic parameters of shiitake mushrooms, the method including: The target image data of the mushroom sticks are acquired from multiple perspectives using a preset camera. For each of the aforementioned viewpoints, the foreground cloud data corresponding to the viewpoint is determined based on the intrinsic parameter matrix corresponding to the preset camera and the target image data corresponding to the viewpoint. For each of the aforementioned viewpoints, feature extraction is performed on the foreground point cloud data to obtain a fast point feature histogram corresponding to the viewpoint; feature matching is performed based on the fast point feature histogram to obtain multiple corresponding feature point pairs; for each of the aforementioned feature point pairs, the three-dimensional Euclidean distance of the feature point pair is determined; feature point pairs in the fast point feature histogram whose three-dimensional Euclidean distance is greater than a distance threshold are removed to obtain a first feature map corresponding to the viewpoint. For each pair of feature points in the first feature map corresponding to the viewpoint, the line segment between the feature points is determined; the difference between the line segment between the feature points and the corresponding line segment between the feature points in the first feature map of other viewpoints besides the viewpoint is determined; feature point pairs with a difference greater than the line segment threshold are removed from all the first feature maps to obtain the second feature map corresponding to each viewpoint. Based on the rigid transformation matrix and the iterative nearest point algorithm, all the second feature maps are iteratively fused to obtain the three-dimensional point cloud data corresponding to the mushroom stick; Based on the three-dimensional point cloud data, the phenotypic parameters corresponding to the multiple shiitake mushrooms on the mushroom stick are determined.
[0119] Furthermore, the logical instructions in the aforementioned memory 1430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0120] On the other hand, the present invention also provides a computer program product, the computer program product comprising a computer program that can be stored on a non-transitory computer-readable storage medium, wherein when the computer program is executed by a processor, the computer is able to execute the phenotypic parameter determination method for shiitake mushrooms provided by the above methods, the method comprising: The target image data of the mushroom sticks are acquired from multiple perspectives using a preset camera. For each of the aforementioned viewpoints, the foreground cloud data corresponding to the viewpoint is determined based on the intrinsic parameter matrix corresponding to the preset camera and the target image data corresponding to the viewpoint. For each of the aforementioned viewpoints, feature extraction is performed on the foreground point cloud data to obtain a fast point feature histogram corresponding to the viewpoint; feature matching is performed based on the fast point feature histogram to obtain multiple corresponding feature point pairs; for each of the aforementioned feature point pairs, the three-dimensional Euclidean distance of the feature point pair is determined; feature point pairs in the fast point feature histogram whose three-dimensional Euclidean distance is greater than a distance threshold are removed to obtain a first feature map corresponding to the viewpoint. For each pair of feature points in the first feature map corresponding to the viewpoint, the line segment between the feature points is determined; the difference between the line segment between the feature points and the corresponding line segment between the feature points in the first feature map of other viewpoints besides the viewpoint is determined; feature point pairs with a difference greater than the line segment threshold are removed from all the first feature maps to obtain the second feature map corresponding to each viewpoint. Based on the rigid transformation matrix and the iterative nearest point algorithm, all the second feature maps are iteratively fused to obtain the three-dimensional point cloud data corresponding to the mushroom stick; Based on the three-dimensional point cloud data, the phenotypic parameters corresponding to the multiple shiitake mushrooms on the mushroom stick are determined.
[0121] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for determining the phenotypic parameters of shiitake mushrooms provided by the methods described above, the method comprising: The target image data of the mushroom sticks are acquired from multiple perspectives using a preset camera. For each of the aforementioned viewpoints, the foreground cloud data corresponding to the viewpoint is determined based on the intrinsic parameter matrix corresponding to the preset camera and the target image data corresponding to the viewpoint. For each of the aforementioned viewpoints, feature extraction is performed on the foreground point cloud data to obtain a fast point feature histogram corresponding to the viewpoint; feature matching is performed based on the fast point feature histogram to obtain multiple corresponding feature point pairs; for each of the aforementioned feature point pairs, the three-dimensional Euclidean distance of the feature point pair is determined; feature point pairs in the fast point feature histogram whose three-dimensional Euclidean distance is greater than a distance threshold are removed to obtain a first feature map corresponding to the viewpoint. For each pair of feature points in the first feature map corresponding to the viewpoint, the line segment between the feature points is determined; the difference between the line segment between the feature points and the corresponding line segment between the feature points in the first feature map of other viewpoints besides the viewpoint is determined; feature point pairs with a difference greater than the line segment threshold are removed from all the first feature maps to obtain the second feature map corresponding to each viewpoint. Based on the rigid transformation matrix and the iterative nearest point algorithm, all the second feature maps are iteratively fused to obtain the three-dimensional point cloud data corresponding to the mushroom stick; Based on the three-dimensional point cloud data, the phenotypic parameters corresponding to the multiple shiitake mushrooms on the mushroom stick are determined.
[0122] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0123] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0124] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for determining phenotypic parameters of shiitake mushrooms, characterized in that, include: The target image data of the mushroom sticks are acquired from multiple perspectives using a preset camera. For each of the aforementioned viewpoints, the foreground cloud data corresponding to the viewpoint is determined based on the intrinsic parameter matrix corresponding to the preset camera and the target image data corresponding to the viewpoint. For each of the aforementioned viewpoints, feature extraction is performed on the foreground point cloud data to obtain a fast point feature histogram corresponding to the viewpoint; feature matching is performed based on the fast point feature histogram to obtain multiple corresponding feature point pairs; for each of the aforementioned feature point pairs, the three-dimensional Euclidean distance of the feature point pair is determined; feature point pairs in the fast point feature histogram whose three-dimensional Euclidean distance is greater than a distance threshold are removed to obtain a first feature map corresponding to the viewpoint. For each pair of feature points in the first feature map corresponding to the viewpoint, determine the line segments between the feature point pairs; Determine the difference between the line segment between the points and the corresponding line segment in the first feature map of other viewpoints besides the stated viewpoint; remove feature point pairs whose difference is greater than the line segment threshold in all the first feature maps to obtain the second feature map corresponding to each of the stated viewpoints; Based on the rigid transformation matrix and the iterative nearest point algorithm, all the second feature maps are iteratively fused to obtain the three-dimensional point cloud data corresponding to the mushroom stick; Based on the three-dimensional point cloud data, the phenotypic parameters corresponding to the multiple shiitake mushrooms on the mushroom stick are determined.
2. The method for determining phenotypic parameters of shiitake mushrooms according to claim 1, characterized in that, The step of determining the foreground cloud data corresponding to the viewpoint based on the intrinsic parameter matrix corresponding to the preset camera and the target image data corresponding to the viewpoint includes: The original point cloud data corresponding to the viewpoint is determined based on the intrinsic parameter matrix and the target image data corresponding to the viewpoint. The original point cloud data corresponding to the viewpoint is filtered to obtain the foreground point cloud data corresponding to the viewpoint.
3. The method for determining the phenotypic parameters of shiitake mushrooms according to claim 2, characterized in that, The step of filtering the original point cloud data corresponding to the viewpoint to obtain the foreground point cloud data corresponding to the viewpoint includes: The median of the data was determined based on all the original point cloud data described above. The upper and lower threshold values of the point cloud are determined based on the median of the data. For each of the aforementioned viewpoints, the original point cloud data corresponding to the viewpoint is filtered based on the upper limit threshold and the lower limit threshold of the point cloud to obtain the first point cloud data corresponding to the viewpoint; the first point cloud data is then filtered based on a statistical filtering method to obtain the foreground point cloud data corresponding to the viewpoint.
4. The method for determining phenotypic parameters of shiitake mushrooms according to claim 1, characterized in that, The step of extracting features from the foreground point cloud data to obtain a fast point feature histogram corresponding to the viewpoint includes: The local normal vector corresponding to the foreground cloud data is determined based on the preset covariance matrix and the foreground cloud data corresponding to the viewpoint. Based on the local normal vector, feature extraction is performed on the foreground point cloud data to obtain a fast point feature histogram corresponding to the viewpoint.
5. The method for determining phenotypic parameters of shiitake mushroom according to claim 1, characterized in that, The step of determining the phenotypic parameters corresponding to multiple shiitake mushrooms on the mushroom log based on the three-dimensional point cloud data includes: The 3D point cloud data is input into the target detection model to obtain the 3D bounding box output by the target detection model; the target detection model is trained based on the sample point cloud data and corresponding labels. Based on the three-dimensional bounding box and the three-dimensional point cloud data, determine the point cloud of the mushroom cap corresponding to each of the mushrooms; For each of the shiitake mushrooms, the phenotypic parameters corresponding to the shiitake mushrooms are determined based on the point cloud of the shiitake mushroom cap.
6. The method for determining phenotypic parameters of shiitake mushrooms according to claim 5, characterized in that, The step of inputting the 3D point cloud data into the target detection model to obtain the 3D bounding box output by the target detection model includes: The three-dimensional point cloud data is input into the columnar feature encoder in the target detection model to obtain the pseudo-image feature map output by the columnar feature encoder. The pseudo-image feature map is input into the backbone network of the target detection model to obtain the dense bird's-eye view features output by the backbone network; the backbone network includes a spatial pyramid pooling module, which is used to obtain multi-scale information of the pseudo-image feature map; The dense bird's-eye view features are input into the convolutional block attention module in the target detection model to obtain the purified dense bird's-eye view features output by the convolutional block attention module; the convolutional block attention module is used to perform attention purification on the dense bird's-eye view features; The purified dense bird's-eye view features are input into the detection head of the target detection model to obtain the three-dimensional bounding box output by the detection head.
7. The method for determining phenotypic parameters of shiitake mushroom according to claim 5, characterized in that, The step of determining the mushroom cap point cloud corresponding to each of the shiitake mushrooms based on the three-dimensional bounding box and the three-dimensional point cloud data includes: For each of the shiitake mushrooms, an initial single mushroom point cloud is determined based on the three-dimensional bounding box and the three-dimensional point cloud data; The initial single-mushroom point cloud is denoised to obtain the first denoised single-mushroom point cloud; Statistical filtering is performed on the first single mushroom point cloud to obtain the filtered second single mushroom point cloud; Remove the stipe dot cloud from the second single mushroom dot cloud to obtain the third single mushroom dot cloud; The pose normalization of the third single mushroom point cloud was performed based on principal component analysis to obtain the mushroom cap point cloud corresponding to the mushroom.
8. The method for determining phenotypic parameters of shiitake mushroom according to claim 7, characterized in that, The process of removing the stipe dot cloud from the second single mushroom dot cloud to obtain the third single mushroom dot cloud includes: The pose normalization of the second single mushroom point cloud is performed based on principal component analysis to obtain the normalized single mushroom point cloud corresponding to the second single mushroom point cloud. For each data point in the normalized single mushroom point cloud, determine the unit normal vector corresponding to the data point; determine the horizontal distance of the data point to the Z-axis of the coordinate system; The data point is determined to be a stipe point cloud based on a horizontal distance threshold, an angle threshold, the unit normal vector, and the horizontal distance; wherein, if the angle between the unit normal vector and the direction unit vector of the Z-axis of the coordinate system is greater than the angle threshold, and the horizontal distance is less than the horizontal distance threshold, the data point is determined to be a stipe point cloud. The third single mushroom point cloud is obtained by removing each of the stipe point clouds from the second single mushroom point cloud.
9. The method for determining phenotypic parameters of shiitake mushroom according to any one of claims 1 to 8, characterized in that, The phenotypic parameters include cap thickness, maximum cap diameter, cap roundness, and cap surface area.
10. A device for determining the phenotypic parameters of shiitake mushrooms, characterized in that, include: The acquisition module is used to acquire target image data of the mushroom sticks from multiple perspectives using a preset camera. The first determining module is used to determine the foreground cloud data corresponding to each of the aforementioned viewpoints based on the intrinsic parameter matrix corresponding to the preset camera and the target image data corresponding to the viewpoint. The first elimination module is used to extract features from the foreground point cloud data for each of the aforementioned viewpoints to obtain a fast point feature histogram corresponding to the viewpoint; perform feature matching based on the fast point feature histogram to obtain multiple corresponding feature point pairs; determine the three-dimensional Euclidean distance of each feature point pair; and eliminate feature point pairs in the fast point feature histogram whose three-dimensional Euclidean distance is greater than a distance threshold to obtain a first feature map corresponding to the viewpoint. The second elimination module is used to determine the line segments between feature point pairs in the first feature map corresponding to the viewpoint. Determine the difference between the line segment between the points and the corresponding line segment in the first feature map of other viewpoints besides the stated viewpoint; remove feature point pairs whose difference is greater than the line segment threshold in all the first feature maps to obtain the second feature map corresponding to each of the stated viewpoints; The fusion module is used to iteratively fuse all the second feature maps based on the rigid transformation matrix and the iterative nearest point algorithm to obtain the three-dimensional point cloud data corresponding to the mushroom stick. The second determining module is used to determine the phenotypic parameters corresponding to multiple shiitake mushrooms on the mushroom stick based on the three-dimensional point cloud data.