Game card surface defect visual detection method and system

By employing multi-angle illumination and phase demodulation processing, the accuracy and reliability issues of surface defect detection for game cards have been resolved. This enables comprehensive capture of detailed information on the card surface and accurate identification of defects, thereby improving the accuracy and reliability of the detection.

CN121962061APending Publication Date: 2026-05-01SUZHOU HOPS CULTURAL & CREATIVE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SUZHOU HOPS CULTURAL & CREATIVE CO LTD
Filing Date
2026-01-15
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

In existing technologies, methods for detecting surface defects on game cards cannot fully display detailed features under different angles of illumination, making it difficult to accurately extract microscopic texture features, resulting in low detection accuracy and reliability.

Method used

By controlling light sources from multiple directions to illuminate sequentially, image sequences of the card surface under different angles of illumination are collected to construct a multi-angle illumination image sequence. The phase field distribution of micro-texture is generated through phase demodulation processing. Defect areas are identified by combining singularity intensity values ​​and topological surround characteristics. Finally, a judgment is made by combining geometric features and phase anomaly features.

Benefits of technology

It improves the accuracy and reliability of surface defect detection for game cards, can capture more comprehensive detailed information, reduce false detections and missed detections, enhance the ability to identify defects, and can accurately classify and quantify defect types and severity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121962061A_ABST
    Figure CN121962061A_ABST
Patent Text Reader

Abstract

The invention relates to the field of visual detection, and discloses a game card surface defect visual detection method and system, which are used for effectively improving the accuracy of game card surface defect detection. Comprising the following steps: controlling a multi-directional light source to illuminate in sequence, acquiring an image sequence to construct a multi-angle illumination image set, performing phase demodulation and the like to generate phase field distribution, further constructing a phase singular point intensity diagram, identifying a defect candidate area according to singular point density distribution and topological surrounding characteristics, and determining a boundary. And geometric features and phase anomaly features of the defect candidate region are extracted, and the defect type and severity are judged in combination with a preset rule. According to the method, through multi-angle illumination and comprehensive feature analysis, the problems of single illumination, inaccurate feature extraction and the like of a traditional detection method are effectively solved, and the accuracy and reliability of detection are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of visual inspection, and more particularly to a method and system for visual inspection of surface defects on game cards. Background Technology

[0002] In the field of game card manufacturing, the surface quality of cards directly affects the product's aesthetics, collectible value, and market competitiveness. As consumers' demands for card quality increase, accurate detection of surface defects has become a crucial step in the production process. A wide variety of defects can occur on card surfaces, including but not limited to scratches, stains, unevenness, and abnormal textures. These defects not only reduce the card's visual appeal but may also affect its physical properties and lifespan.

[0003] With the continuous development of computer vision and image processing technologies, defect detection methods based on machine vision have gradually become a research hotspot.

[0004] Shortcomings of existing technology: Traditional machine vision inspection methods often use a single-direction light source for illumination, and the acquired images cannot fully display the detailed features of the card surface under different angles of illumination. For some card surfaces with complex textures or minor defects, it is difficult to obtain comprehensive and accurate information, thus affecting the accuracy of defect detection. In the image processing process, the existing technology for extracting micro-texture features on the surface of cards is not perfect enough. It cannot effectively preserve the real texture information and suppress random noise interference. As a result, in the subsequent defect identification stage, it is difficult to accurately distinguish between normal texture changes and real defects, which increases the risk of false detection and false detection. Some existing technologies rely solely on simple image features or geometric parameters for defect identification, failing to fully consider the diverse features of defects and lacking analysis of comprehensive defect characteristics, resulting in low accuracy and reliability of defect identification.

[0005] Therefore, we propose a visual inspection method and system for surface defects of game cards to solve the above problems. Summary of the Invention

[0006] This invention provides a visual inspection method and system for game card surface defects, which can effectively improve the accuracy of game card surface defect detection.

[0007] The first aspect of this invention provides a visual detection method for surface defects on game cards, comprising: sequentially illuminating the card surface with light sources from multiple directions to acquire image sequences under illumination at different angles, thereby constructing a multi-angle illumination image sequence; performing phase demodulation processing on the multi-angle illumination image sequence to generate a phase field distribution of the micro-texture of the card surface; calculating the singularity intensity value at each pixel position based on the phase field distribution to construct a phase singularity intensity map; identifying candidate defect regions and determining defect boundaries based on the singularity density distribution and topological encirclement characteristics in the phase singularity intensity map; and making a final determination of the defect type and severity based on the geometric features and phase anomaly features of the candidate defect regions, combined with preset judgment rules.

[0008] Optionally, in a first implementation of the first aspect of the present invention, the method includes: extracting intensity information under illumination from the multi-angle illumination image sequence, calculating the sine and cosine components at each pixel position, and generating an orthogonal component map; performing initial phase angle calculation based on the orthogonal component map to obtain a wrapping phase map; performing phase unrolling processing on the wrapping phase map to eliminate phase jumps and generating a continuous phase distribution map; and performing phase noise filtering processing on the continuous phase distribution map to retain the real surface texture features while suppressing random noise interference, thereby obtaining the phase field distribution of the micro-texture on the card surface.

[0009] Optionally, in a second implementation of the first aspect of the present invention, the phase unrolling process of the wrapped phase map includes: calculating the phase reliability of each pixel based on the local phase gradient information of the wrapped phase map to generate a phase quality distribution map; determining the starting path for phase unrolling based on the phase quality distribution map, performing path tracking unrolling from high-quality regions to low-quality regions to generate an initial unrolled phase map; identifying and marking residual points in the initial unrolled phase map to establish a residual point location distribution map; constructing a branch cutting network based on the residual point location distribution map, forming an optimal cutting path by connecting residual points to generate phase unrolling constraints; and applying the phase unrolling constraints to correct the initial unrolled phase map, eliminating phase jump errors, and generating a final continuous phase distribution map.

[0010] Optionally, in a third implementation of the first aspect of the present invention, the method includes: constructing a circular closed path centered on each pixel position; calculating the cumulative phase change value of the phase field distribution along the closed path to generate an initial singularity intensity distribution; processing the initial singularity intensity distribution to convert the cumulative phase change value into a standardized singularity intensity value to generate a normalized singularity intensity map; performing local extremum detection and identification of candidate pixel positions based on the normalized singularity intensity map to generate a singularity candidate position map; merging adjacent singularity candidate pixels into a continuous region based on the singularity candidate position map to generate a singularity region distribution map; and performing fusion processing based on the singularity region distribution map and the normalized singularity intensity map to construct a phase singularity intensity map.

[0011] Optionally, in a fourth implementation of the first aspect of the present invention, the method includes: setting a sliding window on the phase singularity intensity map, calculating the singularity density value within each window region, and generating a singularity density distribution map; analyzing the gradient vector direction change of the phase field distribution, calculating the topological wrapping value of each local region, and generating a topological wrapping number distribution map; performing fusion analysis on the singularity density distribution map and the topological wrapping number distribution map to identify candidate defect regions that meet preset conditions and generate initial defect region markers; performing morphological optimization processing based on the initial defect region markers to eliminate isolated noise points and fill the internal holes of the regions, and generating a defect region mask; and extracting the contour boundary point set of each defect region based on the defect region mask to generate a defect boundary contour description.

[0012] Optionally, in a fifth implementation of the first aspect of the invention, the singularity density... , where N threshold A represents the number of pixels exceeding the threshold. window The area is the window area. The singularity density map and the topological wrap number map are fused to enhance defect features and suppress noise. A weighted feature value is calculated for each pixel. :

[0013] Where T is the number of topological wraps, and w1 and w2 are the weights.

