Intelligent sorting system for paper sheet articles

The intelligent sorting system for paper-based sheet items utilizes image acquisition and deep learning technologies to identify the grayscale uniformity and edge contours of playing cards, solving the problem of high false alarm rate in the detection of intermediate bends in existing technologies and achieving high-precision playing card sorting.

CN121892411APending Publication Date: 2026-04-21HENGZHI METHODIST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HENGZHI METHODIST CO LTD
Filing Date
2026-01-28
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing playing card detection technologies struggle to accurately identify structural anomalies caused by bends in the middle, resulting in a high false alarm rate and failing to meet the demands for efficient sorting.

Method used

An intelligent sorting system for paper-based sheet items is adopted. The system acquires images of playing cards through an image acquisition device, and combines deep learning and traditional image segmentation methods to identify character and pattern areas. It also uses grayscale uniformity and edge contour extraction techniques to detect anomalies in the playing cards.

Benefits of technology

It improves the accuracy of identifying specific structural anomalies such as intermediate bends, enhances the reliability and automation level of the sorting system, and reduces the false alarm rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121892411A_ABST
    Figure CN121892411A_ABST
Patent Text Reader

Abstract

The invention provides an intelligent sorting system for paper sheet-shaped articles, and relates to the technical field of intelligent sorting of paper sheet-shaped articles, and the system comprises the steps that a target image corresponding to a target paper sheet-shaped article is obtained; obtaining a target character in the target image; if the target character is the first preset type character, determining whether the target paper sheet article is abnormal or not according to the gray level uniformity of a character area and an area outside a pattern area in the target image; if the target character is a second preset type character, performing edge contour extraction on the target image to obtain an edge contour image corresponding to the character and the pattern; performing feature extraction on the edge contour image to obtain an edge contour feature vector corresponding to the target image; determining whether the target paper sheet article is normal or not; according to the method, the capability of judging the defects such as middle bending is remarkably enhanced, the reliability and the automation level of overall sorting are improved, and the defects that in the prior art, the detection means is single, and the adaptability is insufficient are overcome.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent sorting technology for paper sheet items, and in particular to an intelligent sorting system for paper sheet items. Background Technology

[0002] In the recycling and reuse of playing cards, it is necessary to inspect the appearance of the cards and sort out those with defects or bends. Currently, common sorting methods mainly rely on manual visual inspection or automated inspection systems based on machine vision. However, manual sorting is inefficient, unstable, and costly; while existing automated inspection technologies mostly focus on identifying obvious stains, incomplete printing, or errors in characters or patterns. For structural anomalies such as bends in the middle of playing cards caused by moisture or stress (i.e., physical deformation of the card in non-patterned areas), due to slight bending, the curvature of the four corners, and inconsistent bending directions, relying solely on aspect ratio or edge straightness for detection is prone to false alarms and cannot meet the requirements of high-precision sorting. Therefore, how to improve the accuracy of identifying playing cards with specific structural anomalies such as bends in the middle has become an urgent technical problem to be solved in this field. Summary of the Invention

[0003] To address the aforementioned technical problems, the technical solution adopted by this invention is as follows: According to a first aspect of this application, an intelligent sorting system for paper sheet-like items is provided. The system includes: a paper sheet-like item conveying device, an image acquisition device, and a processor; wherein the paper sheet-like item conveying device is used to convey paper sheet-like items, the image acquisition device is used to acquire images of the paper sheet-like items, and the processor is used to perform the following steps: S100, acquire the target image corresponding to the target paper sheet-like item through the image acquisition device; the target paper sheet-like item can be any paper sheet-like item; S200, parse the target image to obtain the target characters in the target image; S300, if the target character is a first preset type character, then determine whether the target paper sheet is abnormal based on the grayscale uniformity of the area outside the character area and the pattern area in the target image; S400, if the target character is a second preset type character, then the edge contour is extracted from the target image to obtain the edge contour image corresponding to the character and the pattern; S500 performs feature extraction on the edge contour image to obtain the edge contour feature vector corresponding to the target image; S600, obtain the similarity γ between the edge contour feature vector corresponding to the target image and the standard feature vector corresponding to the preset target character; S700, if γ>λ, then the target paper sheet is determined to be normal; otherwise, the paper sheet is determined to be abnormal; λ is a preset similarity threshold.

[0004] The present invention has at least the following beneficial effects: The intelligent sorting system for paper sheet items of this invention, for characters of the first preset type, can accurately identify uneven brightness in the background caused by physical bending, wrinkles, or stains by detecting the grayscale uniformity of the background area outside the character and pattern areas, thus precisely locating anomalies in non-pattern areas that are difficult to detect by traditional methods. For characters of the second preset type, an edge contour extraction and feature comparison method is used to determine anomalies by analyzing the contour shape changes of the characters and patterns themselves, which is particularly suitable for situations where bending causes contour deformation or blurred edges. These two strategies complement each other, forming a multi-level, intelligent detection logic. The system can automatically select the optimal detection path according to the characteristics of the characters, which not only significantly enhances the ability to identify defects such as "intermediate bending" but also improves the overall reliability and automation level of sorting, overcoming the shortcomings of existing technologies in terms of single detection methods and insufficient adaptability. Attached Figure Description

[0005] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0006] Figure 1 A flowchart illustrating the processing steps of the intelligent sorting system for paper sheet items provided in this embodiment of the invention. Detailed Implementation

