A tea quality detection method and system based on image recognition

CN122948831APending Publication Date: 2026-10-20TEA RES INST GUANGDONG ACAD OF AGRI SCI +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611159150.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-01
Publication Date
2026-10-20

AI Technical Summary

Technical Problem

[0003]然而,在实际的在线连续输送检测过程中,受限于振动上料装置的瞬时波动、茶叶本身的轻薄柔软以及相互间容易缠连的物理特性,输送带上的茶叶时常会出现局部铺展不均匀、相互堆叠或者彼此搭接的情况,如图5中输送带上出现的茶叶堆叠区域

Benefits of technology

[0017]由上可知,本申请提供的一种基于图像识别的茶叶品质检测方法及系统,通过获取在线输送带茶叶图像的分割目标区域,通过形态特征判断是否为粘连区域,在粘连区域满足预设可拆分条件时确定接触位置并拆分为多个子区域,并对子区域进行单叶条件校验;在粘连区域不满足预设可拆分条件时,将其作为非单叶异常目标输出,从而避免堆叠导致的误分割目标直接进入品质检测流程,提高品质检测的准确性和可靠性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

This application provides a tea quality inspection method and system based on image recognition, relating to the field of tea processing and automated quality inspection technology. The key technical points are: by acquiring the segmented target region of an online conveyor belt image of tea leaves, determining whether it is an adhered region based on morphological features; when the adhered region meets preset separable conditions, determining the contact position and splitting it into multiple sub-regions, and performing single-leaf condition verification on the sub-regions; when the adhered region does not meet the preset separable conditions, outputting it as a non-single-leaf abnormal target, thereby avoiding mis-segmented targets caused by stacking from directly entering the quality inspection process, improving the accuracy and reliability of quality inspection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of tea processing and automated quality inspection technology, and more specifically, to a tea quality inspection method and system based on image recognition. Background Technology

[0002] In the initial processing of tea, automated inspection systems based on image recognition have been widely used to achieve rapid online grading and accurate sorting of product quality. For example... Figure 5 As shown, in a conventional online inspection process, the pre-processed tea leaves are evenly spread by a vibrating feeder and conveyed onto a continuously operating conveyor belt. When the tea leaves pass through a fixed visual acquisition area with the conveyor belt, an industrial camera captures images of the belt surface in real time. The existing image recognition system performs foreground target segmentation on the acquired images, separating the outlines of each tea leaf from the background, and then extracting the appearance features such as length, curl, integrity, and color of each individual tea leaf target. Based on the extracted features, the corresponding quality grade is mapped, and this drives the downstream sorting mechanism to complete the grade sorting action.

[0003] However, in actual online continuous conveying and testing processes, due to the instantaneous fluctuations of the vibrating feeding device, the thin and soft nature of the tea leaves themselves, and their tendency to entangle, the tea leaves on the conveyor belt often exhibit uneven spreading, stacking, or overlapping in certain areas. Figure 5 The image shows a stacked area of ​​tea leaves on a conveyor belt. When multiple strips of tea leaves come into contact or partially obscure each other in space, and the colors of the tea leaves are relatively similar, existing conventional methods based on grayscale thresholding, edge detection, or morphological processing struggle to accurately distinguish the contact boundaries between adjacent tea leaves when segmenting foreground objects. Because the actual physical boundaries are invisible, contact areas that should belong to different individual leaves are missegmented as the same continuous foreground object area, making it impossible to distinguish the contact boundaries. The system's missegmentation results mistakenly identify this as a single, adhered area.

[0004] The deviation in this segmentation stage is further amplified in the subsequent feature extraction stage. The system calculates the length / morphological features based on the overall adhesion area, resulting in feature values ​​that deviate significantly from the actual condition of a single leaf. This can even lead to incorrect judgments, classifying the leaf as a large or complete high-quality single leaf. Consequently, the quality grade judgment results are biased, leading to misclassification, reduced sorting accuracy, and directly affecting the accuracy of downstream sorting mechanisms and the consistency of product grading.

[0005] To address the aforementioned issues, existing technologies urgently need improvement. Summary of the Invention

[0006] The purpose of this application is to provide a tea quality detection method and system based on image recognition, which has the advantages of improving the accuracy and reliability of tea quality detection.

[0007] This application provides a tea quality detection method based on image recognition, the technical solution of which is as follows: Obtain the first target region segmented from tea images continuously acquired from an online conveyor belt; Based on the first morphological feature characterizing the appearance shape of the first target area, determine whether the first target area is an adhesive area containing multiple tea leaves. If the first target area is an adhesive area and meets the preset separable conditions, determine the contact position inside the first target area to represent the boundary between different tea leaves, and divide the first target area into multiple second target areas along the contact position. If the second morphological feature characterizing the appearance shape of the second target region satisfies the single-leaf morphological condition, the second target region is used as a single-leaf target for quality inspection.

[0008] Furthermore, this application also proposes that the step of determining whether the first target area is an adhesive area containing multiple tea leaves includes: The system acquires the area information, contour shape regularity information, skeleton line morphology information, grayscale texture information, and edge concavity information of the first target region. The area information is used to characterize the total number of pixels occupied by the first target region. The contour shape regularity information is used to characterize the degree of similarity between the contour shape of the first target region and its convex hull shape. The skeleton line morphology information is used to characterize whether there are middle branches of the skeleton line in the first target region. The grayscale texture information is used to characterize whether there are local overlapping textures that change from light to dark and then back to light in the first target region. The edge concavity information is used to characterize the depth of the concavity on the outer contour of the first target region. Obtain the statistical range of normal single-leaf morphological features used to define the permissible morphological range of single-leaf targets. The statistical range of normal single-leaf morphological features is pre-generated based on known normal single-leaf samples. When any of the area information, the contour shape regularity information, the skeleton line shape information, the grayscale texture information, and the edge concavity information exceeds the statistical range of the normal single leaf morphology features, a single-frame anomaly judgment result is generated to characterize that the first target area does not meet the normal single leaf morphology conditions, and the first target area is determined to be the adhesion area based on the single-frame anomaly judgment result.

[0009] Furthermore, this application also proposes that determining the first target region as an adhesion region includes: The area information, contour shape regularity information, skeleton line morphology information, grayscale texture information, and edge concavity information of the first target region in consecutive multi-frame images are obtained. When the number of frames that meet the preset abnormal conditions reaches the second preset number within the most recent first preset number of frames, the first target area is determined to be an adhesion area. The preset anomaly condition is: generating the single-frame anomaly judgment result, or the difference between any one of the region area information, contour shape regularity information, skeleton line morphology information, grayscale texture information and edge concavity information and the boundary of the normal single leaf morphological feature statistical range is within the preset tolerance band. After determining the first target region as an adhesion region, if the region area information, contour shape regularity information, skeleton line shape information, grayscale texture information, and edge concavity information do not meet the preset abnormal conditions within the subsequent third preset number of consecutive frames, then the determination of the first target region as an adhesion region is cancelled.

[0010] Furthermore, this application also proposes that the step of determining the contact positions within the first target region used to characterize the boundaries between different tea leaves includes: Obtain first change information to characterize the local width change information on the skeleton line within the first target region; Obtain second pointing information to characterize the spatial pointing information of the concave portion of the outer contour of the first target region; Obtain third distribution information to characterize the gradual distribution of local surface properties within the first target region; Based on the first change information, the second pointing information, and the third distribution information, segmentation reference information for distinguishing the boundaries between different tea leaves is determined; The contact position is determined based on the segmentation reference information.

[0011] Furthermore, this application also proposes that, after dividing the first target region into multiple second target regions, it further includes: Obtain morphological verification information to characterize the appearance shape of each second target region. The morphological verification information includes the area information, contour shape regularity information, skeleton line morphology information, grayscale texture information, and edge concavity information of each second target region. Obtain a single-leaf morphology reference range for defining the permissible morphological range of a single-leaf target, wherein the single-leaf morphology reference range is pre-generated based on known normal single-leaf samples; When the morphological verification information of the second target area falls within the single leaf morphological reference range, the second target area is used as the single leaf target for quality inspection. When the morphological verification information of the second target region exceeds the single leaf morphological reference range, the second target region is marked as an abnormal unresolved target.

[0012] Furthermore, this application also proposes that, after marking the second target region as an anomalous pending target, it further includes: Obtain anomaly frequency information to characterize the cumulative occurrence of the anomaly-pending targets during continuous detection; Based on the abnormal frequency information, a feeding adjustment command is generated for adjusting the feeding equipment of the conveyor belt. Send the feeding adjustment command to the feeding equipment.

