Mobile phone shell production defect detection method and system based on AI vision

By using AI vision technology to perform image correction and texture response analysis on the surface images of mobile phone cases, and constructing local texture energy and energy aggregation analysis, the problems of low efficiency and frequent misjudgment in existing detection methods are solved, and real-time and accurate identification and screening of minor anomalies in the production process of mobile phone cases are realized.

CN121962049APending Publication Date: 2026-05-01SHENZHEN NEW ORIGIN PRECISION IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN NEW ORIGIN PRECISION IND CO LTD
Filing Date
2026-01-09
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing methods for detecting defects in mobile phone case production rely on manual inspection, which is inefficient and susceptible to subjective influence. Furthermore, methods based on template matching or edge recognition are difficult to effectively distinguish texture defects, leading to frequent misjudgments and missed judgments. In particular, it is difficult to achieve accurate identification and stable screening of minute anomalies on high-speed production lines.

Method used

By using an AI vision-based approach, images of the phone case surface are captured by an industrial camera, and image correction and texture response analysis are performed. Local texture energy and energy aggregation analysis are constructed, and defect assessment is carried out by combining texture energy spatial aggregation degree, thereby realizing the automated identification and screening of texture disturbances.

Benefits of technology

It enables real-time and accurate identification of minor anomalies during the production of mobile phone cases, reduces the false alarm rate, and improves the automation and accuracy of detection, with the advantages of strong real-time performance and low false alarm rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121962049A_ABST
    Figure CN121962049A_ABST
Patent Text Reader

Abstract

The invention discloses a mobile phone shell production defect detection method and system based on AI vision, and relates to the technical field of automatic detection.The method comprises the steps that a surface image of a mobile phone shell is collected through an industrial camera, posture angle information of the mobile phone shell in the surface image is extracted, image correction is conducted on the surface image, and a regular mobile phone image is obtained; constructing a local analysis neighborhood and calculating a directional texture response component to form a texture response graph; comprehensive texture response intensity Rz is calculated in the local neighborhood and energized, and local texture energy Et is obtained for texture disturbance evaluation; and if abnormal disturbance exists, an energy aggregation analysis area is constructed in the center of the disturbance area, the texture energy space aggregation degree Ce is calculated, and then the texture energy spatial aggregation degree Ce and local texture energy Et are combined to fit a texture energy response value Me for texture energy state evaluation. According to the method, spatial quantitative analysis and aggregation degree quantification of texture changes are realized, and the method is suitable for online visual defect screening of a mobile phone shell with a complex structure on a high-speed assembly line.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of automated inspection technology, specifically to a method and system for detecting defects in mobile phone case production based on AI vision. Background Technology

[0002] The development of artificial intelligence (AI) vision technology has gradually propelled the manufacturing industry towards high automation and high-precision quality management. AI vision systems, through industrial cameras, high-speed image processing, and deep learning algorithm modeling, can replace manual inspection of product appearance in real-time, stable, and fatigue-free operation, especially in large-scale, standardized production scenarios. Based on this, appearance defect detection has become one of the important application areas of AI vision. Mobile phone cases, as common plastic components in the consumer electronics field, still exhibit microscopic texture defects during production, such as overflow, shrinkage marks, bubbles, mold marks, and poor demolding, despite their highly mature injection molding process. Therefore, developing an AI vision-based mobile phone case defect detection method can help identify defective products in real-time on the production line, preventing substandard products from entering downstream assembly or the market.

[0003] Existing methods for detecting defects in mobile phone case manufacturing mostly rely on manual visual inspection, line scanning cameras combined with binary segmentation, or simple algorithm models based on static template comparison. These methods have several limitations. First, manual inspection is inefficient and susceptible to subjective judgment bias and fatigue. Second, template matching or edge recognition methods are not effective in distinguishing texture disturbance defects generated during the molding process, as these defects are often not clear boundary deformations but rather local disturbances in texture continuity. Furthermore, differences in shooting angles and fluctuations in transport position can introduce image pose disturbances, leading to frequent misjudgments and missed detections. These problems are particularly pronounced on high-speed production lines, urgently requiring a complete methodology capable of automatically performing image pose correction, texture energy modeling, and spatial clustering analysis to achieve accurate identification and stable screening of minute anomalies. Summary of the Invention

[0004] To address the shortcomings of existing technologies, this invention provides a method and system for detecting defects in mobile phone case production based on AI vision, thus solving the problems mentioned in the background.

[0005] To achieve the above objectives, the present invention provides the following technical solution: a method for detecting defects in mobile phone case manufacturing based on AI vision, comprising the following steps: S1. Use an industrial camera installed on the production line to capture surface images of the phone case, extract the orientation and angle information of the phone case from the surface image, and perform image correction on the surface image to obtain a regular image of the phone case. S2. Construct a local analysis neighborhood based on the pixels in the regularized image of the mobile phone, calculate the texture response components in the local analysis neighborhood, merge the texture response components to form a comprehensive texture response intensity Rz, and construct a texture response map according to the pixel spatial position. S3. Using each pixel in the texture response map as the center, the comprehensive texture response intensity Rz is energized in the local analysis neighborhood to obtain the local texture energy Et for texture perturbation evaluation. S4. When the texture perturbation assessment indicates the presence of abnormal texture perturbation, construct an energy aggregation analysis region in the texture response map with the center point of the perturbation pixel region, and calculate the spatial aggregation degree Ce of texture energy of each pixel in the energy aggregation analysis region. S5. Fit the local texture energy Et with the texture energy spatial aggregation degree Ce, perform point-by-point joint quantization of the texture energy under the same pixel, and construct the texture energy response value Me to evaluate the texture energy state.

[0006] Preferably, S1 includes S11; S11. Using an industrial camera installed on the production line, capture real-time images of the phone case's surface as it passes the shooting station. Extract the closed outer contour of the phone case from the surface image through boundary response continuity analysis. Represent the contour points of the closed outer contour as a set C, where C = {(x...} i y i )|i=1,2,…,N}, and then determine the main expansion direction of the contour point set C in the two-dimensional plane through the statistical characteristics of the spatial distribution of contour points. Define the current main expansion direction as the main contour direction axis of the phone case in the current surface image, and extract the posture angle information of the phone case in the surface image based on the main direction axis. Based on the relative relationship between the main direction axis and the reference direction of the image coordinate system, the planar rotation angle θr of the phone case in the image plane is obtained, and the main structural direction angle θm of the phone case is determined based on the direction distribution of stable structural boundary segments in the contour. The stable structure includes the long side outline of the phone case, the straight line of the frame, and the symmetrical boundary of the structure.

