A method and system for segmentation of fruiting bodies and packets of edible mushrooms
By performing coarse segmentation and hole detection on the point cloud data of edible fungi, and tracing the point cloud in reverse along the growth direction of the stipe, the problem of low segmentation accuracy of edible fungi fruiting bodies and fungal bags in the existing technology is solved, and a high-precision segmentation effect is achieved.
Patent Information
- Application Number
- CN202511516723.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-23
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2045-10-23
AI Technical Summary
In existing technologies, the three-dimensional reconstruction and segmentation methods for edible fungi fruiting bodies and fungal bags cannot achieve high-precision segmentation, resulting in large errors in the measurement of phenotypic parameters.
By coarsely segmenting the edible mushroom point cloud data, the initial point cloud of the mushroom bag and the initial point cloud of the fruiting body are obtained. The cavity detection method is used to find the cavity boundary of the stipe residue. The point cloud is traced in reverse along the growth direction of the stipe to construct the stipe residue point cloud. Finally, the residue point cloud is removed to achieve accurate segmentation.
It improves the accuracy of segmentation of edible fungi fruiting bodies and mushroom bags, and reduces measurement errors.
Smart Images

Figure CN120997241B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of fruiting body and stipe segmentation, and particularly relates to a fruiting body and stipe segmentation method and system based on edible fungi. BACKGROUND
[0002] The stipe, also known as a cultivation bag or a cultivation package, is a core carrier for artificial cultivation of edible fungi (such as shiitake mushrooms, tree mushrooms, etc.). The core components of the stipe include a culture medium and a strain, and the stipe is usually packaged with a breathable material to form a stipe. After sterilization and inoculation of the culture medium (nutrients), the stipe is prepared to provide suitable nutrients, humidity, and environmental conditions for the growth of edible fungus mycelium and the development of fruiting bodies (edible parts). It is a key tool for large-scale and standardized production of edible fungi in modern agriculture, and is widely used in home planting and commercial planting scenarios. Obtaining the phenotypic parameters of the fruiting body and the morphological changes of the stipe during the growth of the edible fungi is of great significance for the optimization of the cultivation process and the preparation process of the stipe.
[0003] Due to the occlusion problem, the extraction of the phenotypic parameters of the edible fungus fruiting body using two-dimensional pictures is usually not comprehensive, so three-dimensional reconstruction is considered. However, since the fruiting body grows on the stipe, and the stipe and the stem have similar colors, and the surface of the stipe is concave-convex. Whether using Neural Radiance Fields (NERF) technology, Multi-View Stereo (mvs), or other methods, the stipe point cloud and the fruiting body point cloud are closely related after three-dimensional reconstruction, which causes the conventional method to be unable to better segment, resulting in a certain error in subsequent phenotypic parameter measurement. Therefore, a technical solution is needed to segment the edible fungus fruiting body and stipe point cloud with high precision. SUMMARY
[0004] Therefore, the purpose of the present application is to provide a fruiting body and stipe segmentation method and system based on edible fungi, which solves the technical problem that the existing fruiting body and stipe segmentation method cannot achieve high-precision segmentation.
[0005] In one aspect, the present application provides a fruiting body and stipe segmentation method based on edible fungi, comprising:
[0006] Obtaining edible fungus point cloud data and performing coarse segmentation to obtain stipe initial point cloud and fruiting body initial point cloud, the fruiting body initial point cloud including stipe initial point cloud and cap point cloud, and performing cavity detection on the stipe initial point cloud using a triangulation cavity detection method to obtain a plurality of surface cavities of the stipe initial point cloud;
[0007] According to the size and height, the surface cavity is filtered to obtain a cavity boundary, which is the uppermost annular structure of a stipe residual part, which is the remaining part of the stipe in the fruiting body on the pileus after coarse segmentation, and all points are tracked in the reverse direction along the growth direction of the stipe from the cavity boundary as the starting point until the end point of the stipe residual part is detected to construct a stipe residual point cloud, and the stipe residual point cloud and the initial point cloud of the fruiting body are used to construct an actual point cloud of the fruiting body, and the initial point cloud of the pileus is used to construct an actual point cloud of the pileus after removing the stipe residual point cloud;
[0008] According to the actual point cloud of the pileus and the actual point cloud of the fruiting body, the point cloud data of the edible mushroom is segmented to obtain the actual point cloud of the pileus and the actual point cloud of the fruiting body.
[0009] The above-mentioned segmentation method of the fruiting body and the pileus of the edible mushroom is used to first coarsely segment the point cloud data of the edible mushroom to obtain the initial point cloud of the pileus and the initial point cloud of the fruiting body, and in order to improve the segmentation accuracy, the initial point cloud of the pileus is subjected to cavity detection to obtain a plurality of surface cavities of the initial point cloud of the pileus and then obtain a cavity boundary, and all points are tracked in the reverse direction along the growth direction of the stipe from the cavity boundary as the starting point until the end point of the stipe residual part is detected to construct a stipe residual point cloud, and the stipe residual point cloud and the initial point cloud of the fruiting body are used to construct an actual point cloud of the fruiting body, and the initial point cloud of the pileus is used to construct an actual point cloud of the pileus after removing the stipe residual point cloud, and according to the actual point cloud of the pileus and the actual point cloud of the fruiting body, the point cloud data of the edible mushroom is segmented to obtain the actual point cloud of the pileus and the actual point cloud of the fruiting body, and through coarse segmentation and secondary segmentation of the stipe residual part, accurate segmentation of the pileus and the fruiting body is realized, and the segmentation accuracy is improved.
[0010] In addition, the above-mentioned segmentation method of the fruiting body and the pileus of the edible mushroom according to the present application can have the following additional technical features:
[0011] Further, the step of obtaining the point cloud data of the edible mushroom and coarsely segmenting to obtain the initial point cloud of the pileus and the initial point cloud of the fruiting body comprises:
[0012] The original point cloud data of the edible mushroom is obtained and preprocessed to obtain preprocessed original point cloud data of the edible mushroom, and the normal vector of the point is calculated according to the preprocessed original point cloud data of the edible mushroom to preliminarily determine a total set of top surface points, which includes a pileus top surface point set and a cap top surface point set;
[0013] The top surface point set is clustered to obtain a plurality of connected regions, and a mushroom cap top surface point set and a mushroom cover top surface point set are obtained according to the area and height of the connected regions, and a mushroom cap cylindrical model is constructed according to the position of the original mushroom cap top surface, the position of the original mushroom cap bottom and the preset diameter, and the edible mushroom point cloud data is obtained by updating the edible mushroom original point cloud data through the mushroom cap cylindrical model, and the edible mushroom point cloud data is coarsely segmented to obtain a mushroom cap initial point cloud and a fruiting body initial point cloud.
[0014] Further, the step of obtaining the mushroom cap top surface point set and the mushroom cover top surface point set according to the area and height of the connected regions comprises:
[0015] The area of each connected region is calculated and its height is determined, the areas are arranged in descending order, and the connected region corresponding to the lowest height and the largest area is the mushroom cap top surface point set, and the other connected regions are the mushroom cover top surface point set.
[0016] Further, the method for obtaining the preset diameter comprises:
[0017] The lowest point of the point cloud is determined according to the edible mushroom original point cloud data to determine the mushroom cap bottom.
[0018] A preset height above the mushroom cap bottom is sampled along the outer side of the mushroom cap to obtain a sampling point set, the center is obtained by least square circle fitting on the sampling point set, and the radius is calculated, and the diameter is obtained according to the calculated radius to obtain the preset diameter.
[0019] Further, in the step of tracking all points from the hollow boundary as a starting point in the reverse direction of the stem growth direction until the termination point of the stem residue is detected to construct a stem residue point cloud of all tracked points:
[0020] When tracking all points, it is necessary to determine whether each point meets all the constraint conditions at the same time, and the constraint conditions include spatial continuity, height constraint, normal vector constraint and curvature constraint, wherein:
[0021] The spatial continuity is that the new point needs to be in the neighborhood of the current point and move in the reverse direction of the stem growth direction;
[0022] The height constraint is that the height of the new point needs to be lower than that of the current point;
[0023] The normal vector constraint is that the angle between the normal vector direction of the point on the stem and the stem growth direction meets the first angle threshold, and the angle between the normal vector direction of the point on the mushroom cap top surface and the stem growth direction is less than the second angle threshold;
[0024] The curvature constraint is that the curvature value of the point where the stipe and the bag are connected is greater than the curvature threshold. Further, the step of calculating the normal vector of the point based on the pre-processed edible mushroom original point cloud data to preliminarily determine the total set of top surface points comprises:
[0025] The normal vector of each point of the pre-processed edible mushroom original point cloud data is calculated to extract the component value in the positive direction of the Z-axis;
[0026] The bag surface is preliminarily positioned based on the component value in the positive direction of the Z-axis of the pre-processed edible mushroom original point cloud data to obtain the preliminarily positioned edible mushroom original point cloud data, and the total set of top surface points is obtained based on the preliminarily positioned edible mushroom original point cloud data.
[0027] In another aspect, the application provides a fruiting body and bag segmentation system based on edible mushrooms, which comprises:
[0028] An acquisition module is configured to acquire edible mushroom point cloud data and perform coarse segmentation to obtain bag initial point cloud and fruiting body initial point cloud, wherein the fruiting body initial point cloud comprises stipe initial point cloud and cap point cloud, and a triangular subdivision cavity detection method is used to detect cavities of the bag initial point cloud to obtain a plurality of surface cavities of the bag initial point cloud;
[0029] A screening module is configured to screen and filter the surface cavities based on size and height to obtain a cavity boundary, wherein the cavity boundary is the uppermost annular structure of the stipe residual part, the stipe residual part is the part of the stipe in the fruiting body left on the bag after coarse segmentation, and all points are tracked in the reverse direction of the stipe growth direction from the cavity boundary as the starting point until the end point of the stipe residual part is detected to construct a stipe residual point cloud, the stipe residual point cloud and the fruiting body initial point cloud construct an actual fruiting body point cloud, and the bag initial point cloud removes the stipe residual point cloud to form an actual bag point cloud;
[0030] A segmentation module is configured to segment the edible mushroom point cloud data based on the actual bag point cloud and the actual fruiting body point cloud to obtain an actual bag point cloud and an actual fruiting body point cloud.
[0031] In another aspect, the application provides a computer readable storage medium having a computer program stored thereon, wherein the program is executed by a processor to implement the fruiting body and bag segmentation method based on edible mushrooms.
[0032] In another aspect, the application also provides a data processing device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the program to implement the fruiting body and bag segmentation method based on edible mushrooms. BRIEF DESCRIPTION OF DRAWINGS
[0033] Figure 1Flow chart of the method for splitting the fruiting body and the mushroom bag based on edible fungi in the embodiment of the present application;
[0034] Figure 2 Specific flow chart of step S101 in the embodiment of the present application;
[0035] Figure 3 Normal vector Z-axis positive direction component heat map in the embodiment of the present application;
[0036] Figure 4 Mushroom bag and mushroom cap surface rough extraction effect graph based on Z-axis component in the embodiment of the present application;
[0037] Figure 5 Normal vector calculation principle diagram in the embodiment of the present application;
[0038] Figure 6 Point normal vector visualization diagram in the embodiment of the present application;
[0039] Figure 7 Mushroom bag and mushroom cap top surface segmentation effect diagram in the embodiment of the present application;
[0040] Figure 8 Mushroom bag top surface fitting effect diagram in the embodiment of the present application;
[0041] Figure 9 Mushroom bag top surface positioning effect diagram in the embodiment of the present application;
[0042] Figure 10 Sampling diagram within a specified height in the embodiment of the present application;
[0043] Figure 11 Mushroom bag radius fitting diagram in the embodiment of the present application;
[0044] Figure 12 Mushroom bag cylindrical model diagram in the embodiment of the present application;
[0045] Figure 13 Boundary edge and non-boundary edge diagram in the embodiment of the present application;
[0046] Figure 14 Hole extraction effect diagram in the embodiment of the present application;
[0047] Figure 15 Hole filtering effect diagram in the embodiment of the present application;
[0048] Figure 16 Stem root area normal vector direction diagram in the embodiment of the present application;
[0049] Figure 17 Stem root residual diagram in the embodiment of the present application;
[0050] Figure 18A segmentation effect diagram of the fungus bag and the fruiting body in the embodiment of the present application;
[0051] The following detailed description will further illustrate the present application in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION
[0052] In order to facilitate the understanding of the present application, the present application will be described more fully below with reference to the accompanying drawings. The drawings show several embodiments of the present application. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive.
[0053] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the present application. As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0054] In order to solve the technical problem that the existing fruiting body and fungus bag segmentation method cannot achieve high-precision segmentation, the present application provides a method and system for segmenting fruiting bodies and fungus bags based on edible mushrooms. The edible mushroom point cloud data is first coarsely segmented to obtain initial point clouds of the fungus bag and the fruiting body. After coarse segmentation of the fungus bag and the fruiting body, the stipe residual part is left on the fungus bag. In order to improve the segmentation accuracy, the initial point cloud of the fungus bag is subjected to a cavity detection to obtain a plurality of surface cavities of the initial point cloud of the fungus bag and further obtain a cavity boundary. Then, starting from the cavity boundary, all points are traced in the reverse direction along the growth direction of the stipe until the end point of the stipe residual part is detected to construct a stipe residual point cloud from all the traced points. The stipe residual point cloud and the initial point cloud of the fruiting body are used to construct an actual fruiting body point cloud. After removing the stipe residual point cloud from the initial point cloud of the fungus bag, an actual fungus bag point cloud is formed. Then, the edible mushroom point cloud data is segmented based on the actual fungus bag point cloud and the actual fruiting body point cloud to obtain an actual fungus bag point cloud and an actual fruiting body point cloud. Through coarse segmentation and secondary segmentation of the stipe residual part, accurate segmentation of the fungus bag and the fruiting body is achieved, and the segmentation accuracy is improved.
[0055] In order to facilitate the understanding of the present application, several embodiments of the present application will be presented below. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive.
[0056] Embodiment one
[0057] Please refer to Figure 1As shown in the figure, it is an edible mushroom based on fruit body and mushroom bag segmentation method in the first embodiment of the application, the method comprises steps S101-S104:
[0058] S101, obtain edible mushroom point cloud data and perform coarse segmentation to obtain initial point cloud of mushroom bag and initial point cloud of sub entity.
[0059] As a specific example, the initial point cloud of sub entity includes initial point cloud of stipe and cap point cloud. Further, as shown in the figure, step S101 specifically includes steps S1011-S1013: Figure 2
[0060] S1011, obtain edible mushroom original point cloud data and perform preprocessing to obtain preprocessed edible mushroom original point cloud data, calculate the normal vector of the point according to the preprocessed edible mushroom original point cloud data to preliminarily determine the total set of top surface points, and the total set of top surface points includes the set of mushroom bag top surface points and the set of cap top surface points.
[0061] As a specific example, in order to better perform coarse segmentation on the obtained edible mushroom original point cloud data, the obtained edible mushroom original point cloud data needs to be preprocessed, specifically, the preprocessing method includes: first, uniformly down-sampling the obtained edible mushroom original point cloud data; second, calculating the centroid of the point cloud, and translating all points until the centroid moves to the origin position to centralize the coordinates; then, using statistical filtering and conditional filtering to remove outlier noise points of the reconstructed point cloud data to realize filtering and denoising; second, using PCA (Principal Component Analysis, PCA) algorithm to calculate the main direction of the point cloud, corresponding to the horizontal diameter direction and vertical direction of the mushroom bag respectively, aligning the main direction of the point cloud with the coordinate axis to rotate the point cloud, the coordinate system is set: O is the coordinate origin, XOY is the horizontal plane, Z axis is perpendicular to XOY plane, Z axis positive direction is perpendicular to XOY plane upward, the vertical direction of the mushroom bag corresponds to Z axis, and the spatial position relationship of the edible mushroom above the mushroom bag is ensured, so as to correct the main direction; further, using straight-through filtering to separate the already rotated carrier platform and the calibration object to obtain preprocessed edible mushroom original point cloud data. Further, calculate the proportion based on the calibration object, and restore the point cloud coordinates to the real size, and the calculation formula is:
[0062] ;
[0063] In the formula, l real , w real and h real respectively represent the real length, width and height of the calibration object; l reco , w reco and h reco respectively represent the length, width and height of the calibration object in the reconstructed three-dimensional point cloud; (x, y, z) is the original coordinate; (x', y', z') is the converted coordinate value; * is the multiplication operator symbol.
[0064] In the embodiment, the point cloud normal vector is calculated, and the component value in the positive direction of the Z axis is extracted. Based on the component value of the normal vector in the positive direction of the Z axis (threshold > 0.9), the top surface point set of the mushroom bag and the top surface point set of the mushroom cap are preliminarily determined. Specifically, the normal vector of the pre-processed edible mushroom original point cloud data is calculated to extract the component value in the positive direction of the Z axis; wherein the normal vector of the mushroom bag top surface and the normal vector of the mushroom cap top surface have larger component values in the positive direction of the Z axis, and the normal vector of the mushroom bag side surface and the normal vector of the mushroom stem side surface have smaller component values in the positive direction of the Z axis; the pre-processed edible mushroom original point cloud data in the positive direction of the Z axis is used to preliminarily locate the surface of the mushroom bag to obtain the preliminarily located edible mushroom original point cloud data, and the top surface point total set is obtained according to the preliminarily located edible mushroom original point cloud data.
[0065] As a specific example, the normal vector of the pre-processed edible mushroom original point cloud data is calculated, and the component value in the positive direction of the Z axis is extracted. Since the normal vector of the mushroom bag top surface and the normal vector of the mushroom cap top surface have larger component values in the positive direction of the Z axis, and the normal vector of the mushroom bag side surface and the normal vector of the mushroom stem have smaller components, the preliminary positioning of the surface of the mushroom bag can be performed according to this feature. As shown in Figure 3 , the total set of the top surface points of the mushroom bag and the mushroom cap is obtained after preliminary positioning, as shown in Figure 4 . It needs to be further explained that since the top surface points of the mushroom bag are uneven, this is only part of the real top surface points of the mushroom bag, that is, preliminary positioning.
[0066] Further, the method for calculating the point cloud normal vector based on the pre-processed edible mushroom original point cloud data is as follows: for each scanning point in the point cloud p i , the nearest neighbor Q adjacent points q i , i =1,2,3,…,N, N is a positive integer, then the local plane P in the least square sense is calculated, and this plane P can be represented as:
[0067] ;
[0068] In the formula, is the normal vector of the plane P, d is the distance from the plane P to the coordinate origin.
[0069] Since the normal vector Ambiguity, that is, only the straight line where the normal vector is located is obtained, and the final direction of the normal vector in which direction of the straight line is not determined, therefore, a simple heuristic method is used to set the direction of the normal vector, that is, pointing to the outside of the surface from the coordinate origin. As shown in Figure 5 , the obtained normal vector is directionally decomposed, and thus the component of the positive direction of the Z axis is obtained. Further, point cloud normal vector visualization is as shown in Figure 6 .
[0070] S1012, clustering the total set of top surface points to obtain a plurality of connected regions, obtaining the mushroom cap top surface point set and the mushroom cover top surface point set according to the area and height of the connected regions, and obtaining the original mushroom cap top surface and the original mushroom cover top surface, and constructing a mushroom cap cylindrical model according to the position of the original mushroom cap top surface, the position of the original mushroom cap bottom, and the preset diameter.
[0071] In this embodiment, the original point cloud data of the edible mushroom includes an original mushroom cap point cloud, and the position of the mushroom cap bottom can be obtained according to the lowest point coordinates of the original mushroom cap point cloud in the Z axis direction. Since the component values of the normal vectors of the mushroom cover top surface and the mushroom cap top surface in the positive direction of the Z axis are similar (close to 1), it is difficult to distinguish only by the direction of the normal vector, therefore, based on connectivity analysis and height filtering, further segmentation is performed by clustering area, as shown in Figure 7 , and Figure 7 is a segmentation effect diagram of the mushroom cap and the mushroom cover top surface. Specifically, the total set of top surface points obtained in the foregoing is clustered and processed by using the DBSCAN (Density-Based Spatial Clustering of Applications with Noise) method, the mushroom cap top surface will form a large connected region, and the mushroom cover top surface will form a plurality of small connected regions, the area of each connected region is calculated and its height is determined, according to the area of each connected region and descending order, the connected region corresponding to the area of the largest region with the lowest height is the mushroom cap, which is constructed from the mushroom cap top surface point set, and the connected regions corresponding to the areas of the other regions are the mushroom covers, which are constructed from the mushroom cover top surface point set.
[0072] Further, statistical filtering is used to remove the noise points of the non-mushroom cap top surface points, and RANSAC (Random Sample Consensus) plane fitting is performed on the denoised mushroom cap top surface point set to determine the approximate position of the mushroom cap top surface. As shown in Figure 8 , which is a fitting effect diagram of the mushroom cap top surface. As shown in Figure 9 , which is a positioning effect diagram of the mushroom cap top surface.
[0073] In the embodiment, the preset diameter acquisition method comprises: determining the lowest point of the point cloud in the Z-axis direction according to the original point cloud data of the edible fungi to determine the bottom of the mushroom bag; sampling along the outer side of the stem at a preset height above the bottom of the mushroom bag to obtain a set of sampling points, performing least square circle fitting on the set of sampling points to obtain the center and calculate the radius, and obtaining the diameter according to the calculated radius to obtain the preset diameter.
[0074] As shown in Figure 10 , the lowest Z coordinate of the entire point cloud is used to determine the bottom of the mushroom bag, and sampling is performed in a specified height range above the bottom of the mushroom bag, and least square circle fitting is performed on the sampling points to obtain the center and calculate the radius r, as shown in Figure 11 . In the embodiment, the specified height range is 3-5 cm.
[0075] The original mushroom bag top surface position, the original mushroom bag bottom position, and the preset diameter are used to construct a mushroom bag cylindrical model, and the edible fungi point cloud data is coarsely segmented based on the mushroom bag cylindrical model to obtain a mushroom bag initial point cloud and a fruiting body initial point cloud, as shown in Figure 12 .
[0076] S1013, the edible fungi point cloud data is obtained by updating the edible fungi original point cloud data through the mushroom bag cylindrical model, and the edible fungi point cloud data is coarsely segmented to obtain a mushroom bag initial point cloud and a fruiting body initial point cloud.
[0077] S102, a triangular subdivision cavity detection method is used to detect the cavities of the mushroom bag initial point cloud to obtain a plurality of surface cavities of the mushroom bag initial point cloud.
[0078] Since the stem is seamlessly connected to the mushroom bag, after preliminary segmentation, the stem root remains on the top surface of the mushroom bag, resulting in a cavity on the top surface of the mushroom bag, and the stem root remaining part extends downward from the cavity boundary until it connects with the top surface of the mushroom bag. To achieve high-precision segmentation, the remaining stem point cloud needs to be further segmented.
[0079] Therefore, cavity detection needs to be performed on the preliminarily segmented mushroom bag initial point cloud, and a cavity detection method based on Delaunay triangular subdivision is used for cavity detection: the point cloud model of the mushroom bag is converted into a triangular mesh to triangulate the point cloud, and the topological relationship between each point in the meshed point cloud model is used to find the cavity boundary points, so as to detect the cavities on the surface of the mushroom bag initial point cloud. Specifically, as shown in Figure 13As shown, the hole region in the point cloud, the edge of which is represented in the triangular mesh as a ring composed of continuous, closed "boundary edges". Finding these closed boundary rings can locate the holes. According to the topological properties of each edge in the mesh, if the edge is shared by two adjacent triangles, the edge is a non-boundary edge. If the edge belongs to only one triangle, it is a hole boundary, and then the two points connected by the boundary are the hole boundary points. The extracted boundary edges are scattered and need to be connected to form a closed ring. Starting from the starting point of a boundary edge clockwise, the next boundary edge sharing the vertex is found. In this way, the next boundary edge sharing the vertex is constantly found until the end point of the path coincides with the starting point, forming a closed ring, i.e. the hole boundary. As shown, the surface hole extraction effect diagram is shown. Figure 14
[0080] S103, filtering the surface holes according to the size and height to obtain the hole boundary, and tracking all points in the reverse direction of the stipe growth direction from the hole boundary as the starting point until the termination point of the stipe residual part is detected to construct a stipe residual point cloud from all the tracked points, and the stipe residual point cloud and the initial point cloud of the fruit body construct an actual point cloud of the fruit body, and the initial point cloud of the volva constitutes an actual point cloud of the volva after removing the stipe residual point cloud.
[0081] Specifically, the hole boundary is the uppermost annular structure of the stipe residual part. The stipe residual part is the remaining part of the stipe in the fruit body on the volva after the coarse segmentation of the volva and the fruit body. Since the surface holes of the volva include the holes at the bottom of the volva and the extremely small holes generated by the noise at the top of the volva, the size and height are used for screening and filtering, Figure 15 The surface hole filtering effect diagram is shown. The termination point of the stipe residual part is the connection point of the stipe residual part and the volva. Further, in the step of tracking all points in the reverse direction of the stipe growth direction from the hole boundary as the starting point until the termination point of the stipe residual part is detected to construct a stipe residual point cloud from all the tracked points:
[0082] When tracking all points, each tracked point needs to meet all the constraint conditions at the same time, including the spatial continuity constraint, the height constraint, the normal vector constraint, and the curvature constraint. The spatial continuity is that the new point needs to be in the neighborhood of the current point and move in the reverse direction of the stipe growth direction. The height constraint is that the height of the new point needs to be lower than that of the current point. The normal vector constraint is that the angle between the normal vector direction of the point on the stipe and the stipe growth direction meets a first angle threshold value, which is 90°±2° in the embodiment. It can be understood that the normal vector constraint is that the angle between the normal vector direction of the point on the stipe and the stipe growth direction needs to be approximately perpendicular. The angle between the normal vector direction of the point on the top surface of the pileus and the stipe growth direction is less than a second angle threshold value, which is 30° in the embodiment. It can be understood that the angle between the normal vector direction of the point on the top surface of the pileus and the stipe growth direction needs to be relatively small, which is less than 30°. The curvature constraint is that the curvature value of the point at the connection between the stipe and the pileus is greater than a curvature threshold value, so that the point at the connection between the stipe and the pileus has a higher curvature value. The curvature threshold value is 0.3 in the embodiment.
[0083] Specifically, as shown in Figure 16 , first, for each hollow boundary ring, the stipe reverse growth direction perpendicular to the normal vector information of the point in the boundary ring is calculated, which is defined as the extension direction of the region growth. Second, the hollow boundary point is added to the seed queue, marked as visited, and added to the stipe point set. From the hollow boundary point, the region growth is performed in the reverse direction along the stipe growth direction. It is judged whether the points traversed meet all the above constraint conditions. At this time, the height value is no longer continuously decreased, but tends to be flat, and the local normal vector and the curvature will have obvious changes, indicating that the top surface of the pileus is reached.
[0084] It needs to be further explained that, as shown in Figure 17 , since the top surface of the pileus may have local protrusions and is close to the stipe, the region growth is easy to include the protrusions. In order to avoid this situation, the height constraint is added to the growth condition, which requires that the height of the new point is lower than that of the current point, that is, the height of the new point is not higher than that of the current point, and the decrease is not more than the maximum allowed height difference δ h , so that the growth does not spread to the entire top surface of the pileus. In the embodiment, the maximum allowed height difference δ h is 0.002 m.
[0085] S104, the edible mushroom point cloud data is segmented according to the actual pileus point cloud and the actual subentity point cloud to obtain the actual pileus point cloud and the actual subentity point cloud.
[0086] As shown in Figure 18 , the stipe residual point cloud and the subentity initial point cloud are integrated to construct the subentity actual point cloud, and then the edible mushroom point cloud data is segmented by combining the actual pileus point cloud to obtain the actual subentity point cloud and the actual pileus point cloud.
[0087] In summary, the method for segmenting fruiting bodies and mushroom bags based on edible mushrooms in the above embodiments of the present application first performs coarse segmentation on edible mushroom point cloud data to obtain initial point clouds of mushroom bags and fruiting bodies. After coarse segmentation of the mushroom bags and fruiting bodies, the residual stipe part is left on the mushroom bags. In order to improve the segmentation accuracy, the initial point cloud of the mushroom bag is subjected to cavity detection to obtain multiple surface cavities of the initial point cloud of the mushroom bag and further obtain a cavity boundary. Then, all points are traced in the reverse direction along the stipe growth direction from the cavity boundary as the starting point until the end point of the residual stipe part is detected to construct a residual stipe point cloud from all the traced points. The residual stipe point cloud and the initial point cloud of the fruiting body are used to construct an actual point cloud of the fruiting body. The residual stipe point cloud is removed from the initial point cloud of the mushroom bag to form an actual point cloud of the mushroom bag. The actual point cloud of the mushroom bag and the actual point cloud of the fruiting body are used to segment the edible mushroom point cloud data to obtain an actual mushroom bag point cloud and an actual fruiting body point cloud. Through coarse segmentation and secondary segmentation of the residual stipe part, accurate segmentation of the mushroom bag and the fruiting body is achieved, and the segmentation accuracy is improved.
[0088] Embodiment Two
[0089] The second embodiment of the present application provides a system for segmenting fruiting bodies and mushroom bags based on edible mushrooms, comprising:
[0090] The acquisition module is configured to acquire edible mushroom point cloud data and perform coarse segmentation to obtain initial point clouds of mushroom bags and fruiting bodies. The initial point cloud of the fruiting body includes an initial point cloud of a stipe and a point cloud of a cap. A cavity detection method based on triangulation is used to perform cavity detection on the initial point cloud of the mushroom bag to obtain multiple surface cavities of the initial point cloud of the mushroom bag.
[0091] The screening module is configured to screen and filter the surface cavities according to size and height to obtain a cavity boundary. The cavity boundary is the uppermost annular structure of the residual stipe part. The residual stipe part is the part of the stipe in the fruiting body that is left on the mushroom bag after coarse segmentation. All points are traced in the reverse direction along the stipe growth direction from the cavity boundary as the starting point until the end point of the residual stipe part is detected to construct a residual stipe point cloud from all the traced points. The residual stipe point cloud and the initial point cloud of the fruiting body are used to construct an actual point cloud of the fruiting body. The residual stipe point cloud is removed from the initial point cloud of the mushroom bag to form an actual point cloud of the mushroom bag.
[0092] The segmentation module is configured to segment the edible mushroom point cloud data according to the actual point cloud of the mushroom bag and the actual point cloud of the fruiting body to obtain an actual mushroom bag point cloud and an actual fruiting body point cloud.
[0093] In summary, the edible mushroom based on the fruiting body and the mushroom bag segmentation system in the above embodiment, by the edible mushroom point cloud data first coarse segmentation to obtain the initial point cloud and the initial point cloud of the fruiting body; Because the stipe residual part is left on the mushroom bag after the coarse segmentation of the mushroom bag and the fruiting body, in order to improve the segmentation accuracy, the initial point cloud of the mushroom bag is subjected to cavity detection to obtain a plurality of surface cavities of the initial point cloud of the mushroom bag and further obtain the cavity boundary, and then the cavity boundary is taken as the starting point to track all points in the reverse direction along the stipe growth direction until the termination point of the stipe residual part is detected to construct the stipe residual point cloud with all the tracked points, the stipe residual point cloud and the initial point cloud of the fruiting body are used to construct the actual point cloud of the fruiting body, and the initial point cloud of the mushroom bag is removed from the stipe residual point cloud to form the actual point cloud of the mushroom bag, and then the edible mushroom point cloud data is segmented according to the actual point cloud of the mushroom bag and the actual point cloud of the fruiting body to obtain the actual mushroom bag point cloud and the actual fruiting body point cloud, through coarse segmentation and secondary segmentation of the stipe residual part, the accurate segmentation of the mushroom bag and the fruiting body is realized, and the segmentation accuracy is improved.
[0094] In addition, the embodiment of the present application also proposes a computer readable storage medium, which stores a computer program, and the program is executed by a processor to realize the steps of the method in the above embodiment.
[0095] In addition, the embodiment of the present application also proposes a data processing device, which includes a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor executes the program to realize the steps of the method in the above embodiment.
[0096] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered a list of executable instructions for implementing logic functions, and can be specifically embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, a processor-based system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions, or in conjunction with such an instruction execution system, apparatus, or device. For the purposes of this specification, a "computer-readable medium" can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device, or in conjunction with such an instruction execution system, apparatus, or device.
[0097] More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection (electronic) having one or more wires, a portable computer diskette (magnetic), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can also be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, for example, via an optical scanner, then compiled, interpreted, or otherwise processed, using suitable methods, before being stored in a computer memory.
[0098] It should be understood that aspects of the application can be implemented in hardware, software, firmware or combinations thereof. In the embodiments described above, various steps or methods can be implemented, for example, by software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, and in another embodiment, any of the following technologies, known in the art, or their combinations can be used: discrete logic circuitry having logic gates for implementing logic functions upon data signals, application specific integrated circuits having appropriate combinational logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), and the like.
[0099] In the description of the specification, the description of the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" and the like means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Also, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0100] Although embodiments of the present application have been shown and described, it would be appreciated by those skilled in the art that changes can be made in these embodiments without departing from the principles and spirit of the application, the scope of which is defined by the claims and their equivalents.
Claims
1. A method for separating fruiting bodies and mushroom bags based on edible fungi, characterized in that, include: The edible fungi point cloud data is acquired and coarsely segmented to obtain the initial point cloud of the fungi bag and the initial point cloud of the fruiting body. The initial point cloud of the fruiting body includes the initial point cloud of the stipe and the point cloud of the cap. The triangulation cavity detection method is used to detect cavities in the initial point cloud of the fungi bag to obtain multiple surface cavities in the initial point cloud of the fungi bag. The surface cavities are filtered according to size and height to obtain the cavity boundary. The cavity boundary is the uppermost ring structure of the stipe remnant. The stipe remnant is the part of the stipe in the fruiting body that remains on the fruiting bag after coarse division. Starting from the cavity boundary, all points are traced backward along the stipe growth direction until the end point of the stipe remnant is detected to construct a stipe remnant point cloud. The stipe remnant point cloud and the initial point cloud of the fruiting body are used to construct the actual point cloud of the fruiting body. The initial point cloud of the fruiting bag is used to form the actual point cloud of the fruiting bag after removing the stipe remnant point cloud. The edible fungus point cloud data is segmented based on the actual point cloud of the mushroom bag and the actual point cloud of the sub-entity to obtain the actual mushroom bag point cloud and the actual sub-entity point cloud. The triangulation hole detection method includes: converting the point cloud model of the mushroom bag into a triangular mesh to triangulate the point cloud; using the topological relationship between each point in the meshed point cloud model to find the hole boundary points, thereby detecting the holes on the initial point cloud surface of the mushroom bag; the method for obtaining the hole boundary points includes: finding the boundary based on the topological attributes of each edge in the mesh; if the edge is shared by two adjacent triangles, the edge is a non-boundary edge; if the edge belongs to only one triangle, it is a hole boundary, and the two points connecting the boundary are the hole boundary points. In the step of tracing all points backward along the growth direction of the stipe from the boundary of the cavity until the termination point of the stipe remnant is detected, and constructing a stipe remnant point cloud from all the traced points: When tracking all points, it is necessary to determine whether each point simultaneously satisfies all constraints, including spatial continuity, height constraints, normal vector constraints, and curvature constraints, among which: Spatial continuity requires that the new point must be within the neighborhood of the current point and move in the opposite direction of the stipe growth; The height constraint requires that the height of the new point must be lower than that of the current point. The normal vector constraint is that the angle between the normal vector direction of a point on the stipe and the growth direction of the stipe meets the first angle threshold, while the angle between the normal vector direction of a point on the top surface of the mushroom bag and the growth direction of the stipe is less than the second angle threshold. The curvature constraint is that the curvature value of the point where the stipe connects to the bag is greater than the curvature threshold.
2. The method for separating fruiting bodies and mushroom bags based on edible fungi according to claim 1, characterized in that, The steps for acquiring edible mushroom point cloud data and performing coarse segmentation to obtain the initial point cloud of the mushroom bag and the initial point cloud of the sub-entities include: The original point cloud data of edible fungi is acquired and preprocessed to obtain the preprocessed original point cloud data of edible fungi. The normal vector of the points is calculated based on the preprocessed original point cloud data of edible fungi to preliminarily determine the total set of top surface points. The total set of top surface points includes the top surface point set of the mushroom bag and the top surface point set of the mushroom cap. Clustering is performed on the top surface point set to obtain multiple connected regions. Based on the area and height of the connected regions, the top surface point set of the mushroom bag and the top surface point set of the mushroom cap are obtained, thus obtaining the original top surface of the mushroom bag and the original top surface of the mushroom cap. A cylindrical model of the mushroom bag is constructed based on the position of the original top surface of the mushroom bag, the position of the bottom of the original mushroom bag, and a preset diameter. The original point cloud data of edible fungi is updated through the cylindrical model of the mushroom bag to obtain the point cloud data of edible fungi. The point cloud data of edible fungi is coarsely segmented to obtain the initial point cloud of the mushroom bag and the initial point cloud of the sub-entities.
3. The method for dividing fruiting bodies and mushroom bags based on edible fungi according to claim 2, characterized in that, The steps to obtain the top surface point set of the fungal bag and the top surface point set of the cap based on the area and height of the connected region, and then to obtain the original top surface of the fungal bag and the original top surface of the cap, include: Calculate the area of each connected region and determine its height. Sort the areas in descending order. The connected region with the lowest and largest area is the top point set of the fungal bag, and the other connected regions are the top point sets of the fungal cap.
4. The method for separating fruiting bodies and mushroom bags based on edible fungi according to claim 2, characterized in that, Methods for obtaining the preset diameter include: The lowest point of the point cloud is determined based on the original point cloud data of edible fungi to determine the bottom of the mushroom bag; A sampling point set is obtained by taking samples along the outer side of the mushroom bag at a preset height above the bottom of the mushroom bag. The sampling point set is then fitted with a least-squares circle to obtain the center and the radius is calculated. The diameter is obtained based on the calculated radius to obtain the preset diameter.
5. The method for dividing fruiting bodies and mushroom bags based on edible fungi according to claim 2, characterized in that, The steps involved in calculating the normal vectors of points based on the preprocessed raw point cloud data of edible fungi to preliminarily determine the total set of points on the top surface include: The normal vector of each point in the preprocessed raw point cloud data of edible fungi is calculated to extract its component value in the positive direction of the Z-axis; The surface of the mushroom bag is initially located based on the component values of the pre-processed original point cloud data of edible fungi in the positive Z-axis direction to obtain the initially located original point cloud data of edible fungi. The top surface point set is obtained based on the initially located original point cloud data of edible fungi.
6. A system for separating fruiting bodies and mushroom bags based on edible fungi, characterized in that, The system includes: The acquisition module is used to acquire edible fungi point cloud data and perform coarse segmentation to obtain the initial point cloud of the fungus bag and the initial point cloud of the fruiting body. The initial point cloud of the fruiting body includes the initial point cloud of the stipe and the point cloud of the cap. The triangulation cavity detection method is used to detect cavities in the initial point cloud of the fungus bag to obtain multiple surface cavities in the initial point cloud of the fungus bag. The filtering module is used to filter the surface cavities according to size and height to obtain the cavity boundary. The cavity boundary is the uppermost ring structure of the stipe remnant. The stipe remnant is the part of the stipe in the fruiting body that remains on the fruiting bag after coarse division. Starting from the cavity boundary, all points are traced backward along the stipe growth direction until the end point of the stipe remnant is detected to construct a stipe remnant point cloud. The stipe remnant point cloud and the initial point cloud of the fruiting body are used to construct the actual point cloud of the fruiting body. The initial point cloud of the fruiting bag is used to remove the stipe remnant point cloud to form the actual point cloud of the fruiting bag. The segmentation module is used to segment the edible fungus point cloud data according to the actual point cloud of the fungus bag and the actual point cloud of the sub-entity to obtain the actual point cloud of the fungus bag and the actual point cloud of the sub-entity. The triangulation hole detection method includes: converting the point cloud model of the mushroom bag into a triangular mesh to triangulate the point cloud; using the topological relationship between each point in the meshed point cloud model to find the hole boundary points, thereby detecting the holes on the initial point cloud surface of the mushroom bag; the method for obtaining the hole boundary points includes: finding the boundary based on the topological attributes of each edge in the mesh; if the edge is shared by two adjacent triangles, the edge is a non-boundary edge; if the edge belongs to only one triangle, it is a hole boundary, and the two points connecting the boundary are the hole boundary points. In the step of tracing all points backward along the growth direction of the stipe from the boundary of the cavity until the termination point of the stipe remnant is detected, and constructing a stipe remnant point cloud from all the traced points: When tracking all points, it is necessary to determine whether each point simultaneously satisfies all constraints, including spatial continuity, height constraints, normal vector constraints, and curvature constraints, among which: Spatial continuity requires that the new point must be within the neighborhood of the current point and move in the opposite direction of the stipe growth; The height constraint requires that the height of the new point must be lower than that of the current point. The normal vector constraint is that the angle between the normal vector direction of a point on the stipe and the growth direction of the stipe meets the first angle threshold, while the angle between the normal vector direction of a point on the top surface of the mushroom bag and the growth direction of the stipe is less than the second angle threshold. The curvature constraint is that the curvature value of the point where the stipe connects to the bag is greater than the curvature threshold.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method for segmenting the fruiting bodies and mushroom bags based on edible fungi as described in any one of claims 1-5.
8. A data processing apparatus, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method for segmenting the fruiting bodies and mushroom bags based on edible fungi as described in any one of claims 1-5.
Citation Information
Patent Citations
Pleurotus ostreatus growth monitoring method based on point cloud deep learning
CN115439655A
Method and device for detecting internal void defect of chip resistor welding spot and void detection equipment of resistor
CN117094955A