[0013] Furthermore, this application also proposes that, after determining the first target region as an adhesion region, the following steps are also included: Obtain a load characterization quantity used to characterize the load status of the first target region that has been identified as an adhesion region in the current frame image; When the load representation quantity meets the preset load reference condition, it is determined that the first target region corresponding to the load representation quantity does not meet the preset splittable condition. An overload anomaly mark is generated for the first target region to represent that it has not been split. The first target region carrying the overload anomaly mark is output as a non-single leaf target.

[0014] Furthermore, this application also proposes that determining the contact position based on the segmentation reference information includes: When the segmentation reference information indicates at least two candidate segmentation positions, the morphological features of the candidate sub-regions corresponding to each candidate segmentation position within the first target region are obtained. The candidate segmentation position where the morphological feature falls within the statistical range of the normal single leaf morphological feature is determined as the contact position.

[0015] Furthermore, this application also proposes that the step of obtaining the region area information, contour shape regularity information, skeleton line morphology information, grayscale texture information, and edge concavity information of the first target region in consecutive multi-frame images includes: Obtain conveying motion information to characterize the speed and direction of the conveyor belt; Based on the position of the first target region in the current frame and the transport motion information, the predicted position of the first target region in the historical frame image is determined; Based on the degree of overlap between the predicted location and the target region in the historical frame, the first target region in the current frame and a target region in the historical frame are associated as the same physical object. From the target region of the historical frame associated with the same physical object, obtain the region area information, contour shape regularity information, skeleton line morphology information, grayscale texture information and edge concavity information.

[0016] In addition, this application also provides a tea quality detection system based on image recognition, the technical solution of which is as follows: The first target region acquisition module is used to acquire the first target region segmented from tea images continuously acquired from the online conveyor belt; The adhesion judgment module is used to determine whether the first target area is an adhesion area containing multiple tea leaves based on the first morphological feature that characterizes the appearance shape of the first target area. The contact positioning and splitting module is used to determine the contact position inside the first target area that represents the boundary between different tea leaves when the first target area is an adhesive area and meets the preset splitting conditions, and to split the first target area into multiple second target areas along the contact position. The single-leaf confirmation module is used to identify the second target region as a single-leaf target for quality inspection when the second morphological feature characterizing the appearance shape of the second target region meets the single-leaf morphological condition.

[0017] As can be seen from the above, the tea quality inspection method and system based on image recognition provided in this application obtains the segmented target area of ​​the tea image on the online conveyor belt, determines whether it is an adhesion area based on morphological features, determines the contact position and splits it into multiple sub-regions when the adhesion area meets the preset separable conditions, and performs single-leaf condition verification on the sub-regions; when the adhesion area does not meet the preset separable conditions, it is output as a non-single-leaf abnormal target, thereby avoiding the direct entry of mis-segmented targets caused by stacking into the quality inspection process, and improving the accuracy and reliability of quality inspection. Attached Figure Description

[0018] Figure 1 This is a schematic diagram of the tea quality detection method based on image recognition proposed in this application.

[0019] Figure 2 This is a schematic diagram of the overall architecture and processing flow of the tea quality detection system based on image recognition proposed in this application.

[0020] Figure 3 This is a schematic diagram illustrating how the contact position in the tea leaf adhesion area proposed in this application is located using three types of clues: changes in the width of the skeleton cross section, symmetrical pointing of the concave contour, and overlapping texture of the internal dark area.

[0021] Figure 4 This is a schematic diagram illustrating the predicted position matching and association of the target in the current frame and the target in the historical frame based on the transport motion information proposed in this application.

[0022] Figure 5 This is a diagram illustrating the problems with existing technologies. Detailed Implementation

[0023] The following description, in conjunction with the technical solution of this application, provides a clearer and more complete explanation of the relevant content. It should be noted that the embodiments described herein are only a part of the implementation methods of this application, and not all of them. Other implementation methods obtained by those skilled in the art based on the embodiments of this application without creative effort should also fall within the protection scope of this application. Furthermore, in the description of this application, the terms "first," "second," etc., are mainly for distinction and should not be construed as indicating relative importance.

[0024] Reference Figure 1 This application proposes a tea quality detection method based on image recognition, including: S1. Obtain the first target region segmented from tea images continuously acquired from the online conveyor belt; S2. Based on the first morphological feature that characterizes the appearance shape of the first target area, determine whether the first target area is an adhesive area containing multiple tea leaves. S3. If the first target area is an adhesive area and meets the preset separable conditions, determine the contact position inside the first target area to represent the boundary between different tea leaves, and divide the first target area into multiple second target areas along the contact position. S4. If the second morphological feature characterizing the appearance of the second target region satisfies the single-leaf morphological condition, the second target region is used as a single-leaf target for quality inspection.

[0025] In the online grading stage of primary tea processing, a conveyor belt transports the sorted and dried tea leaves to a vision inspection station, where an industrial camera continuously captures images of the belt surface. When the vibrating feeder experiences a momentary surge in flow, the tea leaves are prone to localized overlap or stacking on the conveyor belt. Because the color and texture of tea leaves are extremely similar and two-dimensional images lack depth information, conventional foreground segmentation algorithms may misidentify multiple tea leaves as a single connected region. This leads to subsequent feature extraction based on an incorrect composite target, resulting in calculated indicators such as length and curl that deviate significantly from the actual single leaf, ultimately causing misjudgments in quality grade and incorrect sorting.

[0026] To address the issue of inconsistent leaf attribution caused by stacking and adhesion, this method first determines whether a foreground target is an adhered region based on its morphological characteristics before performing quality calculations. For targets identified as adhered regions that meet preset separability conditions, the contact boundary is further located and separated internally to recover the target region of a single tea leaf. For targets identified as adhered regions but that do not meet preset separability conditions due to excessive processing load in the current frame, they can be output as abnormal targets to prevent targets that have not completed attribution correction from entering the normal quality inspection process.

[0027] In step S1, the process of obtaining the first target region relies on a conventional machine vision preprocessing pipeline. For each frame of the image acquired from the conveyor belt, Gaussian filtering is first used for noise reduction, followed by background subtraction using a dynamically updated background image to obtain a preliminary set of foreground pixels. Then, Otsu adaptive thresholding is used for binarization, and morphological opening operations are performed to remove fine noise. Finally, connected component analysis is used to obtain each independent foreground connected region, which serves as the first target region. Each first target region may correspond to a single tea leaf, or it may contain multiple tea leaves stuck together due to segmentation failure, requiring differentiation in subsequent steps.

[0028] In step S2, the determination of whether the first target region is an adhesion region is based on multiple first morphological features extracted from the region. These features include at least the total pixel area of ​​the region, the regularity of the contour shape, the branching shape of the internal skeleton lines, the local overlay texture, and the depth of the concavity at the contour edge.

[0029] The area of ​​a normal single leaf usually falls within a limited range pre-calculated based on the variety. However, when multiple tea leaves stick together, the combined area often exceeds the upper limit of a normal single leaf. The regularity of the outline can be measured by the ratio between the actual area of ​​the first target area and its convex area. A relatively full single leaf outline usually has a ratio close to one, while the outline of the sticking area often has more inward concave curves due to the outward spread of the leaves, which reduces the proportion of the actual area to the convex area.

[0030] The branching morphology of the skeletal lines reveals whether there are multiple elongated main axes within the region. The skeletal lines of a single leaf rarely branch in the middle, while those of adherent areas are very likely to fork in the middle, corresponding to the convergence of the axes of multiple leaves at the junction. The detection of local overlay texture focuses on whether there are dark bands within the region where grayscale changes from light to dark and then back to light. These dark areas typically appear where the edge of the upper tea leaf covers the lower tea leaf, formed due to differences in transmission caused by oblique lighting.

[0031] The depth of the contour depression is quantified using the distance between the contour point sequence and the edge of the convex hull. A deeper depression may indicate that the two tea leaves are not completely closed at the junction. The statistical distribution range of these features is established in advance using known independent single-leaf samples. Once any of the following factors of the current first target region—area, convexity area ratio, partial branching of the skeleton, overlay texture in the dark area, or depression depth—exceeds the range, a single-frame anomaly judgment result can be generated to characterize that the first target region does not conform to the normal single-leaf morphology.

[0032] The single-frame anomaly detection result can be used directly as the basis for determining adhesion regions in implementations without continuous frame stability control, or as evidence of anomalies in subsequent multi-frame statistics in implementations with continuous frame stability control. This screening mechanism based on morphological limit deviation can quickly filter out the vast majority of normal single-leaf targets, allowing only a few targets suspected of adhesion to enter the subsequent confirmation or deep repair process.

[0033] Reference Figure 3 For the first target area that is determined to be an adhesive area and meets the preset separable conditions, step S3 will attempt to locate the contact position between different tea leaves within the adhesive area.