[0007] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0008] It should be noted that, based on this disclosure, those skilled in the art will understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects set forth herein can be used to implement the device and / or practice the method. Furthermore, this device and / or practice the method can be implemented using other structures and / or functionalities besides one or more of the aspects set forth herein.

[0009] The following will refer to Figure 1 The flowchart shown is a process flow diagram of an intelligent sorting system for paper sheet items, which introduces an intelligent sorting system for paper sheet items.

[0010] The intelligent sorting system for paper sheet items includes: a paper sheet item conveying device, an image acquisition device, and a processor; wherein, the paper sheet item conveying device is used to convey paper sheet items, the image acquisition device is used to acquire images of the paper sheet items, and the processor is used to perform the following steps: S100: Acquire the target image corresponding to the target paper sheet through the image acquisition device; the target paper sheet can be any paper sheet.

[0011] Furthermore, the paper-like item is a playing card.

[0012] The system in this embodiment is used in the recycling of playing cards, which requires sorting the cards to detect abnormal cards that are difficult to detect, such as cards that are bent in the middle. A paper sheet conveyor (such as a conveyor belt) transports the playing cards one by one, flatly, through an image acquisition station. The image acquisition device (such as an industrial area array CCD or CMOS camera) is fixedly installed directly above the station, with its optical axis perpendicular to the plane of the conveyor belt.

[0013] A uniform and stable light source (such as a ring-shaped LED diffused light source) is set at the acquisition station to ensure uniform illumination on the playing card surface and minimize imaging interference such as reflections and shadows. When the sensor (such as a photoelectric sensor) detects that the playing card has reached the predetermined position, it triggers the camera to take a single picture and acquire a high-resolution color or grayscale image containing the complete face of the card, i.e., the "target image".

[0014] The acquired images undergo preliminary preprocessing, such as size normalization (scaling all images to a fixed pixel size), to provide a consistent data foundation for subsequent processing.

[0015] This step establishes a standardized, high-quality image data acquisition process. Stable lighting and a fixed shooting angle ensure image consistency, eliminating the influence of environmental variables on subsequent analysis. This is the primary prerequisite for ensuring the stability and repeatability of the entire system. For example, even if there are slight color differences between production batches of playing cards, they can still be stably imaged under a fixed light source, avoiding misinterpreting color differences as bending shadows due to changes in lighting.

[0016] S200: The target image is parsed to obtain the target characters in the target image.

[0017] Based on the standard printing specifications of playing cards, fixed regions of interest (ROIs) for characters (such as the "A" in the top left corner and the inverted "A" in the bottom right corner) are determined in the target image.

[0018] For the located character region image, optical character recognition technology or a lighter template matching algorithm is used for recognition. Since the character set of playing cards (A, 2-10, J, Q, K) and font are relatively fixed, a predefined character template library can be used for fast matching, and the recognition result is output as the "target character".

[0019] This step enables rapid and accurate classification of playing card types. By employing targeted region localization and template matching, it avoids interference from complex backgrounds caused by general OCR, achieving fast recognition speed and high accuracy. This provides crucial decision-making basis for subsequent routing to different dedicated detection algorithms.

[0020] S300, if the target character is a first preset type character, then determine whether the target paper sheet is abnormal based on the grayscale uniformity of the area outside the character area and the pattern area in the target image.

[0021] Furthermore, the first preset type character includes A and 2 to 10.

[0022] Furthermore, step S300 includes the following steps: S310, detect the character region and pattern region in the target image, and generate masks corresponding to the character region and pattern region.

[0023] Semantic segmentation models based on deep learning (such as U-Net) or traditional image segmentation methods can be used. Since the characters (numbers) and patterns (such as hearts and diamonds) on playing cards have specific colors (red and black) and relatively fixed shapes and positions, color threshold-based segmentation combined with morphological operations can also be used.

[0024] The target image is input into the selected model or algorithm. The model / algorithm's task is to accurately identify all pixels in the image that belong to printed characters and fixed patterns. A binary image (mask) with the same size as the target image is created. All pixel positions identified as characters or patterns are marked as 1 (white, indicating "masked") in the mask, and all other pixel positions are marked as 0 (black, indicating "retained"). This mask image clearly distinguishes the "foreground (printed content)" and the "background (card base)".

[0025] This step, by generating a precise mask, allows the system to reliably "remove" complex printed patterns from the image being analyzed, ensuring that subsequent grayscale uniformity analysis focuses entirely on the textureless, uniform card background area. This effectively avoids misjudging edges or color variations of the printed pattern itself as background anomalies, laying an accurate regional foundation for subsequent detection. For example, it can accurately mask all ten hearts in a "10 of Hearts" card, leaving only the red number "10" and the card's background color area between the patterns for analysis.

[0026] S320, perform grayscale conversion on the target image to obtain the target grayscale image corresponding to the target image.

[0027] Convert a color target image to a single-channel grayscale image. Use a standard conversion formula, for example: Grayscale value = 0.299 × R + 0.587 × G + 0.114 × B; where R, G, and B represent the intensity values ​​of the red, green, and blue channels, respectively. After conversion, each pixel is represented by only one grayscale value (typically ranging from 0 to 255), simplifying the image data and focusing on reflecting brightness information.

[0028] In this step, grayscale conversion compresses the three-channel color information into a single-channel brightness information, significantly reducing the amount of data and complexity of subsequent calculations. For the core task of detecting shadows caused by physical bending (essentially brightness changes), retaining the brightness information is sufficient. This step improves processing efficiency and eliminates potential interference from different color channels, allowing the system to focus on the key feature dimension of grayscale (brightness / darkness).