[0014] Optionally, in the sixth implementation of the first aspect of the present invention, the step of fusing and analyzing the singularity density distribution map and the topological wrap number distribution map includes: establishing a correspondence mapping between the singularity density distribution map and the topological wrap number distribution map to generate a dual-feature correlation matrix; assigning feature weights to the dual-feature correlation matrix, determining the relative importance of singularity density and topological wrap number based on defect type features, and generating a feature weight allocation table; performing weighted fusion calculation on the singularity density distribution map and the topological wrap number distribution map based on the feature weight allocation table to generate an initial fused feature map; processing the initial fused feature map to generate an optimized fused feature map; and applying an adaptive threshold segmentation algorithm to the optimized fused feature map, automatically determining the segmentation threshold based on local feature intensity, and generating a binarized defect candidate region map.

[0015] Optionally, in the seventh implementation of the first aspect of the present invention, the method includes: extracting geometric feature parameters from the defect boundary contour description, including defect area, perimeter, aspect ratio, and contour complexity, to generate a defect geometric feature set; extracting phase anomaly features of the defect region from the phase field distribution, including phase abrupt change intensity, phase gradient direction, and phase continuity index, to generate a defect phase feature set; performing feature fusion based on the defect geometric feature set and the defect phase feature set to construct a comprehensive defect feature description vector; performing matching analysis between the comprehensive defect feature description vector and a preset defect judgment rule base, classifying defect types according to feature thresholds and logical conditions, and generating defect type classification results; and based on the defect type classification results, combining a defect severity assessment model to quantitatively assess the severity level of various defects and output a final defect judgment report.

[0016] Optionally, in the eighth implementation of the first aspect of the present invention, the method further includes: performing visualization rendering processing on the final defect judgment report, superimposing the defect location, type, and severity information onto the original card image to generate a visualized defect detection report; performing self-calibration of the detection system based on the visualized defect detection report, generating system calibration parameters by analyzing the false detection rate and false negative rate in historical detection data; and adaptively adjusting the light source parameters and camera settings during the multi-angle illumination image acquisition process according to the system calibration parameters to generate an optimized acquisition system configuration.

[0017] A second aspect of the present invention provides a visual inspection system for surface defects of game cards. The system includes: an image acquisition module for sequentially illuminating the card surface from multiple directions using light sources, acquiring image sequences of the card surface under different angles of illumination, and constructing a multi-angle illumination image sequence; a phase processing module for performing phase demodulation processing on the multi-angle illumination image sequence to generate a phase field distribution of the micro-texture of the card surface; a singularity analysis module for calculating the singularity intensity value at each pixel location based on the phase field distribution, and constructing a phase singularity intensity map; a feature extraction module for identifying candidate defect regions and determining defect boundaries based on the singularity density distribution and topological encirclement characteristics in the phase singularity intensity map; and a defect determination module for making a final determination of the defect type and severity based on the geometric features and phase anomaly features of the candidate defect regions, combined with preset determination rules.

[0018] The mechanism of this invention is as follows: by controlling multi-angle illumination to actively construct the phase field distribution of the card surface, the microscopic surface morphology and texture defects are transformed into accurately measurable phase information, and the physical optical response of the defects themselves is directly modeled and analyzed, resulting in complete and self-consistent defect characterization and identification. Beneficial effects: By controlling multiple light sources to illuminate sequentially and constructing a multi-angle lighting image sequence, it is possible to capture detailed information about the card surface under different lighting angles. This is especially true for cards with complex textures or minor defects, which can obtain more comprehensive features. The phase information of the micro-texture on the card surface is accurately extracted, effectively preserving the real texture features while suppressing random noise interference, avoiding false detection and missed detection caused by inaccurate texture feature extraction, and improving the reliability of detection. By constructing a circular closed path to calculate the cumulative value of phase change, abnormal changes in the micro-texture of the card surface can be reflected more accurately, effectively distinguishing normal texture changes from real defects, providing a more reliable basis for subsequent defect identification, and enhancing the detection system's ability to identify defects. Multi-feature fusion can comprehensively reflect the feature information of defects. When matching and analyzing with a preset rule base, it can more accurately classify defect types. Combined with the evaluation model, it can quantitatively evaluate the severity of defects, which greatly improves the accuracy and precision of defect detection. Attached Figure Description

[0019] Figure 1 This is a schematic diagram of an embodiment of the visual inspection method for surface defects of game cards in this invention; Figure 2 This is a schematic diagram of another embodiment of the visual inspection method for surface defects of game cards in this invention; Figure 3This is a schematic diagram of multi-angle lighting image acquisition of game cards in an embodiment of the present invention; Figure 4 This is a wrap-around phase diagram with periodic stripes in the embodiment; Figure 5 To eliminate the continuous phase distribution map after periodic jumps in the wrapped phase map using a phase unrolling algorithm; Figure 6 This is a phase singularity intensity map. The black background represents areas with gentle phase changes, while the highlighted white areas represent areas with high phase singularity intensity. Figure 7 A schematic diagram showing the process of extracting the binarized defect region and determining its boundary contour after thresholding and morphological processing of the phase singularity intensity map; Figure 8 This is a schematic diagram of one embodiment of the visual inspection system for surface defects of game cards in this invention; Figure 9 This is a schematic diagram of one embodiment of a visual inspection device for surface defects of game cards in this invention. Detailed Implementation

[0020] This invention provides a method and system for visually inspecting surface defects on game cards, effectively improving the accuracy of surface defect detection. The terms "first," "second," "third," "fourth," etc. (if applicable) in the specification, claims, and accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" or "having" and any variations thereof are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0021] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 One embodiment of the visual inspection method for surface defects of game cards in this invention includes: 101. By controlling light sources from multiple directions to illuminate sequentially, image sequences of the card surface under different angles of illumination are collected to construct a multi-angle illumination image sequence; It is understood that the executing entity of this invention can be a visual inspection system for surface defects of game cards, or it can be a terminal or a server; the specific implementation is not limited here. This embodiment of the invention will be described using a server as an example.

[0022] It should be noted that a ring lighting device consisting of eight strip LED light sources is used. The light sources are evenly distributed in a ring around the card, with adjacent light sources spaced 45 degrees apart, covering an all-around lighting angle from 0° to 360°. The incident angle of each light source has been precisely calibrated (0°, 45°, 90°, 135°, 180°, 225°, 270°, 315°) to ensure that light can be projected onto the card surface from different directions.

[0023] When the system is working, the programmable logic controller (PLC) triggers each light source sequentially according to a preset timing sequence: only one light source is lit at a time, and it remains lit for 80 milliseconds; 20 milliseconds after lighting (waiting for the light source to stabilize), the 5-megapixel industrial CMOS camera is triggered to perform exposure acquisition, with the exposure time set to 10 milliseconds. The complete "light-up-acquisition" cycle for a single light source is 100 milliseconds, and the total time to complete acquisition from all eight angles is approximately 0.8 seconds.

[0024] During the acquisition process, the cards are fixed in place by a vacuum adsorption platform to ensure no displacement during shooting. The camera lens axis remains perpendicular to the card surface, with a working distance of 200 mm, covering the entire 90 mm × 60 mm card area, and achieving an image resolution of 0.03 mm per pixel.

[0025] Light source parameters: Each LED light source has a color temperature of 5500K (simulating sunlight) and a color rendering index (CRI) greater than 90 to ensure accurate color reproduction. The light source brightness is uniformly calibrated to 800 lux (card surface illuminance) via PWM dimming to reduce the impact of brightness fluctuations on the consistency of the image sequence. Synchronization control: The controller synchronizes light source switching and camera triggering via encoder signals to avoid image blurring or lighting misalignment due to timing deviations. Each image embeds angle-encoded metadata (Light_Angle_45) for easy association with the lighting direction later. Image sequence construction: Eight images of the same card under different lighting directions are obtained and stored as an image sequence, numbered sequentially by angle. The image sequence must meet pixel-level alignment requirements; no further registration is required.

