A system and method for detecting quality of Pleurotus eryngii based on image analysis
Through an image analysis-based detection system, combined with the cap and stalk image analysis, the degree of damage and neatness are identified, and the problem of low quality detection efficiency of olive mushrooms in the existing technology is solved, and a more efficient and accurate quality evaluation is achieved. Reduced labor costs.
Patent Information
- Application Number
- CN202210070171.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-20
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2042-01-20
AI Technical Summary
In the prior art, the quality testing of Oyster mushrooms mainly relies on human resources and has low efficiency and consumes a lot of manpower, making it difficult to accurately judge the quality of Oyster mushrooms.
Using an image analysis-based detection system, preliminary detection is carried out through the cap and shank image acquisition module to identify the damage degree and shank neatness of the shank, and output quality detection results, including damage area identification, area calculation, related area statistics and cross-section Area comparison modules.
It improves the detection efficiency of Oyster mushrooms, reduces labor costs, and can more accurately evaluate the quality of Oyster mushrooms.
Smart Images

Figure CN114419002B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Pleurotus eryngii detection, and in particular to a Pleurotus eryngii quality detection system and method based on image analysis. Background Art
[0002] King Oyster Mushroom is a rare new edible mushroom variety that is edible, medicinal and therapeutic. King Oyster Mushroom has thick flesh and tender texture, especially the dense, firm and milky white stem, which can be eaten in its entirety. The stem is more crisp and refreshing than the cap, and has a pleasant almond aroma and a taste like abalone, so it is becoming more and more popular among people.
[0003] During the cultivation of King Oyster Mushroom, the production of King Oyster Mushroom is easily affected by the temperature, humidity, ventilation, etc. of the environment, resulting in different quality of the produced King Oyster Mushroom. In the prior art, the quality of King Oyster Mushroom is mainly judged by human eyes, which consumes a lot of manpower and has relatively low work efficiency. Summary of the invention
[0004] The object of the present invention is to provide a system and method for detecting quality of Pleurotus eryngii based on image analysis, so as to solve the problems raised in the above-mentioned background technology.
[0005] In order to solve the above technical problems, the present invention provides the following technical solutions: a quality detection system for Pleurotus eryngii based on image analysis, the quality detection system comprising a cap image acquisition module, a cap detection module, a stem detection module and a detection information output module, the cap image acquisition module is used to acquire the cap image of the Pleurotus eryngii to be analyzed, the cap detection module obtains the damage degree of the cap of the Pleurotus eryngii to be analyzed, if the damage degree of the cap of the Pleurotus eryngii to be analyzed is greater than the damage threshold, then the detection information output module outputs information that the quality detection of the Pleurotus eryngii to be analyzed is unqualified, if the damage degree of the cap of the Pleurotus eryngii to be analyzed is less than or equal to the damage threshold, then the Pleurotus eryngii to be analyzed is a preferred Pleurotus eryngii, the stem detection module acquires the stem image of the preferred Pleurotus eryngii, and analyzes the stem image, and controls the detection information output module to output the quality detection result information of the preferred Pleurotus eryngii according to the analysis result of the stem detection module.
[0006] Furthermore, the cap detection module includes a damaged area recognition module, a regional information acquisition module, a regional number comparison module, an associated area selection module and a damage degree calculation module. The damaged area recognition module performs binarization processing on the cap image of the Pleurotus eryngii to be analyzed, detects and identifies the damaged cap area in the cap image, the regional information acquisition module is used to obtain the area of the damaged cap area and the number k of damaged cap areas in the cap image, and the region number comparison module is used to compare the number k of damaged cap areas in the cap image with the number When the number k is greater than the number threshold, it is judged that the damage degree of the cap of the Pleurotus eryngii to be analyzed is greater than the damage threshold. When the number k is less than or equal to the number threshold, the associated region selection module and the damage degree calculation module are operated. The associated region selection module is used to count the distance between any two damaged cap regions on the Pleurotus eryngii to be analyzed. If the distance between two damaged cap regions is less than the distance threshold, then the two damaged cap regions are associated regions with each other. The damage degree calculation module calculates the damage degree of the cap of the Pleurotus eryngii to be analyzed. Where P is the area of the cap of the Pleurotus eryngii to be analyzed, i is the damaged area of the i-th cap of the Pleurotus eryngii to be analyzed, S i is the area of the damaged area of the i-th cap of Pleurotus eryngii to be analyzed, m i is the number of associated regions of the i-th damaged cap region of Pleurotus eryngii to be analyzed.
[0007] Furthermore, the stipe detection module includes a stipe division module, a boundary stipe selection module, an influencing stipe selection module and a logarithmic statistical comparison module. The stipe division module divides the stipe into a number of stipes of equal width and thickness along the direction of the stipe of the preferred Pleurotus eryngii toward the cap, and obtains the cross-sectional area of each stipe in turn. The boundary stipe selection module sets a stipe as a candidate stipe, a stipe adjacent to the candidate stipe and away from the cap as a first reference stipe, and a stipe adjacent to the candidate stipe and close to the cap as a second reference stipe, and calculates the first reference quantity U1=V0-V1 and the second reference quantity U2=V2-V0 of the candidate stipe, wherein V0 is the candidate stipe. The cross-sectional area of V1 is the cross-sectional area of the first reference stipe, and V2 is the cross-sectional area of the second reference stipe. If one of the values corresponding to the first reference amount U1 and the second reference amount U2 of a candidate stipe is greater than or equal to 0 and the other is less than 0, then the candidate stipe is a boundary stipe. The influencing stipe selection module is used to sequentially determine whether two adjacent boundary stipes are a pair of influencing stipes. The logarithmic statistical comparison module is used to count the logarithm of a pair of influencing stipes corresponding to the preferred Pleurotus eryngii. If the logarithm of a pair of influencing stipes corresponding to the preferred Pleurotus eryngii is greater than the logarithmic threshold, the detection information output module outputs information that the quality detection of the Pleurotus eryngii to be analyzed is unqualified.
[0008] Furthermore, the influencing stipe selection module includes a cross-sectional area acquisition comparison module and a proportion threshold comparison module. The cross-sectional area acquisition comparison module calculates the difference in cross-sectional areas of two adjacent boundary stipes in the direction from the stipe of the Pleurotus eryngii to the cap. If the absolute value of the difference in cross-sectional areas of two adjacent boundary stipes is greater than or equal to the cross-sectional threshold, the proportion threshold comparison module is used to obtain the distance length Lf between the positions of the two adjacent boundary stipes in the preferred Pleurotus eryngii. If Lf / Lz is less than or equal to the proportion threshold, where Lz is the length of the stipe of the preferred Pleurotus eryngii, then the two adjacent boundary stipes are a pair of influencing stipes.
[0009] A method for detecting quality of Pleurotus eryngii based on image analysis, the method comprising the following steps:
[0010] Collect the cap image of the Pleurotus eryngii to be analyzed, obtain the damage degree of the cap of the Pleurotus eryngii to be analyzed,
[0011] If the damage degree of the cap of the Pleurotus eryngii to be analyzed is greater than the damage threshold, then output the information that the quality inspection of the Pleurotus eryngii to be analyzed is unqualified;
[0012] If the damage degree of the cap of the Pleurotus eryngii to be analyzed is less than or equal to the damage threshold, then the Pleurotus eryngii to be analyzed is the preferred Pleurotus eryngii, the stipe image of the preferred Pleurotus eryngii is collected, and the quality detection result information of the preferred Pleurotus eryngii is output according to the stipe image.
[0013] Furthermore, obtaining the damage degree of the cap of the Pleurotus eryngii to be analyzed includes:
[0014] The cap image of the Pleurotus eryngii to be analyzed is binarized, the damaged cap area in the cap image is detected and identified, and the area of the damaged cap area and the number k of damaged cap areas in the cap image are obtained.
[0015] If the number k of damaged cap areas in the cap image is greater than the number threshold, then the damage degree of the cap of the Pleurotus eryngii to be analyzed is greater than the damage threshold.
[0016] Otherwise, calculate the damage degree of the cap of the Pleurotus eryngii to be analyzed Where P is the area of the cap of the Pleurotus eryngii to be analyzed, i is the damaged area of the i-th cap of the Pleurotus eryngii to be analyzed, S i is the area of the damaged area of the i-th cap of Pleurotus eryngii to be analyzed, m i is the number of associated regions of the i-th damaged cap region of the Pleurotus eryngii to be analyzed, wherein if the distance between two damaged cap regions is less than the distance threshold, then the two damaged cap regions are associated regions of each other.
[0017] Further, judging whether the quality of the Pleurotus eryngii is qualified according to the stipe image includes:
[0018] Along the direction from the stipe of the selected Pleurotus eryngii to the cap, the stipe is evenly divided into a number of sub-stalks of equal width and thickness, and the cross-sectional area of each sub-stalk is obtained in turn.
[0019] Suppose a certain stipe is a candidate stipe, the stipe adjacent to the candidate stipe and away from the cap is the first reference stipe, and the stipe adjacent to the candidate stipe and close to the cap is the second reference stipe.
[0020] Calculate the first reference quantity U1=V0-V1 and the second reference quantity U2=V2-V0 of the candidate stem.
[0021] Wherein, V0 is the cross-sectional area of the candidate stipe, V1 is the cross-sectional area of the first reference stipe, and V2 is the cross-sectional area of the second reference stipe.
[0022] If one of the values corresponding to the first reference value U1 and the second reference value U2 of a candidate stipe is greater than or equal to 0 and the other is less than 0, then the candidate stipe is a boundary stipe.
[0023] It is determined in turn whether two adjacent boundary stipes are a pair of influencing stipes, and the logarithm of a pair of influencing stipes corresponding to the preferred Pleurotus eryngii is counted. If the logarithm of a pair of influencing stipes corresponding to the preferred Pleurotus eryngii is greater than the logarithmic threshold, then the information that the quality of the preferred Pleurotus eryngii is unqualified is output.
[0024] Furthermore, the step of sequentially determining whether two adjacent boundary stipes are a pair of influencing stipes includes:
[0025] The difference in cross-sectional area between two adjacent boundary stipes is calculated in sequence along the direction from the stipe to the cap of the Pleurotus eryngii. If the absolute value of the difference in cross-sectional area between two adjacent boundary stipes is greater than or equal to the cross-sectional threshold,
[0026] Then obtain the distance length Lf between the positions of the two adjacent boundary stipes in the preferred Pleurotus eryngii. If Lf / Lz is less than or equal to the proportion threshold, where Lz is the length of the stipe of the preferred Pleurotus eryngii, then the two adjacent boundary stipes are a pair of influencing stipes.
[0027] Compared with the prior art, the beneficial effect achieved by the present invention is as follows: the present invention performs a preliminary inspection on the quality of the King Oyster Mushroom by first collecting the image of the cap of the King Oyster Mushroom, and then collects the image of the stipe of the King Oyster Mushroom after the preliminary inspection of the King Oyster Mushroom passes, to determine whether the stipe of the King Oyster Mushroom is uniform, and then determine the quality of the King Oyster Mushroom, thereby further improving the inspection efficiency of the King Oyster Mushroom and reducing the manpower cost required in the inspection process of the King Oyster Mushroom. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0029] Figure 1 It is a module schematic diagram of the Pleurotus eryngii quality detection system based on image analysis of the present invention. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and fragmentarily describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0031] See also Figure 1 The present invention provides a technical solution: a quality detection system for Pleurotus eryngii based on image analysis, the quality detection system comprising a cap image acquisition module, a cap detection module, a stem detection module and a detection information output module, the cap image acquisition module is used to acquire the cap image of the Pleurotus eryngii to be analyzed, the cap detection module obtains the damage degree of the cap of the Pleurotus eryngii to be analyzed, if the damage degree of the cap of the Pleurotus eryngii to be analyzed is greater than the damage threshold, then the detection information output module outputs information that the quality detection of the Pleurotus eryngii to be analyzed is unqualified, if the damage degree of the cap of the Pleurotus eryngii to be analyzed is less than or equal to the damage threshold, then the Pleurotus eryngii to be analyzed is a preferred Pleurotus eryngii, the stem detection module acquires the stem image of the preferred Pleurotus eryngii, and analyzes the stem image, and controls the detection information output module to output the quality detection result information of the preferred Pleurotus eryngii according to the analysis result of the stem detection module.
[0032] The cap detection module includes a damaged area recognition module, a region information acquisition module, a region number comparison module, an associated region selection module and a damage degree calculation module. The damaged area recognition module performs binary processing on the cap image of the Pleurotus eryngii to be analyzed, detects and identifies the damaged cap area in the cap image, the region information acquisition module is used to obtain the area of the damaged cap area and the number k of damaged cap areas in the cap image, the region number comparison module is used to compare the number k of damaged cap areas in the cap image with the number threshold, when the number k is greater than the number threshold, it is determined that the damage degree of the Pleurotus eryngii cap to be analyzed is greater than the damage threshold, when the number k is less than or equal to the number threshold, the associated region selection module and the damage degree calculation module are operated, the associated region selection module is used to count the distance between any two damaged cap areas on the Pleurotus eryngii to be analyzed, if the distance between two damaged cap areas is less than the distance threshold, then the two damaged cap areas are associated areas with each other, and the damage degree calculation module calculates the damage degree of the Pleurotus eryngii cap to be analyzed Where P is the area of the cap of the Pleurotus eryngii to be analyzed, i is the damaged area of the i-th cap of the Pleurotus eryngii to be analyzed, S i is the area of the damaged area of the i-th cap of Pleurotus eryngii to be analyzed, m i is the number of associated regions of the i-th damaged cap region of Pleurotus eryngii to be analyzed.
[0033] The stipe detection module includes a stipe division module, a boundary stipe selection module, an influencing stipe selection module and a logarithmic statistical comparison module. The stipe division module divides the stipe into a plurality of stipes of equal width and thickness along the direction from the stipe of the preferred Pleurotus eryngii to the cap, and sequentially obtains the cross-sectional area of each stipe. The boundary stipe selection module sets a stipe as a candidate stipe, a stipe adjacent to the candidate stipe and away from the cap as a first reference stipe, and a stipe adjacent to the candidate stipe and close to the cap as a second reference stipe, and calculates a first reference quantity U1=V0-V1 and a second reference quantity U2=V2-V0 of the candidate stipe, wherein V0 is the cross-sectional area of the candidate stipe. The influencing stipe selection module is used to determine in turn whether two adjacent boundary stipes are a pair of influencing stipes. The logarithmic statistical comparison module is used to count the logarithm of a pair of influencing stipes corresponding to the preferred Pleurotus eryngii. If the logarithm of a pair of influencing stipes corresponding to the preferred Pleurotus eryngii is greater than the logarithmic threshold, the detection information output module outputs information that the quality detection of the Pleurotus eryngii to be analyzed is unqualified.
[0034] The influencing stipe selection module includes a cross-sectional area acquisition comparison module and a proportion threshold comparison module. The cross-sectional area acquisition comparison module calculates the difference in cross-sectional areas of two adjacent boundary stipes in the direction from the stipe of the Pleurotus eryngii to the cap. If the absolute value of the difference in cross-sectional areas of two adjacent boundary stipes is greater than or equal to the cross-sectional threshold, the proportion threshold comparison module is used to obtain the distance length Lf between the positions of the two adjacent boundary stipes in the preferred Pleurotus eryngii. If Lf / Lz is less than or equal to the proportion threshold, where Lz is the length of the stipe of the preferred Pleurotus eryngii, then the two adjacent boundary stipes are a pair of influencing stipes.
[0035] A method for detecting quality of Pleurotus eryngii based on image analysis, the method comprising the following steps:
[0036] Collect the cap image of the Pleurotus eryngii to be analyzed, and obtain the damage degree of the cap of the Pleurotus eryngii to be analyzed.
[0037] The method of obtaining the damage degree of the cap of the Pleurotus eryngii to be analyzed comprises:
[0038] Binarize the cap image of the Pleurotus eryngii to be analyzed, detect and identify the damaged cap area in the cap image, and obtain the area of each damaged cap area and the number k of damaged cap areas in the Pleurotus eryngii cap image to be analyzed.
[0039] If the number k of damaged cap areas in the cap image is greater than the number threshold, it is directly determined that the damage degree of the cap of the Pleurotus eryngii to be analyzed is greater than the damage threshold, and no additional calculation is required. If there are more damaged cap areas in the Pleurotus eryngii, then the quality of the Pleurotus eryngii is poor;
[0040] If the number k of damaged cap areas in the cap image is less than or equal to the number threshold, calculate the damage degree of the cap of the Pleurotus eryngii to be analyzed Where P is the area of the cap of the Pleurotus eryngii to be analyzed, i is the damaged area of the i-th cap of the Pleurotus eryngii to be analyzed, S i is the area of the damaged area of the i-th cap of Pleurotus eryngii to be analyzed, m iis the number of associated regions of the i-th cap damage region of the Pleurotus eryngii to be analyzed, wherein if the distance between two cap damage regions is less than the distance threshold, then the two cap damage regions are associated regions of each other; when the area of the cap damage region of a Pleurotus eryngii is large, then the Pleurotus eryngii is seriously damaged and the quality of the Pleurotus eryngii is poor; in addition, when considering the damage degree of the cap of the Pleurotus eryngii, the present application not only considers the area of the cap damage region of the Pleurotus eryngii, but also considers the distribution of the cap damage region of the Pleurotus eryngii. When there are many cap damage regions around the cap damage region of a Pleurotus eryngii, these damage regions are likely to spread outward and finally connect together, resulting in a larger cap damage region;
[0041] The damage degree Q of the cap of the Pleurotus eryngii to be analyzed calculated by the above calculation formula is compared with the damage threshold value. If the damage degree of the cap of the Pleurotus eryngii to be analyzed is greater than the damage threshold value, then the information that the quality inspection of the Pleurotus eryngii to be analyzed is unqualified is output;
[0042] If the damage degree of the cap of the Pleurotus eryngii to be analyzed is less than or equal to the damage threshold, then the Pleurotus eryngii to be analyzed is the preferred Pleurotus eryngii, and the stipe image of the preferred Pleurotus eryngii is collected, and the quality detection result information of the preferred Pleurotus eryngii is output according to the stipe image, and the cap of the Pleurotus eryngii is first detected, thereby reducing the workload of subsequent detection of the stipe of the Pleurotus eryngii;
[0043] The method of judging whether the quality of the Pleurotus eryngii is qualified according to the stipe image comprises:
[0044] Divide the stipe of the preferred Pleurotus eryngii into a plurality of stipes of equal width and thickness along the direction from the stipe to the cap, and obtain the cross-sectional area of each stipe in turn. In this embodiment, the cross-sectional area of a stipe can be the area of the cross section where the midpoint of the stipe in the thickness direction is located as the cross-sectional area of the stipe;
[0045] Suppose a certain stipe is a candidate stipe, the stipe adjacent to the candidate stipe and away from the cap is the first reference stipe, and the stipe adjacent to the candidate stipe and close to the cap is the second reference stipe.
[0046] Calculate the first reference quantity U1=V0-V1 and the second reference quantity U2=V2-V0 of the candidate stem.
[0047] Wherein, V0 is the cross-sectional area of the candidate stipe, V1 is the cross-sectional area of the first reference stipe, and V2 is the cross-sectional area of the second reference stipe.
[0048] If one of the values corresponding to the first reference amount U1 and the second reference amount U2 of a candidate stipe is greater than or equal to 0 and the other is less than 0, that is, U1 is greater than or equal to 0 and U2 is less than 0 or U2 is greater than or equal to 0 and U1 is less than 0, then the candidate stipe is a boundary stipe. Under normal circumstances, the stipe of Pleurotus eryngii is cylindrical or club-shaped. If a branch stipe is a boundary stipe, it means that the branch stipe is protruding outward or concave inward relative to other places on the surface of the stipe of Pleurotus eryngii. In this case, it may be because the stipe of Pleurotus eryngii is abnormal, the surface of Pleurotus eryngii is uneven, or it may be a change within the normal range of the stipe surface of Pleurotus eryngii, so the boundary stipe is further analyzed;
[0049] Determine in sequence whether two adjacent boundary stipes are a pair of influencing stipes, including:
[0050] The difference in cross-sectional area between two adjacent boundary stipes is calculated in sequence along the direction from the stipe to the cap of the Pleurotus eryngii. If the absolute value of the difference in cross-sectional area between two adjacent boundary stipes is greater than or equal to the cross-sectional threshold,
[0051] Then obtain the distance length Lf between the positions of the two adjacent boundary stipes in the preferred Pleurotus eryngii. If Lf / Lz is less than or equal to the proportion threshold, where Lz is the length of the stipe of the preferred Pleurotus eryngii, then the two adjacent boundary stipes are a pair of influencing stipes;
[0052] The logarithm of a pair of influencing stipes corresponding to the preferred Pleurotus eryngii is counted. If the logarithm of a pair of influencing stipes corresponding to the preferred Pleurotus eryngii is greater than the logarithm threshold, then the information that the quality of the preferred Pleurotus eryngii is unqualified is output; the logarithm threshold in this example is 1. When the absolute value of the difference between the cross-sectional areas of two adjacent boundary stipes is relatively large and the corresponding Lf / Lz is less than or equal to the proportion threshold, it means that the inner diameter of the Pleurotus eryngii stipe changes greatly within a very small distance. Under normal circumstances, even if there is a smaller inner diameter of the Pleurotus eryngii stipe, it slowly transitions from the larger inner diameter to the smaller inner diameter. Therefore, if the inner diameter changes suddenly, it is because the stipe of the Pleurotus eryngii is abnormal, so the information that the quality inspection is unqualified is output, and then the Pleurotus eryngii for which no quality inspection information is output is transmitted to the relevant inspection personnel for further inspection, thereby reducing the workload of the inspection personnel and reducing the manpower cost.
[0053] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0054] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A Pleurotus eryngii quality detection system based on image analysis, characterized in that: The quality inspection system comprises a cap image acquisition module, a cap detection module, a stem detection module and a detection information output module. The cap image acquisition module is used to acquire the cap image of the Pleurotus eryngii to be analyzed. The cap detection module obtains the damage degree of the cap of the Pleurotus eryngii to be analyzed. If the damage degree of the cap of the Pleurotus eryngii to be analyzed is greater than the damage threshold, the detection information output module outputs information that the quality inspection of the Pleurotus eryngii to be analyzed is unqualified. If the damage degree of the cap of the Pleurotus eryngii to be analyzed is less than or equal to the damage threshold, the Pleurotus eryngii to be analyzed is the preferred Pleurotus eryngii. The stem detection module acquires the stem image of the preferred Pleurotus eryngii and analyzes the stem image. According to the analysis result of the stem detection module, the detection information output module is controlled to output the quality inspection result information of the preferred Pleurotus eryngii. The cap detection module includes a damaged area recognition module, a region information acquisition module, a region number comparison module, an associated region selection module and a damage degree calculation module. The damaged area recognition module performs binary processing on the cap image of the Pleurotus eryngii to be analyzed, detects and identifies the damaged cap area in the cap image, the region information acquisition module is used to obtain the area of the damaged cap area and the number k of damaged cap areas in the cap image, the region number comparison module is used to compare the number k of damaged cap areas in the cap image with the number threshold, when the number k is greater than the number threshold, it is determined that the damage degree of the Pleurotus eryngii cap to be analyzed is greater than the damage threshold, when the number k is less than or equal to the number threshold, the associated region selection module and the damage degree calculation module are operated, the associated region selection module is used to count the distance between any two damaged cap areas on the Pleurotus eryngii to be analyzed, if the distance between two damaged cap areas is less than the distance threshold, then the two damaged cap areas are associated areas with each other, and the damage degree calculation module calculates the damage degree of the Pleurotus eryngii cap to be analyzed Where P is the area of the cap of the Pleurotus eryngii to be analyzed, i is the damaged area of the i-th cap of the Pleurotus eryngii to be analyzed, S i is the area of the damaged area of the i-th cap of Pleurotus eryngii to be analyzed, m i is the number of associated regions of the i-th damaged cap region of Pleurotus eryngii to be analyzed; The stipe detection module includes a stipe division module, a boundary stipe selection module, an influencing stipe selection module and a logarithmic statistical comparison module. The stipe division module divides the stipe into a plurality of stipes of equal width and thickness along the direction from the stipe of the preferred Pleurotus eryngii to the cap, and sequentially obtains the cross-sectional area of each stipe. The boundary stipe selection module sets a stipe as a candidate stipe, a stipe adjacent to the candidate stipe and away from the cap as a first reference stipe, and a stipe adjacent to the candidate stipe and close to the cap as a second reference stipe, and calculates a first reference quantity U1=V0-V1 and a second reference quantity U2=V2-V0 of the candidate stipe, wherein V0 is the cross-sectional area of the candidate stipe. The influencing stipe selection module is used to determine in turn whether two adjacent boundary stipes are a pair of influencing stipes. The logarithmic statistical comparison module is used to count the logarithm of a pair of influencing stipes corresponding to the preferred Pleurotus eryngii. If the logarithm of a pair of influencing stipes corresponding to the preferred Pleurotus eryngii is greater than the logarithmic threshold, the detection information output module outputs information that the quality detection of the Pleurotus eryngii to be analyzed is unqualified.
2. The image analysis-based quality detection system for Pleurotus eryngii according to claim 1, characterized in that: The influencing stipe selection module includes a cross-sectional area acquisition comparison module and a proportion threshold comparison module. The cross-sectional area acquisition comparison module calculates the difference in cross-sectional areas of two adjacent boundary stipes in the direction from the stipe of the Pleurotus eryngii to the cap. If the absolute value of the difference in cross-sectional areas of two adjacent boundary stipes is greater than or equal to the cross-sectional threshold, the proportion threshold comparison module is used to obtain the distance length Lf between the positions of the two adjacent boundary stipes in the preferred Pleurotus eryngii. If Lf / Lz is less than or equal to the proportion threshold, where Lz is the length of the stipe of the preferred Pleurotus eryngii, then the two adjacent boundary stipes are a pair of influencing stipes.
3. A method for detecting quality of Pleurotus eryngii based on image analysis, applied to the quality detection system according to any one of claims 1 to 2, characterized in that: The quality detection method comprises the following steps: Collect the cap image of the Pleurotus eryngii to be analyzed, obtain the damage degree of the cap of the Pleurotus eryngii to be analyzed, If the damage degree of the cap of the Pleurotus eryngii to be analyzed is greater than the damage threshold, then output the information that the quality inspection of the Pleurotus eryngii to be analyzed is unqualified; If the damage degree of the cap of the Pleurotus eryngii to be analyzed is less than or equal to the damage threshold, then the Pleurotus eryngii to be analyzed is the preferred Pleurotus eryngii, the stipe image of the preferred Pleurotus eryngii is collected, and the quality detection result information of the preferred Pleurotus eryngii is output according to the stipe image.
4. The method for detecting quality of Pleurotus eryngii based on image analysis according to claim 3, characterized in that: The method of obtaining the damage degree of the cap of the Pleurotus eryngii to be analyzed comprises: The cap image of the Pleurotus eryngii to be analyzed is binarized, the damaged cap area in the cap image is detected and identified, and the area of the damaged cap area and the number k of damaged cap areas in the cap image are obtained. If the number k of damaged cap areas in the cap image is greater than the number threshold, then the damage degree of the cap of the Pleurotus eryngii to be analyzed is greater than the damage threshold. Otherwise, calculate the damage degree of the cap of the Pleurotus eryngii to be analyzed Where P is the area of the cap of the Pleurotus eryngii to be analyzed, i is the damaged area of the i-th cap of the Pleurotus eryngii to be analyzed, S i is the area of the damaged area of the i-th cap of Pleurotus eryngii to be analyzed, m i is the number of associated regions of the i-th damaged cap region of the Pleurotus eryngii to be analyzed, wherein if the distance between two damaged cap regions is less than the distance threshold, then the two damaged cap regions are associated regions of each other.
5. The method for detecting quality of Pleurotus eryngii based on image analysis according to claim 4, characterized in that: The method of judging whether the quality of the Pleurotus eryngii is qualified according to the stipe image comprises: Along the direction from the stipe of the selected Pleurotus eryngii to the cap, the stipe is evenly divided into a number of sub-stalks of equal width and thickness, and the cross-sectional area of each sub-stalk is obtained in turn. Suppose a certain stipe is a candidate stipe, the stipe adjacent to the candidate stipe and away from the cap is the first reference stipe, and the stipe adjacent to the candidate stipe and close to the cap is the second reference stipe. Calculate the first reference quantity U1=V0-V1 and the second reference quantity U2=V2-V0 of the candidate stem. Wherein, V0 is the cross-sectional area of the candidate stipe, V1 is the cross-sectional area of the first reference stipe, and V2 is the cross-sectional area of the second reference stipe. If one of the values corresponding to the first reference value U1 and the second reference value U2 of a candidate stipe is greater than or equal to 0 and the other is less than 0, then the candidate stipe is a boundary stipe. It is determined in turn whether two adjacent boundary stipes are a pair of influencing stipes, and the logarithm of a pair of influencing stipes corresponding to the preferred Pleurotus eryngii is counted. If the logarithm of a pair of influencing stipes corresponding to the preferred Pleurotus eryngii is greater than the logarithmic threshold, then the information that the quality of the preferred Pleurotus eryngii is unqualified is output.
6. The method for detecting quality of Pleurotus eryngii based on image analysis according to claim 5, characterized in that: The step of sequentially judging whether two adjacent boundary stipes are a pair of influencing stipes comprises: The difference in cross-sectional area between two adjacent boundary stipes is calculated in sequence along the direction from the stipe to the cap of the Pleurotus eryngii. If the absolute value of the difference in cross-sectional area between two adjacent boundary stipes is greater than or equal to the cross-sectional threshold, Then obtain the distance length Lf between the positions of the two adjacent boundary stipes in the preferred Pleurotus eryngii. If Lf / Lz is less than or equal to the proportion threshold, where Lz is the length of the stipe of the preferred Pleurotus eryngii, then the two adjacent boundary stipes are a pair of influencing stipes.