[0029] S330, obtain the grayscale uniformity η of the region outside the mask in the target grayscale image.

[0030] Furthermore, step S330 includes the following steps: S331, in the target grayscale image, the area outside the mask is determined as the area to be evaluated.

[0031] The binary mask generated in step S310 is subjected to a pixel-level logical AND operation with the target grayscale image obtained in step S320. Specifically, for each pixel position, if the mask value at that position is 0 (representing the background), the grayscale value of the grayscale image at that position is retained; if the mask value is 1 (representing the foreground), the grayscale value at that position is ignored or set to a specific label (such as NaN). The region consisting of all retained pixels with a mask value of 0 is the "region to be evaluated".

[0032] This step involves the application of a mask, enabling precise cropping of the analysis area. It ensures that all subsequent calculations (such as gradient calculations and pixel statistics) are strictly confined to the "pure background" area, completely eliminating interference from characters and patterns. This is similar to inspecting a piece of fabric by first covering the printed areas with a template, then only checking the unprinted, solid-color parts for defects, thus guaranteeing the purity of the target being inspected.

[0033] S332, calculate the grayscale gradient magnitude of each pixel in the region to be evaluated.

[0034] Within the region to be evaluated, convolution is performed using an image gradient operator (most commonly the Sobel operator). The gradient value Gx in the horizontal direction (x-direction) and the gradient value Gy in the vertical direction (y-direction) are calculated for each pixel.

[0035] Calculate gradient magnitude: For each pixel within the evaluation region, calculate the gradient magnitude (i.e., edge strength) at that point based on its Gx and Gy values. The formula is: Gradient magnitude = sqrt(Gx...Gy) 2 +Gy 2 It can be approximated as |Gx|+|Gy|. The larger the gradient magnitude, the more drastic the grayscale change at that point (e.g., an edge that suddenly turns from bright to dark).

[0036] This step transforms the image from the "grayscale value" domain to the "grayscale change intensity" domain. A perfect, flat playing card background should have very gentle grayscale changes, with generally low gradient magnitudes. However, once a bend occurs, the bend's "ridge" or "valley" will form a clear light-dark boundary line on the image, and the pixel gradient magnitude near this line will be abnormally high. Calculating the gradient magnitude quantifies and highlights these localized, sharp grayscale abrupt changes, making it a crucial preprocessing step for capturing bend marks.

[0037] S333, obtain the number of pixels NUM1 in the region to be evaluated whose gray-scale gradient magnitude is greater than the preset gradient threshold.

[0038] Set a preset gradient threshold (this threshold can be determined by analyzing the gradient magnitude distribution of a large number of normal playing card background areas, for example, taking a high percentile of the gradient magnitude distribution of normal samples, such as the 95th percentile). Iterate through each pixel in the region to be evaluated and determine whether its gradient magnitude is greater than the preset gradient threshold. Count the total number of pixels whose gradient magnitude exceeds the threshold, denoted as NUM1. These points can be considered "suspected anomalous mutation points".

[0039] This step achieves preliminary quantization of anomalous signals. By setting a threshold, low gradient values ​​caused by pervasive, minute grayscale noise in the background are filtered out, focusing only on pixels with drastic changes. The size of NUM1 directly reflects the degree of "sharp grayscale abrupt changes" within the evaluation area. A flat card will have a small NUM1; a card with a bend in the middle will generate a large number of high-gradient pixels along the bend line, causing NUM1 to increase significantly.

[0040] S334, based on the total number of pixels NUM and NUM1 in the region to be evaluated, determine the grayscale uniformity η = NUM1 / NUM.

[0041] First, obtain the total number of pixels NUM in the region to be evaluated (i.e., the number of all pixels in the mask with a value of 0). Then, calculate using the formula η = NUM1 / NUM. η is a ratio between 0 and 1.

[0042] This step ultimately generates a normalized index η with clear physical meaning. It represents the proportion of pixels in the background region that experience drastic gray-level changes. The smaller the η value, the smoother the gray-level changes in the background region, and the higher the uniformity; the larger the η value, the more abrupt the changes in the background, and the worse the uniformity. This calculation method is more sensitive to sharp local changes (bent edges) than directly calculating the gray-level standard deviation, while being relatively insensitive to overall, gradual changes in illumination, thus enabling more specific identification of bending defects.

[0043] S340, if η < τ, then the target paper sheet is determined to be abnormal; otherwise, the target paper sheet is determined to be normal; τ is a preset grayscale uniformity threshold.

[0044] The calculated grayscale uniformity η is compared with a preset grayscale uniformity threshold τ. The threshold τ is determined by testing a large number of known normal and known abnormal (including bent) samples, based on the statistical distribution of η values, and is usually located near the upper limit of the η value distribution for normal samples. The judgment logic is as follows: if η < τ, the background uniformity is considered good, and the target paper sheet is judged to be normal; if η ≥ τ, the background uniformity is considered poor, with abnormal abrupt changes, and it is judged as abnormal.

