A method and system for evaluating the moldy state of Fuzhuan tea

CN119379676BActive Publication Date: 2025-03-07SHAANXI XIAN XI MORINGA BRICK TEA CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411943238.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-03-07
Estimated Expiration
2044-12-27

AI Technical Summary

Technical Problem

Traditional image segmentation methods are prone to misjudgment when distinguishing between oxa and Aspergillus aflatoxin in fu brick tea, resulting in inaccurate segmentation results and the inaccurate evaluation of the moldy condition of fu brick tea.

Method used

By obtaining the hue and grayscale values ​​of each pixel point in the Fu Brick Tea image, the first mold probability of each pixel point is calculated, and the target pixel point is filtered based on this probability. Then, the Gaussian distribution fitting is used to evaluate the proximity between target pixel points, cluster to form the target area. Finally, the second moldy probability is calculated based on the area of ​​the target area and the variance of the gradient values ​​of edge pixel points, and the moldy state of Fu brick tea is evaluated.

Benefits of technology

该方法能够更准确地区分金花和黄曲霉菌,减少误判,提高茯砖茶发霉状态评估的准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119379676B_ABST
    Figure CN119379676B_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, and in particular to a method and system for evaluating the moldy state of Fu brick tea. The method comprises: determining a first moldy probability of each pixel point according to a hue value and a grayscale value of the pixel point in a Fu brick tea image, determining a target pixel point according to the size of the first moldy probability, quantifying the proximity between the target pixel points by using a Gaussian distribution model, determining the clusterable probability between the target pixel points according to the proximity between the target pixel points and the difference in the first moldy probability, clustering based on the clusterable probability between the target pixel points to obtain a plurality of target areas, calculating a second moldy probability of the target area according to the area feature of each target area and the variance of the gradient value of the edge pixel points, evaluating whether the surface of the Fu brick tea is moldy according to the size of the second moldy probability of all the target areas, being able to more accurately distinguish golden flower and aflatoxin, and improving the accuracy of moldy state evaluation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a method and system for evaluating the moldy state of Fuzhuan tea. Background Art

[0002] During the fermentation process of Fu brick tea, the golden closed thecae formed by the growth of Aspergillus cristatus under specific temperature and humidity conditions are called golden flowers. Golden flowers are an important indicator of the quality of Fu brick tea. Its existence is generally considered to be a sign of high quality. If the temperature and humidity are not properly controlled during the production process, or the raw materials and processing process are contaminated, the tea leaves have a high water content, and the sanitary conditions are poor, the Fu brick tea may become moldy and produce Aspergillus flavus, which can be harmful to human health. Therefore, it is necessary to test whether the Fu brick tea is moldy during the production process, and destroy the moldy tea leaves in time to ensure quality.

[0003] The prior art applies advanced image processing technology to the quality inspection process of tea leaves. For example, a Chinese patent document with an existing authorization announcement number of CN112785571B discloses a method for identifying and segmenting young leaves of famous and high-quality tea based on an improved watershed, which includes the following steps: collecting an original image of tea leaves from a tea garden, using Gaussian filtering to remove various noises in the original image to improve the quality of the image, and obtaining a preprocessed image; splitting the preprocessed image into an R channel image, a G channel image, and a B channel image in an RGB color space; compensating the highlight area of ​​the B channel image; performing a difference operation between the G channel image and the processed B channel image to obtain a GB component image; using a minimum error method to obtain optimal adaptive values ​​T1 and T2; using the Otsu algorithm to perform initial binarization on the processed GB component image; and performing corrosion morphological processing on the binary image to complete the segmentation and identification of tea leaves. For example, the Chinese patent application document with the existing application publication number CN111784764A discloses a tea bud recognition and positioning algorithm, which includes the following steps: extracting tea bud features; segmenting the tea bud image based on the threshold of the super green feature; identifying the bud as a whole, detecting the intersection position of the tea stem and the bud overall identification frame, and setting the position as the bud picking point.

[0004] The image segmentation methods adopted in the above schemes are to grayscale the image and then perform image segmentation based on the brightness information of the image, that is, the grayscale value size. However, since the colors of golden flowers and aflatoxin are similar, the grayscale values ​​after grayscale are also similar, and the shapes of the two are complex. In addition, they are interfered by the texture of the tea leaves themselves, so it is easy to misjudge aflatoxin as golden flowers or tea leaves during segmentation, resulting in inaccurate segmentation results. It is impossible to accurately evaluate the moldy condition of Fuzhuan tea, affecting the quality. Summary of the invention