[0034] The localization process does not rely on one-time edge detection, but rather makes comprehensive use of multiple local clues within the region. The first clue is the change in cross-sectional width along the skeleton line. The width of the foreground pixels in the orthogonal direction can be calculated pixel by pixel along the skeleton line to obtain a width change curve. On this curve, we look for the width contraction position where the width shrinks sharply from a relatively wide position and then widens again. This width contraction position often corresponds to the boundary where the ends of two tea leaves overlap or cross each other.

[0035] The second clue is the symmetrical direction of the deeper depressions on the outline. After detecting all the deeper depressions on the outer outline, the depression symmetry axis of each depression is generated. If the depression symmetry axis can pass through the interior of the target and echo the depression on the other side, or directly point to the edge of the superimposed texture in the dark area inside, then the depression symmetry axis is likely to outline the segmentation boundary that should have existed.

[0036] The third clue is the main extension direction of the internal local overlapping texture. When there is obvious dark area overlapping texture in the area, determine the extension direction of the dark area and take the edge of the dark area as the potential layer boundary, because the outline projection of the upper tea leaves usually forms such a light and dark transition on the lower surface.

[0037] After obtaining several candidate segmentation reference lines from the above three types of clues, a comprehensive evaluation is conducted based on the penetration length of these reference lines and their consistency with the edge texture. The lines that best divide the original region into multiple lines that are similar in shape to independent single leaves are selected as contact positions, and segmentation is performed along these contact positions to obtain multiple second target regions.

[0038] The second target regions obtained after segmentation are not directly sent to the quality calculation stage. Step S4 first performs morphological reliability verification on each second target region. Specifically, it re-extracts second morphological features such as area, contour regularity, skeleton line branching, overlapping texture features, and edge indentation depth for each second target region, and compares them with the statistical distribution range of a normal single leaf.

[0039] If all features of a second target region fall within the range of a normal single leaf, it indicates that the morphology of the region after correction is close enough to a single, complete tea leaf. Therefore, the second target region can be used as a single leaf target for quality inspection. Subsequently, the existing feature extraction process is used to obtain its length, curl, integrity, color, and other indicators, and map the quality grade.

[0040] If the morphology of a certain second target area still exceeds the normal range, such as the area is still too large, the convex area ratio is still too low, or the skeleton still has a middle branch, it means that the area may still contain leaves that are not fully separated, or the selection of the splitting position is too biased. In this case, it will no longer be forcibly output as a single leaf target, but will be marked as an abnormal unresolved target and handed over to the back end for rejection or re-inspection to avoid outputting unreliable quality conclusions.

[0041] It is understandable that the processing chain consisting of S1 to S4 only initiates the internal contact positioning and splitting operations when the first target area is determined to be an adhered area and meets the preset splitting conditions. For target areas determined to be normal single-leaf areas, they can directly enter the fast quality calculation channel without adding extra boundary analysis overhead; for target areas determined to be adhered areas but not meeting the preset splitting conditions, they can be output as non-single-leaf abnormal targets to avoid entering the quality level judgment before the attribution correction is completed.

[0042] This hierarchical processing concentrates computing resources on a few problematic targets that are ready for processing. This ensures the real-time pace of online detection and effectively corrects misclassification of single leaves caused by local stacking and adhesion of the conveyor belt, thus significantly reducing the missorting rate in the online grading process.

[0043] In online tea delivery detection scenarios, the segmented foreground target may contain a single tea leaf or a continuous region formed by stacked tea leaves. If only a single feature is relied upon for judgment, it is easy to cause misjudgment or missed judgment due to changes in the tea leaf's pose or partial occlusion.

[0044] To accurately distinguish between normal single leaves and suspected adherent targets, this application proposes the following judgment method: The steps for determining whether the first target region is an adhered area containing multiple tea leaves include: obtaining the region area information, contour shape regularity information, skeleton line morphology information, grayscale texture information, and edge concavity information of the first target region. Specifically, the region area information represents the total number of pixels occupied by the first target region; the contour shape regularity information represents the degree of similarity between the contour shape of the first target region and its convex hull shape; the skeleton line morphology information represents whether there are central branches in the skeleton lines within the first target region; and the grayscale texture information represents whether there are local overlapping textures within the first target region that gradually darken and then lighten again. Edge depression information is used to characterize the depression depth on the outer contour of the first target region; the statistical range of normal single leaf morphological features is obtained to define the allowable morphological range of the single leaf target. The statistical range of normal single leaf morphological features is pre-generated based on known normal single leaf samples; when any of the region area information, contour shape regularity information, skeleton line morphology information, grayscale texture information and edge depression information exceeds the statistical range of normal single leaf morphological features, a single-frame anomaly judgment result is generated to characterize that the first target region does not meet the normal single leaf morphological conditions, and the first target region is determined to be an adhesion region based on the single-frame anomaly judgment result.

[0045] In practical implementation, the area information of the region can be obtained by counting the number of pixels contained in the first target region. The contour shape regularity information can be characterized by calculating the ratio of the actual area of ​​the first target region to the area of ​​its convex hull. The closer this ratio is to one, the closer the actual contour is to the convex hull contour, and the more regular the contour is.

[0046] The skeleton line morphology information can be obtained by extracting the central skeleton line through morphological refinement of the first target region and detecting whether there are branch points on the skeleton line. If the branch point is located in the middle of the skeleton line and the branch length exceeds the preset noise threshold, it is determined that there is a middle branch.

[0047] Grayscale texture information can be obtained by sliding a local window within the first target area to detect whether the grayscale values ​​within the window exhibit a characteristic of gradually decreasing from the edge to the center and being distributed in a stripe pattern. If the preset contrast condition is met, it is determined that there is a local overlay texture.

[0048] Edge depression information can be obtained by extracting the sequence of outer contour points of the first target region, calculating the vertical distance from the contour depression point to the corresponding convex hull edge, and using this vertical distance as the depression depth.

[0049] The statistical range of normal single leaf morphological characteristics can be constructed by collecting a large number of normal single leaf sample images of known quality, extracting the data distribution of the above five morphological characteristics, and selecting specific quantile values ​​as upper and lower limit thresholds.

[0050] For example, a higher quantile of the area distribution can be selected as the upper limit of the area, and a lower quantile of the convex area ratio distribution can be selected as the lower limit of the regularity. This statistical range can reflect the morphological fluctuation range of the current processed product under normal conditions.

[0051] After obtaining the above information and statistical range, each feature value of the first target region is compared with the statistical range of normal single-leaf morphological features. This comparison adopts a joint satisfaction logic, that is, only when the region area information, contour shape regularity information, skeleton line shape information, grayscale texture information, and edge concavity information all fall within the corresponding normal statistical range is the target considered to conform to the single-leaf morphology.

[0052] If any of the features exceeds the normal range, such as area exceeding the upper limit, regularity below the lower limit, skeleton showing mid-branching, presence of localized overlapping textures, or depression depth exceeding the threshold, a single-frame anomaly judgment result is generated. This single-frame anomaly judgment result indicates that the first target region in the current frame has deviated from the normal single-leaf shape and can be used as a basis for determining the adhesion region. In online continuous detection scenarios that require suppression of inter-frame jitter, this single-frame anomaly judgment result can be further incorporated into the continuous frame statistical process, and the cumulative results of multiple consecutive frames determine whether the first target region is formally classified as an adhesion region.

[0053] This multi-dimensional feature joint judgment mechanism can initially distinguish the first target region from its unclassified state into normal single-leaf targets or suspicious adhered targets. Foreground regions initially identified as normal single-leaf targets can directly enter the subsequent rapid feature extraction process; foreground regions that generate single-frame anomaly judgment results can enter the subsequent adhesion confirmation process according to the actual processing mode.

[0054] Without enabling continuous frame stability control, the single-frame anomaly judgment result can be directly used to determine that it is a stuck region. With continuous frame stability control enabled, the single-frame anomaly judgment result is used as evidence of anomalies in continuous frame statistics. Only after the judgment requirements are met in multiple consecutive frames is it officially determined to be a stuck region. For targets that are officially determined to be stuck regions, it is also necessary to combine information such as load characterization quantity to determine whether they meet the preset splitting conditions. If the preset splitting conditions are met, they are sent to the subsequent contact boundary positioning and splitting process. If the preset splitting conditions are not met, they are output as non-single-leaf anomaly targets.

[0055] In the continuous visual inspection scenario of an online grading conveyor belt for tea after initial processing, the strip-shaped tea leaves are in continuous motion, and the target posture will undergo slight rotation, extension, or changes in crossing angle, and the local shadows will also change with position. For obviously scattered single leaves or obviously stacked sticky blocks, the single-frame judgment results are usually relatively stable.