[0045] This step is the decision endpoint of the detection logic. It transforms the quantitative index η calculated in the previous steps into a clear "normal / abnormal" binary judgment. The statistically derived threshold τ ensures that the judgment standard is objective and reproducible. The core principle is that a playing card bent in the middle will cause a surge in the number of high-gradient pixels NUM1 due to the bent shadow edge, resulting in a significantly higher η value than a normal, flat card. This ultimately triggers the condition η≥τ, accurately identifying it as an anomaly. This method directly targets the most essential feature of bending defects in imaging—local gray-level abrupt changes—achieving high-accuracy detection.

[0046] S400, if the target character is a second preset type character, then the edge contour is extracted from the target image to obtain the edge contour image corresponding to the character and the pattern.

[0047] Furthermore, the second preset type characters include J, Q, and K.

[0048] Furthermore, step S400 includes the following steps: S410, perform grayscale conversion on the target image to obtain the target grayscale image corresponding to the target image.

[0049] The specific implementation of this step is the same as that of step S320, and will not be described in detail here.

[0050] S420, Based on the target grayscale image, determine the target region corresponding to the target image; wherein, the target region is the region outside the characters and patterns in the target image.

[0051] The “target area” here specifically refers to the background area other than the characters and patterns. The method for determining it can be similar to step S310, but the target is different.

[0052] Because playing cards are printed in a standardized manner, a roughly rectangular area can be defined in the image based on prior knowledge. This area usually covers the central part of the card face and intentionally excludes characters located in fixed corner positions (such as "J") and decorative patterns on the edges.

[0053] A lightweight foreground detection method is employed. For example, leveraging the characteristic that J, Q, and K face cards typically have rich colors and strong contrast with the background, a high grayscale threshold or simple color filtering is set to quickly separate the approximate area of ​​the foreground (pattern). The non-foreground area, especially the large continuous area in the center of the card face, is defined as the "target area." The accuracy requirement here does not need to reach the pixel level like the S310; it is only necessary to ensure that most of this area is background.

[0054] The core purpose of this step is to define the sampling range for subsequent calculation of a representative background grayscale reference value (ρ). By focusing the analysis area on a large, theoretically uniform background region, the calculation of the average value can be avoided by the pixels of characters and complex patterns (whose grayscale values ​​may be extremely high or low), thus obtaining a reference value ρ that more realistically reflects "how bright the normal card background should be" under the current shooting conditions. This provides a crucial basis for the next step of adaptive binarization.

[0055] S430, obtain the average gray value ρ corresponding to the target area.

[0056] The ρ value is a crucial environmentally adaptive parameter. It reflects the overall background brightness level of the current card under specific lighting conditions. If the lighting intensifies, the ρ value increases; if the card's background color is darker, the ρ value decreases. By using ρ instead of a fixed threshold, the system can dynamically adapt to the unavoidable minor fluctuations in lighting on the production line and the subtle differences in the background color of different batches of playing cards. This makes the subsequent binarization process robust, a key step in ensuring detection stability.

[0057] S440, according to ρ, perform binarization processing on the target grayscale image to obtain the target binarized image.

[0058] Furthermore, step S440 includes the following steps: S441, for any pixel RE in the target grayscale image, obtain the grayscale value RZ corresponding to RE.

[0059] The target grayscale image is represented in memory or processing unit as a two-dimensional matrix (for area scan cameras) or an ordered array of pixel values. Each element in the matrix corresponds to a pixel "RE" in the image, and the value stored is the grayscale value "RZ" of that point (usually an integer between 0 and 255).

[0060] The system will traverse each element in the matrix or array in a predetermined order (such as the raster scan order, i.e., from left to right and from top to bottom).

[0061] During the traversal, for the currently processed pixel RE, the stored value is directly read from its corresponding matrix position or array index; this value is the grayscale value RZ of the current pixel. This process is the data preparation step for subsequent binarization determination.

[0062] This step establishes an access path from "image location" to "specific grayscale data." By systematically traversing each pixel, it ensures a comprehensive analysis of the entire image, providing the necessary data input for the next step of global binarization decision-making based on dynamic thresholding. This is a prerequisite for achieving refined and automated image processing.

[0063] S442, if RZ≥α×ρ, then set the gray value corresponding to RE to 255; otherwise, set the gray value corresponding to RE to 0; α is a preset adjustment coefficient; 0<α<1.

[0064] Before performing pixel traversal, the dynamic binarization threshold T = α × ρ is pre-calculated. Here, ρ is the average grayscale value of the target area (background) obtained from step S430, representing the baseline brightness of the normal background under the current imaging environment. α is an adjustment coefficient pre-calibrated experimentally, satisfying 0 < α < 1 (e.g., a typical value can be set to 0.85 to 0.95). The role of α is to make the threshold T slightly lower than the average background brightness ρ, which provides a safety margin for distinguishing the background from a slightly darker foreground (or anomaly).

[0065] If RZ≥T: The pixel's brightness is determined to be higher than or equal to the adjusted background brightness threshold. This means it is likely to belong to the "background" area, or a very bright part of the pattern. Therefore, the new value of this pixel (in the output binary image) is set to 255 (representing pure white).

[0066] If RZ < T: The pixel's brightness is determined to be below the dynamic threshold T. This means it is likely a "foreground" object, including dark parts of printed characters or patterns, as well as dark areas caused by physical bending, stains, etc. Therefore, the pixel's new value is set to 0 (representing pure black).

[0067] After performing the above judgment and reassignment on all pixels, the original grayscale image is transformed into a new image. This new image contains only two pixel values: 255 (white) and 0 (black), i.e., the "target binarized image". The connected components of the black part correspond to all the target features to be detected (normal patterns + potential anomalies).