[0005] In order to solve the problem that traditional image segmentation easily misjudges aflatoxin as golden flowers or tea background, resulting in inaccurate segmentation results and inability to accurately evaluate the moldy state of Fuzhuan tea, the present invention proposes a method and system for evaluating the moldy state of Fuzhuan tea, which specifically adopts the following scheme:

[0006] In one aspect, the present invention provides a method for evaluating the moldy state of Fuzhuan tea, comprising:

[0007] Obtaining the hue value and grayscale value of each pixel in the original image of Fuzhuan tea, determining the first mildew probability of each pixel according to the difference between the hue value of each pixel and a preset standard hue value, and the difference between the grayscale value of the pixel and a preset standard grayscale value, and taking the pixel whose first mildew probability is greater than the preset first mildew probability threshold as the target pixel;

[0008] Gaussian distribution fitting is performed on the distance between the target pixels, the proximity between the target pixels is evaluated according to the fitting result, and the clustering probability between the target pixels is determined according to the proximity and the difference in the first mildew probabilities between the target pixels, wherein the clustering probability is positively correlated with the proximity and negatively correlated with the difference in the first mildew probabilities;

[0009] Clustering is performed based on the clusterable probability between all target pixels to obtain multiple target areas. The second mildew probability of each target area is calculated according to the variance of the gradient value of the edge pixel points and the area of ​​the target area. The second mildew probability is negatively correlated with the variance of the gradient value and positively correlated with the area. Whether the surface of the Fubrick tea is moldy is evaluated based on the size of the second mildew probability of all target areas.

[0010] The above technical solution extracts the hue value and grayscale value of each pixel from the original image, and quantifies the first moldy probability of the pixel according to the difference between the hue value and grayscale value of the pixel and the standard value based on the color information and brightness information of the known golden flower and aflatoxin, and preliminarily screens out the pixels that may be moldy according to the first moldy probability, thereby reducing the amount of data to be processed later. By considering the spatial position and moldy probability between pixels, similar pixels are clustered together more accurately to form an accurate moldy area. Further based on the structural characteristics and distribution characteristics of golden flowers and Aspergillus flavus, Aspergillus flavus tends to form larger contiguous areas, while golden flowers appear as independent small balls. Larger target areas are more likely to be moldy areas. The variance of the gradient values ​​of the edge pixels of the target area reflects the smoothness of the boundary of the target area. The boundary of Aspergillus flavus is usually fuzzy, while the boundary of golden flowers is clearer. The smaller the variance of the gradient value, the more likely it is Aspergillus flavus. Therefore, by comprehensively considering the area and edge characteristics of the target area, the second mold probability of each area can be more accurately evaluated. This method can better distinguish between golden flowers and Aspergillus flavus, reduce misjudgment, and improve the accuracy of moldy status assessment.

[0011] Preferably, the second mildew probability of the target area satisfies the following relationship:

[0012] , where It is The second mildew probability of the target area is used to reflect the The probability that the target area belongs to Aspergillus flavus, It is The area of ​​the target region, is the maximum area among all target areas, It is The variance of the gradient values ​​of the edge pixels of the target area is It is the maximum value of the variance of the gradient values ​​of all edge pixels in the target area. It is a normalization operation.

[0013] Preferably, the clusterability probability satisfies the following relationship:

[0014] ,in, It is The target pixel and The clustering probability of target pixels is It is The first mildew probability of the target pixel point, It is The first mildew probability of the target pixel point, It is The target pixel and The proximity of the target pixels, For normalization operation, To take the absolute value sign.

[0015] The above technical solution calculates the second moldy probability by combining the area of ​​the target area and the variance of the gradient values ​​of the edge pixels, wherein the target area with a larger area and a smaller variance of the gradient value is more likely to be Aspergillus flavus. The area and the variance of the gradient value in the formula respectively reflect the characteristics of Aspergillus flavus that tend to form larger contiguous areas with fuzzy boundaries, thereby improving the accuracy of moldy status assessment. The normalization operation ensures that data at different scales can be reasonably compared, so that the final probability value is between 0 and 1.

[0016] Preferably, the Gaussian distribution fitting of the distances between target pixels is to first calculate all Euclidean distances between each target pixel and other target pixels, construct a Euclidean distance histogram corresponding to the target pixel, the horizontal axis of the Euclidean distance histogram is different Euclidean distances, and the vertical axis is the number of other target pixels corresponding to the Euclidean distances, and then Gaussian distribution fitting is performed on the Euclidean distance histogram.

[0017] Preferably, the method of obtaining the hue value and grayscale value of each pixel in the original image is: enhancing the contrast of the original image, filtering and denoising the original image, and converting the denoised original image into The hue value and grayscale value of each pixel in the original image are obtained by performing spatial and grayscale conversion.