[0007] Preferably, S1 further includes S12 and S13; S12. Based on the attitude angle information, obtain the orientation offset state of the main structure of the phone case in the image coordinate system, compare the orientation of the main structure of the phone case with the preset reference orientation to obtain the orientation offset, and perform orientation correction on the surface image based on the orientation offset to eliminate the influence of planar rotation introduced by the shooting posture difference. After orientation correction is completed, based on the offset relationship between the center position of the outer contour of the phone case and the set target position, spatial translation processing is performed on the orientation-corrected surface image, and the position offset of the phone case in the image coordinate system is constrained and controlled. S13. After completing the spatial translation, perform contour matching operation on the phone case in the surface image based on the standard phone case outline model, locate the boundary position and forming area of ​​the phone case in the surface image, and remove the pixel area outside the outline range of the phone case to obtain a regular image of the phone.

[0008] Preferably, S2 includes S21 and S22; S21. Construct a fixed-scale local analysis neighborhood based on each pixel in the regularized image of the mobile phone as the spatial reference center, and extract the gray value of each pixel in the local analysis neighborhood to form the gray distribution information corresponding to the center pixel. Based on the image raster structure of the regularized image from the mobile phone, a set of orientation angles Θ is defined in the local analysis neighborhood, Θ={θ1, θ2, ..., θ...} n}, and for each direction angle in the direction angle set Θ, perform directional response operations on the gray-level distribution information along the corresponding direction angle in the local analysis neighborhood to form a texture response component in the corresponding direction. Then, gather the texture response components at all direction angles at the same pixel position to form a multi-directional texture response component set R, R={R θ1 (x,y),R θ2 (x,y), ...,R θn (x,y)},R θn (x,y) represents the pixel position (x,y) at the direction angle θ. n Texture response components on; S22. At pixel position (x,y), perform unified merging of texture response components corresponding to multiple directions to obtain the comprehensive texture response intensity Rz(x,y) at pixel position (x,y), and arrange the comprehensive texture response intensity Rz(x,y) according to the pixel spatial position to construct a texture response map that corresponds one-to-one with the regular image of the mobile phone.

[0009] Preferably, S3 includes S31; S31. Taking each pixel in the texture response map as the center position, the comprehensive texture response intensity Rz(x,y) is energized in the local analysis neighborhood, and the local texture energy Et is obtained by cumulative calculation, which represents the overall change intensity of the texture response in the region centered on the target pixel, reflecting the intensity of local texture disturbance on the surface of the phone case, as follows. ; Where Et(x,y) represents the local texture energy centered at pixel position (x,y), Ω(x,y) represents the local analysis neighborhood window centered at (x,y), (i,j) is the pixel position coordinate index within the local analysis neighborhood window, and Rz(i,j) represents the comprehensive texture response intensity at pixel position (i,j) within the local analysis neighborhood.

[0010] Preferably, S3 further includes S32; S32. Statistically determine the median value of the local texture energy Et of qualified mobile phone case images in history, and compare the median value as the texture energy reference threshold TE with the obtained local texture energy Et. Generate texture perturbation evaluation based on the comparison results. The scheme is as follows. When the local texture energy Et ≤ texture energy reference threshold TE, it indicates that the texture change in the current image area is normal. At this time, the current area is marked as a texture stable area and is monitored normally. When the local texture energy Et > the texture energy reference threshold TE, it indicates that there is abnormal texture perturbation in the current image region, and energy spatial aggregation analysis is triggered.

[0011] Preferably, S4 includes S41 and S42; S41. When the texture perturbation assessment indicates the presence of abnormal texture perturbation, a fixed-scale energy aggregation analysis region Λ is constructed in the texture response map with the center point of the current abnormal perturbation pixel region. The local texture energy Et(u,v) centered at pixel position (u,v) within the energy aggregation analysis region Λ is statistically analyzed, and the average local texture energy within the energy aggregation analysis region is calculated. ; S42. By calculating the local texture energy Et of each pixel within the energy concentration analysis region Λ relative to the average local texture energy... The degree of deviation is used to obtain the spatial concentration degree Ce of texture energy, which describes the spatial concentration state of texture energy in a local area and is used to describe the degree of concentration of local energy distribution, as follows; ; Where Ce(x,y) represents the spatial concentration of texture energy centered at pixel position (x,y), Λ(x,y) represents the energy concentration analysis region window centered at pixel position (x,y), and Et(u,v) represents the local texture energy Et centered at pixel position (u,v) within the energy concentration analysis region Λ.

[0012] Preferably, S5 includes S51; S51. Fit the local texture energy Et with the texture energy spatial aggregation degree Ce, perform point-by-point joint quantization of the texture energy under the same pixel, and construct the texture energy response value Me, which represents the abnormal aggregation state of the texture change of the pixel position on the surface of the phone case in space, as follows. Me(x,y)=Et(x,y)×Ce(x,y); Where Me(x,y) represents the texture energy response value of the local texture changes at pixel position (x,y) that are spatially clustered.

[0013] Preferably, S5 further includes S52; S52. Extract the texture energy response value Me when the historical texture energy space is normal, and calculate the mean value according to the statistical method and set it as the abnormal response benchmark threshold TB. Compare it with the obtained texture energy response value Me, and generate a texture energy state assessment based on the comparison result, as follows; When the texture energy response value Me ≤ the abnormal response baseline threshold TB, it indicates that the local texture energy spatial aggregation is in a normal state, and the current region is marked as a normal response region. When the texture energy response value Me > the abnormal response baseline threshold TB, it indicates that the local texture energy spatial aggregation is in an abnormal state. At this time, the current area is marked as an abnormal candidate area and written into the abnormal candidate coordinate queue for iterative analysis. If it is in an abnormal state three times in a row, the current phone case is marked as a defective state.