[0026] 102. Perform phase demodulation processing on multi-angle illumination image sequences to generate the phase field distribution of the micro-texture on the card surface; It should be noted that in the detection of surface defects on game cards, the purpose of phase demodulation is to convert multi-angle illumination image sequences into the phase field distribution of the micro-texture on the card surface, thereby highlighting minor defects such as scratches, dents, or bumps. Data Input: The input consists of a sequence of card images acquired from eight light source angles (0°, 45°, 90°, 135°, 180°, 225°, 270°, 315°). Each image has a resolution of 5 megapixels (2448×2048), and the surface illuminance of the cards is uniformly calibrated to 800 lux. Preprocessing: First, the image sequence is converted to grayscale, and the SIFT feature matching algorithm is used to perform sub-pixel-level registration on all images to ensure that the physical points of the same card are aligned in all images (registration error less than 0.1 pixels). Subsequently, the brightness variation curve of each pixel under different lighting directions is extracted to form an eight-point illumination intensity sequence.

[0027] Phase-shifting method application: Since the eight light source angles are evenly distributed, they can be divided into two groups of four-step phase-shifting sequences (0°, 90°, 180°, 270° in one group, and 45°, 135°, 225°, 315° in the other group). The phase difference between each group of sequences is 90°, which meets the requirements of the four-step phase-shifting method. Phase demodulation formula: For each pixel, its brightness value (i.e., the intensity value under the four light source angles) in the four-step phase-shifting sequence is substituted into the phase demodulation calculation. Specifically, the wrapping phase (phase principal value) of each pixel is calculated using the four-step phase-shifting method, and its value range is [-π, π]. This step uses the natural alternation of light source directions to simulate the phase-shifting projection in structured light, without the need for additional projection of the coded pattern. Output result: Finally, a wrapping phase map of the card surface is generated, with the image size consistent with the input (2448×2048 pixels), and each pixel value represents the phase principal value at that position (unit: radians). In the phase diagram, the phase distribution in the background area of ​​the card is uniform, while microscopic defects (scratches with a depth of about 0.01 mm) can cause abrupt phase changes, forming local phase gradient anomalies.

[0028] Accuracy Guarantee: Phase demodulation resolution reaches 0.001 radians, capable of detecting texture changes as small as 5 micrometers. Anti-interference Design: To reduce ambient light noise, all external light sources are turned off during acquisition, and median filtering is used to smooth the phase image, suppressing random noise. Efficiency Optimization: This step processes a single card in approximately 0.2 seconds (including image loading, registration, and phase calculation), suitable for the real-time requirements of industrial online inspection.

[0029] Through the above processing, the micro-texture of the card surface is converted into a high-precision phase field distribution. Phase anomalies in defective regions of the phase field usually manifest as drastic gradient changes or phase discontinuities. Scratches disrupt the smoothness of the phase, while pits may cause phase ring distortion.

[0030] 103. Based on the phase field distribution, calculate the singularity intensity value at each pixel location through closed path integration, and construct a phase singularity intensity map; It should be noted that, based on the aforementioned steps (the phase map of the card surface has been generated through phase demodulation), the singularity intensity value at each pixel location is calculated using the closed path integration method: Input data: The input is a phase map of the card surface (generated by a four-step phase-shifting method using an eight-angle lighting sequence), with an image resolution of 2448×2048 pixels and a phase range of [-π,π] (unit: radians). In the phase map, normal texture areas show smooth phase changes, while defective areas (scratches with a depth of 0.01 mm) cause phase jumps. Preprocessing: First, the phase map is Gaussian filtered (kernel size 3×3, standard deviation 0.5 pixels) to suppress random noise; then, the phase gradient field is calculated to obtain the phase partial derivatives of each pixel in the x and y directions (used for subsequent path integration).

[0031] Integral Path Design: Construct a square closed path with a side length of 8 pixels centered on each pixel (total path perimeter 32 pixels). The offset of the path vertex coordinates relative to the center pixel is (±4, ±4) pixels, ensuring that the path covers a local area of ​​approximately 64 square pixels. Singularity Intensity Value Calculation: For each pixel, perform a loop integration of the phase gradient along the closed path. Specifically, discretize the path into 32 equally spaced points, and calculate the sum of the dot products of the phase gradient vector and the path tangent at each point. After normalizing the integration result, obtain the singularity intensity value (scalar, dimensionless) of that pixel. The physical meaning of the calculation formula is: the cumulative change of phase along the closed path. If there are no singularities in the path, the integral value is close to zero; if phase vortices (phase jumps caused by defects) are included, the integral value increases significantly. Output Mapping: After traversing all pixels, generate a phase singularity intensity map with the same resolution as the phase map. Each pixel value in the image represents the singularity intensity at that location (value range 0~1.5). Defective areas will exhibit high intensity values ​​due to phase abrupt changes (the intensity at scratches can reach above 0.8, while normal areas are generally below 0.1).

[0032] Sensitivity Control: A path radius of 4 pixels ensures detection accuracy while avoiding noise interference. A smaller radius (2 pixels) is sensitive to minute defects but susceptible to noise; a larger radius (10 pixels) may smooth out minor defects. Efficiency Optimization: Parallel computation is used to process the integrals of different pixel regions, with a single card processing time of approximately 0.15 seconds, meeting online detection requirements. Defect Response Characteristics: Experiments show that scratches deeper than 5 micrometers have an average intensity value exceeding 0.5 in the singularity intensity map, while pit defects, due to annular phase distortion, exhibit high-intensity clusters (local values ​​≥ 1.0).

[0033] 104. Analyze the singularity density distribution and topological encirclement characteristics in the phase singularity intensity map to identify candidate defect regions and determine defect boundaries; It should be noted that in the surface defect detection of game cards, the phase singularity intensity map has already been obtained through closed path integration (output of the previous step). The goal of this step is to analyze the spatial distribution and topological features of the singularities in this map, accurately locate the defect region, and delineate its boundaries: Input data: Phase singularity intensity map (resolution 2448×2048 pixels), where each pixel value represents the singularity intensity (range 0~1.5, dimensionless). Normal areas generally have intensity values ​​below 0.1, while defective areas (scratches, dents) can reach intensities above 0.5. Density map generation: Local singularity density is calculated using a sliding window statistical method. The window size is set to 32×32 pixels (corresponding to a physical area of ​​approximately 0.96mm×0.96mm on the card surface), with a step size of 8 pixels. For each window, the proportion of pixels with singularity intensities exceeding the threshold of 0.35 is statistically analyzed to generate a singularity density distribution map. Density values ​​are normalized to the range of 0~1. Defective areas typically have densities above 0.6 due to singularity aggregation, while normal areas have densities below 0.2. Preliminary candidate region extraction: Adaptive threshold segmentation (threshold set to 0.5) is applied to the density map to filter out high-density connected regions as defect candidate regions. Scratches deeper than 5 micrometers will form strip-shaped high-density bands with density values ​​above 0.7.

[0034] Singularity Polarity Analysis: For each candidate region, the topological encirclement characteristics of the singularities are examined. Phase singularities have polarity (positive or negative), determined by the sign of the closed path integral in the phase field. Singularities in normal textures are randomly and uniformly distributed, while defective regions (pits) cause pairs of singularities with opposite polarities to appear, forming topological defect pairs. Encirclement Path Detection: A circular analysis path with a radius of 16 pixels is constructed centered on the candidate region, and the cumulative change in phase gradient along the path is statistically analyzed. If the polarity distribution of singularities within the path is asymmetrical (the ratio of positive to negative singularities deviates from 1:1 by more than 20%), or if phase singularities exist (continuous anomalous bands formed by the intersection or tangency of zero-value lines), then it is confirmed as a real defect. Pits will induce ring-shaped singularities, with phase jumps of up to π radians on both sides.