[0018] Preferably, the method for evaluating whether the surface of the Fu brick tea is moldy according to the size of the second mildew probability is: preset a second mildew probability threshold, and take the target areas in all target areas whose second mildew probability is greater than the second mildew probability threshold as aflatoxin areas, and count the areas of all aflatoxin areas; if the ratio of the total area of ​​all aflatoxin areas to the entire image exceeds the preset ratio threshold, the surface of the Fu brick tea is moldy and the tea is destroyed; if the ratio of the total area of ​​all aflatoxin areas to the entire image does not exceed the preset ratio threshold, the surface of the Fu brick tea is not moldy.

[0019] Preferably, the first mildew probability of each pixel satisfies the following relationship:

[0020] , where It is The first mildew probability of the pixel point is used to reflect the The probability that a pixel belongs to Aspergillus flavus, For normalization operation, is a preset standard grayscale value, which is used to represent the grayscale value of the golden flower. For the The gray value of a pixel, For the The hue value of each pixel, To take the absolute value sign, is the hue value used to represent the golden flower in the preset standard hue value. It is the hue value used to represent Aspergillus flavus in the preset standard hue value.

[0021] The above technical scheme calculates the first mold probability by combining the grayscale value and hue value of the pixel point, wherein the difference between the grayscale value and the standard golden flower grayscale value and the relative difference between the hue value and the standard hue value of golden flower and aflatoxin jointly determine the possibility that the pixel point belongs to aflatoxin, thereby improving the accuracy of distinguishing between aflatoxin and golden flower.

[0022] Preferably, the method for evaluating the proximity between target pixels according to the fitting result is: according to the Gaussian distribution fitting result, the variance of all Euclidean distances between each target pixel and any other target pixel is obtained: ,Will Substitute the probability density function of the Gaussian distribution to calculate the proximity of each target pixel to any other target pixel ,in, For the The target pixel and The proximity of the target pixels, For the The target pixel and The Euclidean distance between target pixels, is a natural constant.

[0023] The variance obtained by the above technical solution through Gaussian distribution fitting To quantify the Euclidean distance distribution between each target pixel and other pixels, this helps to quantify the spatial distribution characteristics between target pixels. The Gaussian distribution probability density function is used to calculate the proximity between each target pixel, which reflects their spatial closeness, so that pixels with closer distances have higher proximity, which can effectively capture the spatial relationship between pixels and provide a more accurate basis for subsequent clustering and mold probability calculation.

[0024] Preferably, before determining the first moldy probability of each pixel point, the method further includes removing the pixel points belonging to tea leaves in the original image according to the following method: The saturation and brightness of each pixel in the original image are spatially acquired, a saturation threshold and a brightness threshold are set, and the pixels in the original image whose saturation is less than the saturation threshold and whose brightness is less than the brightness threshold are regarded as pixels belonging to tea leaves, and the pixels belonging to tea leaves are removed.

[0025] The above technical solution is based on The color space obtains the saturation and brightness of each pixel in the original image. By eliminating tea pixels, the background noise can be reduced, allowing subsequent processing to focus more on the identification of golden flowers and aflatoxin, thereby improving the accuracy of moldy status assessment.

[0026] On the other hand, the present invention also provides a system for evaluating the moldy state of Fu brick tea, the evaluation system comprising a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of any of the state evaluation methods described.

[0027] The present invention has the following effects:

[0028] The present invention makes full use of the color information and brightness information of the image, calculates the first mildew probability of each pixel through the hue value and grayscale value, preliminarily screens out the pixels that may be mildewed, uses Gaussian distribution fitting to evaluate the proximity between the pixels, and performs clustering based on the difference in mildew probabilities to form an accurate moldy area, calculates the second mildew probability based on the area of ​​the target area and the variance of the gradient values ​​of the edge pixels, more accurately distinguishes between golden flower and Aspergillus flavus, and improves the accuracy of moldy state assessment. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0030] Figure 1 It is a schematic flow chart of the method of the present invention. DETAILED DESCRIPTION

[0031] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are 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 those skilled in the art without creative work are within the scope of protection of the present invention.

[0032] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0033] Reference Figure 1 A method for evaluating the moldy state of Fuzhuan tea comprises steps S1 to S4, which are specifically as follows:

[0034] S1: Collect the surface image of Fuzhuan tea, preliminarily evaluate the first mildew probability of the pixel point according to the grayscale information and chromaticity information of the pixel point, and determine the target pixel point in the surface image according to the magnitude of the first mildew probability.