[0014] A mobile phone case manufacturing defect detection system based on AI vision includes an image normalization module, a texture response module, an energy analysis module, a spatial clustering analysis module, and an anomaly clustering assessment module. The image straightening module is used to capture surface images of the phone case using an industrial camera installed on the production line, extract the orientation angle information of the phone case from the surface image, and perform image correction on the surface image to obtain a straightened image of the phone case. The texture response module is used to construct a local analysis neighborhood based on the pixels in the regularized image of the mobile phone, calculate the texture response components in the local analysis neighborhood, merge the texture response components to form a comprehensive texture response intensity Rz, and construct a texture response map according to the pixel spatial position. The energy analysis module is used to perform energy processing on the comprehensive texture response intensity Rz in the local analysis neighborhood with each pixel in the texture response map as the center position, and obtain the local texture energy Et for texture perturbation evaluation. The spatial clustering analysis module is used to construct an energy clustering analysis region Λ in the texture response map with the center point of the perturbed pixel region when the texture perturbation assessment indicates the presence of abnormal texture perturbation, and to calculate the spatial clustering degree Ce of texture energy of each pixel in the energy clustering analysis region Λ. The abnormal clustering evaluation module is used to fit the local texture energy Et with the texture energy spatial clustering degree Ce, perform point-by-point joint quantization of the texture energy under the same pixel, and construct the texture energy response value Me to evaluate the texture energy state.

[0015] This invention provides a method and system for detecting defects in mobile phone case manufacturing based on AI vision. It has the following beneficial effects: (1) Method S1 uses an industrial camera to capture real-time images of the phone case. Boundary response continuity analysis is used to extract the closed outer contour of the phone case from the surface image. The contour points of the closed outer contour are represented as a set of contour points C. The orientation angle information of the phone case in the image coordinate system is obtained through principal direction axis analysis, including the overall rotation angle θr and the principal structure orientation angle θm. Based on the orientation angle information and the set target position, orientation correction and spatial translation are performed respectively to eliminate image disturbances caused by fluctuations in the production line conveyor position and camera shooting angle deviations. Finally, boundary matching and pixel removal are completed using a standard outer contour model to obtain a regular image of the phone case. This process ensures that the texture analysis process is performed on an image with consistent structure and aligned coordinates.

[0016] (2) In method S2, a fixed-scale local analysis neighborhood is constructed based on each pixel in the regularized image of the mobile phone as the spatial reference center. By setting the set of orientation angles Θ, directional response operations are performed on the gray-level distribution of the neighborhood along multiple orientation angles to extract the set of orientation components R, and synthesize them into a comprehensive texture response intensity Rz(x,y) for each pixel. The comprehensive texture response intensity Rz(x,y) is then arranged according to the spatial position of the pixels to construct a texture response map that corresponds one-to-one with the regularized image of the mobile phone. In method S3, each pixel in the texture response map is used as the center position. The comprehensive texture response intensity Rz(x,y) is energized within the local analysis neighborhood, and the local texture energy Et is obtained through cumulative calculation. The degree of texture perturbation is quantified, and then texture perturbation is evaluated with the texture energy reference threshold TE to determine whether it constitutes an abnormal perturbation. This process, by transitioning from pixel-level response to region-level energy description, not only preserves details but also enhances the sensitivity to local texture perturbations, making abnormal texture regions spatially clustered and identifiable.

[0017] (3) In this method S4, a fixed-scale energy aggregation analysis region Λ is constructed around the disturbed pixels that are judged to be abnormal, and the average value of the local texture energy Et(u,v) within the region is statistically analyzed. Based on this, the deviation of each pixel from the average value is calculated to form the texture energy spatial clustering degree Ce, which is used to characterize whether texture anomalies exhibit clustered perturbation features. S5 multiplies the local texture energy Et with the texture energy spatial clustering degree Ce point by point to generate a texture energy response value Me, comprehensively integrating the intensity of texture changes and spatial clustering trends. A preset anomaly response baseline threshold TB is further set and compared with the acquired texture energy response value Me. If it is in an abnormal state three times consecutively, the current sample is confirmed to have an injection molding defect and marked as a defective product. This mechanism realizes energy feature generation, spatial clustering confirmation, and joint response judgment, possessing advantages such as strong real-time performance, low false alarm rate, and clear diagnostic criteria. Attached Figure Description

[0018] Figure 1 This is a schematic diagram illustrating the steps of a mobile phone case manufacturing defect detection method based on AI vision according to the present invention. Figure 2 This is a schematic diagram of the process of a mobile phone case manufacturing defect detection system based on AI vision according to the present invention; Figure 3 This is a schematic diagram illustrating the relationship between the local analysis neighborhood and the energy accumulation analysis region of this invention. Detailed Implementation

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

[0020] Please see Figure 1 This invention provides a method for detecting defects in mobile phone case manufacturing based on AI vision. To achieve the above objectives, this invention employs the following technical solution, comprising the following steps: S1. Use an industrial camera installed on the production line to capture surface images of the phone case, extract the orientation and angle information of the phone case from the surface image, and perform image correction on the surface image to obtain a regular image of the phone case. S2. Construct a local analysis neighborhood based on the pixels in the regularized image of the mobile phone, calculate the texture response components in the local analysis neighborhood, merge the texture response components to form a comprehensive texture response intensity Rz, and construct a texture response map according to the pixel spatial position. S3. Using each pixel in the texture response map as the center, the comprehensive texture response intensity Rz is energized in the local analysis neighborhood to obtain the local texture energy Et for texture perturbation evaluation. S4. When the texture perturbation assessment indicates the presence of abnormal texture perturbation, construct an energy aggregation analysis region in the texture response map with the center point of the perturbation pixel region, and calculate the spatial aggregation degree Ce of texture energy of each pixel in the energy aggregation analysis region. S5. Fit the local texture energy Et with the texture energy spatial aggregation degree Ce, perform point-by-point joint quantization of the texture energy under the same pixel, and construct the texture energy response value Me to evaluate the texture energy state.

