A method for detecting steviol glycoside impurities based on industrial vision
By utilizing image analysis under varying light angles and temperatures during the steviol glycoside crystallization process, feature detection areas are screened and impurities are marked, solving the problems of low reliability and efficiency in impurity detection in existing technologies, and achieving efficient and real-time impurity identification and detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- QUFU SHENGREN PHARMA CO LTD
- Filing Date
- 2025-05-19
- Publication Date
- 2026-04-24
AI Technical Summary
Existing technologies cannot quickly identify high-risk areas where impurities exist during the crystallization process of steviol glycosides, and traditional visual algorithms have difficulty handling the morphological similarity between impurities and steviol glycosides, resulting in low detection reliability and efficiency.
By acquiring surface images at different illumination angles and crystallization temperatures in a crystallization container, and using indicators such as grayscale difference coefficient and contour growth coefficient to screen feature detection areas, high-risk areas for impurities are identified, and impurities are selectively or universally marked according to risk tendency categories.
It enables rapid and reliable identification of high-risk areas where impurities exist during the crystallization process of steviol glycosides, improving detection efficiency and accuracy, reducing the performance requirements and energy consumption of hardware equipment, and is suitable for large-scale production.
Smart Images

Figure CN120594519B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image data processing technology, and in particular to a method for detecting steviol glycoside impurities based on industrial vision. Background Technology
[0002] Steviol glycosides, as a natural low-calorie sweetener, are widely used in the food and other industries. With consumers' increasing demands for product quality and safety, impurity detection during the steviol glycoside production process has become a crucial step in ensuring product quality. Crystallization is a key step in the production process to achieve product purification and shaping, and the contamination of impurities directly affects product purity, taste, and safety. Therefore, impurity detection during crystallization is particularly important. Among existing detection methods, manual visual inspection relies on operator experience, is inefficient, and is easily affected by subjective factors, making it impossible to monitor impurity changes in real time during crystallization. While instrumental analysis methods such as high-performance liquid chromatography (HPLC) and mass spectrometry can accurately detect impurity components, they require offline sampling and analysis. The long detection cycle and high cost make it impossible to dynamically monitor the crystallization process. Using industrial vision technology for impurity detection has core advantages such as real-time performance, non-contact operation, multi-dimensional feature capture, and intelligent linkage, which can significantly improve the efficiency of crystallization detection. However, during the crystallization process, the morphology, distribution, and optical properties of impurities are complex and variable. Impurities may exist in the form of irregular crystals or co-crystallization with steviol glycosides. Their size is similar to that of steviol glycoside crystals. Traditional vision algorithms have difficulty handling the morphological similarity between impurities and steviol glycosides, which can easily lead to missed detections or misjudgments. This cannot meet the requirements of industrial production for detection accuracy and real-time performance. Therefore, improving the reliability and efficiency of steviol glycoside impurity detection is an urgent technical problem to be solved.
[0003] For example, Chinese Patent Publication No. CN116596924B discloses a machine vision-based method and system for detecting the quality of steviol glycosides, comprising: acquiring a grayscale image to be tested; acquiring corresponding difference images for different Gaussian blur parameters; obtaining the specificity of the connected components based on the features of the closed connected components in the difference images and obtaining a specificity matrix; obtaining the optimal Gaussian blur parameters and the optimal high-frequency information region based on the specificity matrix; clustering within the optimal high-frequency information region, dividing the closed connected components into several clusters; obtaining the adaptive enhancement weight coefficients for each pixel within the cluster based on the characteristics of the clusters themselves; enhancing the grayscale image to be tested based on the adaptive enhancement weight coefficients; and obtaining quality evaluation parameters based on the enhanced grayscale image to be tested to complete the quality detection of steviol glycosides.
[0004] The following problems still exist in the existing technology:
[0005] Existing technologies do not take into account the complex and varied morphology and optical properties of impurities during the crystallization process. Impurities may exist in the form of irregular crystals or co-crystallized with steviol glycosides. Existing technologies cannot quickly identify high-risk areas where impurities exist, nor can they adaptively adjust the impurity marking method according to the different crystal outline features in the surface image of steviol glycoside crystallization, which affects the reliability and efficiency of steviol glycoside impurity detection. Summary of the Invention
[0006] To address this, the present invention provides a steviol glycoside impurity detection method based on industrial vision, which overcomes the problems of existing technologies being unable to quickly identify high-risk areas where impurities exist, and being unable to adaptively adjust the impurity marking method according to different crystal contour features in the surface image of steviol glycoside crystals, thus affecting the reliability and efficiency of steviol glycoside impurity detection.
[0007] To achieve the above objectives, the present invention provides a method for detecting steviol glycoside impurities based on industrial vision, comprising:
[0008] Stevia leaves are crushed, extracted, purified, and concentrated to obtain a supersaturated solution, which is then placed in a crystallization container for cooling and crystallization.
[0009] The surface of the supersaturated solution in the crystallization container is divided into several detection areas. Surface images of each detection area under different illumination angles are acquired within a preset acquisition period. The grayscale difference coefficient is determined based on the surface images. The grayscale fluctuation coefficient of each detection area is determined based on the comparison of the grayscale difference coefficients in order to screen feature detection areas.
[0010] The feature acquisition illumination angle is determined based on the grayscale difference coefficient of the feature detection area under adjacent illumination angles within the preset acquisition period, and the surface image of the feature detection area is acquired at the feature acquisition illumination angle to identify the feature contour.
[0011] The characteristic profiles at different crystallization temperatures are obtained, and the profile growth coefficient is determined based on the comparison of the characteristic profiles in order to determine the risk tendency category of the characteristic profiles.
[0012] The method of impurity marking is determined according to the risk propensity category, and the method of impurity marking includes selectively marking impurities on the feature contour based on the comparison of contour feature points on the feature contour.
[0013] Alternatively, the feature contour can be marked with a generalized impurity label.
[0014] Furthermore, determining the grayscale difference coefficient includes,
[0015] Under the same illumination angle, the difference between the maximum and minimum gray values in each detection area is determined as the gray-scale difference coefficient.
[0016] Furthermore, the grayscale fluctuation coefficients of each detection area are determined to include,
[0017] The grayscale difference coefficient of the detection area under different illumination angles within a preset acquisition period is obtained, and the variance of the grayscale difference coefficient is determined as the grayscale fluctuation coefficient of the detection area.
[0018] Furthermore, the process of selecting feature detection regions includes,
[0019] If the grayscale fluctuation coefficient of the detection area meets the feature determination condition, then the detection area is selected as a feature detection area;
[0020] If the grayscale fluctuation coefficient of the detection area does not meet the feature determination criteria, then the detection area will not be screened.
[0021] The feature determination condition is that the grayscale fluctuation coefficient exceeds the preset grayscale fluctuation coefficient reference value.
[0022] Furthermore, determining the feature acquisition illumination angle includes,
[0023] Obtain the grayscale difference coefficient of the feature detection region under different illumination angles, and calculate the absolute value of the difference between the grayscale difference coefficients of the feature detection region under adjacent illumination angles;
[0024] Mark adjacent illumination angles whose absolute difference does not exceed a preset absolute difference threshold, and determine the average angle of the adjacent illumination angles as the feature to obtain the illumination angle;
[0025] The illumination angle is the angle between the illumination direction and the plane of the crystallization container, and the angle increases sequentially according to a preset angle change amount.
[0026] Furthermore, determining the profile growth factor includes,
[0027] The contour area of each feature contour within the feature region is obtained at different crystallization temperatures. The absolute value of the difference between the contour areas at adjacent crystallization temperatures is calculated, and the average value of the absolute value of the difference is determined as the contour growth coefficient of the feature contour.
[0028] The crystallization temperature is gradually reduced by a preset temperature change amount, and the crystallization temperatures are sorted from high to low.
[0029] Furthermore, the process of determining the risk propensity category of the feature profile includes,
[0030] If the growth coefficient of the feature profile meets the criteria for determining implicit risk tendency, then the risk tendency category of the feature profile is determined to be the implicit risk tendency category.
[0031] If the growth coefficient of the feature profile does not meet the criteria for determining implicit risk tendency, then the risk tendency category of the feature profile is determined to be the explicit risk tendency category.
[0032] The condition for determining the latent risk tendency is that the profile growth coefficient exceeds a preset reference value for the profile growth coefficient.
[0033] Furthermore, the methods for impurity labeling include,
[0034] If the risk propensity category is a latent risk propensity category, then the method for impurity marking is to selectively mark impurities on the feature contour based on the comparison of feature points on the feature contour.
[0035] If the risk propensity category is an explicit risk propensity category, then the method for impurity marking is to mark all impurities on the feature contour.
[0036] Further, determining the contour feature points includes,
[0037] The tangent directions of several points on the feature contour are determined, the tangents of two points adjacent to the marked point are obtained, the included angle of the tangents of the two adjacent points is calculated, and the marked point whose included angle of the tangent exceeds the preset included angle threshold is determined as the contour feature point.
[0038] The marked point is any point on the feature contour.
[0039] Furthermore, the process of selectively marking impurities on the feature contours includes,
[0040] If several contour feature points on the feature contour meet the impurity determination criteria, then the feature contour is marked with impurities.
[0041] If several contour feature points on the feature contour do not meet the impurity determination criteria, then it is chosen not to mark the feature contour as an impurity.
[0042] The impurity determination condition is that the variance of the straight-line interval distance between adjacent contour feature points exceeds a preset variance threshold.
[0043] Compared with the prior art, the beneficial effects of the present invention are as follows: The present invention obtains surface images of each detection area under different illumination angles by placing a supersaturated solution in a crystallization container for cooling crystallization, determining the grayscale difference coefficient based on the surface images to determine the grayscale fluctuation coefficient of each detection area, screening feature detection areas, determining the feature acquisition illumination angle based on the grayscale difference coefficient of the feature detection areas under adjacent illumination angles, acquiring surface images of the feature detection areas at the feature acquisition illumination angle to identify feature contours, acquiring feature contours at different crystallization temperatures to determine the contour growth coefficient, determining the risk tendency category of the feature contours, and determining the method of impurity marking. Thus, it achieves rapid identification of high-risk areas where impurities exist. The method of impurity marking is adaptively adjusted according to the different crystal contour features in the surface images of steviol glycoside crystallization, improving the reliability and detection efficiency of steviol glycoside impurity detection.
[0044] In particular, this invention determines the grayscale fluctuation coefficient of each detection area based on the comparison of grayscale difference coefficients to screen feature detection areas. It can be understood that by screening feature detection areas based on grayscale fluctuation coefficients, high-risk areas where impurities may exist can be accurately identified, concentrating detection resources on these areas. This avoids indiscriminate detection of all areas within the crystallization container, reducing data processing volume and computational requirements. It eliminates the need for complex calculations on the entire image area, effectively lowering the performance requirements and operating load of hardware equipment, and significantly saving computing resources. This not only improves detection efficiency and meets the real-time needs of industrial production but also reduces equipment costs and energy consumption. It is particularly suitable for large-scale production scenarios, achieving efficient utilization of detection resources and effective control of computing costs. This invention determines the grayscale fluctuation coefficient of each detection area by comparing grayscale difference coefficients to screen feature detection areas, thereby enabling rapid identification of high-risk areas where impurities exist during steviol glycoside crystallization, improving the reliability and efficiency of steviol glycoside impurity detection.
[0045] In particular, this invention determines the feature acquisition illumination angle based on the grayscale difference coefficient of the feature detection area under adjacent illumination angles. It is understood that the reflective properties of impurities and steviol glycoside crystals change under different illumination angles. By calculating the absolute value of the difference in grayscale difference coefficients of the feature detection area under adjacent illumination angles, adjacent illumination angles with a gradual change in grayscale difference coefficients are selected. The average value of adjacent illumination angles is used as the feature acquisition illumination angle. This ensures stable grayscale differences between impurities and surrounding crystals, avoiding the masking or misjudgment of impurities due to improper illumination angles, thereby improving the accuracy of impurity contour recognition and reducing the probability of missed and false detections. Furthermore, it eliminates the need for comprehensive analysis of images under all illumination angles; instead, it utilizes... By selecting illumination angles based on selected features, focusing on image acquisition that best reflects impurity characteristics, unnecessary image data processing is reduced. Impurity contour recognition and subsequent detection are performed only on images under specific illumination angles, significantly shortening detection time and improving detection efficiency, thus meeting the demand for rapid detection in industrial production. This invention determines the feature acquisition illumination angle based on the grayscale difference coefficient of the feature detection area under adjacent illumination angles, and acquires the surface image of the feature detection area at the feature acquisition illumination angle to identify the feature contour. Therefore, it realizes the acquisition of the surface image of the feature detection area at the feature acquisition illumination angle to identify the feature contour during the crystallization process of steviol glycosides, improving the reliability and detection efficiency of steviol glycoside impurity detection.
[0046] In particular, this invention acquires characteristic profiles at different crystallization temperatures and determines the profile growth coefficient based on the comparison of the characteristic profiles to determine the risk tendency category of the characteristic profiles. It is understood that during the crystallization process of steviol glycosides, steviol glycoside crystals will continuously precipitate and deposit due to changes in solute temperature, and their profile area will gradually increase. However, impurities do not show significant changes in area due to their own physicochemical properties when the temperature changes. By acquiring the area of characteristic profiles at different crystallization temperatures and calculating the absolute value of the difference in profile area between adjacent temperatures, the profile growth coefficient can be obtained, which can quantify this change. For characteristic profiles with changing profile growth coefficients, there is still a possibility that impurities are attached to steviol glycoside crystals. By using the profile growth coefficient, the characteristic profiles are divided into latent risk tendency categories and explicit risk tendency categories. Thus, during the crystallization process of steviol glycosides, the risk tendency category of each profile in the image can be determined based on the surface image of the steviol glycoside crystals, improving the reliability and detection efficiency of steviol glycoside impurity detection.
[0047] In particular, under the condition of latent risk tendency category, this invention selectively marks impurities on the feature contour based on the comparison of feature points on the feature contour. It is understood that the latent risk tendency category refers to the feature contour undergoing significant changes with temperature during the cooling crystallization process. Besides pure steviol glycoside crystals, impurities may also adhere to the steviol glycoside crystals, causing significant changes in their feature contour with temperature. Pure steviol glycoside crystals typically grow relatively regularly, with gentle changes in the tangent direction at each point on their contour, small angles between adjacent tangents, uniform distribution of feature points, and small variance in the straight-line distance between adjacent feature points. The presence of impurities, however, can lead to crystal growth... Long anomalies cause sharp turns, protrusions, or depressions in the contour, resulting in abrupt changes in the tangent direction of some points on the contour, an increased angle between the tangents of adjacent points, and a chaotic distribution of contour feature points with a large variance in the straight-line distance between adjacent contour feature points. Selective impurity labeling effectively reduces mislabeling caused by factors such as normal crystal growth fluctuations and environmental interference. Under the condition of latent risk tendency category, this invention selectively labels feature contours based on the comparison of contour feature points on the feature contour. Thus, it realizes the adaptive adjustment of the impurity labeling method during the crystallization process of steviol glycosides, improving the reliability and detection efficiency of steviol glycoside impurity detection.
[0048] In particular, under the condition of a dominant risk tendency category, the present invention performs a comprehensive impurity labeling on the characteristic contours. It can be understood that the dominant risk tendency category condition means that during the cooling crystallization process, the characteristic contours do not change significantly under temperature changes and are identified as impurities. By comprehensively labeling such contours, the region where impurities exist can be accurately identified, avoiding missed detections due to the similarity of impurity morphology and color to crystals. Compared with traditional detection methods, this can significantly improve the reliability of detection results. Under the condition of a dominant risk tendency category, the present invention performs comprehensive impurity labeling on the characteristic contours, thereby enabling adaptive adjustment of the impurity labeling method during the steviol glycoside crystallization process, improving the reliability and detection efficiency of steviol glycoside impurity detection. Attached Figure Description
[0049] Figure 1 This is a flowchart illustrating the steps of the steviol glycoside impurity detection method based on industrial vision, as described in an embodiment of the present invention.
[0050] Figure 2 This is a flowchart illustrating the logic of filtering feature detection regions according to an embodiment of the present invention.
[0051] Figure 3 A flowchart illustrating the logic for determining the risk tendency category of the feature contour in an embodiment of the present invention;
[0052] Figure 4 This is a logic flowchart illustrating how to determine the method of impurity marking in an embodiment of the present invention. Detailed Implementation
[0053] To make the objectives and advantages of the present invention clearer, the present invention will be further described below with reference to embodiments; it should be understood that the specific embodiments described herein are merely for explaining the present invention and are not intended to limit the present invention.
[0054] Preferred embodiments of the present invention will now be described with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.
[0055] It should be noted that in the description of this invention, the terms "upper," "lower," "inner," "outer," etc., which indicate the direction or positional relationship, are based on the direction or positional relationship shown in the accompanying drawings. This is only for the convenience of description and does not indicate or imply that the device or element must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation of this invention.
[0056] Please see Figure 1 The diagram shows the steps of a steviol glycoside impurity detection method based on industrial vision according to an embodiment of the present invention. The method includes:
[0057] Step S100: The stevia leaves are crushed, extracted, purified and concentrated to obtain a supersaturated solution, and the supersaturated solution is placed in a crystallization container for cooling and crystallization.
[0058] Specifically, the processing of stevia leaves first requires crushing them to increase the surface area of the leaves through mechanical crushing. Then, using suitable solvents and extraction processes, such as solvent extraction and ultrasonic-assisted extraction, steviol glycosides are extracted from the leaves, resulting in a mixed solution containing steviol glycosides and impurities. The extract is then purified and concentrated using techniques such as chromatography and membrane filtration to remove impurities. The concentration of steviol glycosides in the solution is increased through evaporation and concentration to obtain a supersaturated solution. This supersaturated solution is placed in a crystallization container, and the solution's dissolution equilibrium is disrupted by gradually decreasing the temperature, causing steviol glycosides to precipitate from the solution in crystal form. For example, the temperature can be decreased uniformly over time, which will not be elaborated further here.
[0059] Step S200: Divide the surface of the supersaturated solution in the crystallization container into several detection areas, acquire surface images of each detection area under different illumination angles within a preset acquisition period, determine the grayscale difference coefficient based on the surface images, and determine the grayscale fluctuation coefficient of each detection area according to the comparison of the grayscale difference coefficients, so as to screen feature detection areas.
[0060] Specifically, the crystallization container can be a rectangular crystallization tank, a crystallization vessel, a crystallization dish, etc., and preferably, it can be a rectangular crystallization tank.
[0061] Specifically, the area of the detection region is the product of the area of the supersaturated solution surface and the dividing factor. The dividing factor can be set by those skilled in the art according to the accuracy requirements of steviol glycoside impurity detection. The higher the accuracy requirement, the smaller the dividing factor. The value range of the dividing factor can be [0.03, 0.08]. Preferably, the dividing factor can be 0.05. The detection region can be divided by grid division, uniformly dividing the solution surface into rectangular or square grids, with each grid being a detection region. For example, a specific embodiment for determining the detection region is given here, where the area of the supersaturated solution surface is obtained as 100 cm². 2 If the dividing factor is set to 0.05, then the area of the detection region is 5 cm². 2 .
[0062] Specifically, the preset collection cycle can start 3 hours after the cooling and crystallization begins. After 3 hours, the supersaturated solution gradually crystallizes, and the crystal outline can be identified by visual image. The duration of the preset collection cycle can be set by those skilled in the art according to the accuracy requirements of steviol glycoside impurity detection. The higher the accuracy requirement, the longer the duration. The range of the duration of the preset collection cycle can be [0.5, 1], with the unit of the interval being h. Preferably, the duration of the preset collection cycle can be 0.75h.
[0063] Step S300: Determine the feature acquisition illumination angle based on the grayscale difference coefficient of the feature detection area under adjacent illumination angles within the preset acquisition period, and acquire the surface image of the feature detection area at the feature acquisition illumination angle to identify the feature contour.
[0064] Specifically, the feature contour is the outline of the crystal within the feature detection area. The feature contour can be obtained by acquiring the surface image of the feature detection area through an industrial camera, and the crystal contour can be located by detecting pixels with drastic gray-scale changes in the image using an edge detection algorithm. This will not be elaborated further here.
[0065] Step S400: Obtain feature profiles at different crystallization temperatures, determine the profile growth coefficient based on the comparison of feature profiles, and determine the risk tendency category of the feature profiles.
[0066] Step S500: Determine the method for marking impurities based on the risk propensity category;
[0067] The method of impurity marking includes selectively marking impurities on the feature contour based on the comparison of feature points on the feature contour.
[0068] Alternatively, the feature contour can be marked with a generalized impurity label.
[0069] Specifically, determining the grayscale difference coefficient includes,
[0070] Under the same illumination angle, the difference between the maximum and minimum gray values in each detection area is determined as the gray-scale difference coefficient.
[0071] Specifically, the maximum and minimum gray values of the detection area can be obtained by calculating the gray-level histogram and directly traversing the image pixels, which will not be elaborated here.
[0072] Specifically, determining the grayscale fluctuation coefficient for each detection area includes,
[0073] The grayscale difference coefficient of the detection area under different illumination angles within a preset acquisition period is obtained, and the variance of the grayscale difference coefficient is determined as the grayscale fluctuation coefficient of the detection area.
[0074] Please see Figure 2 The diagram shown is a logical flowchart for filtering feature detection regions according to an embodiment of the present invention. The process of filtering feature detection regions includes:
[0075] If the grayscale fluctuation coefficient of the detection area meets the feature determination condition, then the detection area is selected as a feature detection area;
[0076] If the grayscale fluctuation coefficient of the detection area does not meet the feature determination criteria, then the detection area will not be screened.
[0077] The feature determination condition is that the grayscale fluctuation coefficient exceeds the preset grayscale fluctuation coefficient reference value.
[0078] Specifically, the preset grayscale fluctuation coefficient reference value can be set by those skilled in the art based on the accuracy requirements of steviol glycoside impurity detection. The higher the accuracy requirement, the smaller the preset grayscale fluctuation coefficient reference value. The range of the grayscale fluctuation coefficient reference value can be [0.5, 2]. Preferably, the preset grayscale fluctuation coefficient reference value can be 0.7.
[0079] Specifically, this invention determines the grayscale fluctuation coefficient of each detection area based on the comparison of grayscale difference coefficients to screen feature detection areas. It can be understood that by screening feature detection areas based on grayscale fluctuation coefficients, high-risk areas where impurities may exist can be accurately identified, concentrating detection resources on these areas. This avoids indiscriminate detection of all areas within the crystallization container, reducing data processing volume and computational requirements. It eliminates the need for complex calculations on the entire image area, effectively lowering the performance requirements and operating load of hardware equipment, significantly saving computing resources. This not only improves detection efficiency and meets the real-time needs of industrial production but also reduces equipment costs and energy consumption. It is particularly suitable for large-scale production scenarios, achieving efficient utilization of detection resources and effective control of computing costs. This invention determines the grayscale fluctuation coefficient of each detection area by comparing grayscale difference coefficients to screen feature detection areas, thereby enabling rapid identification of high-risk areas where impurities exist during steviol glycoside crystallization, improving the reliability and efficiency of steviol glycoside impurity detection.
[0080] Specifically, it is understood that during the crystallization of steviol glycosides, impurities exhibit significant differences in optical properties compared to steviol glycosides. These differences lead to varying grayscale representations in images. The grayscale difference coefficient characterizes the maximum variation in grayscale values within a detection area under the same illumination angle. The presence of impurities disrupts the uniformity of the crystal structure, making the surface morphology and reflective properties within the area more complex, thereby increasing the grayscale difference coefficient. The grayscale fluctuation coefficient, by calculating the variance of the grayscale difference coefficient under different illumination angles, reflects the stability of the region's optical response. The irregular shape, different orientations, or mixed crystal forms of impurities cause drastic changes in reflective intensity under different illuminations, leading to an increase in the grayscale fluctuation coefficient. Therefore, feature detection areas with grayscale fluctuation coefficients exceeding preset reference values exhibit optical properties that deviate from the stable performance of normal crystals. This invention determines the grayscale fluctuation coefficient of each detection area by comparing grayscale difference coefficients to screen feature detection areas. Consequently, it enables rapid identification of high-risk areas where impurities exist during the crystallization process of steviol glycosides, improving the reliability and efficiency of steviol glycoside impurity detection.
[0081] Specifically, determining the feature to obtain the illumination angle includes,
[0082] Obtain the grayscale difference coefficient of the feature detection region under different illumination angles, and calculate the absolute value of the difference between the grayscale difference coefficients of the feature detection region under adjacent illumination angles;
[0083] Mark adjacent illumination angles whose absolute difference does not exceed a preset absolute difference threshold, and determine the average angle of the adjacent illumination angles as the feature to obtain the illumination angle;
[0084] If the absolute value of the difference exceeds the preset absolute value threshold, the lighting angle will not be filtered.
[0085] The illumination angle is the angle between the illumination direction and the plane of the crystallization container, and the angle increases sequentially according to a preset angle change amount.
[0086] Specifically, the feature acquisition illumination angle can be the average angle of adjacent illumination angles whose absolute difference does not exceed a preset absolute difference threshold.
[0087] Specifically, the range of illumination angle variation and the preset angle variation amount can be set by those skilled in the art according to the accuracy requirements of steviol glycoside impurity detection. The higher the accuracy requirement, the larger the range of illumination angle variation and the smaller the preset angle variation amount. The range of illumination angle variation can be [30, 150], with the interval unit being °. The range of the preset angle variation amount can be [3, 8], with the interval unit being °. Preferably, the range of illumination angle variation can be [40, 140], with the interval unit being °, and the preset angle variation amount can be 5°.
[0088] Specifically, the preset absolute value threshold for the difference can be set by those skilled in the art based on the accuracy requirements of the detection of steviol glycoside impurities. The higher the accuracy requirements, the smaller the preset absolute value threshold for the difference. The range of the absolute value threshold for the difference can be [3, 8], and preferably, the absolute value threshold for the difference can be 4.
[0089] For example, a specific embodiment for determining the illumination angle for feature acquisition is given here. The grayscale difference coefficient of the feature detection region is acquired under five progressively increasing illumination angles, namely 40°, 45°, 50°, 55°, and 60°. The absolute value of the difference between the grayscale difference coefficients of the feature detection region under adjacent illumination angles is 8 for 40° and 45°, 2 for 45° and 50°, 3 for 50° and 55°, and 5 for 55° and 60°. The absolute value threshold for the difference is set to 4. The absolute value of the difference between the grayscale difference coefficients of the two adjacent illumination angles, 45° and 50° and 50° and 55°, does not exceed the preset absolute value threshold. Therefore, the feature acquisition illumination angle can be any one of 47.5° and 52.5°.
[0090] Specifically, this invention determines the feature acquisition illumination angle based on the grayscale difference coefficient of the feature detection area under adjacent illumination angles. It is understood that the reflective properties of impurities and steviol glycoside crystals change under different illumination angles. By calculating the absolute value of the difference in grayscale difference coefficients of the feature detection area under adjacent illumination angles, adjacent illumination angles with a gradual change in grayscale difference coefficients are selected. The average value of adjacent illumination angles is used as the feature acquisition illumination angle. This ensures that the grayscale difference between impurities and surrounding crystals is stable at this angle, avoiding impurities being masked or misjudged due to improper illumination angles. This improves the accuracy of impurity contour recognition and reduces the probability of missed and false detections. Furthermore, it eliminates the need for comprehensive analysis of images under all illumination angles. Instead of analyzing images, this invention selects the illumination angle by filtering features, focusing on image acquisition that best reflects impurity characteristics. This reduces unnecessary image data processing, allowing for impurity contour recognition and subsequent detection only on images under specific illumination angles. This significantly shortens detection time, improves detection efficiency, and meets the demand for rapid detection in industrial production. The invention determines the feature acquisition illumination angle based on the grayscale difference coefficient of the feature detection area under adjacent illumination angles. Surface images of the feature detection area are acquired at the feature acquisition illumination angle to identify feature contours. Thus, during the crystallization process of steviol glycosides, surface images of the feature detection area are acquired at the feature acquisition illumination angle to identify feature contours, improving the reliability and efficiency of steviol glycoside impurity detection.
[0091] Specifically, it is understandable that changes in the illumination angle may introduce external interference factors, such as reflections and shadows, affecting the stability of the detection results. The process of determining the feature acquisition illumination angle is essentially about selecting the illumination conditions that are least affected by external interference and have the most stable impurity features. Acquiring images at this angle for impurity detection can effectively reduce the noise impact caused by illumination changes, enhance the algorithm's adaptability to complex industrial environments, and make the detection results more reliable and stable. Thus, it is possible to acquire surface images of the feature detection area at the feature acquisition illumination angle during the steviol glycoside crystallization process to identify feature contours, thereby improving the reliability and efficiency of steviol glycoside impurity detection.
[0092] Specifically, determining the profile growth factor includes,
[0093] The contour area of each feature contour within the feature region is obtained at different crystallization temperatures. The absolute value of the difference between the contour areas at adjacent crystallization temperatures is calculated, and the average value of the absolute value of the difference is determined as the contour growth coefficient of the feature contour.
[0094] The crystallization temperature is gradually reduced by a preset temperature change amount, and the crystallization temperatures are sorted from high to low.
[0095] Specifically, the temperature range for obtaining the crystallization temperature of the contour area can be set by those skilled in the art based on the average value of several data under the same crystallization environment. The temperature range can be [20, 30], with the unit of interval being °C. Within this temperature range, a relatively clear crystal contour can be obtained, and the supersaturated solution is in a relatively stable crystallization stage.
[0096] Specifically, the preset temperature change can be set by those skilled in the art based on the average value of several data under the same crystallization environment. The preset temperature change can be in the range of [0.5, 2], with the unit being ℃. Preferably, the preset temperature change can be 1℃.
[0097] Specifically, the contour area of a feature contour can be extracted by image segmentation and then determined using pixel statistics, integration, or specialized software tools, which will not be elaborated here.
[0098] Please see Figure 3 As shown, it is a logical flowchart of an embodiment of the present invention for determining the risk tendency category of the feature contour. The process of determining the risk tendency category of the feature contour includes,
[0099] If the growth coefficient of the feature profile meets the criteria for determining implicit risk tendency, then the risk tendency category of the feature profile is determined to be the implicit risk tendency category.
[0100] If the growth coefficient of the feature profile does not meet the criteria for determining implicit risk tendency, then the risk tendency category of the feature profile is determined to be the explicit risk tendency category.
[0101] The condition for determining the latent risk tendency is that the profile growth coefficient exceeds a preset reference value for the profile growth coefficient.
[0102] Specifically, the preset reference value for the profile growth coefficient can be set by those skilled in the art based on the average value of several data points under the same crystallization environment. The range of the reference value for the profile growth coefficient can be [3, 8], with the unit being μm. 2 Preferably, the reference value for the profile growth factor can be 5 μm. 2 .
[0103] Specifically, the temperature interval between adjacent crystallization temperatures can be set by those skilled in the art based on the accuracy requirements of steviol glycoside impurity detection. The higher the accuracy requirement, the smaller the temperature interval. The temperature interval can be in the range of [0.5, 2.5], with the unit being °C. Preferably, the temperature interval can be 1 °C.
[0104] Specifically, this invention acquires characteristic profiles at different crystallization temperatures, determines the profile growth coefficient based on the comparison of the characteristic profiles, and identifies the risk tendency category of the characteristic profiles. It is understood that during the crystallization process of steviol glycosides, steviol glycoside crystals continuously precipitate and deposit due to temperature changes, and their profile area gradually increases. Impurities, due to their own physicochemical properties, do not show significant area changes with temperature. By acquiring the area of characteristic profiles at different crystallization temperatures and calculating the absolute value of the difference in profile area between adjacent temperatures, the profile growth coefficient can be obtained, quantifying this change. For characteristic profiles where the profile growth coefficient changes, there is still a possibility that impurities are attached to the steviol glycoside crystals. The profile growth coefficient is used to classify characteristic profiles into latent risk tendency categories and explicit risk tendency categories. Thus, during the steviol glycoside crystallization process, the risk tendency category of each profile in the image can be determined based on the surface image of the steviol glycoside crystals, improving the reliability and efficiency of steviol glycoside impurity detection.
[0105] Please see Figure 4 The diagram shown is a logic flowchart illustrating how to determine the method for impurity marking according to an embodiment of the present invention. Determining the method for impurity marking includes:
[0106] If the risk propensity category is a latent risk propensity category, then the method for impurity marking is to selectively mark impurities on the feature contour based on the comparison of feature points on the feature contour.
[0107] If the risk propensity category is an explicit risk propensity category, then the method for impurity marking is to mark all impurities on the feature contour.
[0108] Specifically, under the condition of a dominant risk tendency category, this invention performs a comprehensive impurity labeling on the characteristic contours. It is understood that the dominant risk tendency category condition means that during the cooling crystallization process, the characteristic contours do not significantly change with temperature changes and are thus identified as impurities. Comprehensive labeling of these contours can accurately identify the areas where impurities exist, avoiding missed detections due to impurities' similar morphology and color to crystals. Compared to traditional detection methods, this significantly improves the reliability of the detection results. Furthermore, by performing comprehensive impurity labeling on the characteristic contours under the dominant risk tendency category condition, this invention adaptively adjusts the impurity labeling method during the steviol glycoside crystallization process, improving the reliability and efficiency of steviol glycoside impurity detection.
[0109] Specifically, determining contour feature points includes,
[0110] The tangent directions of several points on the feature contour are determined, the tangents of two points adjacent to the marked point are obtained, the included angle of the tangents of the two adjacent points is calculated, and the marked point whose included angle of the tangent exceeds the preset included angle threshold is determined as the contour feature point.
[0111] If the included angle of the tangents does not exceed the preset included angle threshold, then the marked points will not be filtered.
[0112] The marked point is any point on the feature contour.
[0113] Specifically, the determination of several points on the feature contour can be achieved by determining several points along the feature contour according to a preset interval distance between adjacent points. The interval distance is the product of the perimeter of the feature contour and the interval factor. The interval factor can be set by those skilled in the art according to the accuracy requirements of the detection of steviol glycoside impurities. The higher the accuracy requirement, the smaller the interval factor. The value range of the interval factor can be [0.01, 0.03]. Preferably, the interval factor can be 0.02.
[0114] Specifically, the preset angle threshold can be set by those skilled in the art based on the accuracy requirements of the steviol glycoside impurity detection. The higher the accuracy requirement, the smaller the preset angle threshold. The range of the angle threshold can be [15, 30], with the interval unit being °. Preferably, the angle threshold can be 20°.
[0115] Specifically, the process of selectively marking impurities on feature contours includes,
[0116] If several contour feature points on the feature contour meet the impurity determination criteria, then the feature contour is marked with impurities.
[0117] If several contour feature points on the feature contour do not meet the impurity determination criteria, then it is chosen not to mark the feature contour as an impurity.
[0118] The impurity determination condition is that the variance of the straight-line interval distance between adjacent contour feature points exceeds a preset variance threshold.
[0119] Specifically, the preset variance threshold can be set by those skilled in the art based on the accuracy requirements of steviol glycoside impurity detection. The higher the accuracy requirements, the smaller the preset variance threshold. The range of the variance threshold can be [0.5, 0.8], and preferably, the variance threshold can be 0.6.
[0120] Specifically, under the condition of latent risk tendency category, this invention selectively marks impurities on the feature contour based on the comparison of feature points on the feature contour. It can be understood that the latent risk tendency category refers to the feature contour significantly changing with temperature during the cooling crystallization process. Besides pure steviol glycoside crystals, impurities may also adhere to the steviol glycoside crystals, causing significant changes in the feature contour with temperature. Pure steviol glycoside crystals typically grow relatively regularly, with gentle changes in the tangent direction at each point on their contour, small angles between adjacent tangents, uniform distribution of feature points, and small variance in the straight-line distance between adjacent feature points. The presence of impurities, however, can lead to crystal... Abnormal growth causes sharp turns, protrusions, or depressions in the contour, resulting in abrupt changes in the tangent direction of some points on the contour, an increased angle between the tangents of adjacent points, and a chaotic distribution of contour feature points with a large variance in the straight-line distance between adjacent contour feature points. Selective impurity labeling effectively reduces mislabeling caused by factors such as normal crystal growth fluctuations and environmental interference. Under the condition of latent risk tendency category, this invention selectively labels feature contours based on the comparison of contour feature points on the feature contour. Thus, it realizes the adaptive adjustment of the impurity labeling method during the crystallization process of steviol glycosides, improving the reliability and efficiency of steviol glycoside impurity detection.
[0121] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the scope of protection of the present invention.
[0122] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for detecting steviol glycoside impurities based on industrial vision, characterized in that, include: Stevia leaves are crushed, extracted, purified, and concentrated to obtain a supersaturated solution. The supersaturated solution is then placed in a crystallization container for cooling and crystallization. The surface of the supersaturated solution in the crystallization container is divided into several detection areas. Surface images of each detection area under different illumination angles are acquired within a preset acquisition period. The grayscale difference coefficient is determined based on the surface images. The grayscale fluctuation coefficient of each detection area is determined based on the comparison of the grayscale difference coefficients in order to screen feature detection areas. Determining the grayscale difference coefficient involves, under the same illumination angle, determining the difference between the maximum and minimum grayscale values in each detection area as the grayscale difference coefficient; The feature acquisition illumination angle is determined based on the grayscale difference coefficient of the feature detection area under adjacent illumination angles within the preset acquisition period, and the surface image of the feature detection area is acquired at the feature acquisition illumination angle to identify the feature contour. Determining the illumination angle for feature acquisition includes obtaining the grayscale difference coefficient of the feature detection region under different illumination angles and calculating the absolute value of the difference between the grayscale difference coefficients of the feature detection region under adjacent illumination angles. Mark adjacent illumination angles whose absolute difference does not exceed a preset absolute difference threshold, and determine the average angle of the adjacent illumination angles as the feature to obtain the illumination angle; Wherein, the illumination angle is the angle between the illumination direction and the plane of the crystallization container, and the angle increases sequentially according to a preset angle change amount; The characteristic profiles at different crystallization temperatures are obtained, and the profile growth coefficient is determined based on the comparison of the characteristic profiles in order to determine the risk tendency category of the characteristic profiles. Determining the contour growth coefficient includes obtaining the contour area of each feature contour within a feature region at different crystallization temperatures, calculating the absolute value of the difference between the contour areas at adjacent crystallization temperatures, and determining the average value of the absolute values of the differences as the contour growth coefficient of the feature contour. The crystallization temperature is gradually reduced by a preset temperature change amount, and the crystallization temperatures are sorted from high to low. The method of impurity marking is determined according to the risk propensity category, and the method of impurity marking includes selectively marking impurities on the feature contour based on the comparison of contour feature points on the feature contour. Alternatively, the feature contour can be marked with a generalized impurity label.
2. The method for detecting steviol glycoside impurities based on industrial vision according to claim 1, characterized in that, Determining the grayscale fluctuation coefficient for each detection area includes, The grayscale difference coefficient of the detection area under different illumination angles within a preset acquisition period is obtained, and the variance of the grayscale difference coefficient is determined as the grayscale fluctuation coefficient of the detection area.
3. The method for detecting steviol glycoside impurities based on industrial vision according to claim 2, characterized in that, The process of selecting feature detection regions includes, If the grayscale fluctuation coefficient of the detection area meets the feature determination condition, then the detection area is selected as a feature detection area; If the grayscale fluctuation coefficient of the detection area does not meet the feature determination criteria, then the detection area will not be screened. The feature determination condition is that the grayscale fluctuation coefficient exceeds the preset grayscale fluctuation coefficient reference value.
4. The method for detecting steviol glycoside impurities based on industrial vision according to claim 3, characterized in that, The process of determining the risk propensity category of the feature profile includes, If the growth coefficient of the feature profile meets the criteria for determining implicit risk tendency, then the risk tendency category of the feature profile is determined to be the implicit risk tendency category. If the growth coefficient of the feature profile does not meet the criteria for determining implicit risk tendency, then the risk tendency category of the feature profile is determined to be the explicit risk tendency category. The condition for determining the latent risk tendency is that the profile growth coefficient exceeds a preset reference value for the profile growth coefficient.
5. The method for detecting steviol glycoside impurities based on industrial vision according to claim 4, characterized in that, Determining the method for impurity labeling includes, If the risk propensity category is a latent risk propensity category, then the method for impurity marking is to selectively mark impurities on the feature contour based on the comparison of feature points on the feature contour. If the risk propensity category is an explicit risk propensity category, then the method for impurity marking is to mark all impurities on the feature contour.
6. The method for detecting steviol glycoside impurities based on industrial vision according to claim 5, characterized in that, Determining contour feature points includes, The tangent directions of several points on the feature contour are determined, the tangents of two points adjacent to the marked point are obtained, the included angle of the tangents of the two adjacent points is calculated, and the marked point whose included angle of the tangent exceeds the preset included angle threshold is determined as the contour feature point. The marked point is any point on the feature contour.
7. The method for detecting steviol glycoside impurities based on industrial vision according to claim 6, characterized in that, The process of selectively marking impurities on feature contours includes, If several contour feature points on the feature contour meet the impurity determination criteria, then the feature contour is marked with impurities. If several contour feature points on the feature contour do not meet the impurity determination criteria, then it is chosen not to mark the feature contour as an impurity. The impurity determination condition is that the variance of the straight-line interval distance between adjacent contour feature points exceeds a preset variance threshold.
Citation Information
Patent Citations
A Machine Vision-Based Method and System for Stevioside Quality Detection
CN116596924B
Stevioside quality detection method and system based on machine vision
CN116596924A
X-ray-based aramid fiber belt defect online detection method and device
CN119510454A