[0035] The present invention places the Fuzhuan tea on a stable and evenly illuminated plane, uses a high-resolution camera to capture its surface image at a suitable shooting angle and distance, and in order to ensure the quality of the surface image, it is necessary to pre-process the surface image, including: using a contrast enhancement algorithm, such as using histogram equalization, adaptive contrast enhancement, etc. to make the brightness difference in different areas of the image more obvious, thereby highlighting more details. The image is filtered and denoised, such as using a mean filter algorithm to remove noise in the image and improve the overall quality of the image. Through the above-mentioned pre-processing steps, the quality of the Fuzhuan tea surface image can be ensured, providing a clear and accurate data basis for the subsequent evaluation of the moldy state.

[0036] Traditional image segmentation, such as threshold segmentation, is usually performed based on the brightness information of pixels, and the brightness information is characterized by the size of the grayscale value of the pixels. However, this step takes into account that Aspergillus flavus and golden flower are prone to produce similar grayscale values ​​after grayscale. This is because the grayscale image only retains the brightness information and loses the color information. If the color characteristics of Aspergillus flavus and golden flower are similar or the shooting conditions cause them to be consistent in brightness, then it is difficult to distinguish them in the grayscale image.

[0037] HSV is a commonly used color model, in which each letter represents a different color attribute: H stands for hue value, which indicates the type or hue of color, such as red, yellow, blue, etc. Hue value is usually expressed in degrees, ranging from 0 to 360 degrees. For example, red is about 0 degrees, yellow is about 60 degrees, green is about 120 degrees, and blue is about 240 degrees. S stands for saturation, which indicates the purity or vividness of the color. The higher the saturation, the more vivid the color. The lower the saturation, the closer the color is to gray. The saturation value range is usually 0 to 1 (or 0% to 100%). When the saturation is 0, the color turns completely gray. When the saturation is 1, the color reaches the most vivid state. V stands for brightness, which indicates the brightness of the color. The higher the brightness, the brighter the color. The lower the brightness, the darker the color. The brightness value range is also 0 to 1 (or 0% to 100%). When the brightness is 0, the color turns completely black. When the brightness is 1, the color reaches the brightest state.

[0038] In the HSV space, different objects have different hue values: golden flowers are usually golden yellow with a hue value close to 45 degrees, aflatoxin is usually yellowish brown with a hue value close to 60 degrees, and tea background is usually dark gray with a hue value close to 0 or 360 degrees. Even if the hue values ​​of some pixels are similar, their brightness may be quite different.

[0039] In summary, when processing the surface image of Fuzhuan tea, the grayscale image only retains the brightness information. If the threshold segmentation is performed only based on the brightness information of the pixel points, it is impossible to accurately distinguish between Aspergillus flavus and golden flower. The HSV model considers both hue value and brightness information. The use of the HSV color model can more effectively distinguish between golden flower and Aspergillus flavus than simply using a grayscale image.

[0040] Therefore, this step converts the denoised original image into The hue value and grayscale value of each pixel in the original image are obtained by spatial and grayscale conversion. The grayscale value reflects the brightness information of the pixel in the original image, and the hue value of the pixel reflects the color information of the pixel in the original image.

[0041] Next, considering that tea leaves are irrelevant backgrounds in the original image, tea leaves are usually dark gray, dark in color, and have low brightness and saturation. Therefore, in order to exclude the influence of tea leaves on the identification process of aflatoxin and golden flower, the following method is used to remove the pixels belonging to tea leaves in the original image:

[0042] based on The saturation and brightness of each pixel in the original image are spatially acquired, and the saturation threshold and the brightness threshold are both set to 10% (empirical value). The pixels in the original image with a saturation less than 10% and a brightness less than 10% are regarded as pixels belonging to tea leaves, and the pixels belonging to tea leaves are removed.

[0043] Then, after removing the pixels belonging to tea leaves, the remaining pixels in the original image are golden flowers or aflatoxin, and the first moldy probability of each pixel is calculated:

[0044]

[0045] In the formula, It is The first mildew probability of the pixel point is used to reflect the The probability that a pixel belongs to Aspergillus flavus, For normalization operation, is a preset standard grayscale value, which is used to represent the grayscale value of the golden flower. For the The gray value of a pixel, For the The hue value of each pixel, To take the absolute value sign, is the hue value used to represent the golden flower in the preset standard hue value. Set it to 45 degrees. is the hue value used to represent Aspergillus flavus in the preset standard hue value. Here it is set to 60 degrees. Both values ​​are empirical values.