[0021] In this embodiment, S1 acquires images of the phone case surface using an industrial camera, extracts its closed outer contour in real time, and represents the contour points of the closed outer contour as a set of contour points C. The main extension direction of the contour point set C in the two-dimensional plane is determined by the statistical characteristics of the spatial distribution of the contour points, defined as the main direction axis of the phone case contour in the current surface image. The relative angle between the main direction axis and the image coordinate system is extracted to obtain the phone case's attitude angle information. Next, orientation correction and spatial translation are performed sequentially to standardize the phone case structure in the image in terms of planar rotation and position. Compared to traditional methods that rely solely on position templates or simple region cropping, this step integrates structural principal axis judgment and geometric mapping mechanisms, eliminating errors caused by shooting posture and transport jitter. Interference areas are eliminated using a standard contour model, retaining only the effective forming area of ​​the phone case, generating a structurally uniform and regular image of the phone case. This ensures that subsequent texture analysis is performed within the same spatial reference system, improving the spatial alignment and discrimination consistency of the analysis. S2 constructs a local analysis neighborhood with each pixel as the reference center and defines a set of orientation angles Θ. Directional response operations are performed at multiple orientation angles to form directional texture response components. By merging texture response components, the comprehensive texture response intensity Rz is calculated, and a texture response map is constructed by arranging the components according to their pixel spatial locations. S3 performs energy processing on the comprehensive texture response intensity Rz within the local analysis neighborhood centered on each pixel to obtain the local texture energy Et, reflecting the degree of aggregation of texture perturbations within the target region. Unlike existing methods that only use simple filter kernels or gradient images, this method enhances the ability to identify "directional instability" in injection-molded textures through directional response, and explicitly expresses local perturbation behavior in the energy dimension through region-cumulative energy transformation. A texture energy reference threshold TE and the local texture energy Et are introduced for texture perturbation evaluation, constructing an automated perturbation judgment mechanism to achieve sensitive perception of slight but persistent texture anomalies. S4 When the texture perturbation evaluation indicates the presence of abnormal texture perturbation, a fixed-scale energy aggregation analysis region Λ is constructed with the center pixel as the anchor point, and the average value of the local texture energy Et within it is calculated to analyze the concentration trend of energy distribution within the current perturbation region. Based on this, the spatial aggregation degree Ce of texture energy is obtained by calculating the squared deviation of pixel energy values ​​from the mean in all regions, quantitatively describing the degree of spatial aggregation of abnormal energy. S5 generates a texture energy response value Me by combining the local texture energy Et with the spatial aggregation degree Ce, characterizing potential defect regions that simultaneously possess energy abrupt changes and spatial aggregation. A preset abnormal response benchmark threshold TB is then used to compare the texture energy response value Me point by point to assess whether it is in an abnormal state. Compared to traditional methods that rely solely on edge density, brightness jumps, or structural contrast, this method introduces a dual index of "energy × aggregation," establishing an interpretable, quantifiable, and traceable defect judgment model, thus improving detection accuracy and false alarm control capabilities. Example 2

[0022] Please refer to Figure 1 Specifically: S1 includes S11; S11. Using an industrial camera installed on the production line, capture real-time images of the phone case's surface as it passes the shooting station. Extract the closed outer contour of the phone case from the surface image through boundary response continuity analysis. Represent the contour points of the closed outer contour as a set C, where C = {(x...} i y i )|i=1,2,…,N}, and then determine the main expansion direction of the contour point set C in the two-dimensional plane through the statistical characteristics of the spatial distribution of contour points. Define the current main expansion direction as the main contour direction axis of the phone case in the current surface image, and extract the posture angle information of the phone case in the surface image based on the main direction axis. Based on the relative relationship between the main direction axis and the reference direction of the image coordinate system, the planar rotation angle θr of the phone case in the image plane is obtained, which represents the overall rotation state of the phone case relative to the image coordinate system when shooting. Based on the direction distribution of stable structural boundary segments in the contour, the main structural direction angle θm of the phone case is determined, which represents the directional position of the main structure of the phone case in the image coordinate system. The stable structure includes the long side outline of the phone case, the straight line of the frame, and the symmetrical boundary of the structure.

[0023] S1 also includes S12 and S13; S12. Based on the attitude angle information, obtain the orientation offset state of the main structure of the phone case in the image coordinate system, compare the orientation of the main structure of the phone case with the preset reference orientation to obtain the orientation offset, and perform orientation correction on the surface image based on the orientation offset to eliminate the influence of planar rotation introduced by the shooting posture difference. After orientation correction is completed, based on the offset relationship between the center position of the outer contour of the phone case and the set target position, spatial translation processing is performed on the orientation-corrected surface image to align the phone case with the set target position, and the position offset of the phone case in the image coordinate system is constrained and controlled to eliminate spatial translation errors caused by conveyor belt position fluctuations and shooting time differences. S13. After completing the spatial translation, perform contour matching operation on the phone case in the surface image based on the standard phone case outline model, locate the boundary position and forming area of ​​the phone case in the surface image, and remove the pixel area outside the outline range of the phone case to obtain a regular image of the phone.

[0024] In this embodiment, S11 uses an industrial camera to capture real-time images of the phone case and obtains a complete and closed set of contour points C through boundary response continuity analysis. Based on the set of contour points C, the main expansion direction of the phone case is determined, and the posture angle information of the phone case in the surface image is extracted. S12, based on the direction offset and position offset, the image is sequentially oriented and spatially translated to ensure that the phone case structure is aligned to the target position in the image, eliminating offsets and distortions caused by shooting angle, transport errors, etc. S13, the standard phone case outline model is used to match the phone case outline in the rectified surface image, extract the effective forming area, remove the background and redundant pixels, and form a regularized phone image. This implementation achieves active correction of image geometric distortion and consistent extraction of the forming area, ensuring spatial consistency and structural comparability of subsequent texture response analysis. Compared with existing methods based on ROI cropping or static template alignment, this solution can dynamically extract posture information and perform adaptive adjustments according to the actual captured image. Through dual correction of image angle and position, a unified reference space is constructed for subsequent texture disturbance recognition. Example 3

