Mobile phone glass quality detection method and system based on image detection
By constructing a transparency enhancement algorithm and a self-enhancing step for crack boundaries, combined with optical physical property inversion and saliency learning networks, the problems of false detection and missed detection in mobile phone glass detection under transparent backgrounds are solved, the ability to identify micro-cracks and scratches is improved, and more accurate quality judgment is achieved.
Patent Information
- Application Number
- CN202510969901.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-15
- Publication Date
- 2025-10-24
AI Technical Summary
Existing technologies are easily affected by transparent backgrounds when detecting defects in mobile phone glass, leading to false positives or false negatives. They are particularly difficult to identify defects with blurred boundaries, such as micro-cracks and blurry scratches with extremely low contrast.
By constructing a transparency enhancement algorithm and a crack boundary self-enhancement step, combined with optical physical property inversion, background response suppression mechanism and saliency learning network, the ability to identify microcracks and scratches is improved, including multi-scale filter bank and crack boundary self-enhancement processing.
It significantly reduces detection errors, improves the distinguishability of the main glass area against a transparent background, enhances the ability to identify minute defects, reduces the false negative rate, and provides more accurate quality judgment results.
Smart Images

Figure CN120833320A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image defect detection, in particular to a mobile phone glass quality detection method and system based on image detection. BACKGROUND
[0002] According to the Chinese patent with publication number CN202510025720.1, a mobile phone glass cover plate defect detection method, system, device and storage medium are disclosed. The main technical principle of the patent is to obtain a first gray scale image of a glass cover plate to be detected and a second gray scale image of a standard glass cover plate; align the second gray scale image with the first gray scale image pixel by pixel; calculate the gray scale value difference of each pixel of the first gray scale image and the second gray scale image to obtain a residual image; calculate the Otsu best threshold value of the residual image; perform binaryzation processing on the residual image according to the Otsu best threshold value to obtain a binary image; and determine the defect position of the glass cover plate to be detected according to the binary image.
[0003] However, the above scheme has the following disadvantages in actual application:
[0004] Firstly, the current disclosed detection method is based on the gray scale difference between the standard glass image and the glass image to be detected to generate a residual image and perform binaryzation processing, ignoring the large transparent background area in the image. Since the transparent background is optically similar to the glass cover plate body when imaging, it is easy to cause the background transmission area and the glass area to show high similarity in the gray scale space, causing the response of the residual image to the background interference to be enhanced, thereby causing false detection or missed detection in the binaryzation stage, reducing the accuracy and robustness of the overall detection.
[0005] Secondly, the existing technology mainly relies on pixel-level gray scale difference to construct a defect image, which is difficult to effectively identify microcracks and fuzzy scratches with extremely low contrast and other boundary fuzzy defects. Such defects often present sub-pixel level brightness mutation or discontinuous texture structure, which is difficult to obtain stable response under the traditional residual image and fixed threshold segmentation mechanism, resulting in that part of the slight but potentially risky defect area cannot be accurately detected, and there is a missing risk in actual application. SUMMARY
[0006] The present application provides a mobile phone glass quality detection method and system based on image detection, aiming to solve the problem of false detection or missed detection in mobile phone glass detection under a transparent background in related technologies, and to solve the problem of difficulty in identifying microcracks and fuzzy scratches with extremely low contrast and other boundary fuzzy defects.
[0007] In order to achieve the above purpose, in the present application, a mobile phone glass quality detection method based on image detection is provided, comprising the following steps:
[0008] An imaging condition for collecting a mobile phone glass image is configured, and an original image of the mobile phone glass is collected according to the configured imaging condition.
[0009] A transparency enhancement algorithm is constructed according to the transparent background existing in the collected original image, and an enhanced image is obtained by processing the original image according to the transparency enhancement algorithm.
[0010] A crack boundary self-enhancement step is introduced, and micro cracks and blurred scratches existing in the enhanced image are positioned, the enhanced image is marked according to the positioning results of the micro cracks and the blurred scratches, and a marked image is obtained.
[0011] According to the marked image, the crack size, position coordinates and boundary integrity parameters in the marked image are extracted, the extracted results are compared with a glass defect discrimination standard library, and the corresponding glass quality discrimination result is output according to the comparison result.
[0012] Preferably, the imaging condition for collecting the mobile phone glass image is configured, and the original image of the mobile phone glass is collected according to the configured imaging condition, specifically including:
[0013] By configuring a standardized imaging parameter set for mobile phone glass image collection, the standardized imaging parameter set includes light source irradiation angle, irradiation mode, exposure time, light sensitivity gain and imaging resolution.
[0014] According to the standardized imaging parameter set, the imaging device is controlled to collect the original image of the mobile phone glass containing the transparent background area, the original image at least includes the glass main body area, the edge buffer area and the background transmission area, and the original image is used for optical model construction and image inversion processing of the transparency enhancement algorithm.
[0015] Preferably, the transparency enhancement algorithm is constructed according to the transparent background existing in the collected original image, and the enhanced image is obtained by processing the original image according to the transparency enhancement algorithm, specifically including:
[0016] A multi-scale filter set is designed, an image guiding mechanism based on the structure characteristics of glass defects is introduced, and the original image is preprocessed according to the image guiding mechanism based on the structure characteristics of glass defects and the multi-scale filter set to obtain a preprocessed image.
[0017] An optical and physical property driven brightness inversion model is constructed, the preprocessed image is input into the brightness inversion model, and a physical property compensation image is output.
[0018] A defect saliency learning network containing a transparent background special attention mechanism is constructed, the physical enhanced image is input, the defect saliency learning network is guided to focus on the micro crack and scratch feature area, the response strength of the background and uniform area is suppressed, and the enhanced image is output.
[0019] Preferably, an optical-physical property driven brightness inversion model is constructed, the pre-processed image is input into the brightness inversion model, and a physical property compensation image is output. Specifically, the brightness inversion model comprises the following steps:
[0020] The average refractive index, light transmittance coefficient and surface reflectivity of the glass material are taken as prior parameters of the brightness inversion model, a pixel-level optical brightness inversion function is constructed, and the brightness values of the pixel points in the original image are physically compensated.
[0021] The brightness inversion function is used to quantify the brightness distortion caused by refraction interference in the glass imaging area, and is defined by the following formula:
[0022]
[0023] In the formula, represents the brightness compensation value of the pixel point with coordinates in the image after the brightness inversion processing is performed, represents the original brightness value of the corresponding pixel point in the pre-processed image, represents the average refractive index of the glass material, represents the light transmittance coefficient of the glass material, reflecting the retention proportion of the light energy after the light energy transmits through the glass, represents the reflectivity of the glass surface, used to reflect the reflection proportion of the incident light at the glass interface.
[0024] The brightness compensation value of each pixel point in the processed image is calculated by the brightness inversion function, the brightness of the processed image is physically restored under the condition of refraction interference according to the calculated brightness compensation value, and a physical property compensation image is formed according to the physically restored processed image.
[0025] Preferably, a defect saliency learning network containing a transparent background special attention mechanism is constructed, a physical enhancement image is input, the defect saliency learning network is guided to focus on the micro crack and scratch feature area, the response strength of the background and uniform area is suppressed, and an enhanced image is output. Specifically, the defect saliency learning network comprises the following steps:
[0026] A saliency learning structure based on a convolutional neural network is constructed, a physical enhancement image is used as an input image, a transparent background special attention mechanism is embedded in the encoding and decoding paths, and the focusing ability of the model on the micro crack and scratch area is improved.
[0027] The transparent background special attention mechanism comprises the following steps: based on the pixel heterogeneity score, the brightness gradient change rate and the texture direction change amplitude of each pixel point in the local window are jointly calculated to obtain a saliency initial score map.
[0028] In the saliency initial score map, image regions with scores higher than a first threshold value are extracted as focus regions, and a weighted enhancement operation is performed on the feature channels corresponding to the focus regions to strengthen the texture feature responses of microscopic defect regions.
[0029] The first threshold value is used to determine the internal structural heterogeneity of the region, and is set according to the statistical results of the average gradient values of the crack regions in the training data set, and is set to 1.5 to 2.0 times the average gradient value of the entire image.
[0030] At the same time, channel activation suppression operation is performed on image regions with scores lower than a second threshold value to weaken the response of uniform background regions; the second threshold value is used to identify background regions or flat image regions, and is set to less than 0.8 times the average gradient value of the entire image.
[0031] After the attention focus of the defect saliency learning network is completed, the image size is restored through the decoding path, and an enhanced image is output, in which the saliency response intensity of the defect region is obviously higher than that of the background region.
[0032] The output enhanced image satisfies the following response suppression constraint conditions:
[0033]
[0034] In the formula, represents the saliency response value of the pixel point with coordinates in the enhanced image, represents the pixel region identified as the background; represents the total number of pixel points in the background region; represents the background region saliency suppression threshold.
[0035] Preferably, a crack boundary self-enhancement step is introduced, which is used to locate microscopic cracks and fuzzy scratches existing in the enhanced image, and according to the positioning results of the microscopic cracks and fuzzy scratches, the enhanced image is marked to obtain a marked image, which specifically includes:
[0036] The brightness gradient distribution map and the texture direction map are extracted in the enhanced image, and a structure prior boundary candidate map is constructed according to the brightness change rate of the pixels in the enhanced image and the texture continuity feature, which is used to identify the pixel distribution area of the potential crack or scratch edge.
[0037] The structure prior boundary candidate map is subjected to scale grouping processing, and edge structures of different intensities and widths are divided into three scales, including small scale, corresponding to 1 to 3 pixel width; medium scale, corresponding to 3 to 8 pixel width; large scale, corresponding to greater than or equal to 8 pixel width three types of structure regions.
[0038] For three different scale structure regions, a residual enhancement filter is applied for boundary enhancement processing, the filter is calculated by the brightness difference residual value between the local edge and the surrounding background, the local enhancement of the edge response is realized, and the boundary residual response map is output.
[0039] The boundary residual response map and the saliency map output by the defect saliency learning network are pixel-by-pixel weighted and fused to obtain a joint response map, and the area with a high response value in the joint response map has both edge structure strength and defect saliency features.
[0040] The boundary connected domain of the area in the joint response map whose pixel response value is higher than the boundary enhancement judgment threshold is extracted, and the boundary enhancement judgment threshold is set to the 85th percentile of the response value distribution of the joint response map, which is used to retain the structure area with the most prominent boundary saliency.
[0041] In the boundary connected domain, noise points are removed and false boundaries are eliminated according to the crack direction consistency and curvature distribution rules, and the crack contour line with continuous structure characteristics is retained.
[0042] The finally extracted crack contour line is numbered and encoded to generate a marked image aligned with the size of the enhanced image, and each crack area in the marked image contains a corresponding boundary coordinate set, crack contour width and length index, which is used for size comparison and defect level evaluation in the subsequent quality discrimination step.
[0043] Preferably, the quality discrimination is performed according to the marked image, the crack size, position coordinates and boundary integrity parameters in the marked image are extracted, the extracted results are compared with the preset glass defect discrimination standard, and the corresponding glass quality discrimination result is output according to the comparison result, specifically including:
[0044] The crack area in the marked image which has completed the numbering and coding is executed for region attribute extraction operation, the boundary coordinate set of each crack area is obtained, and the length, maximum width, minimum width and average width index of the corresponding crack are calculated based on the boundary coordinates.
[0045] The crack main axis is constructed by the boundary point trajectory, the shortest distance between the crack main axis and the glass edge region is calculated, and the spatial position coordinates of the crack relative to the glass main body region are obtained.
[0046] The integrity score parameter of the crack contour is extracted based on the boundary coordinate curvature change rate, and the score parameter is used to measure whether the crack has discontinuous structure defects such as cracking, breakpoints and boundary interruption.
[0047] A glass defect discrimination standard library is constructed, the standard library is constructed according to the glass factory quality standard data set, and contains multi-level discrimination interval rules of crack length, width, boundary integrity score and position region.
[0048] The discrimination standard library includes three classification results: the first level defect represents a crack length exceeding 20 mm or a width exceeding 1.5 mm, or a boundary fracture; the second level defect represents a length of 10-20 mm, a width of 0.5-1.5 mm, and a contour integrity score less than 0.85; and the third level is an acceptable crack with a length less than 10 mm, a width less than 0.5 mm, and an integrity score higher than 0.9.
[0049] The defect parameter comparison process is performed, each crack area attribute extracted is matched with the corresponding index item in the standard library, and the comparison result label is output.
[0050] When the comparison result matches any of the above three classification levels, the quality discrimination level corresponding to the current glass image is assigned, and the comparison results of all crack areas are summarized, and the most serious level is taken as the final quality level of the whole glass sample.
[0051] If there is a crack area in the marked image that cannot match any level in the standard library, a non-standard crack marking process is triggered, the current crack area parameters are recorded, and the state of manual review is marked, and a defect warning prompt is output for subsequent manual intervention review.
[0052] The image detection-based mobile phone glass quality detection method further includes a cross-domain feature normalization mechanism, specifically including:
[0053] Based on the original image after acquisition, three processing steps of gray scale histogram normalization processing, background brightness plane compensation, and view angle projection readjustment are sequentially performed to obtain a standardized image.
[0054] The gray scale histogram normalization processing is to match the current image gray scale histogram with the reference template of the training sample, and correct the brightness distribution curve through histogram mapping.
[0055] The background brightness plane compensation is to collect the brightness point array in the image background area, fit the brightness plane function, and the calculation formula is:
[0056]
[0057] In the formula, represents the fitted brightness value at position , and are the fitting coefficients, respectively; the image after the gray scale histogram normalization processing is subjected to plane brightness restoration according to the background brightness plane compensation.
[0058] The perspective projection is readjusted as follows: based on the relative lens posture parameters recorded during image acquisition, a back-projection transformation model is constructed, geometric correction is performed on the image after plane brightness restoration, and the structural consistency coordinate system under the standard shooting perspective is restored; the image that has completed cross-domain feature normalization processing is input into subsequent image enhancement.
[0059] This application also provides a mobile phone glass quality inspection system based on image detection, including the following modules:
[0060] The image acquisition module is used to configure the imaging conditions for collecting mobile phone glass images and collect the original images of the mobile phone glass according to the configured imaging conditions.
[0061] The transparency enhancement module is used to construct a transparency enhancement algorithm according to the transparent background in the collected original image, and process the original image according to the transparency enhancement algorithm to obtain an enhanced image.
[0062] The crack boundary enhancement module is used to introduce a crack boundary self-enhancement step, locate the micro cracks and fuzzy scratches in the enhanced image, and mark the enhanced image according to the positioning results of the micro cracks and fuzzy scratches to obtain a marked image.
[0063] The quality judgment module is used to perform quality judgment based on the marked image, extract the crack size, position coordinates and boundary integrity parameters in the marked image, compare the extracted results with the glass defect judgment standard library, and output the corresponding glass quality judgment results based on the comparison results.
[0064] The mobile phone glass quality inspection system based on image detection also includes a cross-domain feature normalization module, which specifically includes:
[0065] The cross-domain feature normalization module includes a grayscale histogram unit, a brightness plane compensation unit and a viewing angle projection readjustment unit.
[0066] The grayscale histogram unit is used to match the grayscale histogram of the current image with the reference template of the training sample and correct the brightness distribution curve through histogram mapping.
[0067] The brightness plane compensation unit is used to collect brightness dots in the background area of the image and fit the brightness plane function. The calculation formula is:
[0068]
[0069] Where, Indicates location The fitted brightness value, are fitting coefficients respectively; the plane brightness of the image after grayscale histogram normalization is restored based on the background brightness plane compensation.
[0070] The view angle projection re-adjusting unit is used for constructing a reverse projection transformation model according to a lens relative attitude parameter recorded during image acquisition, performing geometric correction on the image after the plane brightness restoration, and restoring the structural consistency coordinate system under the standard shooting view angle; and inputting the image after the cross-domain feature normalization processing into the transparency enhancement module.
[0071] The beneficial effects of the present application are:
[0072] In view of the misjudgment problem caused by the failure of the existing detection method to effectively distinguish the glass cover plate from the transparent background area, the present application introduces an optical physical property inversion and background response suppression mechanism in the original image processing flow by constructing a transparency enhancement algorithm, which can explain the brightness distortion caused by refraction interference at the pixel level, and suppress the response strength of the background and homogeneous area through a special attention mechanism; it is helpful to improve the distinguishability of the glass main area in the image under complex imaging conditions containing a transparent background, and provides a contrast-enhanced image basis for the subsequent defect detection process, thereby significantly reducing the detection error caused by the optical similarity of the background.
[0073] In view of the problem of insufficient recognition ability of the existing detection method for low-contrast micro-cracks and blurred scratches, the present application introduces a scratch boundary self-enhancement step, combines the brightness gradient and texture direction distribution information in the image, constructs a structure prior graph, and realizes boundary detail enhancement processing under the multi-scale residual filtering and saliency map weighting mechanism; it can effectively extract the continuous crack profile in the sub-pixel brightness fluctuation range, and eliminate noise and false boundaries through boundary connectivity screening and structure consistency constraint, improve the complete recognition ability of micro-defects, and reduce the omission rate, and provide more accurate crack area structure description for subsequent quality discrimination.
[0074] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the following preferred embodiments are described in detail below, and the accompanying drawings are described as follows. BRIEF DESCRIPTION OF DRAWINGS
[0075] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments of the present application. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0076] Figure 1 The flow chart of the mobile phone glass quality detection method based on image detection provided by the embodiments of the present application.
[0077] Figure 2 The overall framework diagram of the mobile phone glass quality detection system based on image detection provided by the embodiments of the present application. DETAILED DESCRIPTION
[0078] The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
[0079] Please refer to Figure 1 , Figure 1 The flowchart of the mobile phone glass quality detection method based on image detection provided in the embodiments of the present application.
[0080] In the present embodiment, the mobile phone glass quality detection method based on image detection comprises steps S100, S200, S300 and S400.
[0081] Step S100, configuring imaging conditions for collecting mobile phone glass images, collecting original images of mobile phone glass according to the configured imaging conditions, specifically comprising:
[0082] By configuring a standardized imaging parameter set for mobile phone glass image collection, the standardized imaging parameter set includes light source irradiation angle, irradiation mode, exposure time, photosensitive gain and imaging resolution.
[0083] According to the standardized imaging parameter set, the imaging device is controlled to collect mobile phone glass original images containing transparent background area, the original image at least includes glass body area, edge buffer area and background transmission area, and the original image is used for optical model construction and image inversion processing of transparency enhancement algorithm.
[0084] It should be noted that the light source irradiation angle is set to 30°-60°, which is used to highlight the reflection characteristics of the small texture on the glass surface; the irradiation mode includes top diffuse light and oblique side angle directional light composite lighting to reduce excessive mirror reflection; the exposure time and photosensitive gain are jointly adjusted to prevent image overexposure or overdarkness caused by high light transmission of glass; the imaging resolution is set to no less than 2000x2000 pixels to ensure the image definition of micro-cracks; by configuring the above imaging parameters, the collected original image retains the glass body structure, edge connection characteristics and background transmission information, so that the subsequent transparency enhancement algorithm establishes a reflection interference suppression model based on the transmission distribution and physical structure characteristics of the glass, thereby improving the distinguishability and accuracy of defect detection.
[0085] The mobile phone glass quality detection method based on image detection further comprises a cross-domain feature normalization mechanism, specifically comprising:
[0086] Based on the original image collected, three processing steps of gray histogram normalization processing, background brightness plane compensation and view angle projection re-adjustment are sequentially performed to obtain a standardized image.
[0087] The gray scale histogram normalization processing is: matching the current image gray scale histogram with the reference template of the training sample, and correcting the brightness distribution curve through histogram mapping.
[0088] The background brightness plane compensation is: collecting the brightness point array in the image background area, fitting the brightness plane function, and the calculation formula is:
[0089]
[0090] In the formula, represents the position of the fitting brightness value, respectively, are fitting coefficients; the image after the background brightness plane compensation and the gray scale histogram normalization processing is subjected to plane brightness restoration.
[0091] The view angle projection re-adjustment is: constructing an inverse projection transformation model according to the recorded lens relative attitude parameters during image acquisition, performing geometric correction on the image after the plane brightness restoration, and restoring the structure-consistent coordinate system under the standard shooting view angle; and inputting the image after the cross-domain feature normalization processing into the subsequent image enhancement.
[0092] Step S200, constructing a transparency enhancement algorithm according to the transparent background existing in the collected original image, processing the original image according to the transparency enhancement algorithm to obtain an enhanced image, specifically including:
[0093] A multi-scale filter bank is designed, an image guiding mechanism based on glass defect structure characteristics is introduced, and the original image is preprocessed according to the image guiding mechanism based on glass defect structure characteristics and the multi-scale filter bank to obtain a preprocessed image.
[0094] It should be noted that designing a multi-scale filter bank means that the structural response of the multi-size defects such as cracks and scratches in the image is strengthened based on different spatial frequency domains, and the filter bank includes multiple high-pass filter kernels with different sizes, which are respectively used to respond to slight scratches with a width of 10 to 18 pixels and structural crack regions with a width of more than 8 pixels, forming a progressive enhancement filter response system from small scale to large scale, which is used to enhance the edge contrast of potential defect regions and suppress the background low-frequency region.
[0095] It should be noted that the image guiding mechanism based on glass defect structure characteristics means that a guide image is constructed using the brightness gradient direction information, edge density change and crack curvature distribution characteristics in the original image. The guide image participates in the weight adjustment of the filter channel as a structural prior in the image filtering process, so that the filtering process can enhance the ability to maintain microscopic defect structures in non-uniform boundary regions while maintaining the continuity of the glass body boundary, and improve the structural stability and feature consistency in the subsequent physical modeling and saliency learning stages.
[0096] Constructing an optical physical property driven brightness inversion model, inputting the pre-processed image into the brightness inversion model, and outputting a physical property compensated image, specifically including:
[0097] Taking the average refractive index, light transmission coefficient and surface reflectivity of the glass material as the prior parameters of the brightness inversion model input, constructing a pixel-level optical brightness inversion function, and performing physical compensation on the brightness value of each pixel point in the original image.
[0098] The brightness inversion function is used to quantify the brightness distortion caused by refraction interference in the glass imaging area, and the formula is defined as:
[0099]
[0100] In the formula, represents the brightness compensation value of the pixel point with coordinates in the image after performing brightness inversion processing, represents the original brightness value of the corresponding pixel point in the pre-processed image, represents the average refractive index of the glass material, and the numerical range is 1.45 to 1.52; represents the light transmission coefficient of the glass material, reflecting the retention proportion of the light energy after penetrating through the glass, and the numerical range is 0 to 1; represents the reflectivity of the glass surface, which is used to reflect the reflection proportion of the incident light on the glass interface, and the numerical range is 0 to 1.
[0101] Through the brightness inversion function, the corresponding brightness compensation value of each pixel point in the processed image is calculated, and the brightness of the processed image is physically restored under the condition of refraction interference according to the calculated brightness compensation value; and the physical property compensated image is formed according to the physically restored processed image.
[0102] Constructing a defect saliency learning network containing a transparent background special attention mechanism, taking the physical enhancement image as the input, guiding the defect saliency learning network to focus on the micro crack and scratch feature area, and suppressing the response strength of the background and uniform area, and outputting an enhanced image, specifically including:
[0103] Constructing a saliency learning structure based on a convolutional neural network, taking a physical enhancement image as an input image, and embedding a transparent background special attention mechanism in the encoding and decoding path, for improving the focusing ability of the model on the micro crack and scratch area.
[0104] The transparent background special attention mechanism includes: based on the pixel heterogeneity score, the brightness gradient change rate and the texture direction change amplitude of each pixel point in the local window are jointly calculated to obtain a saliency initial score map.
[0105] It should be noted that the joint calculation process of the brightness gradient change rate and the texture direction change amplitude is implemented based on the statistical feature extraction mechanism in the local window, which aims to comprehensively reflect the structural complexity and directional fluctuation of the area around each pixel point, and is used to build a saliency scoring basis with discriminative ability. Specifically, first, in the enhanced image, each pixel point As the center, establish a radius of Local analysis window , perform Sobel operator extraction on the pixel brightness distribution in the window, and obtain the horizontal direction Vertical direction The brightness gradient response; calculate the local brightness gradient change rate , the calculation formula is defined as:
[0106]
[0107] Where, and Respectively represents the brightness and The rate of change of the gradient in the direction; is the mean brightness within the local window.
[0108] In the initial saliency score map, image areas with scores higher than the first threshold are extracted as the areas to be focused, and a weighted enhancement operation is performed on the feature channels corresponding to the focused areas to enhance the texture feature response of the micro-defect areas.
[0109] Among them, the first threshold is used to determine the degree of internal structural heterogeneity of the region, and is set according to the statistical results of the average gradient value of the crack area in the training data set, and is set to 1.5 to 2.0 times the average gradient value of the entire image.
[0110] At the same time, a channel activation suppression operation is performed on image areas with scores lower than a second threshold to weaken the response of uniform background areas; the second threshold is used to identify background areas or flat areas of the image and is set to less than 0.8 times the average gradient value of the entire image.
[0111] After the defect saliency learning network completes attention focusing, the image size is restored through the decoding path and an enhanced image is output, in which the saliency response intensity of the defect area is significantly higher than that of the background area.
[0112] The output enhanced image satisfies the following suppression response constraints:
[0113]
[0114] Where, Indicates that the coordinates in the enhanced image are The significant response value of the pixel point, represents a pixel region identified as background; represents the total number of pixels in the background region; represents a background region saliency suppression threshold, set in the range of 0.1 to 0.25.
[0115] Step S300, a crack boundary self-enhancement step is introduced to locate the micro cracks and fuzzy scratches existing in the enhanced image, and according to the positioning results of the micro cracks and fuzzy scratches, the enhanced image is marked to obtain a marked image, specifically including:
[0116] In the enhanced image, the brightness gradient distribution map and the texture direction map are extracted, and the structure prior boundary candidate map is constructed according to the brightness change rate of the pixels in the enhanced image and the texture continuity feature, which is used to identify the pixel distribution area of the potential crack or scratch edge.
[0117] The structure prior boundary candidate map is subjected to scale grouping processing, and edge structures of different intensities and widths are divided into three scales, including small scale, corresponding to 1 to 3 pixel width; medium scale, corresponding to 3 to 8 pixel width; large scale, corresponding to greater than or equal to 8 pixel width three types of structure regions.
[0118] For the three different scale structure regions, a residual enhancement filter is applied for boundary enhancement processing, the filter is calculated by the brightness difference residual value between the local edge and the surrounding background, realizing the local enhancement of the edge response, and outputting the boundary residual response map.
[0119] It should be noted that the residual enhancement filter is constructed based on the edge intensity change trend in the local region, first the brightness difference between the center pixel and the surrounding eight neighborhood pixels in the structure candidate region is calculated to form a residual vector set, then a weighted response factor is constructed based on the residual mean and standard deviation, which is used to dynamically enhance the local contrast of the brightness change in the boundary region; avoid the problem of false expansion of the edge caused by uniform enhancement, and accurately highlight the real outline response of the potential crack edge.
[0120] The boundary residual response map and the saliency map output by the defect saliency learning network are subjected to pixel-by-pixel weighted fusion to obtain a joint response map, the area with high response value in the joint response map has both edge structure intensity and defect saliency feature.
[0121] It should be noted that the defect saliency feature refers to the feature expression ability of the image region activated by the high response in the defect saliency learning network, the defect saliency region has typical defect attributes such as asymmetric structure, gradient discontinuity and texture disturbance, and the activation intensity of the defect saliency region in the defect saliency learning network is significantly higher than that of the background region, reflecting the abnormality in the overall feature map.
[0122] A boundary connected domain is extracted for a region in which the pixel response value in the joint response map is higher than a boundary enhancement determination threshold value, the boundary enhancement determination threshold value being set as the 85th percentile of the response value distribution of the joint response map, for retaining a structure region with the most prominent boundary saliency.
[0123] It should be noted that the structure region with the most prominent saliency refers to a pixel aggregation region that simultaneously satisfies the double high response of edge intensity and saliency score in the joint response map, the structure region with the most prominent saliency presents high local contrast in space and has a consistent structure trend in direction, and is a high confidence identifier for the true existence of the crack or scratch boundary.
[0124] Noise points are removed and false boundaries are eliminated in the boundary connected domain according to the crack trend consistency and curvature distribution rule, and a crack contour line with continuous structure characteristics is retained.
[0125] It should be noted that the crack trend consistency refers to the change amplitude of the main direction vector of adjacent pixels in the boundary connected domain being less than a preset tolerance threshold, and the preset tolerance threshold is specifically within 15°, indicating that the crack presents a relatively consistent growth trend in the current region; the curvature distribution rule refers to calculating the curvature of the boundary point sequence based on the fitting curve, and screening out isolated points with sharp curvature fluctuations, so as to exclude false boundary responses caused by accidental texture misjudgment, and improve the stability and authenticity of crack extraction.
[0126] The finally extracted crack contour line is numbered and coded to generate a mark image aligned with the size of the enhanced image, each crack region in the mark image containing a corresponding boundary coordinate set, crack contour width and length indicators, for performing size comparison and defect level assessment in the subsequent quality discrimination step.
[0127] In step S400, the quality discrimination is performed according to the mark image, the crack size, position coordinates and boundary integrity parameters in the mark image are extracted, the extracted results are compared with a glass defect discrimination standard library, and a corresponding glass quality discrimination result is output according to the comparison result, specifically including:
[0128] The region attribute extraction operation is performed on the crack region in the mark image that has been numbered and coded, the boundary coordinate set of each crack region is obtained, and the length, maximum width, minimum width and average width indicators of the corresponding crack are calculated based on the boundary coordinates.
[0129] The crack main axis is constructed by the boundary point trajectory, the shortest distance between the crack main axis and the glass edge region is calculated, and the spatial position coordinates of the crack relative to the glass main region are obtained.
[0130] The integrity score parameter is extracted based on the curvature rate of change of the boundary coordinates, and is used to measure whether the crack has a discontinuous structural defect such as a fracture, a breakpoint, or a boundary interruption.
[0131] It should be noted that the score parameter is used to evaluate the continuity and closeness of the crack profile boundary, specifically including three indicators of the curvature rate standard deviation of the boundary pixel sequence, the edge interruption length proportion, and the edge direction vector consistency; the numerical range of the score parameter is 0 to 1, and the higher the value, the more complete and continuous the boundary structure is; if the integrity score is less than 0.8, it means that the crack has obvious breakpoints or boundary missing, affecting the stability of the structure recognition.
[0132] A glass defect discrimination standard library is constructed, which is constructed according to a glass factory quality standard data set and contains multi-level discrimination interval rules of crack length, width, boundary integrity score, and location area.
[0133] The discrimination standard library includes three-level classification results: the first-level defect represents a crack length exceeding 20 mm or a width exceeding 1.5 mm, or a boundary fracture; the second-level defect represents a length of 10 to 20 mm, a width of 0.5 to 1.5 mm, and a profile integrity score less than 0.85; and the third-level is an acceptable crack, with a length less than 10 mm, a width less than 0.5 mm, and an integrity score higher than 0.9.
[0134] A defect parameter comparison process is performed, in which each crack region attribute extracted is matched with the corresponding index item in the standard library one by one, and the comparison result label is output.
[0135] It should be noted that the corresponding index refers to the crack length, maximum width, average width, profile integrity score, and crack position coordinates extracted from the marked image, which correspond to the comparison items in the standard library respectively, and are used to match the grade attributes of the crack one by one; during the matching process, an interval judgment and an upper and lower boundary tolerance control mechanism are adopted to ensure the robustness and accuracy of the comparison, and to avoid misjudgment caused by the edge fuzzy area.
[0136] When the comparison result matches any of the above three-level classifications, the corresponding quality discrimination level of the current glass image is assigned, and the comparison results of all crack regions are summarized, and the most serious level is taken as the final quality level of the whole glass sample.
[0137] If there is a crack region in the marked image that cannot match any level in the standard library, a non-standard crack marking process is triggered, the current crack region parameters are recorded, and the crack region is marked as a state to be manually reviewed, and a defect warning prompt is output for subsequent manual intervention and review.
[0138] It should be noted that the manual intervention review refers to that in the automatic identification process of the glass defect, when the crack characteristics do not meet the pre-defined standard classification conditions, or multiple crack region attribute parameters are inconsistent, the crack region is marked as an undefined type, and a review task number is automatically generated; the review task includes image interception, parameter display and comparison record, so that the artificial quality inspection personnel can judge the defect level, so as to ensure the comprehensiveness of quality evaluation and the traceability of final output.
[0139] At this point, the image detection-based mobile phone glass quality detection method is completed.
[0140] Please refer to Figure 2 , Figure 2 The overall framework diagram of the image detection-based mobile phone glass quality detection system provided by the embodiment of the application is shown in the following figure.
[0141] In the embodiment, the image detection-based mobile phone glass quality detection system comprises the following modules:
[0142] The image acquisition module is configured to collect the image of the mobile phone glass, and collect the original image of the mobile phone glass according to the configured imaging condition.
[0143] The transparency enhancement module is configured to construct a transparency enhancement algorithm according to the transparent background existing in the collected original image, and process the original image according to the transparency enhancement algorithm to obtain an enhanced image.
[0144] The crack boundary enhancement module is configured to introduce a crack boundary self-enhancement step, position the micro-cracks and fuzzy scratches existing in the enhanced image, mark the enhanced image according to the positioning results of the micro-cracks and fuzzy scratches, and obtain a marked image.
[0145] The quality discrimination module is configured to discriminate the quality according to the marked image, extract the crack size, position coordinates and boundary integrity parameters in the marked image, compare the extracted results with a glass defect discrimination standard library, and output the corresponding glass quality discrimination result according to the comparison result.
[0146] It should be noted that the image detection-based mobile phone glass quality detection system further comprises a cross-domain feature normalization module, which specifically comprises:
[0147] The cross-domain feature normalization module comprises a gray histogram unit, a brightness plane compensation unit and a view angle projection re-adjustment unit.
[0148] The gray histogram unit is configured to match the gray histogram of the current image with a reference template of a training sample, and correct the brightness distribution curve through histogram mapping.
[0149] A brightness plane compensation unit is configured to collect a brightness dot array in an image background region, fit a brightness plane function, and calculate a formula as follows:
[0150]
[0151] wherein, represents a position of a fitted brightness value, are fitting coefficients; and the image after the background brightness plane compensation and the grayscale histogram normalization is subjected to plane brightness restoration.
[0152] A view angle projection re-adjustment unit is configured to construct an inverse projection transformation model according to a lens relative attitude parameter recorded during image collection, perform geometric correction on the image after the plane brightness restoration, and restore a structure-consistent coordinate system under a standard shooting view angle; and input the image after the cross-domain feature normalization into a transparency enhancement module.
[0153] Thus, a mobile phone glass quality detection system based on image detection is completed.
[0154] In addition, in order to verify the feasibility of the technical solution provided in the present application in processing transparent background interference and identifying a subtle crack boundary, the following comparative experiments are performed; the same batch of samples are detected by the mobile phone glass cover plate defect detection method of the present application, i.e., the "transparency enhancement algorithm" and "crack boundary self-enhancement step", and the prior art method, i.e., the defect detection method based on grayscale image contrast residual, and the detection performance difference of the two methods in different scenes is compared.
[0155] The test procedure is as follows:
[0156] A1. Image collection and preprocessing: collect mobile phone glass cover plate images according to the standardized imaging conditions configured in the technical solution of the present application; the purpose is to ensure that the image conditions input by the two methods are consistent and the quality is stable. The technical solution of the present application uses a unified light source angle, exposure time, gain and resolution to obtain a glass cover plate original image containing a transparent background, and performs grayscale histogram normalization, background brightness compensation and view angle correction and other preprocessing on the image; the prior art method also uses the collected original grayscale image as input, and performs simple filtering on the reference image. After preprocessing, both methods obtain basic input data for subsequent steps.
[0157] A2. Transparency enhancement, the collected image is input into the transparency enhancement algorithm module of the technical solution of the present application to solve the interference of the glass transparent background on defect detection. The purpose is to suppress the noise caused by background transmission patterns or illumination changes and improve the defect contrast. The present application compensates for image brightness distortion through a brightness inversion model driven by physical optical characteristics, and uses a dedicated transparent background attention mechanism to enhance the saliency of microscopic crack and scratch regions while suppressing the response of the background region. After transparency enhancement processing, the brightness and texture features of the defect region in the output enhanced image are highlighted, and the artifacts caused by the transparent background are significantly reduced. The prior art method does not have this step, it directly uses the original gray image for processing, so it may produce more false difference signals in complex or transparent regions, and it is difficult to distinguish between real crack defects and background patterns. Such differences will be reflected in the experimental results through the false positive rate and accuracy indicators.
[0158] A3. Crack boundary identification, based on the enhanced image, the technical solution of the present application introduces a crack boundary self-enhancement step to locate and edge enhance microscopic cracks and fuzzy scratches. The purpose is to accurately extract the contour line of the crack and avoid missing small cracks or edge breakage. Specifically, the present application method first extracts the brightness gradient distribution map and texture direction map of the enhanced image to construct the candidate area of the potential crack edge; then according to the edge width intensity, small, medium and large scales are divided, and residual enhancement filters are used to locally enhance the edges of each scale to obtain an edge residual response map. Next, the edge response and the aforementioned saliency map are weighted and fused to extract the connected edge region with high response, and isolated noise points are removed, and finally a continuous and complete crack contour line marker is obtained. The prior art method at this stage uses the difference residual between the gray scale image to be tested and the standard gray scale image, and then uses the Otsu algorithm to binarize the residual to extract the defect region. This method can only give the approximate region of the defect, and there is no special enhancement processing for the crack boundary, and often the crack details are lost or the edge is fuzzy and incomplete. Through this step, the present application method can obtain a clear and coherent crack boundary, while the prior art can only obtain a rough defect binary mask, and the boundary accuracy is low. Figure Two
[0159] A4. Defect quality discrimination, the marked crack profile obtained in the previous step is used in the technical solution of the application for further defect size and grade evaluation. The purpose is to evaluate the severity of the crack defect according to objective standards, and output the quality grade result of the glass cover plate. The method of the application extracts the length, width and position coordinates of each crack, and calculates the integrity score of the crack profile. Then the parameters are compared with the pre-established glass defect discrimination standard library, and the defects are classified into levels one, two, three or acceptable according to the length, width, integrity and other thresholds, to determine the quality grade of the current glass cover plate or whether manual review is needed. After obtaining the defect binary image, the prior art method can only determine whether the defect exists and the approximate position; since the defect area is not analyzed in detail, the prior art method lacks quantitative evaluation of the size and continuity of the crack, and usually cannot directly give in-depth conclusions such as defect grade.
[0160] A5. Result output, finally, the detection marking result and quality discrimination conclusion of the technical solution of the application are output, including the image of the marked defect profile and the corresponding grade judgment report. Each crack defect is clearly marked and has parameter information, which is convenient for tracing and manual review. The prior art method outputs a binary defect image or a mark indicating the defect position, but does not provide more detailed information. The output results can be compared intuitively.
[0161] Experiments were conducted under the same environmental conditions to detect a batch of mobile phone glass cover plate samples using the technical solution of the application and the prior art method respectively; the test samples included 50 high-resolution glass cover plate images, some of which had real or simulated fine crack / scratch defects. In order to investigate the influence of transparent background interference, the background conditions of these images were different: half of the samples had complex patterns or text placed under the glass to simulate complex transparent background interference, and the other half of the samples were taken under a uniform light and dark background. In addition, a small number of defect-free control samples were included to evaluate false positives. All the test glasses were collected by the same type of camera under fixed lighting and angle to ensure that the two methods processed the same input images. For the prior art method, each test image was provided with a corresponding defect-free standard glass image as a reference template, and the alignment and comparison were performed according to the method provided by the prior art. During the experiment, the two methods respectively detected all the images according to the corresponding process, and compared the detected defect areas with the manually annotated real defects. In order to quantitatively compare the performance, a plurality of evaluation indicators were calculated for the output results of each method, including the classification accuracy of samples with or without defects and the accuracy of crack area positioning. The entire experiment was performed on the same computing platform to avoid the influence of hardware or running environment differences on the results.
[0162] The industry-accepted image defect detection evaluation indicators were used to objectively quantify the performance differences between the technical solution of the application and the prior art method:
[0163] Accuracy: the proportion of actual real defects in the regions predicted as defects. For pixel-level defect detection, Accuracy = the number of correctly detected defect pixels / the total number of pixels marked as defects by the model; the accuracy reflects the false positive rate of the method, and the higher the value, the fewer the false positives.
[0164] Recall: the proportion of successfully detected regions in the actual defect regions; for pixel-level detection, Recall = the number of correctly detected defect pixels / the total number of actual defect pixels. Recall reflects the false negative rate of the method, and the higher the value, the fewer the false negatives, and the more comprehensive the defects that can be detected.
[0165] F1 value: the harmonic mean of Precision and Recall, used to comprehensively evaluate the detection accuracy and integrity, the calculation formula is: F1 = 2 * (Precision * Recall) / (Precision + Recall). The higher the F1 value, the higher the accuracy and recall of the method, and it is a general index that balances false positives and false negatives.
[0166] IoU: the ratio of the intersection area of the predicted defect region and the actual defect region to the union area, referred to as the intersection-over-union; for each crack defect on an image, calculate the intersection-over-union of the predicted mask and the manually annotated mask; IoU measures the positioning accuracy of the defect region: the closer the value is to 1 or 100%, the more consistent the detected method is with the actual region.
[0167] Crack contour recognition rate: the proportion of the number of crack edge pixels correctly recognized by the detection method to the total number of actual crack contour pixels, expressed in percentage, and the crack contour recognition rate index is specifically used to evaluate the effect of extracting the boundary of a small crack: the higher the value, the more complete and continuous the crack contour line restored by the method, and the fewer the details missing and edge interruptions.
[0168] The above indicators are all in the range of 0-1 or 0-100%, and the larger the value, the better the detection performance. For samples containing multiple cracks, calculate the IoU and contour recognition rate of each crack, and then take the average as the evaluation of the entire image. Finally, the average index value of all test images is used for method comparison; in addition, for non-defect control images, focus on accuracy to verify the stability of the two methods under background interference.
[0169] Statistical analysis of the detection outputs of the two methods on all test images is shown in the following table:
[0170] As shown in the above table, under the transparent background interference condition, the technical scheme provided by the present application shows high stability and accuracy. The transparent background interference is effectively suppressed by the transparency enhancement algorithm, and there is almost no false detection in the complex background image; the prior art relies on the difference of the reference image, is easily affected by the background pattern or light difference, and the false positive rate increases and the accuracy decreases after introducing noise. The technical scheme provided by the present application can stably filter background interference and only respond to real crack signals, so that the detection result is more reliable.
[0171] In terms of fine crack boundary identification, the technical scheme provided by the present application improves the detection capability of micro defects and the edge restoration accuracy through the crack boundary self-enhancement step. The higher Recall value indicates that even low-contrast cracks can be accurately captured; and the prior art often has hairline crack detection or contour discontinuity due to the use of global Otsu threshold and lack of morphological enhancement, resulting in low recall rate and contour recognition rate. The technical scheme provided by the present application can completely extract the crack boundary through multi-scale edge enhancement and saliency fusion, avoiding misjudgment and omission.
[0172] In terms of defect positioning accuracy, the technical scheme provided by the present application has a significant advantage over the prior art in terms of IoU score. On the one hand, the transparent background processing reduces noise interference, making the boundary closer to the real crack; on the other hand, the crack boundary self-enhancement can accurately depict the morphology, outputting more accurate defect size and position, which is beneficial to subsequent grade determination. The prior art often causes the defect area to be too large or too small due to rough threshold segmentation, affecting fine evaluation.
[0173] In summary, the technical scheme provided by the present application has advantages in image enhancement and boundary extraction, and can realize high-precision and low-error defect detection under complex conditions. The comparative experiment fully verifies the significant improvement of the stability, recognition ability and positioning accuracy compared with the prior art.
[0174] It should be understood that the size of the sequence number of the above-mentioned processes in various embodiments of the present application does not mean the order of execution, and the execution order of the processes and modules should be determined according to their functions and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0175] Those skilled in the art can realize that the algorithms or steps described in conjunction with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical scheme. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0176] The above merely provides the specific implementation of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art can easily think of the changes or replacements within the technical range disclosed by the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method for detecting the quality of a mobile phone glass based on image detection, characterized in that, The following steps are involved: Configure the imaging conditions for capturing images of the mobile phone glass, and capture the original image of the mobile phone glass according to the configured imaging conditions; A transparency enhancement algorithm is constructed according to the transparent background in the collected original image, and the original image is processed according to the transparency enhancement algorithm to obtain an enhanced image; A crack boundary self-enhancement step is introduced to locate the microcracks and fuzzy scratches in the enhanced image. Based on the positioning results of the microcracks and fuzzy scratches, the enhanced image is marked to obtain a marked image. Quality judgment is performed based on the marked image. The crack size, position coordinates and boundary integrity parameters in the marked image are extracted. The extracted results are compared with the glass defect judgment standard library, and the corresponding glass quality judgment results are output based on the comparison results. 2.The image detection-based mobile phone glass quality detection method of claim 1, wherein, Configure the imaging conditions for capturing mobile phone glass images. Capture the original images of mobile phone glass based on the configured imaging conditions. Specifically, the following steps are included: By configuring a standardized imaging parameter set for mobile phone glass image acquisition, the standardized imaging parameter set includes light source illumination angle, illumination mode, exposure time, photosensitivity gain and imaging resolution; According to a set of standardized imaging parameters, the imaging device is controlled to capture an original image of the mobile phone glass containing a transparent background area. The original image includes at least the main glass area, the edge buffer area, and the background transmission area. The original image is used for optical model construction and image inversion processing of the transparency enhancement algorithm. 3.The image detection-based mobile phone glass quality detection method of claim 1, wherein, A transparency enhancement algorithm is constructed based on the transparent background in the collected original image, and the original image is processed according to the transparency enhancement algorithm to obtain an enhanced image, specifically including: Design a multi-scale filter bank, introduce an image guidance mechanism based on the structural characteristics of glass defects, and preprocess the original image using the image guidance mechanism based on the structural characteristics of glass defects and the multi-scale filter bank to obtain a preprocessed image. Construct a brightness inversion model driven by optical physical properties, input the preprocessed image into the brightness inversion model, and output a physically compensated image; A defect saliency learning network with a dedicated attention mechanism for transparent background is constructed. Taking the physically enhanced image as input, the defect saliency learning network is guided to focus on the characteristic areas of microcracks and scratches, suppress the response intensity of the background and uniform areas, and output an enhanced image. 4.The image detection-based mobile phone glass quality detection method of claim 1, wherein, Construct a brightness inversion model driven by optical physical properties, input the preprocessed image into the brightness inversion model, and output a physically compensated image. Specifically, it includes: The average refractive index, transmittance and surface reflectivity of the glass material are used as the prior parameters of the brightness inversion model input. A pixel-level optical brightness inversion function is constructed to physically compensate the brightness value of each pixel in the original image. The brightness inversion function is used to quantify the brightness distortion caused by refraction interference in the glass imaging area, and the formula is defined as: ; In the formula, represents the brightness compensation value of the pixel point with coordinates in the image after performing the brightness inversion processing, represents the original brightness value of the corresponding pixel point in the pre-processed image, represents the average refractive index of the glass material, represents the light transmission coefficient of the glass material, reflecting the proportion of the light energy retained after the light transmits through the glass, represents the reflectivity of the glass surface, used to reflect the proportion of the incident light reflected by the glass interface; Through the brightness inversion function, the corresponding brightness compensation value is calculated for each pixel in the processed image, and the brightness of the processed image is physically restored under the refraction interference condition based on the calculated brightness compensation value; a physical property compensation image is constructed based on the physically restored processed image. 5.The image detection-based mobile phone glass quality detection method of claim 4, wherein, The defect saliency learning network comprising a transparent background dedicated attention mechanism is constructed to input a physically enhanced image, guide the defect saliency learning network to focus on the micro crack and scratch feature area, suppress the response intensity of the background and uniform area, and output an enhanced image, and specifically comprises: A saliency learning structure based on a convolutional neural network is constructed, a physically enhanced image is used as an input image, and a transparent background dedicated attention mechanism is embedded in the encoding and decoding paths to improve the focusing ability of the model on the micro crack and scratch area; The transparent background dedicated attention mechanism comprises: based on the pixel heterogeneity score, the brightness gradient change rate and the texture direction change amplitude of each pixel in the image within a local window are jointly calculated to obtain a saliency initial score map; In the saliency initial score map, the image area with a score higher than a first threshold value is extracted as a focusing area, and a weighted enhancement operation is performed on the feature channels corresponding to the focusing area to strengthen the texture feature response of the micro defect area; The first threshold value is used to determine the heterogeneity degree of the internal structure of the region, and is set according to the statistical results of the average gradient value of the crack area in the training data set, and is set to 1.5 to 2.0 times the average gradient value of the whole image; At the same time, a channel activation suppression operation is performed on the image area with a score lower than a second threshold value to weaken the response of the uniform background area; the second threshold value is used to identify the background area or the flat area of the image, and is set to less than 0.8 times the average gradient value of the whole image; After the defect saliency learning network completes the attention focusing, the image size is restored through the decoding path, and an enhanced image is output, wherein the saliency response intensity of the defect area is obviously higher than that of the background area; The output enhanced image satisfies the following response suppression constraint condition: ; In the formula, represents the saliency response value of the pixel point with coordinates in the enhanced image, represents the pixel region identified as background; represents the total number of pixel points in the background region; represents the saliency suppression threshold value of the background region. 6.The image detection-based mobile phone glass quality detection method of claim 1, wherein, A crack boundary self-enhancement step is introduced, the micro cracks and fuzzy scratches existing in the enhanced image are positioned, and according to the positioning results of the micro cracks and fuzzy scratches, the enhanced image is marked to obtain a marked image, and specifically comprises: The brightness gradient distribution map and the texture direction map are extracted from the enhanced image, the structural prior boundary candidate map is constructed according to the brightness change rate and the texture continuity features of the pixels in the enhanced image, and the pixel distribution area of the potential crack or scratch edge is identified; Scale grouping processing is performed on the structural prior boundary candidate map, and edge structures of different intensities and widths are divided into three scales, including a small scale corresponding to 1 to 3 pixel widths, a medium scale corresponding to 3 to 8 pixel widths, and a large scale corresponding to a width of 8 pixels or more; For the three different scale structure areas, a residual enhancement filter is applied for boundary enhancement processing, the filter is calculated by the brightness difference residual value between the local edge and the surrounding background to realize local enhancement of the edge response, and a boundary residual response map is output; The boundary residual response map and the saliency map output by the defect saliency learning network are weighted and fused pixel by pixel to obtain a joint response map, and the area with a high response value in the joint response map simultaneously has edge structure intensity and defect saliency features. A boundary connected domain is extracted for a region in which the pixel response value in the joint response map is higher than a boundary enhancement determination threshold value, the boundary enhancement determination threshold value being set as the 85th percentile of the response value distribution of the joint response map, for retaining a structure region in which boundary saliency is most prominent; Within the boundary connected domain, noise point elimination and pseudo boundary elimination are performed according to the crack direction consistency and curvature distribution rules, and a crack contour line with continuous structure characteristics is retained; The finally extracted crack contour line is numbered and coded to generate a marking image aligned with the size of the enhanced image, each crack region in the marking image containing a corresponding boundary coordinate set, crack contour width and length indicators, for subsequent quality discrimination steps to perform size comparison and defect level assessment.
7. The image detection-based mobile phone glass quality detection method of claim 1, wherein, Quality discrimination is performed according to the marking image, crack size, position coordinates and boundary integrity parameters in the marking image are extracted, the extracted results are compared with a glass defect discrimination standard library, and corresponding glass quality discrimination results are output according to the comparison results, specifically including: Region attribute extraction is performed on the crack region in the marking image that has been numbered and coded, the boundary coordinate set of each crack region is obtained, and the length, maximum width, minimum width and average width indicators of the corresponding crack are calculated based on the boundary coordinates; A crack main axis is constructed through the boundary point trajectory, the shortest distance between the crack main axis and the glass edge region is calculated, and the spatial position coordinates of the crack relative to the glass main body region are obtained; Based on the boundary coordinate curvature change rate, an integrity score parameter of the crack contour is extracted, the score parameter being used to measure whether the crack has discontinuous structure defects such as cracking, breakpoints and boundary interruptions; A glass defect discrimination standard library is constructed, the standard library being constructed according to a glass factory quality standard data set and containing multi-level discrimination interval rules of crack length, width, boundary integrity score and position region; The discrimination standard library includes three-level classification results: first-level defects represent cracks with a length exceeding 20 mm or a width exceeding 1.5 mm, or boundary cracking; second-level defects represent cracks with a length of 10 to 20 mm, a width of 0.5 to 1.5 mm and a contour integrity score less than 0.85; and third-level defects are acceptable cracks with a length less than 10 mm, a width less than 0.5 mm and an integrity score greater than 0.9; A defect parameter comparison process is performed, each crack region attribute is matched with the corresponding indicator item in the standard library, and a comparison result label is output; When the comparison result matches any of the above three-level classifications, the corresponding quality discrimination level of the current glass image is assigned, and the comparison results of all crack regions are summarized, and the most serious level is taken as the final quality level of the whole glass sample; If there is a crack region in the marking image that cannot match any level in the standard library, a non-standard crack marking process is triggered, the current crack region parameters are recorded, and the crack region is marked as a state to be manually reviewed, a defect warning prompt is output, and subsequent manual intervention review is used. 8.The image detection-based mobile phone glass quality detection method of claim 1, wherein, It also includes a cross-domain feature normalization mechanism, specifically including: Based on the original image after acquisition, three processing steps of gray histogram normalization processing, background brightness plane compensation and perspective projection re-tuning are sequentially performed to obtain a standardized image; The gray histogram normalization processing is to match the current image gray histogram with the reference template of the training sample, and correct the brightness distribution curve through histogram mapping; The background brightness plane compensation is to collect the brightness dot array in the image background area, fit the brightness plane function, and the calculation formula is: ; In the formula, representing the position of the fitting brightness value, respectively, are fitting coefficients; the image after the gray scale histogram is normalized according to the background brightness plane compensation is subjected to plane brightness restoration; The perspective projection re-tuning is to construct an inverse projection transformation model according to the recorded lens relative attitude parameters during image acquisition, perform geometric correction on the image after plane brightness restoration, and restore the structure consistency coordinate system under the standard shooting perspective; the image after completing the cross-domain feature normalization processing is input into the subsequent image enhancement.
9. A mobile phone glass quality detection system based on image detection, characterized in that, The image detection-based mobile phone glass quality detection method according to any one of claims 1-8 comprises the following modules: An image acquisition module is configured to configure imaging conditions for acquiring mobile phone glass images, and acquire original images of mobile phone glass according to the configured imaging conditions; A transparency enhancement module is configured to construct a transparency enhancement algorithm according to the transparent background existing in the acquired original image, process the original image according to the transparency enhancement algorithm, and obtain an enhanced image; A crack boundary enhancement module is configured to introduce a crack boundary self-enhancement step, locate the micro cracks and fuzzy scratches existing in the enhanced image, mark the enhanced image according to the positioning results of the micro cracks and fuzzy scratches, and obtain a marked image; A quality discrimination module is configured to discriminate the quality according to the marked image, extract the crack size, position coordinates and boundary integrity parameters in the marked image, compare the extracted results with a glass defect discrimination standard library, and output the corresponding glass quality discrimination result according to the comparison result.
10. The image detection-based mobile phone glass quality detection system of claim 9, wherein, Further comprising a cross-domain feature normalization module, specifically comprising: The cross-domain feature normalization module comprises a gray histogram unit, a brightness plane compensation unit and a perspective projection re-tuning unit; The gray histogram unit is configured to match the gray histogram of the current image with the reference template of the training sample, and correct the brightness distribution curve through histogram mapping; The brightness plane compensation unit is configured to collect the brightness dot array in the image background area, fit the brightness plane function, and the calculation formula is: ; In the formula, representing the position of the fitting brightness value, respectively, are fitting coefficients; the image after the gray scale histogram is normalized according to the background brightness plane compensation is subjected to plane brightness restoration; The perspective projection re-tuning unit is configured to construct an inverse projection transformation model according to the recorded lens relative attitude parameters during image acquisition, perform geometric correction on the image after plane brightness restoration, and restore the structure consistency coordinate system under the standard shooting perspective; the image after completing the cross-domain feature normalization processing is input into the transparency enhancement module.
Citation Information
Patent Citations
Mobile phone glass cover plate defect detection method, system and equipment and storage medium
CN119417836A
Cited By
Target identification system based on multi-modal image analysis
CN121392435A
Intelligent quality evaluation method for waterproof cloth
CN121481982A
Pump body casting surface defect intelligent detection method and system
CN122265291A
A method and system for intelligent detection of surface defects in pump body castings
CN122265291B