[0046] This formula comprehensively considers the brightness information difference and color information difference between the pixel point and the golden flower, and can make a preliminary and accurate distinction between Aspergillus flavus and golden flower. Reflects the The difference in grayscale value between a pixel and the golden flower. The larger the value, the greater the difference between the grayscale value of the pixel and the grayscale value of the golden flower. The less likely the pixel is to be the golden flower, but more likely it is Aspergillus flavus. Reflects the The relative difference in hue value between the pixel point and the golden flower and aflatoxin. If the hue value of the pixel point differs more from that of the golden flower, the pixel point is more likely to be aflatoxin. If the hue value of the pixel point differs more from that of the golden flower, the pixel point is more likely to be a golden flower.

[0047] In this formula, since the golden flower is a brighter part, its grayscale value will be higher. In order to obtain the grayscale value (the preset standard grayscale value) used to represent the golden flower, two methods are provided here:

[0048] The first method is to place the previously confirmed Fuzhuan tea without aflatoxin on the surface under the current environmental conditions, collect its surface image, mark the pixels belonging to the golden flower, perform grayscale conversion, obtain the grayscale values ​​of all the pixels belonging to the golden flower, and use the average of the grayscale values ​​of all the pixels belonging to the golden flower as the preset standard grayscale value. .

[0049] The second method is to construct a grayscale histogram. The horizontal axis of the grayscale histogram is the brightness value of all pixels (from 0 to 255), and the vertical axis is the number of times each brightness value appears. This histogram can reflect the frequency of occurrence of different brightness values ​​in the original image. Since golden flowers are usually brighter than aflatoxin, the brightness value corresponding to golden flowers will be higher in the histogram. The nearest peak value close to the brightness value of 255 is the brightness value corresponding to this peak value, which represents the maximum brightness value in the original image. The brightness value corresponding to this peak value is used as the preset standard grayscale value. .

[0050] Next, the method for determining the target pixel points in the surface image according to the size of the first mildew probability is: presetting the first mildew probability to 0.5 (empirical value), and taking the pixel points in the surface image whose first mildew probability is greater than 0.5 as the target pixel points. The target pixel points are the pixel points that are preliminarily considered to be mildewed, that is, these target pixel points are preliminarily considered to be Aspergillus flavus.

[0051] S2: Fit the distance between target pixels with Gaussian distribution, and evaluate the proximity between target pixels based on the fitting results.

[0052] For each target pixel, the Euclidean distance between the target pixel and other target pixels is calculated to obtain multiple different Euclidean distances. For example, there are the following four different target pixels Tag1, Tag2, Tag3, and Tag4. For the target pixel Tag1, the proximity between the target pixel Tag1 and Tag2, Tag3, and Tag4 should be evaluated respectively. First, the Euclidean distance between Tag1 and Tag2 is calculated as L1, the Euclidean distance between Tag1 and Tag3 is L1, and the Euclidean distance between Tag1 and Tag4 is L2. There are two Euclidean distances, L1 and L2. Then, a histogram of all Euclidean distances between each target pixel and any other target pixel is constructed. The horizontal axis of the histogram is different Euclidean distances, and the vertical axis is the number of other target pixels corresponding to the Euclidean distances. In the Euclidean distance histogram corresponding to the target pixel Tag1, the number of other target pixels corresponding to L1 on the horizontal axis is 2, indicating that there are 2 other target pixels (Tag2 and Tag3) whose distance from the target pixel Tag1 is L1.

[0053] The Euclidean distance histogram can reflect which Euclidean distances appear most frequently, and then the Euclidean distance histogram is fitted with a Gaussian distribution. Gaussian distribution (also known as normal distribution) is a common probability distribution, which is shaped like a bell curve. It is very useful in statistics and image processing because it can well describe the data distribution of many natural phenomena. By fitting the Gaussian distribution, the fitted Gaussian distribution can provide some useful parameters, such as mean and variance, which are helpful to better understand and analyze the data. Therefore, here the histogram is fitted with a Gaussian distribution, that is, the data points in the histogram are fitted to a Gaussian distribution curve. This fitting process can be achieved through the least squares method or other statistical methods. After the fitting is completed, the parameters of the Gaussian distribution will be obtained, especially the variance , the variance reflects the discreteness of the data. Here, the variance represents the fluctuation degree of the Euclidean distance between each target pixel and all other target pixels. The probability density function of the Gaussian distribution is:

[0054]

[0055] in, x is a random variable, is the mean of the sample data, is the standard deviation of the sample data, is the variance of the sample data, is pi, is a natural constant.

[0056] Next, the proximity between the target pixels is evaluated based on the fitting results. The specific method is as follows:

[0057] According to the Gaussian distribution fitting result, the variance of all Euclidean distances between each target pixel and other target pixels is obtained. ,Will Substitute the probability density function of the Gaussian distribution and calculate the proximity of each target pixel to any other target pixel:

[0058]

[0059] In this formula, For the The target pixel and The proximity of the target pixels, For the The target pixel and The Euclidean distance between target pixels, is a natural constant, when the distance between two pixels When smaller, The value of will be larger, indicating that they are very close. When larger, The values ​​will be smaller, indicating that they are farther away.

[0060] It can be seen that this formula is a part of the probability density function of the Gaussian distribution (the exponential part of the probability density function), which is used to calculate the proximity between two target pixels. It maps the Euclidean distance between the target pixels into a measure of proximity, so that each target pixel has a higher degree of proximity to other target pixels with smaller distances. This method can effectively quantify the spatial relationship between pixels and improve the accuracy of clustering and mold status assessment.

[0061] In summary, this step calculates the Euclidean distance between target pixels and constructs a histogram, and then uses Gaussian distribution fitting to quantify the distribution characteristics of these distances, and ultimately can accurately evaluate the proximity between target pixels. This method not only considers the spatial position relationship between pixels, but also uses statistical methods to improve the accuracy of the evaluation, so that subsequent clustering operations can be performed more effectively, thereby more accurately identifying moldy areas.

[0062] S3: determining the clustering probability between the target pixels according to the proximity and the difference in the first mildew probability between the target pixels, and performing clustering based on the clustering probability between all the target pixels to obtain a plurality of target areas.

[0063] When analyzing the distribution of Aspergillus flavus on the surface of Fuzhuan tea, we first identify the pixels with a higher probability of mold, i.e., the target pixels in the previous step, and then cluster the target pixels into different regions. These regions may correspond to Aspergillus flavus regions or golden flower regions.

[0064] Since Aspergillus flavus tends to form large contiguous areas, they can be clustered together according to the distance between the target pixels and the difference in the first mold probability to form possible Aspergillus flavus areas. In the surface image, the main characteristics of the Aspergillus flavus area are: the edges are not obvious because there are hyphae at the edges, and the hyphae are connected to each other, resulting in blurred boundaries, and the Aspergillus flavus areas are usually large in area because they form large contiguous areas. In contrast, Jinhua is a beneficial bacterial community on Fuzhuan tea. They are independent spherical distributions without hyphae connection. Therefore, in the surface image, the edges of the Jinhua area are clear and the area is relatively small.

[0065] Therefore, by analyzing the edge clarity and area size of each cluster area, the aflatoxin area and the golden flower area can be more accurately identified and distinguished. If an area has fuzzy edges and a larger area, it is more likely to be an aflatoxin area. If an area has clear edges and a smaller area, it is more likely to be a golden flower area. This analysis method helps to more accurately identify and distinguish between aflatoxin and golden flowers on the surface of Fuzhuan tea, thereby improving the accuracy of moldy status assessment.

[0066] This step determines the clustering probability of each target pixel with any other target pixel according to the following relationship:

[0067]

[0068] In the formula, It is The target pixel and The clustering probability of target pixels is It is The first mildew probability of the target pixel point, It is The first mildew probability of the target pixel point, It is The target pixel and The proximity of the target pixels, For normalization operation, To take the absolute value sign.

[0069] In this formula, Reflects the The target pixel and The difference in the first mildew probabilities of the two target pixels is the smaller the difference in the first mildew probabilities of the two target pixels is, and the greater the proximity between the two, the more similar the features of the two target pixels are, and the more they should be clustered together.

[0070] This formula can effectively distinguish pixels with similar mildew probabilities and close in space, so as to better identify the aflatoxin area and golden flower area.

[0071] Then, the clustering probability threshold is preset to be 0.5 (empirical value) based on the clustering probability between each target pixel and other target pixels, and all target pixels are clustered.

[0072] The clustering principle is: if the clusterability probability between two target pixels is greater than 0.5, the two target pixels can be clustered into one category.

[0073] Determine the number of clusters: Initially set the number of clusters to 2, randomly select 2 initial cluster centers, perform clustering, and then increase the number of clusters in sequence, perform clustering, and obtain different clustering results corresponding to each cluster data. Use the elbow method to determine the optimal number of clusters. The elbow method is a commonly used method. By plotting the error sum of squares (SSE) curve under different numbers of clusters, find the "elbow" point in the curve. The number of clusters corresponding to this point is usually the optimal.