[0035] Boundary Optimization: Based on the topological characteristic verification results, the boundaries of candidate regions are refined. Morphological closing operations (kernel size 3×3 pixels) are used to fill boundary holes, and then Canny edge detection combined with singularity density gradient (gradient threshold 0.15 / pixel) is used to determine the final defect boundary. The boundary width of a slight scratch can be accurate to 3 pixels (approximately 0.09 mm). False Positive Rejection: If the candidate region has a high singularity density but weak topological wrapping characteristics (polarity ratio close to 1:1, and no singular lines), it is judged as a false defect (printing texture interference) and rejected. Experimental data show that this method can reduce the false positive rate by approximately 30%.

[0036] Sensitivity settings: The sliding window size needs to balance detection accuracy and noise tolerance—a window that is too small (16×16 pixels) is easily affected by random noise, while a window that is too large (64×64 pixels) may smooth out the boundaries of subtle defects. Output results: A binary mask image of the defect region is generated (resolution same as the input), and the coordinates of the defect boundaries are marked. The topological feature parameters (mean singularity density, polarity asymmetry index) of each defect region are also recorded for subsequent classification. By combining the singularity density and topological encirclement criteria, this method can effectively distinguish between real defects and noise, improving boundary positioning accuracy. For scratches with a depth of 0.01 mm, the boundary positioning error can be controlled within ±2 pixels.

[0037] 105. Based on the geometric features and phase anomaly features of the defect area, and in conjunction with preset judgment rules, make a final judgment on the defect type and severity; It should be noted that after identifying and delineating the boundaries of the candidate defect regions, this step requires a final determination of the defect type (scratches, pits, bumps) and severity (minor, moderate, severe) based on the geometric features and phase anomaly features of the defect regions, combined with preset rules. Input data: Binary mask image of the defect candidate region (with defect boundaries marked), phase singularity intensity map (singularity intensity value 0~1.5), and phase field distribution map (phase value range [-π,π]). Geometric feature extraction: For each defect region, calculate the following geometric parameters: Area: Total number of pixels in the defect region (scratch area is usually less than 0.5mm). 2 The area of ​​the pit may be 1~3mm. 2 Aspect Ratio: The ratio of the longer side to the shorter side of the smallest bounding rectangle of the defect (the aspect ratio of scratches is usually greater than 5:1, while that of pits / protrusions is close to 1:1). Boundary Irregularity: The ratio of the perimeter of the defect to the circumference of a circle of equal area (the boundary of scratches is relatively regular, with a ratio close to 1.2; pits may reach more than 1.5 due to ring distortion).

[0038] Phase anomaly feature extraction: Average singularity intensity: the mean of singularity intensity within the defect area (normal area <0.1, scratches approximately 0.3~0.6, pits / protrusions may >0.8).

[0039] Phase gradient extrema: The maximum phase change rate at the defect boundary (a pit causes a phase jump exceeding π radians / mm). Topological polarity distribution: The ratio of positive to negative singularities within the defect region (the polarity distribution of scratches is random, while pits often show positive and negative pairs clustered together).

[0040] Based on the historical defect sample library (containing thousands of labeled scratches, dents, and bumps), the following judgment rules are set, and some key thresholds are shown in Table 1 below: Table 1

[0041] Type determination logic: If the aspect ratio is >5 and the singularity intensity is <0.6, it is determined to be a scratch; if the aspect ratio is close to 1 and the singularity intensity is >0.8, combined with the characteristic of paired positive and negative singularities, it is determined to be a pit; if the phase gradient is extremely high and the boundary is regular, it is determined to be a protrusion. False positive rejection: If the area is <0.05mm... 2 If the average singularity intensity is <0.2, it is considered noise interference and the defect category is excluded.

[0042] Severity quantification: Scratches are graded according to area (0.1mm). 2 Slight, 0.5mm 2 (Severe); the depth / height of pits / protrusions is calculated using a phase field depth inversion model (a phase change of 0.1 radians corresponds to a depth of approximately 0.005 mm).

[0043] Output: Generates a defect report table, including the type, severity, location coordinates, and characteristic parameters of each defect: Defect No. 001: Type = Scratch, Severity = Moderate, Area = 0.4mm 2 Singularity intensity = 0.45. Defect number 002: Type = pit, Severity = severe, Area = 1.2mm 2 Depth = 0.035mm. Real-time guarantee: The time for judging all defects on a single card is less than 0.1 seconds, meeting the efficiency requirements of online inspection. Through the above rules, the system can accurately distinguish the defect type and quantify the severity, providing a basis for card quality grading (qualified / substandard / scrap).

[0044] In this embodiment of the invention, when acquiring multi-angle illumination image sequences, all external light sources are turned off to reduce the impact of ambient light noise on the images. After phase demodulation processing, median filtering is used to smooth the phase map, further suppressing random noise and ensuring that the detection results are not affected by external environmental factors, thereby improving the stability and reliability of the detection. In the step of calculating the singularity intensity value through closed path integration, parallel computing is used to process the integrals of different pixel regions, accelerating the processing speed and further improving the overall detection efficiency to meet the needs of rapid detection in large-scale industrial production. Judgment rules are set based on a historical defect sample library (containing thousands of labeled scratches, dents, and bumps), making the rules scientific and reasonable. This allows for accurate differentiation of different types of defects and quantification of their severity, providing an accurate basis for card quality grading (qualified / substandard / scrap), which helps improve product quality and production management.

[0045] Please see Figures 2-7 Another embodiment of the visual inspection method for surface defects of game cards in this invention includes: 201. By controlling light sources from multiple directions to illuminate sequentially, image sequences of the card surface under different angles of illumination are collected to construct a multi-angle illumination image sequence; Specifically, at least four light sources from different directions are controlled to illuminate sequentially according to a preset time sequence. Each light source is illuminated simultaneously, triggering an image acquisition device to acquire the original image of the card surface under single-direction illumination. The acquired original image is then subjected to illumination intensity normalization processing to eliminate the influence of differences in the intensity of different light sources on image quality, generating a normalized illumination image. The normalized illumination image is then subjected to pixel-level registration and alignment to correct image shifts caused by minute displacements of the card during acquisition, resulting in a precisely registered multi-angle illumination image sequence. The registered multi-angle illumination image sequence is then arranged and combined according to the direction of the light sources to construct a complete phase demodulation input image set. Among them, the normalized illumination image is used to eliminate the influence of inconsistent light source intensity on subsequent phase calculation, and the accurately registered multi-angle illumination image sequence ensures the spatial consistency of images in each direction during phase demodulation.

[0046] It should be noted that the core is a lighting unit containing eight strip LED light sources. These light sources are evenly distributed on the horizontal plane (one every 45 degrees) with the card as the center, and cover an illumination angle of 0 to 90 degrees in the vertical direction to achieve multi-angle outlining of the surface micro-texture.

[0047] The key parameters of the system are configured as shown in Table 2 below: Table 2

[0048] After the system starts, the cards are precisely transported to the inspection station. Then, eight light sources are sequentially illuminated according to a preset time sequence, triggering the camera to capture eight images of the card under different lighting angles within 0.28 seconds. These raw images first undergo illumination intensity normalization to eliminate brightness unevenness caused by individual differences in the light sources. Next, an image registration algorithm corrects for micrometer-level displacement that may occur during continuous shooting, ensuring that the position of each pixel in the eight images strictly corresponds. Finally, a spatially consistent, illumination-standardized multi-angle illumination image sequence is generated, providing high-quality input for subsequent phase demodulation.

[0049] 202. Perform phase demodulation processing on multi-angle illumination image sequences to generate the phase field distribution of the micro-texture on the card surface; Specifically, intensity information under illumination from various directions is extracted from multi-angle illumination image sequences, and the sine and cosine components of each pixel are calculated to generate an orthogonal component map. Based on the orthogonal component map, initial phase angle calculation is performed to obtain a wrapping phase map, which reflects the initial phase distribution of the card's surface micro-texture. The wrapping phase map is then subjected to phase unrolling processing, and phase jumps are eliminated using a quality-guided path tracking method to generate a continuous phase distribution map. Finally, the continuous phase distribution map undergoes phase noise filtering to preserve realistic surface texture features while suppressing random noise interference, resulting in an optimized phase field distribution. Among them, the orthogonal component map serves as the direct input data for phase angle calculation, the wrapping phase map provides initial phase information of surface texture, and the continuous phase distribution map eliminates the influence of phase jump on subsequent analysis.