[0068] In this step, by using a dynamic threshold T bound to the current image background brightness ρ, the system can automatically compensate for changes in light intensity and subtle differences in the background color of different batches of paper. T adjusts accordingly regardless of whether the image is shot in strong or low light, ensuring stable binarization results.

[0069] When the card bends in the middle, a shadow band with a lower grayscale value is generated at the bend. Since the threshold T is calculated based on the normal background brightness, the grayscale value RZ of these shadow bands will almost certainly be less than T, thus being clearly segmented as a black area in the binarized image. This ensures that the bend mark is not "whitewashed" as background, but is preserved as a foreground feature.

[0070] The introduction of the adjustment coefficient α makes the threshold setting more conservative, effectively avoiding misjudging slightly darker noise points in the background as foreground, while ensuring that the true dark parts of the pattern are completely preserved. For example, for the complex dark clothing details of the "King of Spades", even if the gray values ​​of some parts are slightly higher than the theoretical optimal segmentation point due to illumination, these details can still be reliably segmented as black because T has been appropriately reduced (α×ρ).

[0071] The resulting high-quality binary image contains all the features of interest (printed patterns and physical anomalies) within its black areas, with clear boundaries. This provides a perfect foundation for the subsequent step S450 to perform precise edge contour extraction, enabling the contour features to simultaneously reflect the regularity of the printed content and the integrity of the physical condition of the card.

[0072] S450 extracts the edge contours of the target binarized image to obtain the edge contour image corresponding to the target image.

[0073] Use a contour tracing algorithm (such as the findContours algorithm in OpenCV). This algorithm scans the binary image and identifies all connected components consisting of consecutive black pixels (with a value of 0).

[0074] For each connected component found, the algorithm extracts its outermost pixel boundary, forming a closed polygon composed of a series of points—this is a "contour." Ultimately, a set of multiple contours is obtained, which together constitute the "edge contour image." In this image, the background is white, and all contour lines are drawn with black lines.

[0075] This step achieves the abstraction from regions to lines, which is a direct prerequisite for shape feature extraction. It transforms black blocky regions in a binary image (which may include complete J, Q, K figure patterns, decorative patterns, and black shadow areas created by bends) into a clear set of lines representing their shape boundaries. This transformation eliminates texture and filling information within the regions, retaining only the shape boundaries, making the features purer. Based on the contours, geometric features such as length, area, and moments can be easily calculated.

[0076] Furthermore, if a curved shadow exists, the black area formed by this shadow in the binary image will also be extracted as a contour. This means that the final contour set includes not only the contours of normal patterns but also contours of abnormally curved patterns. When the subsequent step (S500) extracts the overall features of these contours, the presence of abnormal contours will directly cause changes in the feature vectors, thus making them detectable by similarity comparison (S600-S700). For example, a normal "King of Clubs" has a specific contour shape feature; if its face is curved, the extracted contour will have an extra segment or piece of contour line that does not belong to the original pattern, causing the overall shape feature to deviate from the standard and thus be judged as abnormal.

[0077] S500 extracts features from the edge contour image to obtain the edge contour feature vector corresponding to the target image.

[0078] Furthermore, step S500 includes the following steps: S510, extract the geometric features of the character contour and pattern contour in the edge contour map to form the edge contour feature vector; wherein, the geometric features include at least one of contour length, contour area, aspect ratio of the minimum bounding rectangle of the contour, and Hu moment of the contour.

[0079] For each identified major contour (typically corresponding to the main pattern of the characters J, Q, and K, as well as any possible anomalous dark area contours), perform the following operations: Contour length calculation: For a contour consisting of N ordered points, the perimeter (length) of the contour is obtained by calculating and summing the Euclidean distances between adjacent points. This represents the total extension of the contour boundary.

[0080] Contour area calculation: The contour area is obtained by using a polygon area formula (such as the Shoelace formula) or by directly counting the number of pixels enclosed within the closed contour. This reflects the size of the area covered by the contour.

[0081] Calculating the aspect ratio of the minimum bounding rectangle: First, determine the smallest rectangle (rotated rectangle) that can completely enclose the outline, with its direction aligned with the principal axis of the outline. Then, obtain the lengths of the long and short sides of this rectangle. Finally, calculate the aspect ratio (usually long side / short side). This ratio describes how "long and thin" or "wide and flat" the overall shape of the outline is.

[0082] Hu moment calculation: First, based on the pixel coordinates of the contour, calculate its second and third central moments. Then, using these central moments, 7 Hu invariant moments (I1 to I7) are derived. The mathematical properties of this set of moments make them highly invariant to the translation, rotation, and scaling of the image, and can effectively describe the global shape features of the contour, such as extensibility, skewness, and complexity.

[0083] From the geometric features of the multiple contours calculated above, select the feature value of a core contour (such as the contour with the largest area, which usually corresponds to the main pattern), or weight / combine the features of multiple contours. Arrange the selected feature values ​​(e.g., [contour length L, contour area A, aspect ratio R, Hu moments I1, I2, ..., I7]) in a predetermined order to form a one-dimensional numerical array. This array is the "edge contour feature vector" that represents the overall shape of the current target image.

[0084] This step compresses complex visual contour information into a compact set of values, greatly reducing the amount of data while retaining key information for distinguishing normal and abnormal shapes, laying the foundation for efficient similarity calculation.