[0025] Please refer to Figure 3 Specifically: S2 includes S21 and S22; S21. Construct a fixed-scale local analysis neighborhood based on each pixel in the regularized image of the mobile phone as the spatial reference center, and extract the gray value of each pixel in the local analysis neighborhood to form the gray distribution information corresponding to the center pixel. Based on the image raster structure of the regularized image from the mobile phone, a set of orientation angles Θ is defined in the local analysis neighborhood, Θ={θ1, θ2, ..., θ...} n}, and for each direction angle in the direction angle set Θ, perform directional response operations on the gray-level distribution information along the corresponding direction angle in the local analysis neighborhood to form a texture response component in the corresponding direction. Then, gather the texture response components at all direction angles at the same pixel position to form a multi-directional texture response component set R, R={R θ1 (x,y),R θ2 (x,y), ...,R θn (x,y)},R θn (x,y) represents the pixel position (x,y) at the direction angle θ. n Texture response components on; The set of orientation angles Θ is defined as a set of discrete orientation angles in the image pixel plane, used to describe the response of grayscale changes in different spatial directions, covering the orientation distribution of the entire pixel plane; S22. At pixel position (x,y), perform a unified merging of the texture response components corresponding to multiple directions to obtain the comprehensive texture response intensity Rz(x,y) at pixel position (x,y). Where N represents the number of orientation angles involved in the calculation, and the comprehensive texture response intensity Rz(x,y) is arranged according to the pixel spatial position to construct a texture response map that corresponds one-to-one with the regular image of the mobile phone.

[0026] In this embodiment, S21 constructs a fixed-scale local analysis neighborhood based on each pixel in the regularized image of the mobile phone as the spatial reference center, and sets a discrete set of orientation angles Θ. Directional response operations are performed on the grayscale distribution within the neighborhood along each orientation angle to extract texture response components in different directions. Finally, a set R containing multi-directional texture response components is constructed at each pixel location. In S22, the multi-directional texture response components are unified and merged to generate a comprehensive texture response intensity Rz(x,y), and a texture response map is constructed according to the pixel spatial coordinates. The purpose of this implementation is to explicitly express the multi-directional grayscale variation structure implicit in the regularized image of the mobile phone, so that minute texture perturbations can be described in a quantitative and spatial manner; it improves the directional sensitivity and spatial positioning accuracy of complex shaped texture anomalies, providing a basis for accurately judging the degree of texture perturbation and aggregation behavior in subsequent energy analysis. Example 4

[0027] Please refer to Figure 1 Specifically: S3 includes S31; S31. Taking each pixel in the texture response map as the center position, the comprehensive texture response intensity Rz(x,y) is energized in the local analysis neighborhood, and the local texture energy Et is obtained by cumulative calculation, which represents the overall change intensity of the texture response in the region centered on the target pixel, reflecting the intensity of local texture disturbance on the surface of the phone case. By converting the discrete texture response into a region-level energy description, the continuous texture anomaly forms an analyzable energy distribution feature in space, as follows. ; Where Et(x,y) represents the local texture energy centered at pixel position (x,y), Ω(x,y) represents the local analysis neighborhood window centered at (x,y), (i,j) is the pixel position coordinate index within the local analysis neighborhood window, and Rz(i,j) represents the comprehensive texture response intensity at pixel position (i,j) within the local analysis neighborhood.

[0028] S3 further includes S32; S32. Statistically determine the median value of the local texture energy Et of qualified mobile phone case images in history, and compare the median value as the texture energy reference threshold TE with the obtained local texture energy Et. Generate texture perturbation evaluation based on the comparison results. The scheme is as follows. When the local texture energy Et ≤ texture energy reference threshold TE, it means that the texture change in the current image area is normal, and the phone case presents a normal injection molding texture state. At this time, the current area is marked as a texture stable area and is monitored normally. When the local texture energy Et > the texture energy reference threshold TE, it indicates that there is an abnormal texture disturbance in the current image area, and the phone case exhibits an abnormal injection molding texture state. At this time, energy spatial aggregation analysis is triggered.

[0029] In this embodiment, S31 uses each pixel in the texture response map as the center position and performs energy processing on the comprehensive texture response intensity Rz(x,y) within the local analysis neighborhood to form local texture energy Et. This local texture energy Et is used to quantify the overall intensity of texture changes within the region and capture the spatial representation characteristics of local texture perturbations. The derivation of this formula comes from the energy response calculation method in the image energy model, which is essentially a local sum of squares energy accumulation algorithm. In the field of classical image processing, it is similar to local gray-level variation analysis or image energy calculation based on power spectral density. In signal analysis, ∑x 2 Used to represent signal energy intensity, its mathematical form can be traced back to image filtering and response energy calculation. In the general form, R(a,b) represents the image response value under directional response. The sum-of-squares operation amplifies local texture perturbations, giving subtle changes a stronger expressive power for response differences. In this scheme, the image response value is replaced by the comprehensive texture response intensity Rz(i,j) formed by directional fusion, constituting the energy accumulation expression based on texture directional response synthesis. Rz(x,y) 2 This represents the square of the response intensity at each location. Mathematically, it enhances the contribution of high response values ​​and suppresses low-value fluctuations, highlighting anomalous regions. The squaring operation originates from the physics definition that "energy = the square of the response amplitude," and involves summation. This formula accumulates the squared response values ​​across the entire neighborhood, transforming the originally discrete pixel-level response field into a field of aggregated regional energy, thus enhancing texture perturbation in a spatial sense. The overall texture response intensity Rz in this formula is derived from grayscale inputs. After calculating the directional texture response components, the multi-directional response components are merged. Essentially, it belongs to the grayscale change response quantity. Pixel grayscale values ​​are digital signal amplitudes and do not correspond to fundamental physical quantities in the International System of Units (SI). They are usually considered dimensionless scalars; therefore, the local texture energy Et is a dimensionless value. In signal processing and image analysis, "energy" describes the cumulative intensity of signal amplitude in space or time. It is a mathematical and engineering abstract quantity and does not require corresponding physical work capacity. The local texture energy Et in this step is not energy in the physical sense, but rather an engineering quantitative indicator of the "accumulated degree of texture response intensity" in image signal analysis. Its name comes from the signal energy model, not the physical energy model. Since the overall texture response intensity Rz is dimensionless, the local texture energy Et is also dimensionless, involving no physical conservation or physical energy calculations. The dimensional system is self-consistent and conforms to the technical conventions of this field. S32 statistically analyzes the local texture energy Et in a large number of historical qualified sample images, extracts the median value as the texture energy reference threshold TE, and compares the current local texture energy Et with the texture energy reference threshold TE to achieve an automated initial judgment of the local texture perturbation state. When the local texture energy Et exceeds the texture energy reference threshold TE, energy space aggregation analysis is triggered, forming a hierarchical processing mechanism for texture anomaly identification. This method not only achieves an improvement from pixel-level response to region-level energy model, but also forms an adaptive and quantifiable perturbation identification standard by introducing historical statistical thresholds. Example 5