[0050] Furthermore, the wrapped phase map undergoes phase unwrapping processing, including: calculating the phase reliability of each pixel based on the local phase gradient information of the wrapped phase map to generate a phase quality distribution map; determining the starting path for phase unwrapping based on the phase quality distribution map, performing path tracking unwrapping from high-quality regions to low-quality regions to generate an initial unwrapped phase map; identifying and marking residual points in the initial unwrapped phase map to establish a residual point location distribution map; constructing a branch cutting network based on the residual point location distribution map, forming the optimal cutting path by connecting residual points, and generating phase unwrapping constraints; applying the phase unwrapping constraints to correct the initial unwrapped phase map, eliminating phase jump errors, and generating a final continuous phase distribution map; wherein, the phase quality distribution map is used to guide the path planning of phase unwrapping, the residual point location distribution map identifies key obstacle areas in the phase unwrapping process, and the phase unwrapping constraints ensure the mathematical consistency of phase unwrapping.

[0051] It should be noted that the object processed was a standard playing card (88mm × 63mm), whose surface may have micron-level scratches or dents. The system has acquired image sequences of the card under lighting from eight different directions (each image has a resolution of 20 megapixels) and completed illumination normalization and pixel-level registration.

[0052] The intensity variation signal of each pixel under different illumination directions was extracted from eight registered images. This signal approximates a sine curve. The sine and cosine components of each pixel were calculated using least-squares fitting. At pixel coordinates (500, 500), the calculated sine component value was 125.3, and the cosine component value was -87.6. The two orthogonal component maps (sine and cosine maps) generated at the end together constitute the input data for subsequent phase calculations.

[0053] Based on the generated orthogonal component map, the principal phase value of each pixel is calculated using the four-quadrant arctangent function. The calculated value ranges from -π to π radians. In areas suspected of having scratch defects, the phase value exhibits a sharp jump from -2.8 radians to 2.6 radians, which initially identifies discontinuities in the surface microtexture.

[0054] Because the wrapped phase map exhibits periodic jumps, phase unwrapping is necessary to obtain a continuous physical phase distribution. The specific process includes: Quality map generation: The reliability of each point is calculated based on the phase gradient of adjacent pixels in the wrapped phase map, generating a phase quality distribution map. High-quality regions (with gentle gradients) can achieve a reliability score above 0.95, while the reliability score at phase jump boundaries is below 0.3. Path tracing unwrapping: Starting from the most reliable region at the image center (score 0.98), path tracing is performed in descending order of quality, adding integer multiples of 2π to each pixel to eliminate jumps, generating an initial continuous phase map. Residual point correction: Residual points (i.e., points with non-zero phase integrals, typically defect cores) are identified and marked in the initial continuous phase map. A branching network is then constructed to connect these residual points, forming a constraint path for phase unwrapping. Based on these constraints, the initial unwrapping result is corrected to obtain a completely continuous phase distribution map.

[0055] The unfolded continuous phase map may contain random noise. This embodiment employs an anisotropic Gaussian filter for noise reduction, which effectively smooths noise (suppressing phase fluctuations from ±0.15 radians to within ±0.03 radians) while preserving realistic defect edge features (the steep phase step of scratches). Finally, an optimized high signal-to-noise ratio phase field distribution map is generated, clearly revealing microscopic texture variations and defects on the card surface at the 0.5-micrometer level.

[0056] 203. Based on the phase field distribution, calculate the singularity intensity value at each pixel location through closed path integration, and construct a phase singularity intensity map; Specifically, a circular closed path is constructed centered on each pixel location. The cumulative phase change value of the phase field distribution along the closed path is calculated to generate an initial singularity intensity distribution. The initial singularity intensity distribution is then normalized, converting the cumulative phase change value into a standardized singularity intensity value to generate a normalized singularity intensity map. Local extremum detection is performed based on the normalized singularity intensity map to identify candidate pixel locations with significant singularity features, generating a singularity candidate location map. Connectivity analysis is performed on the singularity candidate location map to merge adjacent singularity candidate pixels into continuous regions, generating a singularity region distribution map. The singularity region distribution map and the normalized singularity intensity map are then fused to construct the final phase singularity intensity map. Here, the initial singularity intensity distribution reflects the degree of phase discontinuity of the phase field in local regions, the normalized singularity intensity map provides a standardized singularity intensity measure, the singularity candidate location map identifies potential defect core regions, and the singularity region distribution map describes the spatial distribution characteristics of defects.

[0057] It should be noted that, taking an 88mm×63mm card as an example, the phase field distribution is obtained by phase demodulation of an eight-directional illumination image sequence, with a resolution of 2000×2000 pixels and a phase value range of -π to π radians.

[0058] A circular closed path (radius 3 pixels) is constructed centered on each pixel location. The phase difference (in radians) between adjacent pixels along the path is calculated, and their absolute values ​​are summed as the cumulative phase change value. In normal, smooth areas (card background): the phase change along the path is gradual, with a cumulative value of approximately 0.05 radians (at pixel (500, 500)). In the core defect area (micro-scratches): the phase changes drastically, and the cumulative value increases significantly. At the scratch center pixel (300, 300), the cumulative value reaches 6.20 radians (close to 2π, corresponding to the singularity characteristic of topological charge 1). The initial singularity intensity map directly reflects the phase discontinuity, with the measured cumulative value range being 0~6.28 radians.

[0059] The initial singularity intensity distribution is linearly normalized, mapping the cumulative phase change value to the [0,1] interval: Normalization formula: Singularity intensity value = Cumulative value / 2π. The normalized value of the scratch core pixel (300, 300) is approximately 0.99, while the normalized value of the smooth area pixel (500, 500) is only 0.008. After normalization, the singularity intensity values ​​have standard comparability, facilitating subsequent thresholding.

[0060] Slide a 5×5 pixel window across the normalized singularity intensity map to detect local maxima (intensity values ​​0.2 or higher than their neighbors): Set an intensity threshold of 0.15 to filter out low-value fluctuations caused by noise. Twelve consecutive candidate points were detected in the scratch region, all with intensity values ​​higher than 0.7, while no candidate points were found in the normal region. Generate a binarized singularity candidate location map to identify potential defect core pixels.

[0061] An 8-connected region analysis is performed on the candidate location map, merging adjacent candidate pixels to form continuous regions: candidate points corresponding to scratches are aggregated into a connected region with an area of ​​approximately 25 pixels (equivalent to an actual size of 0.1mm × 0.4mm). Isolated noise points (regions with an area less than 5 pixels) are removed. A singularity region distribution map is generated to clarify the spatial clustering range of defects.

[0062] The singularity region distribution map (binary mask) is multiplied pixel-by-pixel with the normalized singularity intensity map to enhance the intensity values ​​of the real defect regions: the intensity values ​​of scratch regions are retained as original values ​​(0.7~0.99), while the intensity of non-defect regions is reduced to zero. The final phase singularity intensity map highlights the singularity features of the defects while suppressing background noise. The key parameter configurations are shown in Table 3 below: Table 3

[0063] 204. Analyze the singularity density distribution and topological encirclement characteristics in the phase singularity intensity map to identify candidate defect regions and determine defect boundaries; Specifically, a sliding window is set on the phase singularity intensity map, and the singularity density value within each window region is calculated to generate a singularity density distribution map. The gradient vector direction change of the phase field distribution is analyzed, and the topological wrapping value of each local region is calculated to generate a topological wrapping number distribution map. The singularity density distribution map and the topological wrapping number distribution map are fused and analyzed to identify candidate defect regions that meet preset conditions and generate initial defect region markers. The initial defect region markers are morphologically optimized to eliminate isolated noise points and fill the voids inside the regions, generating an optimized defect region mask. Based on the optimized defect region mask, the contour boundary point set of each defect region is extracted to generate the final defect boundary contour description. Among them, the singularity density distribution map reflects the degree of singularity aggregation in the defect region, the topological wrapping number distribution map characterizes the geometric structure characteristics of the defect region, the initial defect region markers provide preliminary location information of the defect, and the optimized defect region mask is used to accurately define the defect range.