[0056] However, for targets that are in slight contact, just touching, partially obscured, or whose contact boundaries are barely visible, their feature values ​​such as area, contour regularity, and concave depth often fall near the boundary between normal single leaf and suspected adhesion.

[0057] Because foreground segmentation in a single frame exhibits pixel-level fluctuations, the feature values ​​of the same physical target in consecutive frames will oscillate around the judgment threshold. If the processing branch is determined directly based on the initial screening result of a single frame, the target may be judged as a normal single leaf in the current frame, judged as a suspicious adhesion in the next frame because its area slightly exceeds the upper limit, and then return to a normal single leaf in the next frame after that. This causes the same target to switch back and forth between the normal branch and the depth branch, resulting in branch jitter.

[0058] This jitter can cause some targets that actually have a slight risk of adhesion to be directly sent to the level judgment because they temporarily return to the normal range in a certain frame. It can also cause some originally clear single-leaf targets to be pulled into the depth processing branch due to slight fluctuations in a single frame, increasing the processing burden and interfering with the dynamic allocation of processing resources.

[0059] To address this, this application proposes a continuous frame state statistics and branch stability control mechanism: The system acquires the area, contour shape regularity, skeleton line morphology, grayscale texture, and edge concavity information of the first target region in multiple consecutive frames. When the number of frames satisfying the preset anomaly condition reaches a second preset number within the most recent first preset number of frames, the first target region is determined to be a stuck region. The preset anomaly condition is: generating a single-frame anomaly judgment result, or the difference between any one of the area, contour shape regularity, skeleton line morphology, grayscale texture, and edge concavity information and the boundary of the statistical range of normal single-leaf morphological features is within a preset tolerance band. After determining the first target region to be a stuck region, if the area, contour shape regularity, skeleton line morphology, grayscale texture, and edge concavity information do not satisfy the preset anomaly condition within the subsequent third preset number of consecutive frames, the determination of the first target region as a stuck region is cancelled.

[0060] To accurately track the same physical target across multiple consecutive frames, position alignment requires incorporating conveyor belt motion information. Specifically, conveyor motion information characterizing the conveyor belt's speed and direction can be acquired, and the predicted position of the first target region in historical frame images can be determined based on the position of the first target region in the current frame and the conveyor motion information.

[0061] Subsequently, the first target region in the current frame is associated with one target region in the historical frame as the same physical object according to the overlap degree between the predicted position and the position of the target region in the historical frame. Through this association method based on kinematic prediction and spatial overlap matching, it is possible to accurately obtain region area information, contour shape regularity information, skeleton line morphology information, grayscale texture information and edge depression information from the historical frame target regions of the associated same physical object, thereby providing a time series data basis for subsequent inter-frame statistics.

[0062] After acquiring the feature information of multiple consecutive frames, it is necessary to define which state belongs to a single-frame anomaly. In order to incorporate the critical state that is close to the boundary of the normal range but has not completely exceeded it into monitoring, a preset tolerance zone can be set on the basis of the statistical range of the normal single-leaf morphological features.

[0063] Taking the region area information as an example, assuming that the upper limit of the normal single-leaf area is A_max, an observation upper limit A_watch can be set, satisfying A_watch<A_max, for example, A_watch can be 90% of A_max. When the target area A satisfies A_watch ≤ A ≤ A_max×1.1, it is considered that the area has entered the boundary observation zone.

[0064] For other features such as contour shape regularity and edge depression depth, a similar idea can also be adopted to set the observation lower limit or observation upper limit. The preset anomaly condition is defined as any one of the above five types of information exceeding the statistical range of the normal single-leaf morphological features, or the difference from the boundary of the statistical range of the normal single-leaf morphological features falling within the preset tolerance zone.

[0065] This design can distinguish between clearly normal states and states that are close to abnormal but not yet sufficiently clear, preventing critical states from being directly ignored.

[0066] After the preset anomaly condition is defined, the number of frames satisfying the condition can be counted within the latest first preset number of frames. The first preset number of frames constitutes a sliding observation window, the specific value of which can be set according to the conveyor belt speed and the camera frame rate, for example, 8 to 15 frames can be selected to cover the short period during which the target passes through the acquisition area.

[0067] When the cumulative number of frames satisfying the preset anomaly condition within this observation window reaches the second preset number of frames, the first target region is formally determined as an adhesion region. The second preset number of frames can be set to 60% to 80% of the total number of frames in the observation window.

[0068] Through this cumulative statistical mechanism, the target's attribution status changes from a dynamic, fluctuating state that easily switches between two processing branches to a steady state that only migrates when supported by sufficient evidence. Targets near the boundary remain in the observation state until sufficient anomalous evidence is accumulated, without immediately triggering deep processing. Only after sufficient anomalous evidence is gathered do they stably enter the suspicious state, thus helping to eliminate branch jitter caused by single-frame fluctuations.

[0069] For targets that have been identified as sticky areas, in order to prevent them from being immediately considered no longer sticky areas due to a single frame accidentally returning to normal, hysteresis cancellation control logic can be introduced.

[0070] Specifically, after identifying the first target area as an adhesion area, the system requires that within a subsequent third preset number of frames, none of the aforementioned five morphological information conditions are met before the adhesion area identification of the first target area is revoked. The third preset number of frames can be set to three to eight frames. This hysteresis control requires multiple consecutive frames to be completely normal before the identification is revoked, avoiding false exits caused by brief recovery periods.

[0071] Furthermore, if a target is about to leave the reliable observation area at the end of the observation window, but its state still cannot be stably classified, a reliable single-leaf result can be omitted, and instead, a boundary-determined target marker can be output. This marker can be reused from the abnormal target output channel, with the abnormality reason field added as boundary state non-convergence. The downstream sorting control module can then process it as an abnormal target, thereby preventing boundary targets from being mistakenly released when there is insufficient evidence.

[0072] Through the aforementioned continuous frame state statistics and branch stability control, the branch jitter phenomenon caused by single-frame judgment fluctuations can be effectively eliminated. This helps avoid normal single leaves being mistakenly pulled into deep processing branches, leading to increased processing burden and output delay. It also helps prevent slightly stuck targets from being missed as normal single leaves because a frame happens to return to the normal range. For online sorting, the number of suspicious targets is no longer artificially high or low due to boundary jitter, and the allocation of processing resources is more accurate. The results received by the downstream sorting end are more consistent and stable, and there are no longer contradictions caused by the same physical target being assigned to different categories in different frames.

[0073] Once a target is stably identified as an adhesion region in this step, it can proceed to the process of determining whether it can be separated. If the preset separation conditions are met, it is used as an input object in the subsequent contact boundary positioning and sub-region segmentation processing. If the preset separation conditions are not met, it is output as a non-single-leaf abnormal target, thereby improving the overall anti-interference capability of adhesion region judgment and the accuracy of quality inspection.

[0074] In the online continuous grading and conveying scenario after the initial processing of tea, when multiple strips of tea leaves are partially stacked or overlapped, because the tea leaves themselves are similar in color and the edges often have no obvious gaps, the actual physical contact boundary inside the adhesion area usually lacks a clear grayscale transition in the two-dimensional image.

[0075] If segmentation is based solely on simple indentations of the outer contour or an overall grayscale threshold, it is easy to misjudge the natural curvature or localized damage of the tea leaves as contact boundaries, or to miss segmentation in grayscale fusion areas. To accurately reconstruct the true physical contact line in the absence of clear visual boundaries, this application further proposes a multi-dimensional cue collaborative localization mechanism.

[0076] Furthermore, in some preferred methods, the step of determining the contact position within the first target area to characterize the boundary between different tea leaves includes: acquiring first change information to characterize the local width variation information on the skeleton line within the first target area; acquiring second pointing information to characterize the spatial pointing information of the concave part of the outer contour of the first target area; acquiring third distribution information to characterize the gradual distribution information of local surface attributes within the first target area; determining segmentation reference information to distinguish the boundary between different tea leaves based on the first change information, the second pointing information, and the third distribution information; and determining the contact position based on the segmentation reference information.

[0077] When two or more tea leaves overlap on a conveyor belt, they form a continuous, adhered color block when viewed from above. To find the actual boundary line within this color block, it is first necessary to obtain the initial information about the change by examining the internal skeletal structure.

[0078] Specifically, the process involves pixel-level traversal along the skeleton lines extracted in the previous steps, generating an orthogonal cross-section at each pixel location of the skeleton lines, and calculating the number of pixels belonging to the foreground target within this cross-section. This number is then used as the local width at that location. In the normal extension direction of a single tea leaf, the width typically exhibits a gentle, gradual change.