[0074] Obtain the target area: The clustering result corresponding to the optimal number of clusters is taken as the final clustering result, and finally all target pixels are clustered into multiple regions, which are recorded as multiple target regions, that is, multiple clusters are obtained by clustering, and all pixels contained in each cluster constitute a target area.

[0075] S4: Calculate the second mildew probability of each target area according to the area of ​​the target area and the variance of the gradient value of the edge pixel points, and evaluate whether the surface of the Fuzhuan tea is moldy according to the magnitude of the second mildew probabilities of all target areas.

[0076] First, obtain the variance of the gradient values ​​of the edge pixels of each target area, the maximum value of the variance of the gradient values ​​of the edge pixels of all target areas, and the maximum value of the area of ​​all target areas.

[0077] Calculate the second mildew probability of each target area:

[0078]

[0079] In the formula, It is The second mildew probability of the target area is used to reflect the The probability that the target area belongs to Aspergillus flavus, It is The area of ​​the target region, is the maximum area among all target areas, It is The variance of the gradient values ​​of the edge pixels of the target area is It is the maximum value of the variance of the gradient values ​​of all edge pixels in the target area. It is a normalization operation.

[0080] In this formula Reflects the The ratio of the area of ​​the target area to the maximum area. The larger the area, the larger the value of this item, indicating that the target area is more likely to be aflatoxin area. Reflects the The ratio of the variance of the edge gradient value of the target area to the maximum variance. The smaller the variance of the gradient value, The larger the value is, the more blurred the edge of the target area is, and it is more likely to be aflatoxin area.

[0081] If a target area is large and has blurred edges, its second mold probability will be higher, indicating that this target area is more likely to be aflatoxin area. On the contrary, if a target area is small and has clear edges, its second mold probability will be lower, indicating that this target area is more likely to be a golden flower area. The comprehensive evaluation method helps to more accurately identify and distinguish between aflatoxin and golden flower areas on the surface of Fuzhuan tea, improving the reliability and accuracy of detection.

[0082] Next, the moldiness of the Fuzhuan tea is evaluated based on the second moldiness probability of all target areas. The method is as follows:

[0083] The second mildew probability threshold is preset to 0.75 (empirical value), and the target area where the second mildew probability is greater than the second mildew probability threshold is taken as the aflatoxin area, and the area of ​​all the aflatoxin areas is counted;

[0084] If the ratio of the total area of ​​all aflatoxin areas to the entire image exceeds the preset ratio threshold, the surface of the Fu brick tea is moldy and it will be destroyed. If the ratio of the total area of ​​all aflatoxin areas to the entire image does not exceed the preset ratio threshold, the surface of the Fu brick tea is not moldy.

[0085] For food, any degree of mold may pose a risk to health, and the appropriate threshold can be determined through experiments. For example, sensory evaluation and physical and chemical testing of tea leaves with different mold area ratios are carried out. Based on the above considerations, a reasonable area ratio threshold should be between 0.5% and 5%. The specific value can be adjusted according to actual conditions and needs. In this step, 1% is set, that is, the total area of ​​all aflatoxin areas accounts for no more than 1% of the entire image area. This area ratio threshold is relatively low, which ensures that even if there is a small amount of mold, it will not have a significant impact on the overall quality and safety.

[0086] The present invention also provides a system for evaluating the moldy state of Fuzhuan tea. The system comprises a memory and a processor. A computer program is stored in the memory. The processor executes the computer program to implement the steps of any one of the detection methods.

[0087] In the description of this specification, "plurality" or "several" means at least two, such as two, three or more, etc., unless otherwise clearly defined.

[0088] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.

Claims

1. A method for evaluating the moldy state of Fuzhuan tea, characterized in that: include: Obtaining the hue value and grayscale value of each pixel in the original image of Fuzhuan tea, determining the first mildew probability of each pixel according to the difference between the hue value of each pixel and a preset standard hue value, and the difference between the grayscale value of the pixel and a preset standard grayscale value, and taking the pixel whose first mildew probability is greater than the preset first mildew probability threshold as the target pixel; Gaussian distribution fitting is performed on the distance between the target pixels, the proximity between the target pixels is evaluated according to the fitting result, and the clustering probability between the target pixels is determined according to the proximity and the difference in the first mildew probabilities between the target pixels, wherein the clustering probability is positively correlated with the proximity and negatively correlated with the difference in the first mildew probabilities; Clustering is performed based on the clusterability probability between all target pixels to obtain multiple target areas. The second moldy probability of the target area is calculated based on the area of ​​each target area and the variance of the gradient value of the edge pixel points, satisfying the following relationship: ; In the formula, It is The second mildew probability of the target area is used to reflect the The probability that the target area belongs to Aspergillus flavus, It is The area of ​​the target region, is the maximum area among all target areas, It is The variance of the gradient values ​​of the edge pixels of the target area is It is the maximum value of the variance of the gradient values ​​of all edge pixels in the target area. It is a normalization operation; whether the surface of the Fuzhuan tea is moldy is evaluated according to the size of the second mold probability.