[0064] Furthermore, the singularity density distribution map and the topological wrap number distribution map are fused and analyzed, including: establishing a correspondence mapping between the singularity density distribution map and the topological wrap number distribution map to generate a dual-feature correlation matrix; assigning feature weights to the dual-feature correlation matrix, determining the relative importance of singularity density and topological wrap number based on defect type characteristics, and generating a feature weight allocation table; performing weighted fusion calculation on the singularity density distribution map and the topological wrap number distribution map based on the feature weight allocation table to generate an initial fused feature map; performing multi-scale spatial filtering on the initial fused feature map to eliminate local noise interference and enhance the true defect features, generating an optimized fused feature map; applying an adaptive threshold segmentation algorithm to the optimized fused feature map, automatically determining the segmentation threshold based on the local feature intensity, and generating a binarized defect candidate region map; wherein, the dual-feature correlation matrix establishes the correspondence between singularity density and topological wrap number, the feature weight allocation table reflects the differences in feature sensitivity of different defect types, the initial fused feature map initially integrates the two types of defect feature information, and the optimized fused feature map eliminates noise interference and retains the true defect features.

[0065] It should be noted that the expansion is based on the phase field distribution (resolution 2000×2000 pixels) generated by the eight-directional lighting system and its derived phase singularity intensity map (singularity intensity value range 0~1).

[0066] Method: Set a 100×100 pixel sliding window (step size 50 pixels) on the phase singularity intensity map, count the number of pixels in each window whose singularity intensity value exceeds the threshold of 0.15, and calculate the singularity density per unit area.

[0067] Example data: Normal area (card background): Density value is 5~10 per 10,000 pixels, evenly distributed. Scratched defect area: Density is significantly increased, reaching 85 per 10,000 pixels at the window (150,200), due to the clustering of phase discontinuities caused by scratches. Formula: Singularity density , where N threshold A represents the number of pixels exceeding the threshold. window Let be the window area.

[0068] The topological wrapping number distribution map is generated by constructing a 3×3 neighborhood centered on each pixel, calculating the wrapping number of the phase field gradient vector (i.e., the integral change of the gradient direction along the closed path divided by 2π), and identifying vortex-like structures.

[0069] Example data: Flat region: wrap number close to 0 (gradient direction changes gently). Depressed defect region: wrap number is +1 (at coordinates (320,500)), indicating that the phase gradient is a clockwise vortex; raised defect region: wrap number is -1. The topological wrap number reflects the geometry of the defect (phase vortex at the scratch edge).

[0070] Fusing the singularity density map with the topological wraparound number map enhances defect features and suppresses noise: Feature weight assignment: Weights are assigned according to defect type; scratches are more sensitive to singularity density, while stains are more sensitive to topological wraparound. Fusion calculation: Weighted feature values ​​are calculated for each pixel. Where T is the number of topological wraps, and w1 and w2 are the weights. Multi-scale filtering: A Gaussian filter (scale σ=1.5) is used to smooth the fusion results and eliminate isolated noise. The feature weights corresponding to the defect types are shown in Table 4 below. Table 4

[0071] Adaptive threshold segmentation: A local threshold (window size 200×200 pixels) is applied to the fused feature map. The threshold calculation formula is as follows: (μ and σ are the local mean and standard deviation), generating a binary defect candidate image.

[0072] Morphological optimization: Erosion followed by dilation (closing operation) eliminates isolated points with an area less than 20 pixels. Internal voids (blank areas in the center of the stain) are filled. Boundary extraction: An edge tracking algorithm is applied to the optimized defect mask to extract the contour point set. The contour of a scratch defect is described by 120 boundary points, with an area of ​​approximately 450 pixels (equivalent to an actual size of 0.2mm × 1.5mm). Parameter configurations are shown in Table 5 below. Table 5

[0073] 205. Based on the geometric features and phase anomaly features of the defect area, and in conjunction with preset judgment rules, make a final judgment on the defect type and severity; Specifically, geometric feature parameters, including defect area, perimeter, aspect ratio, and contour complexity, are extracted from the defect boundary contour description to generate a defect geometric feature set. Phase anomaly features, including phase abrupt change intensity, phase gradient direction, and phase continuity index, are extracted from the phase field distribution to generate a defect phase feature set. The defect geometric feature set and the defect phase feature set are fused to construct a comprehensive defect feature description vector. This comprehensive defect feature description vector is then matched with a pre-defined defect judgment rule base, and defect types are classified based on feature thresholds and logical conditions to generate defect type classification results. Based on the defect type classification results and a defect severity assessment model, the severity level of each type of defect is quantitatively assessed, and a final defect judgment report is output. Among them, the defect geometric feature set reflects the morphological and structural characteristics of the defect, the defect phase feature set characterizes the degree of optical phase anomaly caused by the defect, the comprehensive defect feature description vector provides complete feature information for defect identification, the defect type classification results clarify the specific defect categories such as scratches, stains, and printing defects, and the final defect judgment report contains complete detection information on defect location, type, and severity.

[0074] It should be noted that the goal of step 205 is to accurately classify and assess the severity of defects based on the identified defect regions (from the defect boundary contour description in step 204) and the phase field distribution. The following example uses a playing card (standard size 88mm × 63mm) with three detected candidate defect regions (labeled as regions A, B, and C, respectively) to illustrate the specific implementation of the judgment process.

[0075] Geometric feature extraction: The following key parameters are calculated from the set of contour boundary points of each defect region: Region A: Area = 15mm 2 Perimeter = 18mm, aspect ratio = 3.5, contour complexity (perimeter) 2 Area ( / area) = 21.6. The shape is slender, consistent with scratch characteristics. Region B: Area = 8mm² 2 Perimeter = 12mm, aspect ratio = 1.1, contour complexity = 18.0. The shape is nearly circular, consistent with the characteristics of a stain. Region C: Area = 25mm² 2 The perimeter is 22mm, the aspect ratio is 2.0, and the outline complexity is 19.4. The outline is irregular, which may indicate a printing defect.

[0076] Phase anomaly feature extraction: Extracting phase anomaly values ​​from the phase field distribution of defect regions: Region A: Phase abrupt change intensity = 1.8 radians (high intensity abrupt change), phase gradient direction concentrated along a linear path, phase continuity index = 0.15 (low continuity, indicating structural fracture). Region B: Phase abrupt change intensity = 0.4 radians (weak abrupt change), phase gradient direction radial, phase continuity index = 0.75 (relatively high continuity, indicating local unevenness). Region C: Phase abrupt change intensity = 0.9 radians (medium abrupt change), phase gradient direction disordered, phase continuity index = 0.35 (moderate discontinuity).

[0077] Geometric and phase features are combined into a comprehensive feature description vector, which is then matched against a pre-defined defect judgment rule base (the rule base is generated based on historical data). The key judgment logic is as follows: Scratch defects: Geometrically, aspect ratio > 3.0, contour complexity > 20; Phaseally, abrupt change intensity > 1.5 radians, continuity < 0.3. Stains defects: Geometrically, aspect ratio < 1.5, contour complexity < 20; Phaseally, abrupt change intensity < 0.8 radians, gradient direction not dominant. Printing defects: Geometrically, area > 20 mm². 2 The contour complexity is greater than 18; the phase abrupt change intensity is required to be greater than 0.5 radians, but the gradient direction is chaotic. Based on these rules, region A is classified as a scratch, region B as a stain, and region C as a printing defect.