[0079] However, when two tea leaves come into contact or overlap, the physical overlap at the contact boundary often causes a significant contraction in the width of the skeletal cross-section of that area, which then expands again after crossing the boundary. By calculating the relative change in the width of adjacent cross-sections—for example, dividing the difference between the current cross-section width and the previous cross-section width by the previous cross-section width—when the absolute value of this change exceeds a preset empirical threshold and the trend shows a pattern of narrowing and then widening again, that location can be marked as a candidate contact point, thus obtaining the first change information reflecting the internal geometric deformation.

[0080] This detection method, based on abrupt changes in skeleton width, can effectively capture internal structural compression features that are difficult to detect directly with the naked eye.

[0081] At the same time, in order to introduce external geometric constraints, it is necessary to obtain second directional information. On the outer contour of the adhesion area, the overlap of multiple tea leaves often forms obvious concave areas on both sides of the contact point.

[0082] To address this, deep concave areas on the outer contour are detected, and geometric fitting is performed on the edge segments on both sides of each concave area. The direction of the interior angle bisector or the extension direction of the deepest point is extracted as the axis of symmetry for that concave area. This axis of symmetry points spatially into the interior of the target region, representing the potential cutting direction of the outer contour concave extending inward. If this axis of symmetry passes through the interior of the target and points to another corresponding concave area, or extends to the edge of an internal textured abnormal area, it is used as a candidate cutting guide line, thereby obtaining a second directional information characterizing the spatial orientation of the outer contour concave area.

[0083] The significance of this step lies in establishing a spatial geometric relationship between the external shape defects and the internal potential segmentation directions.

[0084] In addition to their geometric shape, the stacking of tea leaves creates specific optical texture features in the image due to the occlusion of the upper tea leaves by the lower tea leaves and the tiny shadows produced on the contact surfaces.

[0085] Therefore, it is necessary to obtain third distribution information. Within the target area, the local gray-level mean gradient or texture contrast is calculated using a sliding window to detect whether there are valley-shaped gradient distribution areas where the gray-level value gradually decreases from the periphery to the center, presenting a gradient from light to dark and then back to light.

[0086] This type of localized surface property gradient distribution typically corresponds to the dark overlapping texture produced when two tea leaves overlap, and the direction of the striped texture within it is often inconsistent with the main extension direction of the overall target. Once such a gradient distribution area is detected, its boundary range and main extension direction are extracted as potential layer boundaries, thereby obtaining third distribution information. This analysis based on surface property gradients can compensate for the shortcomings of simple geometric features in cases of uneven lighting or blurred edges.

[0087] After obtaining the clues from the three independent dimensions mentioned above, it is necessary to correlate them spatially to generate segmentation reference information.

[0088] In practice, the abrupt change points of the skeleton width marked by the first change information, the symmetry axis of the concave area indicated by the second pointing information, and the gradual distribution boundary indicated by the third distribution information are mapped to the same target area coordinate system.

[0089] Calculate the spatial distance and collinearity between these clues, for example, to determine whether a symmetry axis of a concave region passes exactly through a location where the skeleton width significantly contracts, and whether there are boundary supports for the gradual distribution of surface properties near that location.

[0090] When these three types of clues highly overlap or corroborate each other in space, it indicates that the location simultaneously possesses triple evidence of internal structural compression, external contour depression, and optical shadow occlusion. At this point, these overlapping clues are combined and merged to generate segmentation reference information used to distinguish the boundaries between different tea leaves. This segmentation reference information can be represented as a parametric straight line or local curve passing through the target area.

[0091] Finally, the contact location is determined based on the generated segmentation reference information. If multiple candidate segmentation reference information exist, they can be sorted based on their cue overlap or confidence level, and the spatial trajectory corresponding to the segmentation reference information with the highest support is selected as the final contact location.

[0092] Through this multi-dimensional collaborative localization mechanism, the determination of the contact location shifts from solely relying on the external contour or grayscale threshold to a comprehensive verification based on internal skeleton deformation, external geometric constraints, and internal texture anomalies. This not only helps reconstruct the true physical contact line under conditions of blurred grayscale boundaries but also effectively avoids misjudging the natural curvature or localized damage of a single tea leaf as the contact boundary, thus providing a reliable spatial basis for accurately separating the adhered area into independent single-leaf targets.

[0093] Furthermore, in some preferred methods, after dividing the first target region into multiple second target regions, the method further includes: acquiring morphological verification information to characterize the appearance shape of each second target region, the morphological verification information including the area information, contour shape regularity information, skeleton line morphology information, grayscale texture information, and edge concavity information of each second target region; acquiring a single-leaf morphological reference range to define the allowable morphological range of the single-leaf target, the single-leaf morphological reference range being pre-generated based on known normal single-leaf samples; when the morphological verification information of the second target region falls within the single-leaf morphological reference range, the second target region is used as a single-leaf target for quality inspection; when the morphological verification information of the second target region exceeds the single-leaf morphological reference range, the second target region is marked as an abnormal unresolved target.

[0094] In the online continuous grading and conveying scenario after the initial processing of tea, after the preceding contact boundary positioning and splitting action, the originally stuck-together tea stack area is cut into multiple independent candidate sub-regions.

[0095] However, due to the physical limitations of image segmentation and boundary inference, the sub-regions generated by the segmentation cannot always perfectly correspond to the actual complete single leaf. In actual processing, there may be some small fragments of leaves, obliquely cut half-leaf tea leaves, or morphologically distorted areas caused by severe overlap of multiple tea leaves.

[0096] If these unverified temporary segmentation results are directly sent to the subsequent quality inspection process, the calculated indicators such as length, curl, and integrity will be severely distorted, which will lead to the downstream pneumatic sorting mechanism making incorrect rejection or grading actions.

[0097] In response, this application introduces an independent morphological verification and state classification mechanism after the splitting process, and conducts a second review on each split second target region to ensure that the object participating in the final quality rating has a real and complete single-leaf physical morphology.

[0098] Specifically, the process of obtaining morphological verification information involves re-performing feature extraction for each second target region. For region area information, the actual size is quantified by counting the total number of foreground pixels contained within the second target region. For contour shape regularity information, the outer contour point sequence of the second target region is first extracted, and its convex hull area is calculated. Then, the actual pixel area is divided by the convex hull area to obtain the convex area ratio, reflecting the degree of edge fragmentation or concavity. For skeleton line morphological information, the central skeleton line within the region is extracted through distance transformation, and the extension path of the skeleton line from one end to the other is traced to determine whether there are abnormal bifurcation nodes in the central region. For grayscale texture information, a local grayscale co-occurrence matrix is ​​calculated within the second target region using a sliding window to detect whether there are overlapping textures in dark areas where the grayscale value first decreases and then increases. For edge concavity information, the outer contour is approximated using polygons, and the concavity depth of the main concave points on the contour relative to the convex hull is calculated.

[0099] It is worth noting that the single-leaf morphology reference range is an objective benchmark for judging whether the above morphological verification information is qualified. This reference range can be generated by pre-collecting a large number of known normal single-leaf sample images of the current processing batch or the same variety, extracting the above-mentioned morphological features, and then statistically analyzing their distribution intervals.

[0100] For example, the 5th to 95th percentile of the area distribution of a normal single leaf sample can be used as the allowable fluctuation range for the area. Similarly, reasonable upper and lower limits for aspect ratio, convex area ratio, probability of no branching in the skeleton, and depth of shallow concavity at the edge can be obtained. This reference range, generated based on statistics from real samples, can adapt to the morphological differences of different tea varieties and processing stages, avoiding the risk of misjudgment caused by using fixed and rigid thresholds.

[0101] When determining whether the morphological verification information of the second target region falls within the single-leaf morphological reference range, strict matching or comprehensive scoring rules can be adopted.

[0102] In one implementation, the area, convexity-to-area ratio, skeleton branching state, dark area texture markers, and edge recess depth of the second target region must simultaneously meet the corresponding upper and lower limit conditions in order to be considered as falling within the reference range.

[0103] In another implementation, slight deviations are allowed for individual non-critical features, but the overall morphological similarity score is calculated using weighted averages. When the score is higher than a preset threshold, it is considered to have fallen within the range. When the morphological verification information falls within the single-leaf morphological reference range, it indicates that the shape of the second target region is regular and the features are reasonable. Its state changes from a temporary segmentation result to a credible single-leaf target, thus qualifying it to enter the subsequent length, curl, integrity calculation, and quality level mapping.