[0085] By combining geometric features with different characteristics, a comprehensive "portrait" of the contour is achieved. Length and area directly reflect changes in physical dimensions (bending may cause additional shadow contours, increasing the total area); aspect ratio is sensitive to the proportional imbalance of the overall shape (bending may cause local stretching or compression of the pattern, changing the proportion of the circumscribed rectangle); Hu moments deeply capture the distortion of the global shape (non-pattern contours introduced by bending will destroy the rectangular features of the original shape). This combination of multiple features makes the descriptive ability stronger and the fault tolerance higher.

[0086] This method exhibits a strong ability to detect anomalies in the center of playing cards. The contour feature vector of a flat face card is stable. When the card is bent in the middle, the bent shadow in the binarized image forms an additional black area that is either connected to or independent of the original pattern contour. After edge extraction, this anomalous area can generate a new contour or cause severe deformation of the main contour. This directly leads to a significant increase in the total length and area of ​​the extracted contours, and the shape and orientation of the minimum bounding rectangle may change. More importantly, the Hu moment value, which represents the essence of the overall shape, will shift significantly. Therefore, the final edge contour feature vector will have a measurable difference from the standard vector.

[0087] S600, obtain the similarity γ between the edge contour feature vector corresponding to the target image and the standard feature vector corresponding to the preset target character.

[0088] In this embodiment, the system pre-stores a "standard feature vector library". Based on the "target character" (e.g., "Q") parsed in step S200, the "standard feature vector" corresponding to the character is retrieved from the library, denoted as V_std=[s1,s2,...,sn]. This standard vector is obtained by collecting a large number of known normal playing card samples with the same character, and performing statistical analysis (e.g., taking the mean of each dimension) on the feature vectors of all samples after executing steps S400-S500. It represents the ideal shape characteristics of the character card in a normal state.

[0089] Because the dimensions and numerical ranges of different dimensions in the feature vectors vary greatly (for example, the contour area may be thousands of pixels, while the Hu moment may be close to 0), directly calculating the similarity will lead to the feature with the larger value dominating the result. Therefore, it is usually necessary to normalize the edge contour feature vector and the standard feature vector before performing the calculation. The standard vector can be normalized using the standard deviation and mean of the corresponding feature values ​​in the pre-stored standard vector, or both can be normalized to the [0,1] interval. The similarity γ can be calculated using the cosine similarity calculation method.

[0090] This step transforms the abstract question of "does the shape look like it?" into a precise, quantifiable mathematical comparison, representing a successful application of supervised pattern recognition in quality inspection. It eliminates the subjectivity and ambiguity of manual visual inspection or simple rule-based judgment. The γ value calculated through the mathematical model is an objective indicator, ensuring complete consistency in detection results under identical conditions.

[0091] S700, if γ>λ, then the target paper sheet is determined to be normal; otherwise, the paper sheet is determined to be abnormal; λ is a preset similarity threshold.

[0092] If γ > λ: it is judged as "normal". This indicates that the similarity between the outline feature vector of the playing card to be detected and the standard vector is higher than the minimum allowable standard, and its shape has not undergone distortion beyond the tolerance.

[0093] If γ≤λ: it is judged as "abnormal". This indicates that the similarity of the outline features of the playing card to be detected has fallen below the acceptable threshold, and its shape has changed significantly.

[0094] Furthermore, the preset similarity threshold λ is determined through the following steps: S710: Obtain several normal paper-like items corresponding to the target character as samples, and perform S200 to S500 on each sample to obtain the set of edge contour feature vectors corresponding to each sample.

[0095] For each target character (e.g., each of J, Q, K), collect a sufficient number (e.g., several hundred) of playing cards that have been verified to be absolutely normal by hand or high-precision equipment as calibration samples. These samples should cover normal printing variations, permissible differences in paper texture, and slight noise inherent in the imaging system.

[0096] Each normal sample is treated as a "target paper-like object," and it sequentially passes through the complete S200 to S500 process. That is, for each sample, image acquisition (S100), character parsing (S200) are performed, and the detection path for the second type of character is executed: grayscale conversion is performed, the background region is determined, the average grayscale value ρ is calculated, adaptive binarization is performed based on ρ, edge contours are extracted, and finally its geometric features are extracted to obtain the unique edge contour feature vector of the sample.

[0097] This step establishes the data foundation for threshold calibration. By collecting a large number of normal samples, this method does not define an ideal "absolute standard," but rather depicts the natural distribution range of "normal states" in the feature space. This acknowledges the reasonable fluctuations that inevitably exist in the production process (such as slight differences in ink density and paper whiteness), making the final threshold more inclusive and realistic.

[0098] This process is executed independently for each character (J, Q, K), generating its own set of feature vectors. This fully considers the inherent differences in shape complexity and outline detail among different patterns (Knight, Queen, King), avoiding the problem of uneven sensitivity in detecting different characters using a single threshold, and ensuring the consistency of the system's detection of various types of cards.

[0099] S720, calculate the similarity between each edge contour feature vector in the edge contour feature vector set and the standard feature vector to obtain a similarity value sequence.

[0100] Using the same similarity calculation algorithm as step S600 (such as cosine similarity), the similarity between the feature vector of each sample in the set and the above standard feature vector is calculated sequentially to obtain a similarity value sequence.

[0101] S730, based on the statistical distribution of the similarity value sequence, a lower limit value is determined and set as the preset similarity threshold λ.

[0102] Perform statistical analysis on the similarity value sequence generated in step S720. Calculate the mean (μ) and standard deviation (σ) of the sequence, and observe its distribution pattern (through histogram or probability plot).