[0030] Please refer to Figure 3 Specifically: S4 includes S41 and S42; S41. When the texture disturbance assessment indicates the presence of abnormal texture disturbance, a fixed-scale energy aggregation analysis region Λ is constructed in the texture response map of the phone case surface with the center point of the current abnormal disturbance pixel region as the center point of the current abnormal disturbance pixel region. The local texture energy Et(u,v) centered on the pixel position (u,v) within the energy aggregation analysis region Λ is statistically analyzed, and the average local texture energy within the energy aggregation analysis region is calculated. , This represents the average local texture energy within the energy aggregation analysis region centered at pixel location (x,y); S42. By calculating the local texture energy Et of each pixel within the energy concentration analysis region Λ relative to the average local texture energy... The degree of deviation is used to obtain the spatial concentration degree Ce of texture energy, which describes the spatial concentration state of texture energy in a local area and is used to describe the degree of concentration of local energy distribution, as follows; ; Where Ce(x,y) represents the spatial clustering degree of texture energy centered at pixel position (x,y), Λ(x,y) represents the window of the energy clustering analysis region centered at pixel position (x,y), and represents the number of pixels and coordinate positions contained in the energy clustering analysis region Λ(x,y). The energy clustering analysis region Λ is a two-dimensional spatial neighborhood used to describe the distribution of texture energy within a certain spatial range around the current pixel position, and Et(u,v) represents the local texture energy Et centered at pixel position (u,v) within the energy clustering analysis region Λ.

[0031] In this embodiment, when the texture perturbation assessment indicates the presence of abnormal texture perturbation, S41 uses the center point of the current abnormal perturbation pixel region as a spatial anchor point to construct a fixed-scale energy aggregation analysis region Λ in the texture response map. The local texture energy Et(u,v) corresponding to each pixel within the energy aggregation analysis region Λ is statistically analyzed to obtain the average local texture energy reflecting the overall energy level of the energy aggregation analysis region Λ. S42 further calculates the local texture energy Et of each pixel within the energy accumulation analysis region Λ relative to the average local texture energy. The degree of deviation forms the texture energy spatial clustering degree Ce, which is used to characterize the spatial concentration of anomalous energy. The derivation of this formula is based on the concept of "local deviation measurement" from classical mathematics and signal analysis; in statistics, the mean absolute deviation is used to measure the dispersion of a set of samples relative to a reference value (such as the mean or median), and its basic form is... In this scheme, the "sample" is no longer an abstract statistic, but a local texture energy Et; the "neighborhood" is no longer a one-dimensional set, but a two-dimensional spatial window Λ(x,y); and the "reference value" is chosen as the local texture energy Et(x,y) at the current pixel position (x,y), rather than the neighborhood mean. Therefore, the above statistical form is naturally mapped to... This method follows the principle of using the current pixel as a spatial anchor point, emphasizing its central position in the local structure. It determines whether the pixel is in an "energy concentration zone" by analyzing the deviation of the energy in the neighborhood from this anchor point, ultimately forming the texture energy spatial aggregation degree Ce. Since the local texture energy Et is dimensionless, the resulting texture energy spatial aggregation degree Ce is also dimensionless. This implementation method no longer relies solely on a single pixel or isolated energy mutation for judgment. By introducing the analysis of the distribution pattern of abnormal energy in the spatial neighborhood, it distinguishes between scattered disturbances and spatially consistent molding anomalies at the discrimination level. This provides a clear spatial basis for the subsequent construction of texture energy responses, enabling the abnormal region to exhibit stable and continuous characteristics on a spatial scale. This provides a clear basis for identifying injection-molded texture anomalies on the surface of mobile phone cases. Furthermore, under complex texture backgrounds and local noise interference, the detection results demonstrate analytical effects that better conform to the actual distribution patterns of molding defects in terms of spatial consistency, discrimination stability, and regional directionality. Example 6

[0032] Please refer to Figure 1 Specifically: S5 includes S51; S51. Fit the local texture energy Et with the texture energy spatial aggregation degree Ce, perform point-by-point joint quantization of the texture energy under the same pixel, and construct the texture energy response value Me, which represents the abnormal aggregation state of the texture change of the pixel position on the surface of the phone case in space, as follows. Me(x,y)=Et(x,y)×Ce(x,y); Where Me(x,y) represents the texture energy response value of the local texture changes at pixel position (x,y) that are spatially clustered.

[0033] S5 also includes S52; S52. Extract the texture energy response value Me when the historical texture energy space is normal, and calculate the mean value according to the statistical method and set it as the abnormal response benchmark threshold TB. Compare it with the obtained texture energy response value Me, and generate a texture energy state assessment based on the comparison result, as follows; When the texture energy response value Me ≤ the abnormal response baseline threshold TB, it indicates that the local texture energy spatial aggregation is in a normal state, and the current region is marked as a normal response region. When the texture energy response value Me > the abnormal response baseline threshold TB, it indicates that the local texture energy spatial aggregation is in an abnormal state. At this time, the current area is marked as an abnormal candidate area and written into the abnormal candidate coordinate queue for iterative analysis. If it is in an abnormal state three times in a row, the current phone case is marked as a defective state.