[0104] Conversely, when the morphological verification information exceeds the single-leaf morphological reference range, it indicates that the area may be a fragment, residual leaf, or severely deformed area resulting from inaccurate segmentation and positioning. In this case, the second target area is marked as an abnormal unresolved target. Internally, abnormal unresolved targets are assigned a specific status identifier, which locks their identity as a problem object to be processed, preventing them from entering the main quality inspection process.

[0105] This state bifurcation mechanism helps filter out invalid objects caused by splitting errors, preventing erroneous data from contaminating subsequent quality judgment results. Simultaneously, targets with pending anomaly markers and their location information are retained, allowing subsequent stages to organize them into anomaly result sets and guide them to separate rejection or re-inspection channels. This balances the real-time performance of online detection with the reliability of single-leaf assignment correction without deviating from the image recognition process.

[0106] After marking sub-regions that still do not meet the single-leaf morphology requirements as abnormal pending targets and removing or directing them to a re-inspection channel, if the process only stays at the back-end marking and removal level, when a batch of tea leaves has strong entanglement characteristics or the feeding parameters are improperly set, resulting in an excessively large instantaneous feeding volume, the stacking of tea leaves on the conveyor belt can easily persist. This leads to the frequent appearance of abnormal pending targets in subsequent acquisition frames, a persistently high removal rate, and a significant impact on the effective yield of normal single leaves. To address this, this application proposes a further feedback control mechanism after marking the second target region as an abnormal pending target.

[0107] After marking the second target area as an abnormal unresolved target, the method further includes: acquiring anomaly frequency information to characterize the cumulative occurrence of abnormal unresolved targets during continuous detection; generating a feeding adjustment instruction for adjusting the conveyor belt feeding equipment based on the anomaly frequency information; and sending the feeding adjustment instruction to the feeding equipment.

[0108] Specifically, the anomaly management module or a separate statistical unit continuously records the location, time, and frame number of each received anomaly / pending target, thus generating anomaly frequency information. The statistical method can be implemented using a sliding time window, for example, counting the number of anomaly / pending targets appearing within a recent preset time period, or counting the proportion of frames in which anomaly / pending targets appear within a consecutive number of frames. Alternatively, statistics can be performed according to spatial segments on the conveyor belt, calculating the density of anomaly / pending targets within a specific segment length. This multi-dimensional statistical approach can more accurately reflect the true severity of the tea leaf accumulation on the conveyor belt.

[0109] The reason why this application introduces anomaly frequency information to generate feeding adjustment instructions is that single-frame or occasional anomaly unresolved targets may only be caused by local accidental factors, while the continuously accumulated anomaly frequency can truly reflect the mismatch between the feeding end parameters and the current characteristics of the tea material.

[0110] When the abnormal frequency information reflects that the frequency of occurrence of unresolved abnormal targets exceeds the normal fluctuation range, or shows a continuous upward trend, such as the cumulative number of occurrences of unresolved abnormal targets exceeding the preset number within 30 consecutive seconds, a feeding adjustment command will be generated. This feeding adjustment command may include control parameters for reducing the vibration feed amplitude, reducing the vibration feed frequency, or reducing the conveyor belt running speed.

[0111] While acquiring abnormal frequency information and generating feeding adjustment instructions, the location and abnormality type of the unresolved abnormal target can also be sent to the sorting control module in parallel, so that the sorting control module can continue to execute the corresponding rejection action and ensure that the abnormal targets in the current frame are handled in a timely manner.

[0112] After receiving the feeding adjustment command, the operating parameters of the feeding equipment will change. For example, the vibration amplitude of the vibrating feeder will be reduced or the feeding amount will be reduced, which will reduce the number of tea leaves falling onto the conveyor belt per unit time, make the tea leaves spread more evenly on the conveyor belt, and reduce the degree of local stacking and overlapping.

[0113] This change in physical state directly affects the distribution of tea leaves entering the visual acquisition area, reducing the proportion of abnormal features such as excessive area of ​​foreground targets, excessive depth of concave areas, and overlapping textures in dark areas in subsequent frames, and consequently decreasing the frequency of unresolved abnormal targets.

[0114] By establishing a feedback loop from the detection end to the feeding control end, it helps to reduce the rate of tea leaf stacking on the conveyor belt from the source of the process. In continuous production, when the frequency of abnormalities increases, it can automatically trigger feeding adjustments to curb the continued development of abnormal trends, so that the entire detection method can maintain a relatively stable single leaf identification accuracy and effective output rate under different batches of tea and different feeding conditions.

[0115] During the online continuous grading and conveying process of tea after initial processing, due to the instantaneous fluctuations of vibration feeding, a large number of tea leaves may appear locally stacked and overlapping in a certain frame of the acquired image. If the number of targets identified as adhesion areas in the current frame image increases abnormally, and the conventional process is still used to perform in-depth processing such as contact boundary positioning, internal segmentation, and sub-region verification on these targets one by one, the image processing time for that frame will increase significantly, even far exceeding the preset adaptive processing cycle.

[0116] This single-frame processing timeout will trigger a chain reaction of delays, causing the processing of subsequent frames to lag, blocking the real-time output of normal single-leaf targets, disrupting the processing rhythm of the entire detection line, and thus affecting the precise operation of the downstream pneumatic sorting actuator.

[0117] In response, this application proposes that after determining the first target region as an adhesion region, the method further includes: obtaining a load characterization quantity to characterize the load status of the first target region that has been determined to be an adhesion region in the current frame image; when the load characterization quantity does not meet the preset load reference condition, the corresponding first target region can be considered to meet the preset splittable condition, and enter the contact boundary positioning and splitting process; when the load characterization quantity meets the preset load reference condition, it is determined that the first target region corresponding to the load characterization quantity does not meet the preset splittable condition, an overload anomaly mark is generated for the first target region to characterize that it has not been split, and the first target region carrying the overload anomaly mark is output as a non-single-leaf target.

[0118] Specifically, the load characterization metric is used to measure the pressure exerted on overall processing resources by contiguous regions in the current frame image. In one implementation, the load characterization metric can be the absolute number of first target regions identified as contiguous regions in the current frame image. In another implementation, the load characterization metric can be the proportion of this number to the total number of all foreground targets in the current frame. Furthermore, the load characterization metric can also be the proportion of the sum of the pixel areas of these contiguous regions to the total pixel area of ​​all foreground targets in the current frame. By statistically analyzing data from these dimensions, the computational load requiring depth processing in the current frame image can be objectively reflected.

[0119] The preset load reference condition is used to determine whether the processing load exceeds the maximum allowable processing time per frame. In practical applications, the load reference condition can be set as a proportional threshold. For example, when the number of adhered regions accounts for more than 30% of the total number of foreground objects, the load reference condition can be considered met.

[0120] This ratio threshold can be flexibly set based on the processor's computing power, the maximum allowed processing time per frame, and the average processing time of the depth processing algorithm. When the load representation meets this load reference condition, it indicates that the number of attached targets in the current frame is high enough to trigger a processing timeout.

[0121] In this scenario, since these adhered targets have been determined to not meet the preset separability conditions, subsequent contact boundary localization and separation depth processing steps will not be performed on them. Instead, an overload anomaly marker will be generated. This overload anomaly marker is used to explicitly characterize that these targets have not been separated and remain in an adhered state due to processing overload.

[0122] At the data organization level, an exception type field can be added to the target output record. This field can be set to "overloaded and not split," along with the target's spatial location range on the conveyor belt. This information organization method maintains compatibility with the output formats of normal single-leaf results and pending exception results, facilitating unified parsing by downstream modules.

[0123] The first target area carrying the overload anomaly marker will be organized as a non-single-leaf target into the anomaly target output result set and sent to the downstream sorting control module. Upon receiving the target information carrying the overload anomaly marker, the sorting control module can trigger a pneumatic rejection action at the corresponding location, blowing the target into a separate buffer channel or waste channel to prevent it from entering the graded sorting airflow array. Simultaneously, the occurrence time, frame number, and number of affected targets of this overload event can be recorded in the monitoring interface or operation log, allowing operators to determine whether adjustments to the vibration feed parameters are necessary.

[0124] Through the above processing method, the internal processing status of these adhered targets changed directly from awaiting in-depth processing to overload anomaly and output as non-single-leaf targets. The overall frame processing status changed from facing the risk of timeout to maintaining real-time cycle time. In abnormal operating conditions where sudden fluctuations in material loading at the industrial site lead to a surge in locally adhered targets, this overload protection mechanism helps maintain the stability of the real-time processing cycle time of the entire detection line by actively sacrificing the in-depth repair of suspicious targets in a small number of abnormal frames. This avoids the chain delays caused by timeouts in individual frame processing, ensures the real-time accurate sorting of the vast majority of normal single-leaf targets, and prevents targets that have not completed their attribution correction from mistakenly entering the grade sorting channel, thereby maintaining the accuracy of the final sorting results.