2. The method for evaluating the moldy state of Fuzhuan tea according to claim 1, characterized in that: The clustering probability satisfies the following relationship: ; in, It is The target pixel and The clustering probability of target pixels is It is The first mildew probability of the target pixel point, It is The first mildew probability of the target pixel point, It is The target pixel and The proximity of the target pixels. For normalization operation, To take the absolute value sign.

3. The method for evaluating the moldy state of Fuzhuan tea according to claim 1, characterized in that: The Gaussian distribution fitting of the distance between target pixels is to first calculate all the Euclidean distances between each target pixel and other target pixels, and construct a Euclidean distance histogram corresponding to the target pixel. The horizontal axis of the Euclidean distance histogram is different Euclidean distances, and the vertical axis is the number of other target pixels corresponding to the Euclidean distances. Then, the Gaussian distribution fitting is performed on the Euclidean distance histogram.

4. The method for evaluating the moldy state of Fuzhuan tea according to claim 1, characterized in that: The method for obtaining the hue value and grayscale value of each pixel in the original image is: Enhance the contrast of the original image, filter and denoise the original image, and convert the denoised original image into The hue value and grayscale value of each pixel in the original image are obtained by performing spatial and grayscale conversion.

5. The method for evaluating the moldy state of Fuzhuan tea according to claim 1, characterized in that: The method for evaluating whether the surface of Fuzhuan tea is moldy according to the magnitude of the second mold probability is: Preset a second mildew probability threshold, take all target areas in which the second mildew probability is greater than the second mildew probability threshold as aflatoxin areas, and count the areas of all aflatoxin areas; If the ratio of the total area of ​​all aflatoxin areas to the entire image exceeds the preset ratio threshold, the surface of the Fu brick tea is moldy and it will be destroyed. If the ratio of the total area of ​​all aflatoxin areas to the entire image does not exceed the preset ratio threshold, the surface of the Fu brick tea is not moldy.

6. The method for evaluating the moldy state of Fuzhuan tea according to claim 2, characterized in that: The first mildew probability of each pixel satisfies the following relationship: ; In the formula, It is The first mildew probability of the pixel point is used to reflect the The probability that a pixel belongs to Aspergillus flavus, For normalization operation, is a preset standard grayscale value, which is used to represent the grayscale value of the golden flower. For the The gray value of a pixel, For the The hue value of each pixel, To take the absolute value sign, is the hue value used to represent the golden flower in the preset standard hue value. It is the hue value used to represent Aspergillus flavus in the preset standard hue value.

7. The method for evaluating the moldy state of Fuzhuan tea according to claim 3, characterized in that: The method for evaluating the proximity between target pixels based on the fitting results is: According to the Gaussian distribution fitting result, the variance of all Euclidean distances between each target pixel and all other target pixels is obtained. ; Will Substitute the probability density function of the Gaussian distribution to calculate the proximity of each target pixel to any other target pixel ,in, For the The target pixel and The proximity of the target pixels, For the The target pixel and The Euclidean distance between target pixels, is a natural constant.

8. The method for evaluating the moldy state of Fuzhuan tea according to claim 4, characterized in that: Before determining the first mold probability of each pixel point, the method further includes removing the pixel points belonging to tea leaves in the original image according to the following method: based on The saturation and brightness of each pixel in the original image are spatially acquired, a saturation threshold and a brightness threshold are set, and the pixels in the original image whose saturation is less than the saturation threshold and whose brightness is less than the brightness threshold are regarded as pixels belonging to tea leaves, and the pixels belonging to tea leaves are removed.

9. A system for evaluating the moldy state of Fuzhuan tea, characterized in that: The evaluation system comprises a memory and a processor, wherein a computer program is stored in the memory, and the processor executes the computer program to implement the steps of the state evaluation method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Tea tender shoot recognition and positioning algorithm

    CN111784764A

  • A method for identifying and segmenting young leaves of famous and high-quality tea based on improved watershed

    CN112785571B

  • Visual detection and analysis system for quality of traditional Chinese medicine decoction pieces

    CN116862911A

  • Fuzhuan tea eurotium cristatum growing dynamic detection method based on artificial intelligence

    CN118037732A