[0034] In this embodiment, S51, based on the calculation of local texture energy Et and texture energy spatial aggregation degree Ce, constructs a texture energy response value Me by performing point-by-point joint quantization of the two, which is used to uniformly characterize the comprehensive performance of texture disturbance intensity and spatial aggregation features at the same pixel position; S52 extracts the distribution of texture energy response values ​​Me from samples where the historical texture energy spatial aggregation is in a normal state, and sets an abnormal response benchmark threshold TB using a statistical mean method, and compares and evaluates the currently detected texture energy response value Me to achieve an objective division of texture state. When the texture energy response value Me is less than or equal to the abnormal response benchmark threshold TB, the corresponding area is determined as a normal response area and monitored; when the texture energy response value Me continuously exceeds the abnormal response benchmark threshold TB, the area is included in the abnormal candidate queue and undergoes multiple rounds of iterative confirmation. Only when abnormal responses are shown three times consecutively is a defect judgment made on the entire phone case. Through the above implementation method, the scheme unifies the modeling of local texture changes and spatial aggregation behavior, and introduces a repeated verification mechanism in the time dimension, so that the process of judging texture anomalies is transformed from a single-point judgment to a comprehensive evaluation process of multiple factors and multiple stages, reducing the interference of occasional texture fluctuations on the results. Example 7

[0035] Please refer to Figure 2 A mobile phone case manufacturing defect detection system based on AI vision includes an image normalization module, a texture response module, an energy analysis module, a spatial clustering analysis module, and an anomaly clustering evaluation module. The image straightening module is used to capture surface images of the phone case using an industrial camera installed on the production line, extract the orientation angle information of the phone case from the surface image, and perform image correction on the surface image to obtain a straightened image of the phone case. The texture response module is used to construct a local analysis neighborhood based on the pixels in the regularized image of the mobile phone, calculate the texture response components in the local analysis neighborhood, merge the texture response components to form a comprehensive texture response intensity Rz, and construct a texture response map according to the pixel spatial position. The energy analysis module is used to perform energy processing on the comprehensive texture response intensity Rz in the local analysis neighborhood with each pixel in the texture response map as the center position, and obtain the local texture energy Et for texture perturbation evaluation. The spatial clustering analysis module is used to construct an energy clustering analysis region Λ in the texture response map with the center point of the perturbed pixel region when the texture perturbation assessment indicates the presence of abnormal texture perturbation, and to calculate the spatial clustering degree Ce of texture energy of each pixel in the energy clustering analysis region Λ. The abnormal clustering evaluation module is used to fit the local texture energy Et with the texture energy spatial clustering degree Ce, perform point-by-point joint quantization of the texture energy under the same pixel, and construct the texture energy response value Me to evaluate the texture energy state.

[0036] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended technical solutions and their equivalents.

Claims

1. A method for detecting defects in mobile phone case manufacturing based on AI vision, characterized in that: Includes the following steps: S1. Use an industrial camera installed on the production line to capture surface images of the phone case, extract the orientation and angle information of the phone case from the surface image, and perform image correction on the surface image to obtain a regular image of the phone case. S2. Construct a local analysis neighborhood based on the pixels in the regularized image of the mobile phone, calculate the texture response components in the local analysis neighborhood, merge the texture response components to form a comprehensive texture response intensity Rz, and construct a texture response map according to the pixel spatial position. S3. Using each pixel in the texture response map as the center, the comprehensive texture response intensity Rz is energized in the local analysis neighborhood to obtain the local texture energy Et for texture perturbation evaluation. S4. When the texture perturbation assessment indicates the presence of abnormal texture perturbation, construct an energy aggregation analysis region in the texture response map with the center point of the perturbation pixel region, and calculate the spatial aggregation degree Ce of texture energy of each pixel in the energy aggregation analysis region. S5. Fit the local texture energy Et with the texture energy spatial aggregation degree Ce, perform point-by-point joint quantization of the texture energy under the same pixel, and construct the texture energy response value Me to evaluate the texture energy state.

2. The method for detecting defects in mobile phone case production based on AI vision according to claim 1, characterized in that: S1 includes S11; S11. Using an industrial camera installed on the production line, capture real-time images of the phone case's surface as it passes the shooting station. Extract the closed outer contour of the phone case from the surface image through boundary response continuity analysis. Represent the contour points of the closed outer contour as a set C, where C = {(x...} i y i )|i=1,2,…,N}, and then determine the main expansion direction of the contour point set C in the two-dimensional plane through the statistical characteristics of the spatial distribution of contour points. Define the current main expansion direction as the main contour direction axis of the phone case in the current surface image, and extract the posture angle information of the phone case in the surface image based on the main direction axis. Based on the relative relationship between the main direction axis and the reference direction of the image coordinate system, the planar rotation angle θr of the phone case in the image plane is obtained, and the main structural direction angle θm of the phone case is determined based on the direction distribution of stable structural boundary segments in the contour. The stable structure includes the long side outline of the phone case, the straight line of the frame, and the symmetrical boundary of the structure.

3. The method for detecting defects in mobile phone case production based on AI vision according to claim 2, characterized in that: S1 also includes S12 and S13; S12. Based on the attitude angle information, obtain the orientation offset state of the main structure of the phone case in the image coordinate system, compare the orientation of the main structure of the phone case with the preset reference orientation to obtain the orientation offset, and perform orientation correction on the surface image based on the orientation offset to eliminate the influence of planar rotation introduced by the shooting posture difference. After orientation correction is completed, based on the offset relationship between the center position of the outer contour of the phone case and the set target position, spatial translation processing is performed on the orientation-corrected surface image, and the position offset of the phone case in the image coordinate system is constrained and controlled. S13. After completing the spatial translation, perform contour matching operation on the phone case in the surface image based on the standard phone case outline model, locate the boundary position and forming area of ​​the phone case in the surface image, and remove the pixel area outside the outline range of the phone case to obtain a regular image of the phone.

4. The method for detecting defects in mobile phone case production based on AI vision according to claim 3, characterized in that: S2 includes S21 and S22; S21. Construct a fixed-scale local analysis neighborhood based on each pixel in the regularized image of the mobile phone as the spatial reference center, and extract the gray value of each pixel in the local analysis neighborhood to form the gray distribution information corresponding to the center pixel. Based on the image raster structure of the regularized image from the mobile phone, a set of orientation angles Θ is defined in the local analysis neighborhood, Θ={θ1, θ2, ..., θ...} n }, and for each direction angle in the direction angle set Θ, perform directional response operations on the gray-level distribution information along the corresponding direction angle in the local analysis neighborhood to form a texture response component in the corresponding direction. Then, gather the texture response components at all direction angles at the same pixel position to form a multi-directional texture response component set R, R={R θ1 (x,y),R θ2 (x,y), ...,R θn (x,y)},R θn (x,y) represents the pixel position (x,y) at the direction angle θ. n Texture response components on; S22. At pixel position (x,y), perform unified merging of texture response components corresponding to multiple directions to obtain the comprehensive texture response intensity Rz(x,y) at pixel position (x,y), and arrange the comprehensive texture response intensity Rz(x,y) according to the pixel spatial position to construct a texture response map that corresponds one-to-one with the regular image of the mobile phone.