[0125] During the contact boundary localization process, due to abrupt changes in skeleton width, the symmetry axis of the concave area, and the texture of the dark area, multiple candidate segmentation positions may be indicated simultaneously. These candidate segmentation positions may conflict with each other. If the selection is based solely on simple rules, misselection may occur, leading to segmentation errors. To address this, this application proposes an optimization mechanism based on the degree of matching between the morphology of the segmented sub-region and the morphology of a normal single leaf.

[0126] Furthermore, in some preferred methods, the contact position is determined based on the segmentation reference information, including: when the segmentation reference information indicates at least two candidate segmentation positions, obtaining the morphological features of the candidate sub-regions corresponding to each candidate segmentation position within the first target region; and determining the candidate segmentation positions whose morphological features fall within the statistical range of normal single-leaf morphological features as contact positions.

[0127] In actual image recognition, segmentation reference information often aggregates various localization cues from locations of abrupt changes in skeleton width, the axis of symmetry of the concave region of the outer contour, and the edges of overlapping textures in the internal dark areas. When these cues point to different locations in space, at least two candidate segmentation locations are formed.

[0128] If selection is based solely on a single geometric metric such as the length or penetration of the clues, interference factors such as local shadows or broken edges of the tea leaves may lead to the selection of the wrong actual contact boundary. To reduce this risk of misselection, candidate sub-regions corresponding to each candidate segmentation position can be obtained through simulated segmentation.

[0129] Taking a specific application scenario as an example, suppose an adhered region is formed by the intersection of two tea leaves. A skeletal abrupt change clue indicates location A, while a contour indentation clue indicates location B, forming two candidate segmentation locations. Instead of directly deciding between A and B, we first virtually cut the pixel mask of the first target region along location A, dividing the originally continuous foreground connected region into independent pixel sets A and B. Then, along location B, we virtually cut the region into independent pixel sets C and D. These segmented pixel sets A, B, C, and D are the candidate sub-regions, and their shapes can be evaluated to determine whether they better match the shape of a real single tea leaf.

[0130] After obtaining candidate sub-regions, candidate segmentation locations that clearly do not meet the geometric penetration requirements can be eliminated to reduce subsequent computation. For the retained candidate sub-regions, the morphological features of each candidate sub-region can be extracted.

[0131] These morphological features can include the pixel area of ​​the candidate sub-region, the aspect ratio of the bounding rectangle, the ratio of the convex hull area to the actual area, and the branching of the skeleton lines. The process of extracting these features can reuse the feature calculation logic established earlier for single-leaf targets, thereby avoiding additional computational overhead.

[0132] Subsequently, the extracted morphological features can be compared with the statistical range of normal single-leaf morphological features. The statistical range of normal single-leaf morphological features is a set of parameters, including upper and lower limits of area, reasonable range of aspect ratio, and lower limit of convex area ratio, obtained from a large number of real single-leaf samples. During the comparison, it can be determined whether each morphological feature of the candidate sub-region falls within the corresponding statistical range.

[0133] When there are multiple candidate segmentation locations, and the morphological features of their corresponding candidate sub-regions all fall within the statistical range of normal single-leaf morphological features, the degree of deviation of the morphological features of each candidate sub-region from the distribution center of normal single leaves can be further calculated, and the candidate segmentation location with the smallest degree of deviation can be determined as the final contact location.

[0134] This approach allows prior morphological information to be used in reverse to influence the segmentation decision-making process. Contact locations determined in this way are more likely to break down the adhesion area into sub-regions that conform to the true single-leaf morphology, helping to reduce the proportion of unresolved abnormal targets in subsequent morphological verification stages, thereby improving the accuracy of the overall quality inspection results. Since the number of candidate segmentation locations is usually small, and the morphological feature extraction process reuses existing computational modules, this optimization process incurs minimal time overhead, meeting the real-time requirements of continuous online conveyor belt inspection.

[0135] When directly extracting feature information of the target region in consecutive frames, the position of the same tea leaf or the same group of tea leaves will shift in adjacent frames due to the continuous movement of the conveyor belt. If information is extracted simply based on spatial proximity, it is easy to incorrectly associate information of different physical objects, resulting in data sequences on which subsequent stability determinations depend not originating from the same target, thus causing data confusion.

[0136] Furthermore, in some preferred methods, the step of obtaining the area information, contour shape regularity information, skeleton line morphology information, grayscale texture information, and edge concavity information of the first target region in consecutive multi-frame images includes: obtaining conveying motion information to characterize the speed and direction of the conveyor belt; determining the predicted position of the first target region in historical frame images based on the position of the first target region in the current frame and the conveying motion information; associating the first target region in the current frame with a target region in a historical frame as the same physical object based on the degree of overlap between the predicted position and the position of the target region in the historical frame; and obtaining the area information, contour shape regularity information, skeleton line morphology information, grayscale texture information, and edge concavity information from the target region of the historical frame associated with the same physical object.

[0137] Reference Figure 4 Specifically, the conveyor motion information can be acquired in real time by a rotary encoder installed on the drive shaft or driven shaft of the conveyor belt, including the current linear speed and direction of the conveyor belt.

[0138] When acquiring images, the encoder's pulse signal and the industrial camera's exposure trigger signal can be timestamped to ensure that each frame corresponds to a precise conveyor belt displacement state. When determining the predicted position, the time interval t between the current frame and the historical frame to be matched can be obtained, along with the linear velocity v from the conveyor motion information. The physical displacement L of the target in the conveyor belt's running direction can then be calculated using the formula L = v × t.

[0139] By combining the direction of movement and starting from the center point of the first target region in the current frame image, the physical displacement L can be calculated backwards to obtain the predicted position of the target in the historical frame image. When evaluating the degree of overlap, the bounding rectangle region corresponding to the predicted position and the bounding rectangle region of the segmented historical frame target region in the historical frame image can be extracted, and the intersection-union ratio between the two can be calculated.

[0140] When the calculated crossover ratio is greater than the preset empirical overlap threshold, or when the distance between the center points of the two regions is less than the preset distance threshold, it can be considered that the two regions are highly overlapping in space, thereby associating the first target region of the current frame image with the target region in the historical frame image as the same physical object.

[0141] If no target region with sufficient overlap to the predicted location is found in the historical frames, the first target region can be considered a newly appearing physical object in the current frame. In this case, no forced association is performed, and its historical feature information is re-accumulated starting from the current frame.

[0142] Through the spatial prediction and overlapping association based on physical motion parameters, the data attribution relationship during the acquisition of multi-frame information is changed, so that the first target region of the current frame and the specific target region in the historical frame form a definite correspondence.

[0143] This approach avoids the problem of mixing different target information due to position matching errors, ensuring that the acquired morphological feature information of multiple consecutive frames does indeed come from the same leaf or group of tea leaves. This provides a reliable data foundation for subsequent branch stability determination, helps to eliminate branch jitter caused by target confusion, and improves the consistency of online detection under continuous working conditions.

[0144] This application also proposes a tea quality detection system based on image recognition, used to perform any of the above method steps. The system includes a first target area acquisition module, an adhesion judgment module, a contact positioning and separation module, and a single leaf confirmation module.

[0145] The first target region acquisition module is used to acquire a first target region segmented from tea images continuously acquired from an online conveyor belt. The adhesion judgment module is used to determine whether the first target region is an adhered region containing multiple tea leaves based on a first morphological feature characterizing its appearance. The contact positioning and splitting module is used to determine the contact positions within the first target region that characterize the boundaries between different tea leaves, and to split the first target region into multiple second target regions along these contact positions, provided that the first target region is an adhered region and meets preset splitting conditions. The single-leaf confirmation module is used to use the second target region as a single-leaf target for quality inspection, provided that the second morphological feature characterizing the appearance of the second target region meets the single-leaf morphological condition.

[0146] The above scheme can organize the identification of adhesion targets, the judgment of separable conditions, and the separation processing in the process of tea quality detection by image recognition into a modular structure that can be implemented in an engineering manner. This allows subsequent in-depth processing to be initiated only for suspicious adhesion areas that meet the preset separable conditions, thereby improving the accuracy of single leaf attribution judgment while taking into account the online processing pace.

[0147] In some specific implementations, refer to Figure 2 , Figure 2 This paper demonstrates the overall architecture and processing flow of a tea quality inspection system based on image recognition. During operation, a feeding device delivers tea leaves onto an online conveyor belt, which provides motion information characterizing its speed and direction. An image acquisition device captures images of the moving tea leaves on the conveyor belt, obtaining continuous images of the tea leaves.