[0103] Based on the statistical analysis results, a robust statistical rule is used to determine the "lower limit". The threshold λ is set to a low percentile of the normal sample similarity distribution. For example, it can be set to the mean minus a certain number of standard deviations (λ=μ-k×σ, where k is selected according to the required confidence level, such as k=2 or 3), or more directly, the 5th percentile or the 1st percentile of the sequence.

[0104] The 5th percentile means that 95% of normal samples have a similarity γ higher than this value.

[0105] In this step, by setting λ to the lower limit of the normal distribution (such as the 5th percentile), the false alarm rate of the control system can be statistically determined. For example, using the 5th percentile as λ, theoretically, in long-term operation, the system is expected to control the probability of incorrectly rejecting normal cards (false alarms) to around 5%.

[0106] Since λ is a lower bound based on normal samples, any sample whose similarity falls below this lower bound has significantly deviated from the normal statistical distribution range in terms of shape characteristics, and is therefore judged as an anomaly with a high degree of confidence. This effectively ensures the ability to capture real anomalies (such as bending).

[0107] Furthermore, following step S700, the following steps are also included: S800, if the target paper sheet is abnormal and λ-Δ<γ≤λ, control the image acquisition device to perform at least one re-imaging of the current target paper sheet under different lighting conditions than during the initial acquisition, and obtain at least one verification image; where Δ is a preset tolerance threshold.

[0108] While making an anomaly judgment in step S700, the system simultaneously checks whether the judgment criterion—similarity γ—satisfies a specific boundary condition: λ - Δ < γ ≤ λ. Here, λ is the main judgment threshold, and Δ is a preset, small positive tolerance threshold (e.g., Δ = 0.02). This condition defines a "suspicion interval" immediately below the pass / fail line.

[0109] If the triggering conditions are met, the system determines that the item is in a "suspected abnormal" state and requires further verification. The processor immediately sends an instruction to the control system: Item positioning: Ensure that the item being inspected pauses briefly or passes slowly through a dedicated verification imaging station on the conveyor.

[0110] Illumination switching: Controls the light source system to switch to one or more illumination modes with different spectral compositions or incident angles than those used during initial acquisition. For example, switching from initial frontal vertical diffused light to low-angle grazing light or side light of a specific wavelength. Illumination parameters (such as intensity and angle) have predefined settings that differ from the main detection mode.

[0111] Image acquisition: Under new lighting conditions, control the image acquisition device to take at least one quick picture of the same target object to obtain one or more "verification images".

[0112] By defining the "suspicion interval" by Δ, the system can automatically identify boundary cases where the γ value is slightly lower than λ due to accidental factors (such as instantaneous reflection, tiny dust particles, and imaging noise) rather than actual defects. This avoids unnecessary verification of all abnormal items, balancing efficiency and accuracy.

[0113] Many real physical defects (such as bends and indentations) and temporary imaging interferences (such as reflections) exhibit drastically different behaviors under different lighting conditions. For example, a genuinely bent card will show more pronounced shadow contrast and more distorted outline features at the bend under low-angle side lighting. A temporary specular reflection may disappear completely after changing the lighting angle. By acquiring this complementary imaging information, the system provides crucial evidence for subsequent verification to distinguish between real defects and temporary interferences.

[0114] S810, perform steps S200 to S600 for each verification image to obtain the verification similarity corresponding to each verification image.

[0115] By performing a complete analysis of the images acquired independently, the possibility of misjudgment due to accidental defects in a single imaging session (such as a single speck of dust falling on a critical location) was completely eliminated.

[0116] Multiple re-imaging and independent analysis generated multiple similarity data points observed from different "viewpoints" (lighting conditions), providing a rich and comprehensive basis for the next step of statistical final judgment, rather than relying on a single point of data.

[0117] S820, if the average of all verified similarities is greater than λ, then the target paper sheet is determined to be normal; otherwise, the target paper sheet is determined to be abnormal.

[0118] If the average of all verified similarities is greater than λ, it indicates that the overall shape characteristics of the item have returned to the normal range under multiple (at least one different) lighting conditions. Therefore, the system overturns the initial "abnormal" judgment made in step S700 and ultimately determines that the target paper sheet-like item is "normal". Otherwise, it indicates that even after changing the imaging conditions, the shape characteristics of the item continue to exhibit abnormalities. Therefore, the system maintains the initial "abnormal" judgment.

[0119] The above steps have at least the following beneficial effects: Significantly reduces false positives (misjudging good products): Many boundary misjudgments caused by momentary interference are corrected by the average similarity of the verification images. For example, a perfectly normal card might be initially judged as abnormal due to a temporary reflection causing γ=0.918 (assuming λ=0.92, Δ=0.02). However, after re-image formation, the reflection disappears, and the γ' values ​​for the two verifications are 0.985 and 0.983 respectively. The average similarity γ'_avg=0.984>λ, thus correctly reverting it to normal. This directly improves the pass rate of qualified products and reduces waste.

[0120] Confirming "true positives" (identifying defective items): For genuine bent cards, their outlines will be distorted under any lighting conditions. Therefore, their verification similarity is usually still very low, and γ'_avg will consistently be lower than λ, thus confirming an anomaly. This strengthens the system's ability to capture real defects.