[0078] Based on defect type, a specific model is used to calculate the severity level (divided into levels 1-5, with level 5 being the most severe). Assessment criteria include: Scratch: The core indicator is the intensity of the phase change (level 5 for intensity > 2.0 radians, level 4 for intensity 1.5-2.0 radians). Area A has an intensity of 1.8 radians, rated as level 4. Stains: The core indicator is area (area > 10 mm²). 2 Level 5, 5-10mm 2 (Level 3). Area B: 8 mm² 2 It was rated as Level 3.

[0079] Printing defects: Consider both area and phase continuity (area × (1 - continuity) > 15 for level 5). Region C score = 25 × (1 - 0.35) = 16.25, rated as level 5.

[0080] The output includes a standardized report containing the defect location, type, and severity level, as shown in Table 6 below: Table 6

[0081] 206. Visualize the final defect assessment report by overlaying the defect location, type, and severity information onto the original card image to generate a visual defect detection report. Perform self-calibration of the detection system based on this report, generating system calibration parameters by analyzing the false positive and false negative rates in historical detection data. Adaptively adjust the light source parameters and camera settings during multi-angle illumination image acquisition based on these calibration parameters to generate an optimized acquisition system configuration. Real-time control of the subsequent card detection process is then implemented based on this optimized acquisition system configuration to ensure the stability and accuracy of the detection system under different environmental conditions. Among them, the visual defect detection report provides an intuitive display of detection results, the system calibration parameters reflect the performance status of the detection system, and the optimized acquisition system configuration is used to adjust the image acquisition process in real time to ensure that the entire detection system maintains its best working condition.

[0082] Specifically, the self-calibration of the detection system based on the visualized defect detection report includes: real-time monitoring of ambient light conditions and temperature changes, collecting environmental parameter data and generating an environmental status monitoring report; compensating and adjusting the image acquisition system according to the environmental status monitoring report, generating environmental compensation parameters and applying them to the image acquisition process; statistically analyzing the detection consistency indicators of various defects based on the defect judgment results in historical detection data, and generating a system stability assessment report; adaptively optimizing the phase demodulation processing parameters according to the system stability assessment report, generating optimized phase calculation parameters; and integrating the environmental compensation parameters and the optimized phase calculation parameters into the system configuration to form an adaptive set of detection parameters. Among them, the environmental status monitoring report is used to sense changes in the detection environment in real time, the environmental compensation parameters ensure that the image acquisition quality is not affected by the environment, the system stability assessment report reflects the long-term reliability of the detection system, and the optimized phase calculation parameters are used to improve the accuracy of phase field calculation.

[0083] It should be noted that in the final stage of the visual inspection process for surface defects on game cards, the inspection results are presented visually, and these results are used to optimize the inspection system itself, forming a closed-loop intelligent inspection process. The following embodiments illustrate the implementation of this step in detail.

[0084] The defect assessment results (from step 205) are fused with the original card image to generate a visualization report. Specifically, the following steps are implemented: Defect Information Overlay: Defect information is annotated using vector graphics of different colors and line styles over the original card image (20 megapixel resolution). Scratch Defect: The boundary is marked with a red dashed line (3 pixels wide), and "Scratch-Lv4" is labeled above the defect. Stain Defect: The area is marked with a yellow semi-transparent fill (40% transparency), and labeled "Stain-Lv3". Printing Defect: The area is outlined with a blue dotted line (2 pixels wide), and labeled "Printing Defect-Lv5".

[0085] Information panel integration: An information panel is generated on the side of the image, listing detailed information about all defects in tabular form, including defect ID, type, severity level, area, location coordinates, etc.

[0086] Output format: The final output is a high-resolution (300 DPI) visual inspection report, which can be saved as PNG or PDF format for quality archiving and manual review.

[0087] The system performs periodic self-calibration based on visual reports and historical detection data to maintain high detection accuracy. The calibration process is as follows: Environmental condition monitoring: Environmental parameters are monitored in real time through temperature and humidity sensors. When the ambient temperature rises from 22℃ to 26℃, the system detects a 0.8% drift in the average grayscale value of the image.

[0088] Performance Indicator Statistics: The system automatically analyzes the results of the most recent 1000 tests to calculate key performance indicators: False Detection Rate: Should be controlled below 0.5% (no more than 5 false detections per 1000 cards). False Detection Rate: Should be controlled below 0.3% (no more than 3 false detections per 1000 cards). Detection Consistency: The fluctuation range of judgment results for similar defects should be less than 5%.

[0089] Parameter optimization and adjustment: Based on the performance index analysis results, the system automatically adjusts key parameters and generates a new system configuration file.

[0090] Table 7 below lists the main parameters involved in the system self-calibration process and their adjustment examples: Table 7

[0091] After completing self-calibration, the system generates an optimized acquisition and processing configuration, which is immediately applied to the subsequent card detection process. The new configuration optimizes the light source trigger sequence from "1-2-3-4-5-6-7-8" to "1-3-5-7-2-4-6-8" to better highlight texture features in specific directions. The system continuously monitors the calibrated performance metrics to ensure stable operation.

[0092] In this embodiment of the invention, by precisely controlling the lighting sequence and timing of the light sources and camera triggering, combined with illumination intensity normalization and pixel-level registration processing, the influence of light source intensity differences and minor card displacements on image quality is eliminated, generating a spatially consistent and illumination-standardized multi-angle illumination image sequence, providing a reliable foundation for subsequent accurate phase demodulation. During phase demodulation, a quality-oriented path tracking method is used for phase unfolding. Through a series of steps, including calculating phase reliability, determining the starting path, identifying and marking residual points, and constructing a branching network, the influence of phase jumps on subsequent analysis is effectively eliminated. Simultaneously, an anisotropic Gaussian filter is used for noise reduction, preserving the true defect edge features while suppressing random noise interference, further improving the quality of the phase field distribution. Analyzing the singularity density distribution and topological encirclement characteristics in the phase singularity intensity map, and fusing these two analyses with morphological optimization processing, allows for accurate identification of candidate defect regions and determination of defect boundaries. By comprehensively considering the singularity aggregation degree and geometric structure characteristics of the defect region, the accuracy of defect localization is effectively improved, reducing false detections and missed detections.

[0093] The above describes the visual detection method for surface defects of game cards in embodiments of the present invention. The following describes the visual detection system for surface defects of game cards in embodiments of the present invention. Please refer to [link / reference]. Figure 8 An embodiment of the visual inspection system for surface defects of game cards in this invention includes: an image acquisition module 301, used to acquire image sequences of the card surface under different angle illuminations by controlling light sources from multiple directions to illuminate it sequentially, and construct a multi-angle illumination image sequence; a phase processing module 302, used to perform phase demodulation processing on the multi-angle illumination image sequence to generate a phase field distribution of the micro-texture of the card surface; a singularity analysis module 303, used to calculate the singularity intensity value of each pixel position based on the phase field distribution, and construct a phase singularity intensity map; a feature extraction module 304, used to identify candidate defect regions and determine defect boundaries based on the singularity density distribution and topological encirclement characteristics in the phase singularity intensity map; and a defect judgment module 305, used to make a final judgment on the defect type and severity based on the geometric features and phase anomaly features of the candidate defect regions, combined with preset judgment rules.

[0094] Figure 9 This is a schematic diagram of the structure of a visual inspection device for surface defects of game cards provided in an embodiment of the present invention. The visual inspection device 400 for surface defects of game cards may include a processor 401 and a memory 402. The memory 402 is used to store program instructions and / or data, and the processor 401 is used to execute the program instructions stored in the memory 402, thereby implementing the method in the above-described method embodiment.

[0095] Optionally, the memory 402 and the processor 401 are coupled. The coupling is an indirect coupling or communication connection between devices, units, or modules, and can be electrical, mechanical, or other forms, for information interaction between devices, units, or modules.