[0148] The image segmentation and first target region acquisition module receives continuous tea leaf images and transmits motion information. It then uses a multi-frame correlation method to perform image segmentation, thereby acquiring the first target region. The acquired first target region is then sent to the adhesion region judgment module.

[0149] The adhesion region judgment module identifies the first target region based on the first morphological features and multi-frame analysis. During this process, the module combines the statistical range of normal single-leaf morphological features for judgment. If the module determines the first target region to be a non-adhesive ordinary single-leaf target, it directly sends it to the quality inspection module for quality inspection and finally outputs the tea quality inspection result. If the module determines the first target region to be an adhesion region, it sends it to the separability condition judgment process, which determines whether the first target region meets the preset separability conditions based on the load characterization quantity.

[0150] When the first target region is determined to be an adhered region and meets the preset separable conditions, it is sent to the contact position localization and splitting module. This module determines the contact positions of different tea leaves within the first target region based on extracted skeleton, contour, and texture features, and splits the first target region into multiple second target regions along these contact positions. When the first target region is determined to be an adhered region but does not meet the preset separable conditions, an overload anomaly marker is generated, and the first target region carrying the overload anomaly marker is output as a non-single-leaf target.

[0151] The split second target region is then sent to the single-leaf confirmation module. This module verifies the morphology of the second target region using a single-leaf morphology reference range. If the second target region meets the single-leaf condition, it is transmitted as a single-leaf target to the quality inspection module, thus obtaining the tea quality inspection result.

[0152] If the second target area does not meet the single-leaf condition, the area will be marked as an abnormal unresolved target. The abnormal target frequency statistics and feeding adjustment instruction generation module at least collects the abnormal unresolved target markings and counts the abnormal frequency information. It can also count the overload abnormal markings as abnormal target states. In this way, it generates a feeding adjustment instruction to adjust the feeding equipment and sends the instruction to the feeding equipment to realize the closed-loop feedback adjustment of the entire system.

[0153] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. All modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A tea quality detection method based on image recognition, characterized in that, include: Obtain the first target region segmented from tea images continuously acquired from an online conveyor belt; Based on the first morphological feature characterizing the appearance shape of the first target area, determine whether the first target area is an adhesive area containing multiple tea leaves. If the first target area is an adhesive area and meets the preset separable conditions, determine the contact position inside the first target area to represent the boundary between different tea leaves, and divide the first target area into multiple second target areas along the contact position. If the second morphological feature characterizing the appearance shape of the second target region satisfies the single-leaf morphological condition, the second target region is used as a single-leaf target for quality inspection.

2. The tea quality detection method based on image recognition according to claim 1, characterized in that, The step of determining whether the first target area is an area containing multiple tea leaves that are stuck together includes: The system acquires the area information, contour shape regularity information, skeleton line morphology information, grayscale texture information, and edge concavity information of the first target region. The area information is used to characterize the total number of pixels occupied by the first target region. The contour shape regularity information is used to characterize the degree of similarity between the contour shape of the first target region and its convex hull shape. The skeleton line morphology information is used to characterize whether there are middle branches of the skeleton line in the first target region. The grayscale texture information is used to characterize whether there are local overlapping textures that change from light to dark and then back to light in the first target region. The edge concavity information is used to characterize the depth of the concavity on the outer contour of the first target region. Obtain the statistical range of normal single-leaf morphological features used to define the permissible morphological range of single-leaf targets. The statistical range of normal single-leaf morphological features is pre-generated based on known normal single-leaf samples. When any of the area information, the contour shape regularity information, the skeleton line shape information, the grayscale texture information, and the edge concavity information exceeds the statistical range of the normal single leaf morphology features, a single-frame anomaly judgment result is generated to characterize that the first target area does not meet the normal single leaf morphology conditions, and the first target area is determined to be the adhesion area based on the single-frame anomaly judgment result.

3. The method according to claim 2, characterized in that, The step of determining the first target region as an adhesion region includes: The area information, contour shape regularity information, skeleton line morphology information, grayscale texture information, and edge concavity information of the first target region in consecutive multi-frame images are obtained. When the number of frames that meet the preset abnormal conditions reaches the second preset number within the most recent first preset number of frames, the first target area is determined to be an adhesion area. The preset anomaly condition is: generating the single-frame anomaly judgment result, or the difference between any one of the region area information, contour shape regularity information, skeleton line morphology information, grayscale texture information and edge concavity information and the boundary of the normal single leaf morphological feature statistical range is within the preset tolerance band. After determining the first target region as an adhesion region, if the region area information, contour shape regularity information, skeleton line shape information, grayscale texture information, and edge concavity information do not meet the preset abnormal conditions within the subsequent third preset number of consecutive frames, then the determination of the first target region as an adhesion region is cancelled.

4. The method according to claim 3, characterized in that, The step of determining the contact position within the first target area used to characterize the boundary between different tea leaves includes: Obtain first change information to characterize the local width change information on the skeleton line within the first target region; Obtain second pointing information to characterize the spatial pointing information of the concave portion of the outer contour of the first target region; Obtain third distribution information to characterize the gradual distribution of local surface properties within the first target region; Based on the first change information, the second pointing information, and the third distribution information, segmentation reference information for distinguishing the boundaries between different tea leaves is determined; The contact position is determined based on the segmentation reference information.

5. The method according to claim 4, characterized in that, After dividing the first target region into multiple second target regions, the method further includes: Obtain morphological verification information to characterize the appearance shape of each second target region. The morphological verification information includes the area information, contour shape regularity information, skeleton line morphology information, grayscale texture information, and edge concavity information of each second target region. Obtain a single-leaf morphology reference range for defining the permissible morphological range of a single-leaf target, wherein the single-leaf morphology reference range is pre-generated based on known normal single-leaf samples; When the morphological verification information of the second target area falls within the single leaf morphological reference range, the second target area is used as the single leaf target for quality inspection. When the morphological verification information of the second target region exceeds the single leaf morphological reference range, the second target region is marked as an abnormal unresolved target.

6. The method according to claim 5, characterized in that, After marking the second target region as an anomalous pending target, the process also includes: Obtain anomaly frequency information to characterize the cumulative occurrence of the anomaly-pending targets during continuous detection; Based on the abnormal frequency information, a feeding adjustment command is generated for adjusting the feeding equipment of the conveyor belt. Send the feeding adjustment command to the feeding equipment.

7. The tea quality detection method based on image recognition according to claim 2, characterized in that, After determining the first target area as an adhesion area, the method further includes: Obtain a load characterization quantity used to characterize the load status of the first target region that has been identified as an adhesion region in the current frame image; When the load representation quantity meets the preset load reference condition, it is determined that the first target region corresponding to the load representation quantity does not meet the preset splittable condition. An overload anomaly mark is generated for the first target region to represent that it has not been split. The first target region carrying the overload anomaly mark is output as a non-single leaf target.

8. The method according to claim 4, characterized in that, Determining the contact position based on the segmentation reference information includes: When the segmentation reference information indicates at least two candidate segmentation positions, the morphological features of the candidate sub-regions corresponding to each candidate segmentation position within the first target region are obtained. The candidate segmentation position where the morphological feature falls within the statistical range of the normal single leaf morphological feature is determined as the contact position.

9. The method according to claim 3, characterized in that, The step of obtaining the area information, contour shape regularity information, skeleton line morphology information, grayscale texture information, and edge concavity information of the first target region in consecutive multi-frame images includes: Obtain conveying motion information to characterize the speed and direction of the conveyor belt; Based on the position of the first target region in the current frame and the transport motion information, the predicted position of the first target region in the historical frame image is determined; Based on the degree of overlap between the predicted location and the target region in the historical frame, the first target region in the current frame and a target region in the historical frame are associated as the same physical object. From the target region of the historical frame associated with the same physical object, obtain the region area information, contour shape regularity information, skeleton line morphology information, grayscale texture information and edge concavity information.

10. A tea quality detection system based on image recognition, used to perform the method according to any one of claims 1 to 9, characterized in that, include: The first target region acquisition module is used to acquire the first target region segmented from tea images continuously acquired from the online conveyor belt; The adhesion judgment module is used to determine whether the first target area is an adhesion area containing multiple tea leaves based on the first morphological feature that characterizes the appearance shape of the first target area. The contact positioning and splitting module is used to determine the contact position inside the first target area that represents the boundary between different tea leaves when the first target area is an adhesive area and meets the preset splitting conditions, and to split the first target area into multiple second target areas along the contact position. The single-leaf confirmation module is used to identify the second target region as a single-leaf target for quality inspection when the second morphological feature characterizing the appearance shape of the second target region meets the single-leaf morphological condition.