Tea dust rate nondestructive testing system based on machine vision
By using machine vision technology for image processing and analysis, combined with adaptive parameter settings, accurate detection of tea breakage rate was achieved, solving the problems of low efficiency and inconsistent results in traditional methods, and improving the detection capability and equipment intelligence level of tea production lines.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-29
- Publication Date
- 2026-04-03
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional manual screening and visual inspection methods are inefficient and produce inconsistent results, failing to meet the real-time and rapid quality inspection needs of modern tea production lines. Furthermore, the lack of objective data recording makes it difficult to achieve refined management of product quality and trace the source of problems.
A machine vision-based non-destructive testing system for tea leaf breakage rate is adopted, including image acquisition, processing and analysis modules. The system uses Gaussian filtering, adaptive thresholding, morphological operations, H-minima transform and watershed algorithm to segment tea leaf particles. Combined with support vector machine classification model, the breakage rate is calculated, and the cleanliness of the workbench is monitored through a cleaning inspection module.
It enables precise detection of tea breakage rate, overcomes the misjudgment problem caused by adhesion, improves the scientific nature and accuracy of detection, ensures the consistency and comparability of test results, reduces manual intervention, and enhances the intelligence level and operating efficiency of the equipment.
Smart Images

Figure CN121783850A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of tea testing, specifically to a non-destructive testing system for tea breakage rate based on machine vision. Background Technology
[0002] In the field of tea production and quality control, accurate detection of tea breakage rate is a crucial step in measuring product grade, evaluating the quality of processing techniques, and ensuring consistency in market circulation standards. For a long time, the industry has generally relied on traditional manual sieving and visual inspection methods.
[0003] This method typically involves mechanical sieving using standard sieves, followed by estimation of the proportion of broken particles based on visual observation and experience-based judgment by inspectors. This approach has several inherent drawbacks: First, its efficiency is extremely low, failing to meet the demands of real-time, rapid quality inspection on modern continuous production lines. Second, the results are heavily influenced by the inspectors' subjective experience, visual fatigue, and emotional state; judgments from different personnel, or even the same person at different times, can vary significantly, leading to poor consistency and low comparability. Furthermore, the process lacks objective data recording, making test results untraceable and difficult to reproduce, hindering refined product quality management and problem tracing.
[0004] To overcome the drawbacks of manual methods, some research and applications have begun to explore the introduction of machine vision technology in recent years. These preliminary automation solutions are usually based on a simple image processing workflow: photographing a spread tea sample, separating the tea leaves from the background through global or adaptive threshold segmentation to generate a binary image, and then directly setting a fixed threshold based on the pixel area of the connected region to distinguish between whole leaves and broken leaves.
[0005] However, these simple threshold segmentation and area statistics methods have shortcomings in practical applications. Specifically:
[0006] Tea leaves are curled and irregular in shape, making it impossible to achieve an ideal single-layer flat distribution on the sample stage. Whether it's whole leaves with whole leaves, broken leaves with broken leaves, or even whole leaves with broken leaves, physical contact and even partial overlap are highly likely to occur between the particles. Simple binarization processing cannot distinguish this contact, identifying multiple adhered particles as a single connected region. This can lead to multiple adhered broken leaf areas being misclassified as whole leaves due to their larger combined area, or a broken leaf adhering to a whole leaf causing feature distortion in that whole leaf area and resulting in misclassification. This segmentation failure caused by adhesion is the primary reason for low accuracy or abnormal fluctuations in broken leaf rate measurements. Summary of the Invention
[0007] The purpose of this invention is to provide a non-destructive testing system for tea leaf breakage rate based on machine vision, thereby solving at least one of the above-mentioned technical problems.
[0008] The objective of this invention can be achieved through the following technical solutions:
[0009] A machine vision-based non-destructive testing system for tea leaf breakage includes:
[0010] The image acquisition module is used to acquire digital images of the tea sample to be tested. It includes: a closed imaging dark box, a transparent sample stage for holding the tea sample at the bottom of the dark box, a high-resolution industrial camera above the transparent sample stage, and a light source for illuminating the tea sample below the transparent sample stage.
[0011] The image processing and analysis module is communicatively connected to the image acquisition module and is used to process and analyze the digital image to identify and distinguish between whole tea leaves and broken pieces.
[0012] The result output module is communicatively connected to the image processing and analysis module, and calculates the tea leaf breakage rate based on the pixel area of the identified whole leaf area and broken leaf area.
[0013] As a further technical solution, the specific process for processing and analyzing the digital image to identify and distinguish between whole tea leaves and broken tea leaves is as follows:
[0014] The acquired backlight image is converted to grayscale, denoised using a Gaussian filtering algorithm, and a binary image is generated using an adaptive thresholding method.
[0015] For the generated binary image, morphological closing and opening operations are performed sequentially on the binary image using a circular structuring element;
[0016] Calculate the distance transform map of the binary image, perform H-minima transformation on the distance transform map, the depth threshold H of the H-minima transformation ranges from 5 to 20 pixels, and find the local maxima points of the image after H-minima transformation as foreground markers;
[0017] The foreground marker and the background region of the binary image are used as inputs to the watershed algorithm. The watershed transformation is performed to segment the sticky tea leaves into independent individuals.
[0018] For each segmented independent region, extract a feature vector containing pixel area, perimeter, circularity, and aspect ratio of the minimum bounding rectangle;
[0019] The feature vectors are input into a pre-trained support vector machine classification model, which outputs a classification result indicating whether each region belongs to a whole leaf or a fragment.
[0020] As a further technical solution, the depth threshold H of the H-minima transform is associated with the spatial resolution of the high-resolution industrial camera and the type of tea to be detected; specifically, for a given type of tea, the threshold H is set to 0.2 to 0.5 times the average diameter of the reference broken leaves of that type.
[0021] As a further technical solution, the specific method for calculating the tea breakage rate is as follows:
[0022] Tea leaf breakage rate = (total pixel area of all broken areas / (total pixel area of all whole leaf areas + total pixel area of all broken areas)) × 100%.
[0023] As a further technical solution, the system also includes a cleaning inspection module;
[0024] The cleaning and inspection module is used to control the image acquisition module to perform an empty imaging of the empty transparent sample stage after the tea sample has been tested and discharged, and to obtain a background reference image.
[0025] Perform a difference calculation between the current background reference image and the clean background image initially calibrated by the system;
[0026] If the sum of all foreground pixels in the differential image exceeds the first preset threshold, it is determined that there is residue or dirt on the workbench, and a cleaning alarm is triggered.
[0027] As a further technical solution, the cleaning inspection module is also used to perform the following type discrimination process after a cleaning alarm is triggered:
[0028] Morphological processing and connected component analysis are performed on the foreground region in the difference image to obtain the pixel area and shape features of each connected component;
[0029] Based on the area distribution characteristics and / or shape characteristics of each connected domain, the state of residue is distinguished into tea leaf fragment residue and sample stage contamination; among them, tea leaf fragment residue corresponds to particle dispersion characteristics, and sample stage contamination corresponds to stain aggregation or linear scratch characteristics.
[0030] As a further technical solution, the distinction based on area distribution characteristics specifically includes:
[0031] Calculate the ratio of the standard deviation of the area of all connected regions to the total area. If the ratio is less than the first threshold, it is determined to be tea leaf residue. If the ratio of the area of a single connected region to the average area of all connected regions is greater than the second threshold, it is determined to be sample stage contamination.
[0032] The distinction based on shape features is specifically as follows:
[0033] Calculate the aspect ratio of the minimum bounding rectangle of the connected component. If there is a connected component whose aspect ratio is greater than the third threshold, it is determined that there are linear scratches on the sample stage.
[0034] As a further technical solution, the system also includes an adaptive feedback control module;
[0035] The adaptive feedback control module is communicatively connected to both the result output module and the cleaning inspection module, and is used to perform the following operations:
[0036] Receive the tea leaf breakage rate detection results, recorded in time series, output by the result output module;
[0037] Within a set sliding time window, count the number of times the tea breakage rate exceeds a preset quality threshold, and calculate the sum of the number of consecutive exceedances and the extent of exceedance.
[0038] The pollution risk assessment value is calculated based on the weighted combination of the number of times the standard was exceeded, the number of consecutive exceedances, and the magnitude of the exceedances.
[0039] The triggering frequency of the cleaning inspection module is dynamically adjusted according to the different risk levels of the pollution risk assessment value.
[0040] The adjustment strategy for the trigger evaluation frequency is as follows:
[0041] When the assessment value is below the assessment range, indicating low risk, maintain the preset cleaning inspection frequency;
[0042] When the assessment value is within the assessment range and is considered medium risk, the cleaning inspection frequency will be increased to be performed after each tea sample test.
[0043] When the assessed value is higher than the assessment range, indicating a high risk, in addition to performing a cleaning inspection after each test, a pre-inspection must be added before the start of the testing process.
[0044] As a further technical solution, the assessment value of the pollution risk is calculated through the following steps:
[0045] First, for each exceeding event recorded within the time window, the difference between the detected fragmentation rate and the preset quality threshold is calculated to obtain the exceeding range of the event; then, the arithmetic mean of the exceeding ranges of all exceeding events is calculated to obtain the average exceeding range.
[0046] The calculated average exceedance is multiplied by a preset magnitude influence coefficient that is greater than zero, and the resulting product is used as the exponent of the natural exponential function to calculate the exponential amplification index; wherein, the magnitude influence coefficient is related to the tea category.
[0047] The number of consecutive exceedances within the time window is summed to obtain the total number of consecutive exceedances; then, the natural logarithm of the sum of consecutive exceedances plus one is calculated, and then this logarithm is added by one to obtain the logarithmic adjustment index.
[0048] The pollution risk assessment value can be obtained by multiplying the average exceedance, the exponential amplification index, and the logarithmic adjustment index.
[0049] The beneficial effects of this invention are:
[0050] This invention employs a combined strategy of distance transformation, H-minima transformation, and watershed algorithm to effectively solve the imaging adhesion problem caused by the irregular shape of tea leaves. The process first transforms the binary image into a topographic map reflecting the distance between particle centers using distance transformation. Then, H-minima transformation intelligently filters out shallow fluctuations caused by minor surface bumps, accurately locating peaks representing the true particle centers as foreground markers. Finally, the watershed algorithm naturally segments the adhered areas based on the terrain, accurately restoring the originally adhered tea leaf image into individual particles. Furthermore, multi-dimensional morphological features of each independent region are extracted, and a support vector machine model is used for intelligent classification. This overcomes the shortcomings of relying solely on area thresholds, which can easily misclassify small whole leaves as fragments or adhered fragment clumps as whole leaves. This makes the distinction between whole leaves and fragments more scientific and accurate, removing the biggest obstacle to the precise calculation of the fragmentation rate. Attached Figure Description
[0051] The invention will now be further described with reference to the accompanying drawings.
[0052] Figure 1 This is a system logic structure diagram of the present invention. Detailed Implementation
[0053] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0054] Please see Figure 1 As shown, this invention is a non-destructive testing system for tea leaf breakage rate based on machine vision, comprising:
[0055] The image acquisition module is used to acquire digital images of the tea sample to be tested. It includes: a closed imaging dark box, a transparent sample stage for holding the tea sample at the bottom of the dark box, a high-resolution industrial camera above the transparent sample stage, and a light source for illuminating the tea sample below the transparent sample stage.
[0056] The image processing and analysis module is communicatively connected to the image acquisition module and is used to process and analyze the digital image to identify and distinguish between whole tea leaves and broken pieces.
[0057] The result output module is communicatively connected to the image processing and analysis module, and calculates the tea leaf breakage rate based on the pixel area of the identified whole leaf area and broken leaf area.
[0058] The specific process for processing and analyzing the digital image to identify and distinguish between whole tea leaves and broken tea leaves is as follows:
[0059] The acquired backlight image is converted to grayscale, denoised using a Gaussian filtering algorithm, and a binary image is generated using an adaptive thresholding method.
[0060] For the generated binary image, morphological closing and opening operations are performed sequentially on the binary image using a circular structuring element;
[0061] Calculate the distance transform map of the binary image, perform H-minima transformation on the distance transform map, the depth threshold H of the H-minima transformation ranges from 5 to 20 pixels, and find the local maxima points of the image after H-minima transformation as foreground markers;
[0062] The foreground marker and the background region of the binary image are used as inputs to the watershed algorithm. The watershed transformation is performed to segment the sticky tea leaves into independent individuals.
[0063] For each segmented independent region, extract a feature vector containing pixel area, perimeter, circularity, and aspect ratio of the minimum bounding rectangle;
[0064] The feature vectors are input into a pre-trained support vector machine classification model, which outputs a classification result indicating whether each region belongs to a whole leaf or a fragment.
[0065] Support Vector Machine (SVM) classification model refers to a binary classification model based on statistical learning theory. Pre-training refers to the process of learning and optimizing the model using feature vectors from a large number of tea sample images that have been labeled with whole leaves and broken leaves.
[0066] The pre-trained support vector machine classification model is obtained by using linear or radial basis functions as kernel functions, optimizing parameters through cross-validation, and training a training set consisting of feature vectors and corresponding labels of tea sample images containing multiple categories and forms of tea.
[0067] The depth threshold H of the H-minima transform is related to the spatial resolution of the high-resolution industrial camera and the type of tea to be detected; specifically, for a given type of tea, the threshold H is set to 0.2 to 0.5 times the average diameter of the reference broken leaves of that type.
[0068] The depth threshold H is a key depth value used to suppress irrelevant minor fluctuations in the distance transformation map before watershed transformation; the unit is pixels, and the value directly determines the algorithm's sensitivity to particle center recognition.
[0069] The specific method for calculating the tea breakage rate is as follows:
[0070] Tea leaf breakage rate = (total pixel area of all broken areas / (total pixel area of all whole leaf areas + total pixel area of all broken areas)) × 100%.
[0071] In this solution, firstly, by constructing a superior physical imaging environment, the most favorable image for analysis is captured; then, an advanced adhesion segmentation algorithm is applied to this image to accurately restore the independent morphology of each tea particle; finally, through an adaptive parameter correlation mechanism, the above-mentioned accurate analysis capabilities are ensured to be flexibly and stably applicable to different hardware conditions and tea varieties.
[0072] Specifically, the enclosed darkroom completely isolates the tea sample from external ambient light, eliminating noise caused by shadows and uneven lighting. The backlight source located beneath the transparent sample stage presents the tea sample as a high-contrast silhouette, clearly and sharply outlining every subtle undulation, break, and even tiny fragment. This solves the problems of texture interference, color dependence, and edge blurring caused by frontal illumination in traditional imaging. The high-resolution industrial camera ensures that this high-quality optical signal is converted into sufficiently rich digital information, faithfully recording even sub-millimeter-level fragment details at the pixel level. The overall effect of this hardware combination is the production of raw digital images with extremely high consistency, extremely low noise, and high fidelity of feature information, providing a clean and reliable raw digital image for all subsequent complex image processing algorithms.
[0073] The initial binary image is then optimized using morphological operations to better reflect the object's true topology. Next, the calculated distance transformation map essentially creates a topographic map depicting the distance from each foreground pixel to the background, where each local maximum corresponds to the center of a potential particle's peak. The crucial H-minima transform acts like a smart filter, suppressing shallow fluctuations below a set depth H in the topographic map, thus retaining only prominent peaks representing the true particle centers and effectively avoiding false segmentation points caused by minor surface irregularities. Finally, a watershed algorithm is executed starting from the foreground markers (peaks) and the background, mimicking water flowing down and merging from the peaks, naturally and accurately separating the adhered areas along the saddles of the terrain. The overall effect of this series of operations is to accurately restore the originally adhered tea leaf image into individual particles, making it possible to extract and classify features from each particle separately; directly solving the core error source of misclassifying multiple fragments as a large whole leaf, removing the biggest obstacle to accurate fragmentation rate calculation.
[0074] Finally, the depth threshold H of the H-minima transform is dynamically correlated with the camera spatial resolution and the tea variety. On the one hand, associating with camera resolution allows the system to adapt to different hardware configurations; when switching to a higher resolution camera, objects of the same physical size will occupy more pixels in the image. By adjusting the pixel value of H accordingly, the system can maintain a constant perception capability for features of the same physical size, ensuring the hardware independence and portability of the algorithm. On the other hand, the H value is correlated with the average diameter of reference tea fragments for a specific tea variety. Different tea varieties have vastly different particle size profiles; the fragments of Longjing tea are completely different in physical scale from those of Pu'er tea. By setting H to 0.2 to 0.5 times the feature size of this tea variety, the algorithm is essentially endowed with prior knowledge about the scale of the currently detected object. This allows the watershed algorithm to automatically adapt its sensitivity to the typical size of the target object: for teas with many small fragments, the system uses a smaller H value to finely separate the tiny particles; for teas with larger leaves, a larger H value is used to avoid over-segmentation. The overall effect of the parameter adaptation mechanism is that the same system can stably and accurately process a variety of tea products without manual parameter readjustment, greatly improving ease of use.
[0075] Example:
[0076] Test for broken tea dust rate in premium Longjing tea:
[0077] Sample: Weigh 10 grams of premium Longjing tea sample and spread it evenly on the transparent sample stage of the system.
[0078] Environment: The sample was placed in a closed imaging dark chamber, completely isolated from ambient light in the laboratory.
[0079] Illumination: The LED surface light source located below the sample stage is lit up, emitting uniform and stable high-intensity backlight.
[0080] Imaging: A high-resolution industrial camera (20 megapixels, with a fixed-focus lens) located approximately 50 cm directly above the sample stage was triggered to capture a backlit digital image of the tea leaves. In the image, the tea leaves appear dark (foreground) due to being blocked from light, while the background appears bright white due to being translucent, forming a high-contrast silhouette.
[0081] Image processing and particle segmentation:
[0082] Preprocessing: The acquired color image is converted to grayscale and smoothed and denoised using a Gaussian filtering algorithm (such as a 5x5 template) to preserve real edges while suppressing minor noise.
[0083] Binarization: An adaptive thresholding method (such as the Otsu algorithm) is used to convert the grayscale image into a binary image, where the tea leaves are white (pixel value 255) and the background is black (pixel value 0). At this point, the tea leaves that are in contact with each other appear as connected patches in the image.
[0084] Morphological processing: Using a circular structuring element with a radius of 3 pixels, the binary image is first closed (filling the small holes inside the particles), and then opened (separating weak connections and smoothing the boundaries).
[0085] Adhesion and separation:
[0086] Calculate the distance transform map of the processed binary image. The value of each foreground pixel in the image represents its distance to the nearest background pixel, forming a grayscale map similar to terrain undulations.
[0087] Perform an H-minima transformation on the distance transformation map. This step aims to suppress local minima with a depth less than a preset threshold H, thereby avoiding excessive false segmentation points generated by tiny surface bumps.
[0088] Local maxima in the transformed image are identified and marked as potential independent grain centers (foreground markers).
[0089] The foreground markers and the background region of the binary image are used as input to perform a watershed transform. The algorithm simulates water flowing from the marker points and converging, ultimately cutting precisely along the watershed line of the adhered region, successfully segmenting all contacting tea leaves in the image into independent connected regions.
[0090] Adaptive setting of key parameters;
[0091] In this example, it is assumed that the spatial resolution of the high-resolution industrial camera used corresponds to an actual size of 0.02 mm per pixel.
[0092] According to the quality standards for premium Longjing tea, the average diameter of the broken tea leaves is approximately 0.8 mm.
[0093] The depth threshold H should be set to 0.2 to 0.5 times the average diameter of the reference debris. Converted to pixel values: the average diameter of the debris in the image is 0.8 mm / 0.02 mm / pixel = 40 pixels. Therefore, the value range of H is approximately 40 pixels * (0.2 ~ 0.5) = 8 to 20 pixels.
[0094] The operator or, based on historical data, sets an empirical value for this category, such as H=12 pixels. This setting means that the algorithm will ignore surface undulations with a depth of less than 12 pixels, ensuring that only significant peaks representing the true center of the particles are retained as markers, thus preventing watershed segmentation from being over-segmented (producing fragmentation) or under-segmented (failing to separate adhesions).
[0095] Feature extraction, classification, and fragmentation rate calculation;
[0096] For each independent connected region obtained by watershed segmentation, i.e. a tea leaf particle, the system automatically extracts its feature vector, including: pixel area, perimeter, circularity (4π * area / perimeter squared), and aspect ratio of the minimum bounding rectangle.
[0097] After segmentation, the system obtains 150 independent connected regions. The system then calculates the morphological feature vector for each region. For example, three typical regions are selected from the image for analysis:
[0098] Region A (suspected debris): Pixel area = 85, perimeter = 35, circularity = (4*3.14*85) / (35*35)≈0.87, minimum bounding rectangle aspect ratio = 1.1.
[0099] Region B (suspected whole leaf): Pixel area = 520, perimeter = 105, circularity = (4*3.14*520) / (105*105)≈0.59, minimum bounding rectangle aspect ratio = 2.8.
[0100] Region C (single particle after adhesion and segmentation): pixel area = 180, perimeter = 55, roundness = (4*3.14*180) / (55*55)≈0.75, minimum bounding rectangle aspect ratio = 1.5.
[0101] These feature vectors are input into a pre-trained support vector machine classification model. This model has been trained using a large number of labeled whole leaf and broken tea samples from Longjing tea. The model analyzes each region and outputs the classification result as either whole leaf or broken tea: 120 whole leaf regions and 30 broken tea regions.
[0102] The total pixel area of all regions classified as fragments is 4250 pixels, and the total pixel area of all regions classified as whole leaves is 65500 pixels.
[0103] Finally, the tea breakage rate of the sample is calculated and output according to the formula:
[0104] Tea breakage rate =
[0105] [4250 pixels / (65500 pixels + 4250 pixels)] × 100% = 6.1%;
[0106] Image analysis of this premium Longjing tea sample showed a breakage rate of 6.1%.
[0107] The system also includes a cleaning inspection module;
[0108] The cleaning and inspection module is used to control the image acquisition module to perform an empty imaging of the empty transparent sample stage after the tea sample has been tested and discharged, and to obtain a background reference image.
[0109] Perform a difference calculation between the current background reference image and the clean background image initially calibrated by the system;
[0110] If the sum of all foreground pixels in the difference image exceeds a first preset threshold, the system determines that there is residue or dirt on the workbench and triggers a cleaning alarm. The first preset threshold is used to determine whether the sum of the foreground pixels in the difference image reaches a level that requires triggering a cleaning alarm; it is the quantitative boundary by which the system judges cleanliness and contamination.
[0111] The first preset threshold is determined by multiplying the standard deviation of noise fluctuation in multiple empty imaging of the clean background image initially calibrated by the system by an empirical coefficient (usually 3 to 5).
[0112] Traditional machine vision systems often neglect the maintenance of cleanliness on the sample-bearing surface. As the number of batches increases, residual tea dust, debris, or stains adhere to the transparent sample stage, becoming background noise in subsequent images and severely interfering with segmentation accuracy, leading to a slow increase or random fluctuation in the fragmentation rate measurement. Therefore, this solution achieves closed-loop monitoring of the workbench cleanliness by automatically performing an empty imaging and differential calculation after each inspection. By differentiating the image with the initial cleanliness calibration image, the system can sensitively detect minute residues. When the total amount of residue exceeds a first preset threshold, a cleaning alarm is triggered. This mechanism transforms periodic or experience-based manual cleaning and maintenance into an on-demand automated early warning system triggered by objective data. This not only effectively prevents systematic errors introduced by workbench contamination and ensures the consistency and comparability of long-term sequence inspection data, but also reduces unnecessary downtime maintenance and improves the intelligence level and operating efficiency of the equipment.
[0113] The cleaning inspection module is also used to perform the following type discrimination process after a cleaning alarm is triggered:
[0114] Morphological processing and connected component analysis are performed on the foreground region in the difference image to obtain the pixel area and shape features of each connected component;
[0115] Based on the area distribution characteristics and / or shape characteristics of each connected domain, the state of residue is distinguished into tea leaf fragment residue and sample stage contamination; among them, tea leaf fragment residue corresponds to particle dispersion characteristics, and sample stage contamination corresponds to stain aggregation or linear scratch characteristics.
[0116] Simple cleaning alarms only indicate an anomaly, but operators still need to check on-site to determine whether it's normal production residue or a malfunction in the equipment itself. This solution analyzes the area distribution and shape characteristics of the foreground region in the differential image, enabling the system to automatically distinguish between two fundamentally different situations: tea leaf residue and sample stage contamination. The former, with its dispersed particle characteristics, is a normal byproduct of the detection process, indicating the need for routine cleaning; the latter, with its accumulated stains or linear scratches, may mean the sample stage requires deep cleaning, replacement, or has physical damage, indicating equipment malfunction or maintenance status.
[0117] The distinction based on area distribution characteristics is as follows:
[0118] Calculate the ratio of the standard deviation of the area of all connected regions to the total area. If the ratio is less than the first threshold, it is determined to be tea leaf residue. If the ratio of the area of a single connected region to the average area of all connected regions is greater than the second threshold, it is determined to be sample stage contamination.
[0119] This index, calculated as the ratio of the standard deviation of the area of all connected regions to the total area, effectively characterizes the particle size uniformity of foreground residue. For randomly scattered tea leaf fragments, the area of each particle (connected region) typically fluctuates within a small range, resulting in a relatively small standard deviation and a small ratio (coefficient of variation) to the total area, consistent with the statistical characteristics of particle dispersion. Conversely, stains or damage often manifest as one or a few abnormally large connected regions (such as a stain) interspersed with a small number of potentially tiny noise points. In this case, the ratio of the area of a single connected region to the average area of all connected regions will be very large, as the average is lowered by numerous small areas, while the largest area stands out abnormally. This ratio can sensitively capture this distribution characteristic of significantly abnormally large individuals, thus accurately identifying it as soiling.
[0120] The distinction based on shape features is specifically as follows:
[0121] Calculate the aspect ratio of the minimum bounding rectangle of the connected component. If there is a connected component whose aspect ratio is greater than the third threshold, it is determined that there are linear scratches on the sample stage.
[0122] This index directly quantifies the elongation of a region by calculating the aspect ratio of its minimum bounding rectangle. Tea dust typically has a nearly circular or circular shape with an aspect ratio close to 1. However, linear scratches or certain strip-shaped stains on the sample stage appear as elongated connected regions in the image, with an aspect ratio significantly greater than 1. Setting a third threshold can effectively distinguish between normal particle residues and linear damage.
[0123] The first, second, and third thresholds are criterions used to quantitatively distinguish between debris residue and countertop stains, corresponding to the dispersion of area distribution, the proportion of abnormally large areas, and the elongation of the shape, respectively. The first, second, and third thresholds are pre-calibrated by statistically analyzing a large number of known types of residue and stain sample images to maximize classification accuracy.
[0124] The system also includes an adaptive feedback control module;
[0125] The adaptive feedback control module is communicatively connected to both the result output module and the cleaning inspection module, and is used to perform the following operations:
[0126] Receive the tea leaf breakage rate detection results, recorded in time series, output by the result output module;
[0127] Within a set sliding time window, count the number of times the tea breakage rate exceeds a preset quality threshold, and calculate the sum of the number of consecutive exceedances and the extent of exceedance.
[0128] The pollution risk assessment value is calculated based on the weighted combination of the number of times the standard was exceeded, the number of consecutive exceedances, and the magnitude of the exceedances.
[0129] The triggering frequency of the cleaning inspection module is dynamically adjusted according to the different risk levels of the pollution risk assessment value.
[0130] The adjustment strategy for the trigger evaluation frequency is as follows:
[0131] When the assessment value is below the assessment range, indicating low risk, maintain the preset cleaning inspection frequency;
[0132] When the assessment value is within the assessment range and is considered medium risk, the cleaning inspection frequency will be increased to be performed after each tea sample test.
[0133] When the assessed value is higher than the assessment range, indicating a high risk, in addition to performing a cleaning inspection after each test, a pre-inspection must be added before the start of the testing process.
[0134] The assessment value of the pollution risk is calculated using the following steps:
[0135] First, for each exceeding event recorded within the time window, the difference between the detected fragmentation rate and the preset quality threshold is calculated to obtain the exceeding range of the event; then, the arithmetic mean of the exceeding ranges of all exceeding events is calculated to obtain the average exceeding range.
[0136] The calculated average exceedance is multiplied by a preset magnitude influence coefficient that is greater than zero, and the resulting product is used as the exponent of the natural exponential function to calculate the exponential amplification index; wherein, the magnitude influence coefficient is related to the tea category.
[0137] The number of consecutive exceedances within the time window is summed to obtain the total number of consecutive exceedances; then, the natural logarithm of the sum of consecutive exceedances plus one is calculated, and then this logarithm is added by one to obtain the logarithmic adjustment index.
[0138] The pollution risk assessment value can be obtained by multiplying the average exceedance, the exponential amplification index, and the logarithmic adjustment index.
[0139] Example: ;
[0140] ;
[0141] in, The calculated pollution risk assessment value, The average exceedance of all exceedance events; the exceedance of a single event = , The percentage of broken tea leaves. The preset quality threshold, The total number of events exceeding the limit recorded within the time window; The magnitude of the influence related to the tea category. Greater than 0; This is the total number of times the event exceeds the limit within the time window.
[0142] Amplitude Influence Coefficient The weighting of the excess magnitude in the index risk model is used to adjust the sensitivity of different types of tea to the breakage rate; the assessment interval is the numerical range that divides the risk levels into low, medium and high.
[0143] The amplitude influence coefficient The quality tolerance range of the broken tea leaves is determined by back-calculation based on the specific tea grade; the evaluation interval is determined by cluster analysis of the risk assessment values under normal, warning and abnormal states in the system's historical operation data.
[0144] The sum of the durations The calculation method is as follows: within the time window, the number of consecutive detections for each exceeding the standard event (i.e., the number of detections from the beginning of exceeding the standard to the first recovery to the standard) is accumulated.
[0145] This plan no longer simply performs cleaning checks at fixed times or with fixed numbers of tests, but instead uses historical test results as the basis for assessing its own health and pollution load status.
[0146] The exponential term amplifies sudden and severe risks: The item makes the average excess range affect the final risk value. The impact grows exponentially. This means that even if the number of times the standard is exceeded is not high, as long as the single or average exceedance is very serious, such as due to a large amount of dust explosion, the assessment value will rise sharply, prompting an immediate switch to high-frequency inspection mode to quickly respond to sudden and serious pollution events.
[0147] Several rational approaches maintain a low risk level: The term models the sustained fatigue pollution effect using the natural logarithm function. In the early stages of pollution persistence... The smaller the value, the more significant its enhancement effect on risk; however, as the number of occurrences increases, its marginal contribution gradually diminishes, thus preventing the system from falling into an oversensitive cleanliness mode due to long-term, slight background drift, such as extremely slow accumulation of countertop contamination. This optimizes operating efficiency while ensuring reliability.
[0148] The composite product reflects the overall situation: the final assessment value. It is the product of three core factors. This model can distinguish between different operating conditions, such as occasional minor exceedances, sudden severe pollution, and long-term slow deterioration, and output a quantitative indicator that comprehensively reflects the current pollution risk.
[0149] The frequency of cleaning inspections is automatically adjusted based on the quantified risk level. This dynamic adjustment strategy maximizes continuous work efficiency while ensuring the long-term reliability of test data. It saves resources during low-risk periods and strengthens safeguards during medium- to high-risk periods, achieving an optimal balance between maintenance costs and test quality.
[0150] For example:
[0151] Set the system to a preset quality threshold. =5.0%, amplitude influence coefficient =0.5.
[0152] Set risk level range: low risk <2.0, medium risk 2.0≤ <10.0, high risk ≥10.0.
[0153] Phase 1 (Low-risk steady state): Within the time window of the most recent 100 tests, there were only 3 slight exceedances, with exceedances of 0.3%, 0.5%, and 0.2% respectively, and no consecutive exceedances.
[0154] calculate: =3, =(0.3+0.5+0.2) / 3=0.33%, =0.
[0155] Risk Value =0.33* *(1+ln(1))≈0.39.
[0156] Judgment and Action: =0.39 < 2.0, indicating low risk. The system maintains the preset basic cleaning inspection frequency; for example, cleaning once after every 10 inspections.
[0157] Phase Two (Sudden Severe Pollution): Subsequent three consecutive tests showed that the breakage rate soared to 8.0%, 9.5%, and 8.8% due to a problem with a certain batch of raw materials.
[0158] Consider a window containing these 3 events, and calculate: =3;
[0159] =(3.0+4.5+3.8) / 3=3.77%, =3.
[0160] Risk Value =3.77* *(1+ln(4))≈60.3.
[0161] Judgment and Action: =60.3≥10.0, indicating a high risk. The system immediately adjusts the cleaning inspection frequency to high-risk mode: a cleaning inspection is performed before and after each subsequent test to ensure that contamination does not affect critical test results.
[0162] Phase 3 (after risk mitigation): After the source of pollution is eliminated, the fragmentation rate in the next 20 tests is qualified, i.e., less than 5%.
[0163] Number of events exceeding the limit within the new time window Amplitude and persistence All decreased, risk value It then fell back.
[0164] when When the calculated value falls back to between 2.0 and 10.0, the system switches to medium-risk mode: a cleaning inspection is performed after each test.
[0165] when When the value drops further below 2.0, the system reverts to low-risk mode and reduces the cleaning frequency.
[0166] The foregoing has provided a detailed description of one embodiment of the present invention, but this description is merely a preferred embodiment and should not be construed as limiting the scope of the invention. All equivalent variations and modifications made within the scope of the claims of this invention should still fall within the patent coverage of this invention.
Claims
1. A non-destructive testing system for tea leaf breakage rate based on machine vision, characterized in that, include: The image acquisition module is used to acquire digital images of the tea sample to be tested. It includes: a closed imaging dark box, a transparent sample stage for holding the tea sample at the bottom of the dark box, a high-resolution industrial camera above the transparent sample stage, and a light source for illuminating the tea sample below the transparent sample stage. The image processing and analysis module is communicatively connected to the image acquisition module and is used to process and analyze the digital image to identify and distinguish between whole tea leaves and broken pieces. The result output module is communicatively connected to the image processing and analysis module, and calculates the tea leaf breakage rate based on the pixel area of the identified whole leaf area and broken leaf area.
2. The machine vision-based non-destructive testing system for tea leaf breakage rate according to claim 1, characterized in that, The specific process for processing and analyzing the digital image to identify and distinguish between whole tea leaves and broken tea leaves is as follows: The acquired backlight image is converted to grayscale, denoised using a Gaussian filtering algorithm, and a binary image is generated using an adaptive thresholding method. For the generated binary image, morphological closing and opening operations are performed sequentially on the binary image using a circular structuring element; Calculate the distance transform map of the binary image, perform H-minima transform on the distance transform map, and find the local maxima points of the image after H-minima transform as foreground markers; The foreground marker and the background region of the binary image are used as inputs to the watershed algorithm. The watershed transformation is performed to segment the sticky tea leaves into independent individuals. For each segmented independent region, extract a feature vector containing pixel area, perimeter, circularity, and aspect ratio of the minimum bounding rectangle; The feature vectors are input into a pre-trained support vector machine classification model, which outputs a classification result indicating whether each region belongs to a whole leaf or a fragment.
3. The machine vision-based non-destructive testing system for tea leaf breakage rate according to claim 2, characterized in that, The depth threshold H of the H-minima transform is related to the spatial resolution of the high-resolution industrial camera and the type of tea to be detected; specifically, for a given type of tea, the threshold H is set to 0.2 to 0.5 times the average diameter of the reference broken leaves of that type.
4. The machine vision-based non-destructive testing system for tea leaf breakage rate according to claim 1, characterized in that, The specific method for calculating the tea breakage rate is as follows: Tea leaf breakage rate = (total pixel area of all broken areas / (total pixel area of all whole leaf areas + total pixel area of all broken areas)) × 100%.
5. The machine vision-based non-destructive testing system for tea leaf breakage rate according to claim 1 or 3, characterized in that, The system also includes a cleaning inspection module; The cleaning and inspection module is used to control the image acquisition module to perform an empty imaging of the empty transparent sample stage after the tea sample has been tested and discharged, and to obtain a background reference image. Perform a difference calculation between the current background reference image and the clean background image initially calibrated by the system; If the sum of all foreground pixels in the differential image exceeds the first preset threshold, it is determined that there is residue or dirt on the workbench, and a cleaning alarm is triggered.
6. The machine vision-based non-destructive testing system for tea leaf breakage rate according to claim 5, characterized in that, The cleaning inspection module is also used to perform the following type discrimination process after a cleaning alarm is triggered: Morphological processing and connected component analysis are performed on the foreground region in the difference image to obtain the pixel area and shape features of each connected component; Based on the area distribution characteristics and / or shape characteristics of each connected domain, the state of residue is distinguished into tea leaf fragment residue and sample stage contamination; among them, tea leaf fragment residue corresponds to particle dispersion characteristics, and sample stage contamination corresponds to stain aggregation or linear scratch characteristics.
7. The machine vision-based non-destructive testing system for tea leaf breakage rate according to claim 5, characterized in that, The distinction based on area distribution characteristics is as follows: Calculate the ratio of the standard deviation of the area of all connected components to the total area. If this ratio is less than a first threshold, it is determined to be tea leaf residue; if the ratio of the area of a single connected component to the average area of all connected components is greater than a second threshold, it is determined to be sample stage contamination. The distinction based on shape features is specifically as follows: Calculate the aspect ratio of the minimum bounding rectangle of the connected component. If there is a connected component whose aspect ratio is greater than the third threshold, it is determined that there are linear scratches on the sample stage.
8. The machine vision-based non-destructive testing system for tea leaf breakage rate according to claim 5, characterized in that, The system also includes an adaptive feedback control module; The adaptive feedback control module is communicatively connected to both the result output module and the cleaning inspection module, and is used to perform the following operations: Receive the tea leaf breakage rate detection results, recorded in time series, output by the result output module; Within a set sliding time window, count the number of times the tea breakage rate exceeds a preset quality threshold, and calculate the sum of the number of consecutive exceedances and the extent of exceedance. The pollution risk assessment value is calculated based on the weighted combination of the number of times the standard was exceeded, the number of consecutive exceedances, and the magnitude of the exceedances. The triggering frequency of the cleaning inspection module is dynamically adjusted according to the different risk levels of the pollution risk assessment value. The adjustment strategy for the trigger evaluation frequency is as follows: When the assessment value is below the assessment range, indicating low risk, maintain the preset cleaning inspection frequency; When the assessment value is within the assessment range and is considered medium risk, the cleaning inspection frequency will be increased to be performed after each tea sample test. When the assessed value is higher than the assessment range, indicating a high risk, in addition to performing a cleaning inspection after each test, a pre-inspection must be added before the start of the testing process.
9. The machine vision-based non-destructive testing system for tea leaf breakage rate according to claim 8, characterized in that, The assessment value of the pollution risk is calculated using the following steps: First, for each exceeding event recorded within the time window, the difference between the detected fragmentation rate and the preset quality threshold is calculated to obtain the exceeding range of the event; then, the arithmetic mean of the exceeding ranges of all exceeding events is calculated to obtain the average exceeding range. The calculated average exceedance is multiplied by a preset magnitude influence coefficient that is greater than zero, and the resulting product is used as the exponent of the natural exponential function to calculate the exponential amplification index; wherein, the magnitude influence coefficient is related to the tea category. The total number of consecutive exceedances within the time window is summed to obtain the total number of consecutive exceedances. Subsequently, the natural logarithm of the sum of the durations plus one is calculated, and then this logarithm is added to one to obtain the logarithmic moderating index. The pollution risk assessment value can be obtained by multiplying the average exceedance, the exponential amplification index, and the logarithmic adjustment index.