[0121] Enhancing system reliability and trustworthiness: This review mechanism enables the system to exhibit "prudent" characteristics similar to human quality inspectors: for uncertain situations, it will examine the situation from multiple angles before drawing conclusions. This significantly improves the reliability of the entire sorting system's decisions and users' trust in the automated results.

[0122] Furthermore, although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.

[0123] While specific embodiments of the invention have been described in detail by way of examples, those skilled in the art should understand that the examples are for illustrative purposes only and are not intended to limit the scope of the invention. Those skilled in the art should also understand that various modifications can be made to the embodiments without departing from the scope and spirit of the invention.

Claims

1. An intelligent sorting system for paper sheet-like items, characterized in that, The system includes: a paper sheet conveying device, an image acquisition device, and a processor; wherein, the paper sheet conveying device is used to convey paper sheet items, the image acquisition device is used to acquire images of the paper sheet items, and the processor is used to perform the following steps: S100, acquire the target image corresponding to the target paper sheet-like item through the image acquisition device; the target paper sheet-like item can be any paper sheet-like item; S200, parse the target image to obtain the target characters in the target image; S300, if the target character is a first preset type character, then determine whether the target paper sheet is abnormal based on the grayscale uniformity of the area outside the character area and the pattern area in the target image; S400, if the target character is a second preset type character, then the edge contour is extracted from the target image to obtain the edge contour image corresponding to the character and the pattern; S500 performs feature extraction on the edge contour image to obtain the edge contour feature vector corresponding to the target image; S600, obtain the similarity γ between the edge contour feature vector corresponding to the target image and the standard feature vector corresponding to the preset target character; S700, if γ>λ, then the target paper sheet is determined to be normal; otherwise, the paper sheet is determined to be abnormal; λ is a preset similarity threshold.

2. The intelligent sorting system for paper sheet items according to claim 1, characterized in that, Step S300 includes the following steps: S310, detect the character region and pattern region in the target image, and generate masks corresponding to the character region and pattern region; S320, perform grayscale conversion on the target image to obtain a target grayscale image corresponding to the target image; S330, obtain the gray level uniformity η of the region outside the mask in the target gray level image; S340, if η < τ, then the target paper sheet is determined to be abnormal; otherwise, the target paper sheet is determined to be normal; τ is a preset grayscale uniformity threshold.

3. The intelligent sorting system for paper sheet items according to claim 1, characterized in that, Step S400 includes the following steps: S410, perform grayscale conversion on the target image to obtain a target grayscale image corresponding to the target image; S420, Based on the target grayscale image, determine the target region corresponding to the target image; wherein, the target region is the region outside the characters and patterns in the target image; S430, obtain the average gray value ρ corresponding to the target area; S440, according to ρ, perform binarization processing on the target grayscale image to obtain the target binarized image; S450 extracts the edge contours of the target binarized image to obtain the edge contour image corresponding to the target image.

4. The intelligent sorting system for paper sheet items according to claim 3, characterized in that, Step S440 includes the following steps: S441, for any pixel RE in the target grayscale image, obtain the grayscale value RZ corresponding to RE; S442, if RZ≥α×ρ, then set the gray value corresponding to RE to 255; otherwise, set the gray value corresponding to RE to 0; α is a preset adjustment coefficient; 0<α<1.

5. The intelligent sorting system for paper sheet items according to claim 1, characterized in that, The paper-like item is a playing card; the first preset type of character includes A and 2 to 10; the second preset type of character includes J, Q and K.

6. The intelligent sorting system for paper sheet items according to claim 1, characterized in that, Step S500 includes the following steps: S510, extract the geometric features of the character contour and pattern contour in the edge contour map to form the edge contour feature vector; wherein, the geometric features include at least one of contour length, contour area, aspect ratio of the minimum bounding rectangle of the contour, and Hu moment of the contour.

7. The intelligent sorting system for paper sheet items according to claim 2, characterized in that, Step S330 includes the following steps: S331, in the target grayscale image, the area outside the mask is determined as the area to be evaluated; S332, Calculate the grayscale gradient magnitude of each pixel in the region to be evaluated; S333, obtain the number of pixels NUM1 in the region to be evaluated whose gray-level gradient magnitude is greater than the preset gradient threshold; S334, based on the total number of pixels NUM and NUM1 in the region to be evaluated, determine the grayscale uniformity η = NUM1 / NUM.

8. The intelligent sorting system for paper sheet items according to claim 1, characterized in that, The preset similarity threshold λ is determined through the following steps: S710: Obtain several normal paper-like items corresponding to the target character as samples, and perform S200 to S500 on each sample to obtain the set of edge contour feature vectors corresponding to each sample. S720, calculate the similarity between each edge contour feature vector in the edge contour feature vector set and the standard feature vector to obtain a similarity value sequence; S730, based on the statistical distribution of the similarity value sequence, a lower limit value is determined and set as the preset similarity threshold λ.

9. The intelligent sorting system for paper sheet items according to claim 1, characterized in that, Following step S700, the following steps are also included: S800, if the target paper sheet is abnormal and λ-Δ<γ≤λ, control the image acquisition device to perform at least one re-imaging of the current target paper sheet under different lighting conditions than during the initial acquisition, and obtain at least one verification image; where Δ is a preset tolerance threshold. S810, Perform steps S200 to S600 for each verification image to obtain the verification similarity corresponding to each verification image; S820, if the average of all verified similarities is greater than λ, then the target paper sheet is determined to be normal; otherwise, the target paper sheet is determined to be abnormal.