[0096] Optionally, the visual inspection device 400 for surface defects of game cards may also include a communication interface 403. The communication interface 403 is used to communicate with other devices through a transmission medium, such as transmitting signals received from other communication devices to the processor 401, or transmitting signals from the processor 401 to other communication devices. The communication interface 403 may be a transceiver or an interface circuit, such as a transceiver circuit or a transceiver chip.

[0097] This application embodiment does not limit the specific connection medium between the processor 401, memory 402, and communication interface 403. This application embodiment... Figure 9 The processor 401, memory 402, and communication interface 403 are connected via a bus 404. Figure 9The connections between other components are shown in bold and are for illustrative purposes only, not as limiting information. The bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, Figure 9 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0098] The present invention also provides a visual inspection device for surface defects of game cards. The visual inspection device for surface defects of game cards includes a memory and a processor. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor performs the steps of the visual inspection method for surface defects of game cards in the above embodiments.

[0099] The present invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when the instructions are executed on a computer, cause the computer to perform the steps of the visual inspection method for surface defects of game cards.

[0100] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0101] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0102] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A visual inspection method for surface defects of game cards, characterized in that, include: By controlling light sources from multiple directions to illuminate sequentially, image sequences of the card surface under different angles of illumination are collected to construct a multi-angle illumination image sequence; Phase demodulation processing is performed on the multi-angle illumination image sequence to generate the phase field distribution of the micro-texture on the card surface; Based on the phase field distribution, the singularity intensity value of each pixel position is calculated, and a phase singularity intensity map is constructed. Based on the singularity density distribution and topological encirclement characteristics in the phase singularity intensity map, candidate defect regions are identified and defect boundaries are determined. Based on the geometric features and phase anomaly features of the defect candidate region, and combined with preset judgment rules, the defect type and severity are finally determined.

2. The visual inspection method for surface defects of game cards according to claim 1, characterized in that, include: Intensity information under illumination from each direction is extracted from the multi-angle illumination image sequence, and the sine and cosine components of each pixel position are calculated to generate an orthogonal component map. The phase angle is initially calculated based on the orthogonal component map to obtain the wrap-around phase map; The phase map of the package is subjected to phase unrolling processing to eliminate phase jumps and generate a continuous phase distribution map; The continuous phase distribution map is subjected to phase noise filtering to preserve the true surface texture features while suppressing random noise interference, thus obtaining the phase field distribution of the micro-texture on the card surface.

3. The visual inspection method for surface defects of game cards according to claim 2, characterized in that, The phase unwrapping process for the packaged phase map includes: The phase reliability of each pixel is calculated based on the local phase gradient information of the wrapped phase map, and a phase quality distribution map is generated. Based on the phase quality distribution map, the starting path for phase unfolding is determined, and path-tracking unfolding is performed from the high-quality region to the low-quality region to generate an initial unfolded phase map; Identify and mark the residual points in the initial unfolded phase diagram, and establish a residual point location distribution map; A branch cutting network is constructed based on the residual point location distribution map. The optimal cutting path is formed by connecting the residual points, and phase expansion constraints are generated. The initial unfolded phase map is corrected by applying the phase unfolding constraint conditions to eliminate phase jump errors and generate the final continuous phase distribution map.

4. The visual inspection method for surface defects of game cards according to claim 2, characterized in that, include: A circular closed path is constructed with each pixel position as the center, and the cumulative phase change value of the phase field distribution on the closed path is calculated to generate the initial singularity intensity distribution. The initial singularity intensity distribution is processed to convert the cumulative phase change value into a standardized singularity intensity value, thereby generating a normalized singularity intensity map. Based on the normalized singularity intensity map, local extremum detection is performed to identify candidate pixel positions and generate a singularity candidate position map. Based on the singularity candidate location map, adjacent singularity candidate pixels are merged into a continuous region to generate a singularity region distribution map; A phase singularity intensity map is constructed by fusing the singularity region distribution map and the normalized singularity intensity map.

5. The visual inspection method for surface defects of game cards according to claim 4, characterized in that, include: A sliding window is set on the phase singularity intensity map, and the singularity density value within each window region is calculated to generate a singularity density distribution map; Analyze the gradient vector direction changes of the phase field distribution, calculate the topology wrapping value of each local region, and generate a topology wrapping number distribution map; The singularity density distribution map and the topological wrap number distribution map are fused and analyzed to identify candidate defect regions that meet preset conditions and generate initial defect region markers. Based on the initial defect region markings, morphological optimization processing is performed to eliminate isolated noise points and fill the voids inside the region, thereby generating a defect region mask. Based on the defect region mask, the contour boundary point set of each defect region is extracted to generate a defect boundary contour description.

6. The visual inspection method for surface defects of game cards according to claim 5, characterized in that, Singularity density , where N threshold A represents the number of pixels exceeding the threshold. window The area is the window area. The singularity density map and the topological wrap number map are fused to enhance defect features and suppress noise. A weighted feature value is calculated for each pixel. :

7. Among them, T is the number of topological wraps, and w1 and w2 are the weights.

8. The visual inspection method for surface defects of game cards according to claim 5, characterized in that, The process of fusing the singularity density distribution map with the topological wrap number distribution map includes: Establish a mapping relationship between the singularity density distribution map and the topological wrap number distribution map, and generate a dual-feature correlation matrix; Feature weights are assigned to the dual-feature correlation matrix, and the relative importance of singularity density and topological wrap number is determined based on defect type characteristics, generating a feature weight assignment table. Based on the feature weight allocation table, a weighted fusion calculation is performed on the singularity density distribution map and the topological wrap number distribution map to generate an initial fused feature map; The initial fused feature map is processed to generate an optimized fused feature map; An adaptive threshold segmentation algorithm is applied to the optimized fused feature map to automatically determine the segmentation threshold based on the local feature intensity, thereby generating a binarized defect candidate region map.

9. The visual inspection method for surface defects of game cards according to claim 1, characterized in that, include: Extract geometric feature parameters from the defect boundary contour description, including defect area, perimeter, aspect ratio, and contour complexity, to generate a defect geometric feature set; Phase anomaly features of the defect region are extracted from the phase field distribution, including phase abrupt change intensity, phase gradient direction and phase continuity index, to generate a defect phase feature set; Based on the defect geometric feature set and the defect phase feature set, feature fusion is performed to construct a comprehensive defect feature description vector; The comprehensive defect feature description vector is matched and analyzed with a preset defect judgment rule base. Based on feature thresholds and logical conditions, defect types are classified to generate defect type classification results. Based on the defect type classification results and combined with the defect severity assessment model, the severity level of each type of defect is quantitatively assessed, and a final defect judgment report is output.

10. The visual inspection method for surface defects of game cards according to claim 8, characterized in that, Also includes: The final defect assessment report is visualized and rendered by overlaying the defect location, type, and severity information onto the original card image to generate a visual defect detection report. The detection system is self-calibrated based on the visual defect detection report. By analyzing the false detection rate and false negative rate in historical detection data, system calibration parameters are generated. Based on the system calibration parameters, the light source parameters and camera settings are adaptively adjusted during the multi-angle illumination image acquisition process to generate an optimized acquisition system configuration.

11. A visual inspection system for surface defects of game cards, characterized in that, The visual inspection system for surface defects of game cards includes: The image acquisition module is used to control light sources from multiple directions to illuminate the card surface sequentially, acquire image sequences under different angles of illumination, and construct a multi-angle illumination image sequence. The phase processing module is used to perform phase demodulation processing on the multi-angle illumination image sequence to generate the phase field distribution of the micro-texture on the card surface; The singularity analysis module is used to calculate the singularity intensity value of each pixel position based on the phase field distribution and construct a phase singularity intensity map. The feature extraction module is used to identify candidate defect regions and determine defect boundaries based on the singularity density distribution and topological encirclement characteristics in the phase singularity intensity map. The defect determination module is used to make a final determination of the defect type and severity based on the geometric features and phase anomaly features of the defect candidate region, combined with preset determination rules.