Vacuum cup surface defect detection method based on image features
By using a multi-angle image acquisition and feature extraction model, the problem of missing surface defects of thermos cups under single-angle detection was solved, achieving efficient and accurate detection of complex surfaces and improving defect identification capabilities and the stability of the detection system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-21
- Publication Date
- 2026-03-13
AI Technical Summary
Existing methods for detecting surface defects in thermos cups rely on single-angle images, which makes it easy to miss local defects due to reflections or angle obscuring. This is especially true when the metallic luster is strong and the surface contour is complex, making it difficult to effectively capture directional and local defect features.
Multi-angle image acquisition is employed, and an angle feature extraction model is used to extract texture structure features, shape structure features, and reflection area features respectively. Texture disturbance index, contour offset index, and reflection focusing index are analyzed, and matching analysis is performed in combination with a preset defect judgment interval set.
It significantly improves the defect detection rate, can more clearly distinguish defect types, and has automated, auditable, and quantitative comparison capabilities, making it suitable for the inspection of thermos cups with complex surfaces.
Smart Images

Figure CN121660980A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing and intelligent detection technology, specifically to a method for detecting surface defects in thermos cups based on image features. Background Technology
[0002] With the development of intelligent manufacturing and industrial automation, the requirements for the appearance quality of consumer products are increasing. In particular, in the manufacturing process of products such as thermos cups that involve multiple surface treatment processes such as metal wire drawing, baking paint spraying, and electroplating coating, the accurate detection of surface defects has become an important part of ensuring product quality.
[0003] The limitations of existing technologies include at least the following problems: Current methods for detecting surface defects in thermos cups typically rely on single-angle images or perform uniform feature extraction and judgment on the entire image, failing to analyze the differences between images from different angles. This easily leads to inaccurate defect identification due to local reflections, changes in texture direction, or shape distortion. Especially on cups with strong metallic luster and complex surface contours, defect features often have directionality and locality, making it difficult for a single image or uniform judgment strategy to effectively capture these local anomalies that only appear under different shooting angles. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention provides a method for detecting surface defects of thermos cups based on image features. This method solves the problem that existing technologies, which rely solely on single-angle image detection, often miss local defects on the surface of thermos cups due to reflections or angle obstruction.
[0005] To achieve the above objectives, the present invention provides the following technical solution: a method for detecting surface defects in a thermos cup based on image features, comprising the following steps: acquiring angular images of the area to be detected in the thermos cup from multiple shooting angles and preprocessing them; inputting the angular images from each shooting angle into a pre-trained angular feature extraction model to extract angular image feature sets from the corresponding shooting angles, including texture structure features, shape structure features, and reflection area features; based on the angular image feature sets from each shooting angle, analyzing the texture perturbation index, contour offset index, and reflection focusing index from the corresponding shooting angle; performing matching analysis between the texture perturbation index, contour offset index, and reflection focusing index from each shooting angle and a preset defect judgment interval set for that shooting angle, the defect judgment interval set including texture abnormal intervals, contour abnormal intervals, and reflection abnormal intervals; if any index falls into its corresponding abnormal interval, then the corresponding shooting angle is marked as a defect image.
[0006] Furthermore, the angle image is composed of a number of image pixels, and each image pixel corresponds to an image grayscale value.
[0007] Furthermore, the angle feature extraction model includes a texture deconstruction subnetwork, a contour mapping subnetwork, and a reflection recognition subnetwork.
[0008] Further, the specific steps for extracting the angular image feature set under the corresponding shooting angle are as follows: In the texture deconstruction sub-network of the angular feature extraction model, the preprocessed angular images of the thermos cup to be detected under multiple shooting angles are subjected to texture direction analysis and grayscale distribution comparison processing to obtain the texture structure features under the corresponding shooting angle; In the contour mapping sub-network of the angular feature extraction model, the preprocessed angular images of the thermos cup to be detected under multiple shooting angles are subjected to edge extraction and structure fitting analysis to obtain the shape structure features under the corresponding shooting angle; In the reflection recognition sub-network of the angular feature extraction model, the preprocessed angular images of the thermos cup to be detected under multiple shooting angles are subjected to highlight region detection and boundary jump analysis to obtain the reflection region features under the corresponding shooting angle.
[0009] Furthermore, the texture structure features include texture direction gradient change values, gray-level co-occurrence difference values, and texture block contrast offset values.
[0010] Furthermore, the specific steps for analyzing the texture perturbation index under the corresponding shooting angle are as follows: read the texture structure features of the thermos cup to be detected under each shooting angle and perform normalization processing; perform comprehensive analysis on the normalized texture structure features to obtain the texture perturbation index of the thermos cup to be detected under each shooting angle.
[0011] Furthermore, the shape and structural features include edge continuity length values, contour fitting offset values, multi-edge coverage ratio values, and contour closure ratio values.
[0012] Further, the specific steps for analyzing the contour offset index under the corresponding shooting angle are as follows: Read the edge continuous length value and contour fitting offset value of the area to be detected of the thermos cup under each shooting angle, and perform normalization processing; Combine the normalized edge continuous length value and contour fitting offset value of the area to be detected of the thermos cup under each shooting angle with the multi-edge coverage ratio and contour closure ratio under the corresponding shooting angle for comprehensive analysis to obtain the contour offset index under the corresponding shooting angle.
[0013] Furthermore, the characteristics of the reflective area include the proportion of the bright area, the gradient value of the high-reflection boundary, the smoothness ratio of the reflective area, and the concentration deviation value of the bright grayscale.
[0014] Further, the specific steps for analyzing the reflection focusing index under the corresponding shooting angle are as follows: Read the high-reflectivity boundary gradient value and the high-brightness grayscale concentration deviation value of the thermos cup to be tested area under each shooting angle, and perform normalization processing; combine the normalized high-reflectivity boundary gradient value and high-brightness grayscale concentration deviation value of the thermos cup to be tested area under each shooting angle with the high-brightness area ratio and the smoothness ratio of the reflective area under the corresponding shooting angle for comprehensive analysis to obtain the reflection focusing index under the corresponding shooting angle.
[0015] The present invention has the following beneficial effects:
[0016] (1) The image feature-based method for detecting surface defects of thermos cups overcomes the problem of blind spots caused by a single shooting angle in traditional detection by adopting a multi-angle image acquisition method, effectively improving the image coverage and defect exposure. In actual detection scenarios, the surface of thermos cups has a complex arc-shaped curved surface structure. Conventional frontal shooting often makes it difficult to fully capture potential defects at the corners of the cup, reflective areas, or slightly curved areas. This method acquires images from multiple angles and extracts angle features respectively, realizing detailed scanning of each field of view area of the thermos cup. Even hidden defects such as very shallow scratches and slight dents can be highlighted at a specific angle, significantly improving the overall defect detection rate.
[0017] (2) The image feature-based method for detecting surface defects of thermos cups decouples and extracts image features such as texture structure, shape structure and reflection area, and specifically models the image response features of different types of defects, which significantly enhances the model's ability to distinguish the types of defects. Compared with the traditional method of evaluating defects by overall image scoring, this method not only retains fine-grained feature information such as texture variation, edge offset, and high reflection focus, but also realizes the separate identification of texture disorder, contour deformation and specular reflection abnormality through parallel processing of texture deconstruction subnetwork, contour mapping subnetwork and reflection recognition subnetwork. It has multi-dimensional and high-resolution anomaly analysis capabilities, and can more clearly distinguish whether the appearance variation is caused by texture disturbance or by deformation, light spots and other factors, providing accurate basis for subsequent quality grading and anomaly classification.
[0018] (3) The image feature-based thermos cup surface defect detection method constructs texture disturbance index, contour offset index and reflection focusing index, and matches them with preset abnormal interval set to realize automatic identification, quantitative evaluation and standardized judgment of surface defects. This structural design avoids the subjective judgment difference in the traditional visual inspection process. At the same time, compared with the end-to-end classification method of black box depth model, this method enables the defect identification process to not only have automation capability, but also auditability and quantitative comparison capability in the output stage. It is conducive to rapid deployment and detection rule adjustment in actual production line, and improves the stability, transparency and maintenance efficiency of the detection system.
[0019] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description
[0020] Figure 1 This is a flowchart of a method for detecting surface defects in a thermos cup based on image features, according to the present invention.
[0021] Figure 2 This is a flowchart illustrating the specific steps involved in analyzing the contour offset index at a corresponding shooting angle in a method for detecting surface defects in a thermos cup based on image features, as described in this invention.
[0022] Figure 3 This is a flowchart illustrating the specific steps involved in analyzing the reflection focusing index at a corresponding shooting angle in a method for detecting surface defects in a thermos cup based on image features, as described in this invention. Detailed Implementation
[0023] Please see Figure 1 This invention provides a technical solution: a method for detecting surface defects in a thermos cup based on image features, comprising the following steps: acquiring angular images of the area to be detected in the thermos cup from multiple shooting angles and preprocessing them; inputting the angular images from each shooting angle into a pre-trained angular feature extraction model to extract angular image feature sets for the corresponding shooting angle, including texture structure features, shape structure features, and reflection area features; based on the angular image feature sets for each shooting angle, analyzing the texture perturbation index, contour offset index, and reflection focusing index for the corresponding shooting angle; performing matching analysis between the texture perturbation index, contour offset index, and reflection focusing index for each shooting angle and a preset defect judgment interval set for that shooting angle, the defect judgment interval set including texture abnormal interval, contour abnormal interval, and reflection abnormal interval; if any index falls into its corresponding abnormal interval, then the corresponding shooting angle is marked as a defect image.
[0024] Preprocessing includes brightness normalization, edge sharpness enhancement, and reflection interference suppression.
[0025] The brightness normalization process specifically includes:
[0026] Read the grayscale values of all image pixels in the current angle image and build a grayscale distribution histogram to observe the distribution range and concentration interval of grayscale values;
[0027] Calculate the minimum and maximum gray values in the image, and denote them as Min_gray and Max_gray, respectively.
[0028] Perform a linear normalization transformation on the original gray value G(i,j) of each pixel, calculate its normalized gray value G'(i,j)=(G(i,j)–Min_gray) / (Max_gray–Min_gray), and map the result to the [0,1] interval;
[0029] After performing this transformation on all pixels, a brightness-normalized image is obtained, in which the grayscale values of all pixels are within a uniform range.
[0030] The purpose of this step is to eliminate the overall brightness shift caused by different shooting angles, light source conditions, or reflection intensity, so that images from different angles can be compared and analyzed under the same brightness benchmark.
[0031] Edge sharpness enhancement processing specifically includes:
[0032] The edge enhancement filter is applied to the brightness-normalized image as input.
[0033] Using the Laplacian enhancement operator or the Qualcomm sharpening convolution kernel, with a 3×3 or 5×5 neighborhood as the window, calculate the difference weight between the gray level of each pixel and the surrounding pixels.
[0034] For each pixel, the gray value of the center pixel G'(i,j)=G(i,j)+α·ΔG is adjusted based on the gray value change rate ΔG of its neighborhood, where α is a fixed gain parameter (e.g. 0.3–0.5) to enhance the local edge intensity;
[0035] A two-way threshold constraint is applied to the processed image to truncate pixels with gray values exceeding the range of [0,1] to the boundary value, thus avoiding false edges caused by over-sharpening;
[0036] After enhancement, the difference in grayscale gradient between the boundary and flat areas in the image is greater, the edge lines are clearer, and the texture direction is more distinct, which facilitates the subsequent extraction of contour structure features and texture direction features.
[0037] Reflective interference suppression processing specifically includes:
[0038] In the edge-enhanced image, the gray value of each pixel is read, and a high inverse threshold T is set based on the histogram statistics (which can be twice the average gray value of the entire image plus the standard deviation).
[0039] Mark all pixels with gray values greater than T and form a high-reflectivity region mask;
[0040] Local smoothing is performed on pixels within the mask area using a bilateral filtering algorithm, taking into account both the spatial distance and grayscale differences between pixels, smoothing bright area details while preserving edge structure;
[0041] Brightness compression is performed on the same area, and the brightness values are remapped to the [0,0.8] range to reduce local overexposure reflections;
[0042] The original grayscale of non-high reflective areas is kept unchanged, and the final output is an image with suppressed reflection interference;
[0043] This process effectively reduces interference from specular reflection on metal surfaces, high-brightness spots, or ghosting of light sources, making the subsequent identification results of reflective area features more stable and reliable.
[0044] An angle image is composed of a number of image pixels, and each image pixel corresponds to an image grayscale value.
[0045] Specifically, the angle feature extraction model includes a texture deconstruction subnetwork, a contour mapping subnetwork, and a reflection recognition subnetwork.
[0046] The specific steps for extracting the feature set of the angle image under the corresponding shooting angle are as follows: In the texture deconstruction subnetwork of the angle feature extraction model, the preprocessed angle images of the thermos cup to be detected under multiple shooting angles are subjected to texture direction analysis and grayscale distribution comparison processing to obtain the texture structure features under the corresponding shooting angle, which are as follows:
[0047] Sobel gradient extraction:
[0048] Read the gray value of each pixel in the angle image, perform Sobel operator calculation on the pixel and its surrounding 3×3 neighborhood, and obtain the gradient components in the horizontal and vertical directions respectively;
[0049] The gradient intensity value of a pixel is obtained by taking the square root of the sum of the squares of the gradients in the two directions, and the gradient direction angle is obtained by calculating the arctangent value, thus forming a "directional gradient map".
[0050] Local window main direction analysis:
[0051] Using an 8×8 or 16×16 pixel local window, the vector average of the orientation angles of all pixels within the window is used to obtain the main texture direction of the region.
[0052] Store all window main directions as an "direction distribution matrix".
[0053] Calculation of texture direction gradient change value:
[0054] Perform a difference operation on the main direction angles of adjacent windows to obtain the rate of change of direction;
[0055] The variance of the orientation difference for all window pairs in the entire image is calculated and used as the texture orientation gradient change value.
[0056] The larger the value, the more drastic the change in surface texture direction, indicating the presence of scratches, abrasions, or unevenness.
[0057] Gray-scale co-occurrence difference value extraction:
[0058] The image grayscale is quantized into 256 levels, and a grayscale co-occurrence matrix is constructed.
[0059] Calculate the frequency of occurrence of adjacent gray-level pairs in the matrix, compare the weighted average value formed by the relative gray-level differences, and obtain the gray-level co-occurrence difference value;
[0060] This value reflects the roughness of the surface texture and local unevenness of light and dark areas.
[0061] Texture block contrast offset value calculation:
[0062] Divide the entire image into regular regions (such as 6×6 blocks) and calculate the average gray level of each block;
[0063] Calculate the maximum and minimum values of the average grayscale difference among all regions, and use their ratio as the texture block contrast offset value;
[0064] This ratio increases significantly when there are minor scratches or foreign matter adhering to the surface;
[0065] In the contour mapping sub-network of the angle feature extraction model, edge extraction and structure fitting analysis are performed on the preprocessed thermos cup detection area under multiple shooting angles to obtain the shape and structure features under the corresponding shooting angles, specifically:
[0066] Edge extraction:
[0067] The Canny algorithm is applied to the image, which consists of four steps: Gaussian filtering, gradient calculation, non-maximum suppression, and double thresholding.
[0068] In the output binary edge image, white pixels represent boundary pixels.
[0069] Calculation of continuous edge length:
[0070] The connected chains of all edge pixels are traced using the connected component labeling method;
[0071] The number of pixels contained in the longest continuous chain is recorded as the edge continuity length value, which reflects the degree of surface cracks or fractures.
[0072] Contour fitting offset value calculation:
[0073] Extract the main contour point set and fit it into an ellipse or circle using the least squares method;
[0074] Calculate the average vertical distance from each contour point to the fitted curve as the contour fitting offset value;
[0075] If there are depressions or warped edges, this value increases significantly.
[0076] Multi-edge coverage ratio extraction:
[0077] The total pixel area of all independent edge regions outside the main outline is calculated and compared with the area of the effective detection region of the entire image.
[0078] The multi-edge coverage ratio reflects the degree of interference at non-primary boundaries, such as scratches, burrs, or film wrinkles.
[0079] Calculation of contour closure ratio:
[0080] Calculate the perimeter of all closed boundaries, then construct their inscribed circles and calculate their perimeters;
[0081] The ratio of these two values is used as the profile closure ratio to determine boundary integrity. If there are breaks or cracks on the surface, this ratio decreases.
[0082] In the reflection recognition sub-network of the angle feature extraction model, highlight region detection and boundary transition analysis are performed on the preprocessed thermos cup detection area under multiple shooting angles to obtain the reflection area features under the corresponding shooting angles, specifically:
[0083] Highlighted area detection:
[0084] Thresholding is performed on the grayscale values of the angled image, with the threshold set to 10% above the peak value of the grayscale histogram.
[0085] Extract all pixel regions with grayscale values higher than the threshold, and calculate the ratio of their total number of pixels to the total number of pixels in the entire image to obtain the proportion of the highlighted region.
[0086] The percentage of high brightness reflects the degree of metal reflection; an abnormally high value indicates the presence of localized reflective defects.
[0087] High inverse boundary gradient value extraction:
[0088] Establish a 3-pixel bandwidth at the edge of the bright area, and calculate the average grayscale values of the inner and outer bands respectively;
[0089] The difference between the two is the gradient value of the high-inflection boundary, which indicates the severity of the transition between light and dark.
[0090] If sharp reflections or scratches appear, this value will increase significantly.
[0091] Calculation of the smoothness ratio of reflective areas:
[0092] Perform B-spline curve fitting on the highlighted region contour and extract the curvature of each contour point;
[0093] The ratio of the standard deviation to the mean of the curvature is defined as the smoothness ratio of the reflective area.
[0094] If the curvature fluctuates greatly, it indicates that the surface of the reflective area is uneven or has wrinkles.
[0095] Calculation of high-brightness grayscale concentration deviation value:
[0096] Extract the grayscale values of all pixels within the highlighted area and calculate their standard deviation;
[0097] The high-brightness grayscale concentration deviation value reflects the brightness uniformity of the bright area.
[0098] This value increases significantly when there are stains, fingerprints, or uneven materials.
[0099] In this implementation scheme, the angle feature extraction model, through the introduction of a layered design of a texture deconstruction subnetwork, a contour mapping subnetwork, and a reflectivity recognition subnetwork, can perform differentiated modeling and refined extraction of different types of defect features on the surface of the thermos cup. This solves the technical difficulties in existing image detection methods, such as unclear identification and inaccurate localization of minor surface scratches, dents, deformations, and local reflectivity anomalies. Among them, the texture deconstruction subnetwork can effectively analyze the directional changes, grayscale distribution, and local contrast differences of surface texture, improving the sensitivity to minor scratches and abrasions. The contour mapping subnetwork models edge morphology and structural offset, which is suitable for detecting structural deformation defects such as fractures and warping. The reflectivity recognition subnetwork focuses on the intensity, boundary, and distribution anomalies of high-brightness areas, making up for the shortcomings of traditional detection in accurately judging reflectivity interference areas.
[0100] Specifically, the texture structure features include texture orientation gradient change values, gray-level co-occurrence difference values, and texture block contrast offset values.
[0101] The specific steps for analyzing the texture perturbation index under the corresponding shooting angle are as follows: Read the texture structure features of the thermos cup to be detected under each shooting angle and perform normalization processing; perform comprehensive analysis on the normalized texture structure features to obtain the texture perturbation index of the thermos cup to be detected under each shooting angle.
[0102] The specific formula for calculating the texture perturbation index of the area to be detected on the thermos cup at a certain shooting angle is as follows: ;in, , , , The values, in order, are the texture perturbation index, texture direction gradient change value, gray-level co-occurrence difference value, and texture block contrast offset value of the area to be tested on the thermos cup under a certain shooting angle. , The values are, in order, the texture adjustment coefficient and the contrast adjustment coefficient stored in the database, and in this embodiment, they are respectively set to 0.95 and 0.55.
[0103] The texture adjustment coefficient ranges from [0.6, 1.2].
[0104] The range of the contrast adjustment coefficient is [0.3, 0.9].
[0105] In this implementation scheme, by jointly analyzing texture direction gradient change values, gray-level co-occurrence difference values, and texture block contrast offset values as texture structural features, and calculating the texture perturbation index accordingly, it can more accurately reflect the subtle changes and abnormal distribution of the surface texture of the thermos cup. Traditional methods often rely on single gray-level contrast or texture mean values for judgment, which are easily affected by factors such as uneven lighting and local reflections, leading to unclear identification of shallow defects such as scratches and abrasions. This scheme, through the combination of directional gradient extraction and gray-level co-occurrence statistics, can not only capture abrupt changes in surface texture direction, but also quantify local gray-level differences and contrast offsets, achieving accurate response to anomalies such as minor scratches and local stains. At the same time, by introducing texture adjustment coefficients and contrast adjustment coefficients, the calculation sensitivity can be adaptively adjusted for different surface roughness and gloss levels, avoiding excessive amplification of noise and improving the ability to identify details. This design effectively solves the problems of unstable texture features and ambiguous judgment criteria under reflective metallic materials.
[0106] Specifically, the shape and structural features include edge continuity length values, contour fitting offset values, multi-edge coverage ratio values, and contour closure ratio values.
[0107] like Figure 2 As shown, the specific steps for analyzing the contour offset index under the corresponding shooting angle are as follows: Read the edge continuous length value and contour fitting offset value of the area to be detected of the thermos cup under each shooting angle, and perform normalization processing; Combine the normalized edge continuous length value and contour fitting offset value of the area to be detected of the thermos cup under each shooting angle with the multi-edge coverage ratio and contour closure ratio under the corresponding shooting angle for comprehensive analysis to obtain the contour offset index under the corresponding shooting angle.
[0108] The specific formula for calculating the contour offset index of the area to be detected on the thermos cup at a certain shooting angle is as follows: ;in, , , , , The following are, in order: contour offset index of the area to be detected on the thermos cup at a certain shooting angle; edge continuity length (after normalization); contour fitting offset (after normalization); multi-edge coverage ratio; and contour closure ratio. , The values are, in order, the shape adjustment coefficient and the edge adjustment coefficient stored in the database, and in this embodiment, they are 1.10 and 0.65 respectively.
[0109] The value range of the shape adjustment coefficient is [0.8, 1.3].
[0110] The range of the edge adjustment coefficient is [0.4, 1.0].
[0111] In this implementation scheme, by introducing shape and structural features such as edge continuity length, contour fitting offset, multi-edge coverage ratio, and contour closure ratio, and fusing them into a contour offset index, the overall contour changes and local abnormal morphologies of the thermos cup surface can be comprehensively characterized. Compared with traditional methods that rely solely on edge detection or fitting errors, this scheme is more robust in identifying problems such as fractures, warping, and dents. For example, edge continuity length can reflect the extension trend of surface cracks, contour fitting offset can quantify the degree of structural deformation, and multi-edge coverage ratio and contour closure ratio further capture secondary interference boundaries and damage integrity, constructing a comprehensive profile of contour anomalies from multiple dimensions. In addition, by setting adjustable shape adjustment coefficients and edge adjustment coefficients, the system can flexibly adapt to the detection needs of different shooting angles or different cup structures, improving the overall stability and universality of recognition. This structured analysis method not only improves the interpretability of detection results but also enhances the sensitivity to minor structural defects, effectively improving the detection system's ability to identify complex deformations.
[0112] Specifically, the characteristics of the reflective area include the proportion of the bright area, the gradient value of the high-reflection boundary, the smoothness ratio of the reflective area, and the concentration deviation value of the bright grayscale.
[0113] like Figure 3As shown, the specific steps for analyzing the reflection focusing index at the corresponding shooting angle are as follows: Read the high-reflection boundary gradient value and the high-brightness grayscale concentration deviation value of the area to be tested of the thermos cup at each shooting angle, and perform normalization processing; Combine the normalized high-reflection boundary gradient value and high-brightness grayscale concentration deviation value of the area to be tested of the thermos cup at each shooting angle with the proportion of bright areas and the smoothness ratio of reflective areas at the corresponding shooting angle for comprehensive analysis to obtain the reflection focusing index at the corresponding shooting angle.
[0114] The specific formula for calculating the reflection focusing index of the area to be tested on the thermos cup at a certain shooting angle is as follows: ;in, , , , , The following parameters are, in order: the reflection focus index of the area to be tested on the thermos cup at a certain shooting angle, the proportion of the bright area, the gradient value of the high-reflectivity boundary (after normalization), the smoothness ratio of the reflective area, and the concentration deviation value of the bright grayscale (after normalization). This is a natural constant, and in this embodiment, it is taken as 2.71. , The gradient adjustment coefficient and focus adjustment coefficient are stored in the database, and in this embodiment, they are respectively set to 1.20 and 0.70.
[0115] The gradient adjustment coefficient takes values ranging from [0.6, 1.6].
[0116] The range of the focusing adjustment coefficient is [0.4, 1.0].
[0117] In this implementation scheme, by integrating multiple reflective region features such as the proportion of high-brightness areas, the gradient value of high-reflectivity boundaries, the smoothness ratio of reflective areas, and the concentration deviation value of high-brightness grayscale, a reflective focusing index with structured characteristics is constructed. This index can effectively reflect the true material characteristics and defect manifestations of the thermos cup surface under light interference. Unlike traditional methods that rely solely on brightness thresholds or boundary sharpness for judgment, this scheme starts from the "focusability of light" and incorporates the edge changes of reflective areas, the smoothness of the areas, and the concentration trend of high-brightness grayscale into the analysis. This allows for a more accurate distinction between normal high-brightness reflection and abnormal reflection caused by surface protrusions, scratches, or stains. Furthermore, the use of an exponential structure to introduce a natural constant allows the index value to have an amplified response effect on local abnormal areas, further improving the detection sensitivity. With the flexible configuration of gradient adjustment coefficients and focusing adjustment coefficients, this scheme can adapt to different surface materials and imaging environments, improving the ability to identify weak reflective anomalies. Thus, without affecting the judgment of normal reflective areas, it effectively improves the overall detection accuracy and stability.
[0118] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0119] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for detecting surface defects in a thermos cup based on image features, characterized in that, Includes the following steps: Acquire angular images of the area to be detected on the thermos cup from multiple shooting angles and perform preprocessing; The angle image at each shooting angle is input into the pre-trained angle feature extraction model to extract the angle image feature set at the corresponding shooting angle, including texture structure features, shape structure features and reflection area features; Based on the angular image feature set at each shooting angle, the texture perturbation index, contour offset index, and reflection focusing index at the corresponding shooting angle are analyzed respectively. The texture disturbance index, contour offset index, and reflection focus index at each shooting angle are matched and analyzed with the preset defect judgment interval set for that shooting angle. The defect judgment interval set includes texture abnormality interval, contour abnormality interval, and reflection abnormality interval. If any index falls into its corresponding abnormal range, then the corresponding shooting angle is marked as a defective image.
2. The method for detecting surface defects of a thermos cup based on image features according to claim 1, characterized in that, The angle image is composed of a number of image pixels, and each image pixel corresponds to an image grayscale value.
3. The method for detecting surface defects of a thermos cup based on image features according to claim 1, characterized in that, The angle feature extraction model includes a texture deconstruction subnetwork, a contour mapping subnetwork, and a reflection recognition subnetwork.
4. The method for detecting surface defects of a thermos cup based on image features according to claim 3, characterized in that, The specific steps for extracting the angle image feature set at the corresponding shooting angle are as follows: In the texture deconstruction subnetwork of the angle feature extraction model, texture direction analysis and grayscale distribution comparison are performed on the preprocessed thermos cup detection area under multiple shooting angles to obtain the texture structure features under the corresponding shooting angle. In the contour mapping sub-network of the angle feature extraction model, edge extraction and structure fitting analysis are performed on the preprocessed thermos cup detection area under multiple shooting angles to obtain the shape and structure features under the corresponding shooting angles. In the reflection recognition sub-network of the angle feature extraction model, the high-brightness region detection and boundary transition analysis are performed on the angle images of the preprocessed thermos cup to be detected area under multiple shooting angles to obtain the reflection area features under the corresponding shooting angle.
5. The method for detecting surface defects of a thermos cup based on image features according to claim 1, characterized in that, Texture structure features include texture direction gradient change values, gray-level co-occurrence difference values, and texture block contrast offset values.
6. The method for detecting surface defects of a thermos cup based on image features according to claim 5, characterized in that, The specific steps for analyzing the texture perturbation index at the corresponding shooting angle are as follows: Read the texture structure features of the area to be detected on the thermos cup at each shooting angle and perform normalization processing; By comprehensively analyzing the normalized texture structure features, the texture perturbation index of the thermos cup detection area under each shooting angle is obtained.
7. The method for detecting surface defects of a thermos cup based on image features according to claim 1, characterized in that, Shape and structural features include edge continuity length, contour fitting offset, multi-edge coverage ratio, and contour closure ratio.
8. The method for detecting surface defects of a thermos cup based on image features according to claim 7, characterized in that, The specific steps for analyzing the contour offset index under the corresponding shooting angle are as follows: Read the edge continuous length value and contour fitting offset value of the area to be detected of the thermos cup at each shooting angle, and perform normalization processing; The normalized edge continuity length value and contour fitting offset value of the thermos cup detection area under each shooting angle are combined with the multi-edge coverage ratio and contour closure ratio under the corresponding shooting angle for comprehensive analysis to obtain the contour offset index under the corresponding shooting angle.
9. The method for detecting surface defects of a thermos cup based on image features according to claim 1, characterized in that, The characteristics of the reflective area include the proportion of the bright area, the gradient value of the high reflectivity boundary, the smoothness ratio of the reflective area, and the concentration deviation value of the bright grayscale.
10. The method for detecting surface defects of a thermos cup based on image features according to claim 9, characterized in that, The specific steps for analyzing the reflection focusing index at the corresponding shooting angle are as follows: Read the high-reflectivity boundary gradient value and high-brightness grayscale concentration deviation value of the area to be detected in the thermos cup at each shooting angle, and perform normalization processing; The normalized high-reflectivity boundary gradient value and high-brightness grayscale concentration deviation value of the thermos cup under each shooting angle are combined with the proportion of high-brightness area and the smoothness ratio of reflective area under the corresponding shooting angle for comprehensive analysis to obtain the reflection focusing index under the corresponding shooting angle.
Citation Information
Cited By
Method and system for detecting surface defects of precast concrete component
CN121955017A
A method and system for detecting surface defects of a concrete precast member
CN121955017B