5. The method for detecting defects in mobile phone case production based on AI vision according to claim 4, characterized in that: S3 includes S31; S31. Taking each pixel in the texture response map as the center position, the comprehensive texture response intensity Rz(x,y) is energized in the local analysis neighborhood, and the local texture energy Et is obtained by cumulative calculation, which represents the overall change intensity of the texture response in the region centered on the target pixel, reflecting the intensity of local texture disturbance on the surface of the phone case, as follows. ; Where Et(x,y) represents the local texture energy centered at pixel position (x,y), Ω(x,y) represents the local analysis neighborhood window centered at (x,y), (i,j) is the pixel position coordinate index within the local analysis neighborhood window, and Rz(i,j) represents the comprehensive texture response intensity at pixel position (i,j) within the local analysis neighborhood.

6. The method for detecting defects in mobile phone case production based on AI vision according to claim 5, characterized in that: S3 further includes S32; S32. Statistically determine the median value of the local texture energy Et of qualified mobile phone case images in history, and compare the median value as the texture energy reference threshold TE with the obtained local texture energy Et. Generate texture perturbation evaluation based on the comparison results. The scheme is as follows. When the local texture energy Et ≤ texture energy reference threshold TE, it indicates that the texture change in the current image area is normal. At this time, the current area is marked as a texture stable area and is monitored normally. When the local texture energy Et > the texture energy reference threshold TE, it indicates that there is abnormal texture perturbation in the current image region, and energy spatial aggregation analysis is triggered.

7. The method for detecting defects in mobile phone case production based on AI vision according to claim 6, characterized in that: S4 includes S41 and S42; S41. When the texture perturbation assessment indicates the presence of abnormal texture perturbation, a fixed-scale energy aggregation analysis region Λ is constructed in the texture response map with the center point of the current abnormal perturbation pixel region. The local texture energy Et(u,v) centered at pixel position (u,v) within the energy aggregation analysis region Λ is statistically analyzed, and the average local texture energy within the energy aggregation analysis region is calculated. ; S42. By calculating the local texture energy Et of each pixel within the energy concentration analysis region Λ relative to the average local texture energy... The degree of deviation is used to obtain the spatial concentration degree Ce of texture energy, which describes the spatial concentration state of texture energy in a local area and is used to describe the degree of concentration of local energy distribution, as follows; ; Where Ce(x,y) represents the spatial concentration of texture energy centered at pixel position (x,y), Λ(x,y) represents the energy concentration analysis region window centered at pixel position (x,y), and Et(u,v) represents the local texture energy Et centered at pixel position (u,v) within the energy concentration analysis region Λ.

8. The method for detecting defects in mobile phone case production based on AI vision according to claim 7, characterized in that: S5 includes S51; S51. Fit the local texture energy Et with the texture energy spatial aggregation degree Ce, perform point-by-point joint quantization of the texture energy under the same pixel, and construct the texture energy response value Me, which represents the abnormal aggregation state of the texture change of the pixel position on the surface of the phone case in space, as follows. Me(x,y)=Et(x,y)×Ce(x,y); Where Me(x,y) represents the texture energy response value of the local texture changes at pixel position (x,y) that are spatially clustered.

9. The method for detecting defects in mobile phone case production based on AI vision according to claim 8, characterized in that: S5 also includes S52; S52. Extract the texture energy response value Me when the historical texture energy space is normal, and calculate the mean value according to the statistical method and set it as the abnormal response benchmark threshold TB. Compare it with the obtained texture energy response value Me, and generate a texture energy state assessment based on the comparison result, as follows; When the texture energy response value Me ≤ the abnormal response baseline threshold TB, it indicates that the local texture energy spatial aggregation is in a normal state, and the current region is marked as a normal response region. When the texture energy response value Me > the abnormal response baseline threshold TB, it indicates that the local texture energy spatial aggregation is in an abnormal state. At this time, the current area is marked as an abnormal candidate area and written into the abnormal candidate coordinate queue for iterative analysis. If it is in an abnormal state three times in a row, the current phone case is marked as a defective state.

10. A mobile phone case manufacturing defect detection system based on AI vision, comprising the mobile phone case manufacturing defect detection method based on AI vision as described in any one of claims 1-9, characterized in that: It includes an image normalization module, a texture response module, an energy analysis module, a spatial clustering analysis module, and an anomaly clustering evaluation module; The image straightening module is used to capture surface images of the phone case using an industrial camera installed on the production line, extract the orientation angle information of the phone case from the surface image, and perform image correction on the surface image to obtain a straightened image of the phone case. The texture response module is used to construct a local analysis neighborhood based on the pixels in the regularized image of the mobile phone, calculate the texture response components in the local analysis neighborhood, merge the texture response components to form a comprehensive texture response intensity Rz, and construct a texture response map according to the pixel spatial position. The energy analysis module is used to perform energy processing on the comprehensive texture response intensity Rz in the local analysis neighborhood with each pixel in the texture response map as the center position, and obtain the local texture energy Et for texture perturbation evaluation. The spatial clustering analysis module is used to construct an energy clustering analysis region Λ in the texture response map with the center point of the perturbed pixel region when the texture perturbation assessment indicates the presence of abnormal texture perturbation, and to calculate the spatial clustering degree Ce of texture energy of each pixel in the energy clustering analysis region Λ. The abnormal clustering evaluation module is used to fit the local texture energy Et with the texture energy spatial clustering degree Ce, perform point-by-point joint quantization of the texture energy under the same pixel, and construct the texture energy response value Me to evaluate the texture energy state.