A visual recognition-based motor insulation cover plate surface defect detection system

CN122928866APending Publication Date: 2026-10-16TAIZHOU SHANYI PLASTIC PRODUCTS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611378760.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-07
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0003]本发明提供一种基于视觉识别的电机绝缘盖板表面缺陷检测系统,目的在于解决现有二维图像检测方法难以准确分离微小缺陷边界且无法获取缺陷三维形态信息的问题,同时解决从多角度反射图像反演表面法向偏差场时法向畸变分量干扰三维轮廓重建精度的问题,实现对绝缘盖板表面缺陷的立体化定量检测和破损等级评定

Benefits of technology

采用采像反演模块获取多角度光照下的初始反射图像序列,并从中反演表面法向偏差场;纹理解析模块在法向偏差场上计算微区纹理梯度图,利用梯度幅值和方向追踪生成可疑缺陷区域的边界链码串。该处理将缺陷引起的法向微观起伏转化为梯度突变,直接基于表面几何特性分离缺陷边界,避免单纯依赖图像灰度信息易受盖板基底纹理和光照不均干扰的局限,使浅层划痕、微小凹坑等低对比度缺陷的边界提取更精准,边界链码串完整包裹缺陷区域,降低漏检和误分割概率。灰度统计模块根据边界链码串确定内部灰度分布直方图,并与相邻非缺陷区域参考灰度直方图进行频数差值绝对值累加,得到全局形态参量;再利用全局形态参量生成定位掩膜提取表面法向偏差场中的法向畸变分量,经各向异性滤波处理后积分重建三维轮廓深度图。通过灰度统计差异量化的全局形态参量能够准确区分缺陷区域与周围正常表面的法向畸变范围,各向异性滤波在保留真实缺陷起伏特征的同时抑制高反射或材质不均导致的法向高频噪声,校正后的法向偏差场重建出的三维轮廓深度图真实反映了缺陷的实际深度分布,最大深度值和深度变化率序列为表面破损等级评定提供可靠的三维量化依据,使破损程度的判定客观且具备可复现性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122928866A_ABST
    Figure CN122928866A_ABST
Patent Text Reader

Abstract

The application discloses a motor insulation cover plate surface defect detection system based on visual identification and belongs to the technical field of visual detection of motor insulation cover plate surface defects. The system comprises an image acquisition inversion module, which acquires an initial reflection image sequence and inverses to obtain a surface normal deviation field; a texture analysis module, which analyzes a micro area texture gradient graph from the surface normal deviation field and separates a boundary chain code string of a suspicious defect area; a gray scale statistical module, which determines an internal gray scale distribution histogram according to the boundary chain code string, performs difference accumulation calculation on the internal gray scale distribution histogram and a reference gray scale histogram of an adjacent non-defect area to obtain a global morphological parameter, and then corrects a normal distortion component by using the global morphological parameter and reconstructs a three-dimensional profile depth graph of the defect area; and a grade evaluation module, which extracts a maximum depth value and a depth change rate sequence to determine a surface damage grade. Through texture gradient analysis of the normal deviation field and normal distortion correction based on gray scale difference, the application realizes stereoscopic quantitative detection of the surface defects of the insulation cover plate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of visual inspection technology for surface defects of motor insulation covers, specifically a visual recognition-based system for detecting surface defects of motor insulation covers. Background Technology

[0002] Surface defect detection of motor insulation covers is a crucial step in ensuring the insulation performance and operational safety of motors. Existing detection methods largely rely on manual visual inspection or machine vision solutions based on two-dimensional images. Manual visual inspection is inefficient, highly subjective, and difficult to meet the consistency requirements of mass production. Conventional machine vision methods identify defect areas by capturing single-frame or uniformly illuminated images of the cover surface and using grayscale thresholding, edge detection, or texture analysis. These methods have limited ability to identify minor surface undulations, shallow scratches, and pits, especially when the illumination direction is fixed, as the grayscale changes caused by defects are weak and easily affected by the cover surface's own texture and uneven reflection, leading to missed detections or misjudgments. Some methods introduce multi-angle illumination image sequences and determine surface unevenness by fusing shadows from different directions, but this only stays at the two-dimensional feature level and cannot obtain three-dimensional morphological information of defects, making it difficult to quantitatively assess defect depth and damage severity. Another approach uses structured light or laser triangulation to reconstruct the 3D surface topography. While this can obtain depth data, it requires additional projection of structured light patterns, resulting in complex system structure and calibration. It also has poor adaptability to materials like insulating covers, which have some light transmittance or significant variations in surface roughness. In normal inversion techniques based on multi-angle reflection images, the obtained surface normal deviation field typically includes normal distortion components caused by localized high reflectivity and material inhomogeneity. Directly using these components to reconstruct depth maps produces significant fluctuations, affecting the accurate assessment of damage levels. Currently, there is a lack of a detection scheme that can accurately extract minute defect boundaries from multi-angle reflection images and effectively suppress normal distortion without adding additional 3D sensors, enabling the reconstruction of surface defect depth and the assessment of damage levels for insulating covers. Summary of the Invention

[0003] This invention provides a visual recognition-based system for detecting surface defects in motor insulation covers. The purpose is to solve the problems of existing two-dimensional image detection methods, which are difficult to accurately separate the boundaries of small defects and cannot obtain the three-dimensional morphological information of defects. At the same time, it solves the problem that the normal distortion component interferes with the accuracy of three-dimensional contour reconstruction when the surface normal deviation field is inverted from multi-angle reflection images. This system enables three-dimensional quantitative detection and damage level assessment of surface defects in insulation covers.

[0004] To achieve the above objectives, the present invention provides the following technical solution: The present invention provides a visual recognition-based surface defect detection system for motor insulation covers, including an image acquisition and inversion module, a texture analysis module, a grayscale statistics module, and a grade evaluation module. The image acquisition and inversion module is used to acquire an initial reflection image sequence of the motor insulation cover surface under preset lighting conditions, and to perform light source direction inversion on the initial reflection image sequence to obtain a surface normal deviation field. Specifically, multiple frames of initial reflection images of the cover surface corresponding to different incident light angles are acquired under preset lighting conditions to form an initial reflection image sequence; the response curve of the reflection intensity of each pixel changing with the incident light angle is extracted from the initial reflection image sequence, and the light source direction vector corresponding to each pixel is inferred from the peak position of the response curve; the light source direction vector is then calculated by vector difference with the ideal plane normal direction to generate the surface normal deviation field. This method utilizes multi-angle reflection intensity response inversion to invert microscopic normal changes, enabling highly sensitive capture of subtle undulations on the cover surface, providing a reliable feature field for revealing hidden defects. In a preferred embodiment, when retrieving the light source direction vector, the same pixel coordinate position is fixed, and the reflection intensity value of that pixel in each frame image is extracted and arranged in order of incident light angle to form the response curve; peak detection is performed on the response curve, and the incident light angle value corresponding to the peak intensity is recorded; based on the incident light angle value corresponding to the peak and the preset light source azimuth information, the light source direction vector of that pixel is calculated, thereby robustly restoring the incident light direction pixel by pixel and enhancing the accuracy of normal inversion. The texture analysis module analyzes the micro-area texture gradient map of the cover plate surface based on the surface normal deviation field, and separates the boundary chain code string of the suspected defect area through the micro-area texture gradient map. The process includes: performing partial derivative calculations on the surface normal deviation field along the horizontal and vertical directions to obtain the micro-area texture gradient map of the cover plate surface; identifying the pixel neighborhood with gradient amplitude exceeding the preset abrupt change threshold in the micro-area texture gradient map, and marking the pixel neighborhood as candidate defect seed points; starting from the candidate defect seed point, tracing adjacent pixels along the gradient direction to generate a boundary chain code string covering the suspected defect area. By using gradient-driven seed point expansion and boundary tracking, the contours of defective regions can be accurately segmented, reducing background texture interference. Furthermore, when identifying candidate defect seed points, the gradient magnitude of each pixel in the micro-area texture gradient map is calculated and compared with a preset abrupt change threshold. Pixels with gradient magnitudes exceeding the preset abrupt change threshold are selected as high-response pixels. These high-response pixels are then aggregated with their eight neighboring pixels that also exceed the preset abrupt change threshold to form a pixel neighborhood. The geometric center pixel of the aggregated pixel neighborhood is marked as a candidate defect seed point, effectively suppressing isolated noise and making seed point localization more stable and representative.The grayscale statistics module determines the internal grayscale distribution histogram of the suspected defect area based on the boundary chain code string, and accumulates the difference between the internal grayscale distribution histogram and the reference grayscale histogram of the adjacent non-defect area to obtain the global morphological parameter of the defect area. Then, the global morphological parameter is used to correct the normal distortion component in the surface normal deviation field, and the three-dimensional contour depth map of the defect area is reconstructed using the corrected normal deviation field. When calculating the global morphological parameter, the grayscale values ​​of each pixel within the suspected defect area are extracted based on the pixel set enclosed by the boundary chain code string to construct the internal grayscale distribution histogram. A predetermined pixel width is extended outward from the bounding rectangle of the boundary chain code string, and the grayscale values ​​of pixels in the non-defect area within the extended region are selected to construct a reference grayscale histogram. The absolute values ​​of the frequency differences between the internal grayscale distribution histogram and the reference grayscale histogram at the same grayscale level are accumulated to obtain the global morphological parameter of the defect area. This parameter comprehensively reflects the statistical grayscale difference between the defect area and the normal area, effectively suppressing the influence of local noise and uneven illumination, and providing a stable value for subsequent distortion correction. Preferably, when constructing the reference grayscale histogram, the minimum bounding rectangle of the boundary chain code string is generated, and the four sides of the minimum bounding rectangle are translated outward by a predetermined pixel width to form an extended rectangular region. Pixels overlapping with the defect region enclosed by the boundary chain code string are removed from the extended rectangular region, and the remaining pixels are taken as non-defect region pixels. The grayscale values ​​of the non-defect region pixels are extracted and their frequency distribution is statistically analyzed to construct the reference grayscale histogram. This ensures that the reference region is pure and representative of the adjacent background, making the difference accumulation results more accurate. In the process of reconstructing the 3D contour depth map, the grayscale statistics module determines the positioning mask of the distorted region in the surface normal deviation field based on the global morphological parameters, and extracts the normal distortion component through the positioning mask. Anisotropic filtering is applied to the normal distortion component to obtain the corrected normal deviation field. The corrected normal deviation field is integrated and reconstructed along the spatial path to generate the 3D contour depth map of the defect region. Anisotropic filtering smooths noise while maintaining the defect edge structure, while integral reconstruction restores the true depth fluctuations, significantly improving the 3D rendering accuracy of the defect morphology. As a preferred reconstruction scheme, the normal distortion component is smoothed and diffused along both the horizontal and vertical directions to suppress high-frequency noise components, resulting in a corrected normal deviation field. In this corrected field, the normal deviation value is accumulated row by row along the horizontal scan line, using the starting point of the boundary chain code string of the defect region as the integration origin, to obtain the initial depth value for each row. Consistency constraints are applied to the initial depth values ​​of each row along the vertical direction to generate a three-dimensional contour depth map of the defect region, thereby effectively controlling accumulated errors and improving the spatial continuity and geometric fidelity of the depth map. The grading module extracts the maximum depth value and depth change rate sequence of the defect region from the three-dimensional contour depth map and determines the surface damage level of the defect region based on these values.Specifically, the pixel depth values ​​corresponding to the defect area in the 3D contour depth map are traversed, and the maximum depth value is selected. The depth difference ratio between adjacent pixels is calculated sequentially along the main extension direction of the defect area to generate a depth change rate sequence. The maximum depth value and the depth change rate sequence are mapped to preset damage level judgment intervals, and the surface damage level of the defect area is output. By jointly judging the depth extreme value and the change rate, surface damage of different severity levels can be quantitatively distinguished, meeting the needs of production line graded control.

[0005] The technical effects and advantages provided by the present invention in the above technical solution are as follows: An image acquisition and inversion module acquires an initial reflection image sequence under multi-angle illumination and inverts the surface normal deviation field from it. A texture analysis module calculates a micro-area texture gradient map on the normal deviation field and generates a boundary chain code string for suspected defect regions using gradient magnitude and direction tracking. This process transforms the micro-normal fluctuations caused by defects into gradient abrupt changes, directly separating defect boundaries based on surface geometric characteristics. This avoids the limitations of relying solely on image grayscale information, which is susceptible to interference from cover plate substrate texture and uneven illumination. This makes the boundary extraction of low-contrast defects such as shallow scratches and micro-pits more accurate, and the boundary chain code string completely encloses the defect region, reducing the probability of missed detections and missegmentation. A grayscale statistics module determines the internal grayscale distribution histogram based on the boundary chain code string and accumulates the absolute value of the frequency difference with the reference grayscale histogram of adjacent non-defect regions to obtain global morphological parameters. These global morphological parameters are then used to generate a positioning mask to extract the normal distortion component in the surface normal deviation field. After anisotropic filtering, the 3D contour depth map is reconstructed through integration. Global morphological parameters quantified by grayscale statistical difference can accurately distinguish the normal distortion range between the defect area and the surrounding normal surface. Anisotropic filtering preserves the true undulation characteristics of the defect while suppressing high-frequency noise in the normal direction caused by high reflection or material inhomogeneity. The three-dimensional contour depth map reconstructed by the corrected normal deviation field truly reflects the actual depth distribution of the defect. The maximum depth value and depth change rate sequence provide a reliable three-dimensional quantitative basis for the assessment of surface damage level, making the determination of damage degree objective and reproducible. Attached Figure Description

[0006] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.

[0007] Figure 1 This is a schematic diagram of a vision-based motor insulation cover surface defect detection system. Figure 2 This is a flowchart of the surface normal deviation field generation process; Figure 3 It is a histogram comparing the grayscale distribution inside the defective area and the non-defective area. Detailed Implementation

[0008] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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, 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.

[0009] See Figure 1 This invention provides a visual recognition-based system for detecting surface defects in motor insulation covers, including an image acquisition and inversion module, a texture analysis module, a grayscale statistics module, and a grade assessment module. The image acquisition and inversion module acquires the initial reflection image sequence of the motor insulation cover surface under preset lighting conditions, and performs light source direction inversion on the initial reflection image sequence to obtain the surface normal deviation field; the texture analysis module analyzes the micro-area texture gradient map of the cover surface based on the surface normal deviation field, and separates the boundary chain code string of the suspected defect area through the micro-area texture gradient map; the gray-scale statistics module determines the internal gray-scale distribution histogram of the suspected defect area based on the boundary chain code string, and performs difference accumulation calculation between the internal gray-scale distribution histogram and the reference gray-scale histogram of the adjacent non-defect area to obtain the global morphological parameter of the defect area; the gray-scale statistics module is also used to correct the normal distortion component in the surface normal deviation field using the global morphological parameter, and reconstructs the three-dimensional contour depth map of the defect area through the corrected normal deviation field; the grade assessment module extracts the maximum depth value and depth change rate sequence of the defect area based on the three-dimensional contour depth map, and determines the surface damage level of the defect area through the maximum depth value and depth change rate sequence. Example 1:

[0010] In specific implementation, please refer to Figure 2 The image acquisition and inversion module acquires the initial reflection image sequence of the motor insulation cover surface under preset lighting conditions, and performs light source direction inversion on the initial reflection image sequence to obtain the surface normal deviation field.

[0011] The preset lighting conditions are provided by a multi-angle light source device. This device comprises multiple point light sources arranged along different azimuth and polar angles. During image acquisition of the motor insulation cover surface, the multi-angle light source device sequentially illuminates each point light source according to a set sequence of incident light angles. Each time a point light source is illuminated, the image acquisition and inversion module controls the imaging equipment to acquire one frame of the reflected image from the motor insulation cover surface. After all the reflected images corresponding to the point light sources have been acquired, an initial reflected image sequence is formed. Each frame in the initial reflected image sequence is associated with a specific incident light angle, defined by two parameters: polar angle and azimuth angle.

[0012] The image acquisition and inversion module iterates through each pixel coordinate position in the initial reflective image sequence. During processing, it fixes a pixel coordinate position and extracts the reflection intensity value of that pixel position in each frame of the initial reflective image sequence. The extracted series of reflection intensity values ​​are arranged in ascending order according to the corresponding incident light angle value, forming the response curve corresponding to that pixel coordinate position. The response curve characterizes the functional relationship between the reflection intensity at that pixel coordinate position and the incident light angle.

[0013] The image acquisition and inversion module performs peak detection on the response curve. Peak detection uses a traversal comparison method: it compares the reflection intensity values ​​point by point in the response curve, determines the data point with the highest reflection intensity value, takes the reflection intensity value corresponding to this data point as the peak intensity, and records the incident light angle value corresponding to this data point as the peak incident light angle value. For pixel coordinate positions... The corresponding peak incident light angle value is denoted as .

[0014] The image acquisition and inversion module calculates the pixel coordinates based on the peak incident light angle and the preset light source azimuth information. The direction vector of the light source at that location. The calculation formula is: ; in, Indicates pixel coordinate position The direction vector of the light source at that location. Indicates pixel coordinate position The corresponding peak incident light angle value of the response curve, This indicates the preset azimuth angle of the light source. (Light source azimuth angle) This refers to the fixed azimuth angle value used by the multi-angle light source device during this round of image acquisition, which remains constant throughout the entire initial reflection image sequence acquisition process. Light source direction vector. It is a three-dimensional unit vector whose direction is determined by its polar angular components. and azimuth components The only certainty.

[0015] After obtaining the light source direction vector at each pixel's coordinate position, the image acquisition and inversion module performs vector difference calculations between the light source direction vector and the ideal plane normal direction to generate a surface normal deviation field. The ideal plane normal direction is a unit vector perpendicular to the ideal surface of the motor insulation cover and pointing towards the imaging device, denoted as... , The value is Pixel coordinates Surface normal deviation field vector at the location pass The light source direction vector inversion and vector difference operations are performed on all pixel coordinate positions within the cover plate image area. The image inversion module outputs a surface normal deviation field covering the entire cover plate surface. Example 2:

[0016] In practice, the texture analysis module acquires the surface normal deviation field generated by the image acquisition and inversion module, and analyzes the micro-area texture gradient map of the cover plate surface.

[0017] The texture analysis module calculates the partial derivatives of the surface normal deviation field along the horizontal and vertical directions. The surface normal deviation field is a two-dimensional vector field, where each pixel's coordinate position... Corresponding to a surface normal deviation field vector The surface normal deviation field vector contains a horizontal component. and vertical components The horizontal partial derivative is calculated by convolving the surface normal bias field with the horizontal Sobel operator to obtain the horizontal gradient component. The vertical partial derivative is calculated by convolving the surface normal deviation field with the vertical Sobel operator to obtain the vertical gradient component. The texture parsing module supports... and Pixel-by-pixel synthesis is performed to obtain a micro-region texture gradient map. The coordinates of each pixel in the micro-region texture gradient map are shown below. Corresponding gradient magnitude Calculated using the following formula: ; in, Represents the pixel coordinate position in the micro-area texture gradient map gradient magnitude at that point Indicates pixel coordinate position The horizontal gradient component at that point, Indicates pixel coordinate position The vertical gradient component at that location.

[0018] The texture parsing module identifies pixel neighborhoods in the micro-region texture gradient map where the gradient magnitude exceeds a preset abrupt change threshold. (Preset abrupt change threshold) The value is the sum of 1.5 times the mean of the gradient magnitudes of all pixels in the micro-region texture gradient map and the standard deviation of the gradient magnitudes of all pixels in the micro-region texture gradient map. The texture parsing module calculates the gradient magnitude of each pixel in the micro-region texture gradient map, compares the gradient magnitude of each pixel with a preset mutation threshold, and selects pixels whose gradient magnitude exceeds the preset mutation threshold as high-response pixels. The texture parsing module performs a neighborhood aggregation operation on each high-response pixel. The specific implementation of the neighborhood aggregation operation is as follows: taking the current high-response pixel position as the center, it checks the eight neighboring pixels in the eight-neighborhood of the center position, extracts the pixels among the eight neighboring pixels that also meet the condition that the gradient magnitude exceeds the preset mutation threshold, and forms a pixel neighborhood together with the high-response pixel at the center position. For multiple pixel neighborhoods that are adjacent to each other and have overlapping areas, the texture parsing module merges the overlapping pixel neighborhoods into a continuous pixel neighborhood. The merged pixel neighborhood may contain multiple originally independent pixel neighborhoods.

[0019] After aggregating and merging pixel neighborhoods, the texture parsing module marks each pixel neighborhood as a candidate defect seed point. The module calculates the average horizontal and vertical coordinates of all pixels within the pixel neighborhood in the image coordinate system. The pixel coordinates determined by these averages are used as the geometric center pixel of the neighborhood, and this geometric center pixel is marked as a candidate defect seed point. Each candidate defect seed point corresponds to a pixel neighborhood, representing the covered region of concentrated high-gradient responses.

[0020] The texture parsing module starts from the candidate defect seed point and traces adjacent pixels along the gradient direction to generate a boundary chain code string covering the suspected defect region. The gradient direction is obtained from the micro-area texture gradient map, and the pixel coordinates are... gradient direction angle at From horizontal gradient components and vertical gradient components The boundary chain code string is obtained through arctangent calculation. The generation method is as follows: The candidate defect seed point is used as the current point in the tracking process. The gradient direction angle of the current point is calculated. Within an eight-neighborhood, the neighboring pixel closest to the gradient direction angle is determined as the next tracking point. The movement direction from the current point to the next tracking point is represented by chain code encoding. Chain code encoding uses an eight-directional chain code, with the eight directions represented by numbers 0 to 7. The texture parsing module updates the current point with a new tracking point and repeats the operation of determining neighboring pixels and recording chain code encoding until the tracking path closes to form a closed curve or the tracking point reaches the boundary of the micro-area texture gradient map. All pixels traversed by the tracking path constitute the boundary chain code string, and the internal region enclosed by the boundary chain code string is the suspected defect region. The texture parsing module performs the boundary chain code string generation operation for each candidate defect seed point, outputting all boundary chain code strings covering the suspected defect regions. Example 3:

[0021] In practice, the grayscale statistics module obtains the boundary chain code string generated by the texture parsing module, and determines the internal grayscale distribution histogram of the suspected defect area based on the boundary chain code string.

[0022] The grayscale statistics module obtains an initial reflection image sequence from the image acquisition and inversion module. This initial reflection image sequence contains multiple frames of reflection images of the cover plate surface. The grayscale statistics module selects one frame of reflection image with an incident light angle of 0 degrees from the initial reflection image sequence as the reference grayscale image. The incident light direction of the reference grayscale image is parallel to the optical axis of the imaging device, which can reflect the intrinsic grayscale characteristics of each pixel position on the cover plate surface under conditions of no oblique illumination.

[0023] The grayscale statistics module extracts the grayscale values ​​of each pixel within the suspected defect area based on the pixel set enclosed by the boundary chain code string. The pixel set enclosed by the boundary chain code string is determined as follows: the grayscale statistics module takes the chain code encoding sequence of the boundary chain code string as input and uses a scan-line-based polygon filling algorithm to determine the coordinate positions of all pixels located within the boundary chain code string. For each pixel coordinate position in the pixel set within the boundary chain code string, the grayscale statistics module searches for the corresponding grayscale value in the baseline grayscale image and summarizes all extracted grayscale values ​​into an internal grayscale value set. The grayscale statistics module performs frequency statistics on the internal grayscale value set and constructs an internal grayscale distribution histogram. The horizontal axis of the internal grayscale distribution histogram represents the grayscale level, with a value range of 0 to 255, and the vertical axis represents the pixel frequency corresponding to each grayscale level.

[0024] The grayscale statistics module expands outward by a predetermined pixel width from the bounding rectangle of the boundary chain code string, and constructs a reference grayscale histogram by selecting the grayscale values ​​of pixels in the non-defect area within the expanded region. Specifically, the grayscale statistics module generates the minimum bounding rectangle of the boundary chain code string. This minimum bounding rectangle is one that completely contains the boundary chain code string and whose sides are parallel to the horizontal and vertical directions of the image, respectively. The minimum bounding rectangle is uniquely determined by the coordinates of its top-left and bottom-right corners. The grayscale statistics module then shifts the top edge of the minimum bounding rectangle upwards by a predetermined pixel width, the bottom edge downwards by a predetermined pixel width, the left edge to the left by a predetermined pixel width, and the right edge to the right by a predetermined pixel width, forming the expanded rectangular region. The predetermined pixel width is set to 20 pixels, based on the fact that the average scale of the texture primitives on the surface of the motor insulation cover is within two orders of magnitude. A width of 20 pixels can completely cover the texture primitives surrounding the defect area without introducing background areas too far from the defect area. After forming the extended rectangular region, the grayscale statistics module removes pixels that overlap with the defect area enclosed by the boundary chain code string from the extended rectangular region. The removal operation is implemented as follows: traversing each pixel coordinate position within the extended rectangular region, it determines whether the current pixel coordinate position is inside the boundary chain code string. If it is inside, the current pixel coordinate position is removed; if it is outside, it is retained. All retained pixel coordinate positions constitute the non-defect area pixels. The grayscale statistics module finds the grayscale value corresponding to each non-defect area pixel coordinate position in the reference grayscale image and summarizes the grayscale values ​​of all non-defect area pixels into a reference grayscale value set. The grayscale statistics module performs frequency statistics on the reference grayscale value set and constructs a reference grayscale histogram. The horizontal axis of the reference grayscale histogram represents the grayscale level, with a value range of 0 to 255, and the vertical axis represents the pixel frequency corresponding to each grayscale level.

[0025] The grayscale statistics module sums the absolute values ​​of the frequency differences between the internal grayscale distribution histogram and the reference grayscale histogram at the same grayscale level to obtain the global morphological parameters of the defect area. Global Morphological Parameters The calculation formula is: ; in, Represents the global morphological parameters of the defect region. Indicates grayscale level. The value of is an integer from 0 to 255. The gray levels in the internal gray-level distribution histogram The corresponding pixel frequency, Indicates the gray level in the reference gray-level histogram The corresponding pixel frequency, This indicates that the internal gray-level distribution histogram and the reference gray-level histogram are in terms of gray level. The absolute value of the pixel frequency difference is calculated. The grayscale statistics module calculates the absolute value of the frequency difference for each of the 256 grayscale levels, and sums up the 256 absolute values. The summed result is the global morphological parameter of the defect area. The global morphological parameter is used to quantitatively characterize the overall deviation between the grayscale distribution inside the suspected defect area and the grayscale distribution of adjacent non-defect areas.

[0026] See Figure 3 This figure illustrates a comparison between the internal grayscale distribution histogram (blue-filled area) constructed by the grayscale statistics module based on the boundary chain code string generated by the texture parsing module in Example 3, and the reference grayscale histogram (orange-filled area) constructed from the grayscale values ​​of the selected adjacent non-defective areas. The horizontal axis represents the grayscale level. The value ranges from 0 to 255, and the vertical axis represents the pixel frequency of the corresponding gray level.

[0027] As shown in the figure, the internal grayscale distribution histogram is concentrated in the grayscale level range of 60 to 120, with a peak frequency exceeding 150, exhibiting an overall low grayscale distribution. This indicates that the pixels within the defective area mainly exhibit darker grayscale characteristics. The reference grayscale histogram, on the other hand, is mainly distributed in the grayscale level range of 120 to 180, with a peak frequency also exceeding 150, leaning towards a higher grayscale level. This shows that the pixels in the non-defective area are significantly brighter than those in the defective area. There is a clear overlap between the two in the grayscale level range of 100 to 120, but the overall grayscale distribution differs significantly, indicating a significant deviation in grayscale characteristics between the defective area and the adjacent non-defective area. Example 4:

[0028] In practice, the grayscale statistics module obtains the global morphological parameters calculated by the grayscale statistics module itself, and uses the global morphological parameters to correct the normal distortion component in the surface normal deviation field.

[0029] The grayscale statistics module determines the localization mask for the distorted region in the surface normal deviation field based on the global morphological parameter. The global morphological parameter is a scalar value that characterizes the overall deviation between the grayscale distribution within the suspected defective region and the grayscale distribution of adjacent non-defective regions. The grayscale statistics module compares the global morphological parameter with a preset morphological threshold, which is the ratio of the maximum frequency value in the internal grayscale distribution histogram to the total number of pixels in the non-defective region, multiplied by a coefficient of 2.0. The coefficient 2.0 is set based on the following: when the frequency difference between the internal grayscale distribution histogram and the reference grayscale histogram reaches twice the maximum frequency ratio of the total number of pixels in the non-defective region, the surface morphology of the defective region has produced a normal deviation distortion that needs to be corrected. When the global morphological parameter is greater than the preset morphological threshold, the grayscale statistics module determines that there is a normal distortion component in the surface normal deviation field region corresponding to the current suspected defective region, and marks the area covering the current suspected defective region and its outer 5-pixel width as the localization mask for the distorted region. When the global morphological parameter is less than or equal to the preset morphological threshold, the grayscale statistics module does not perform a correction operation on the surface normal deviation field and directly enters the three-dimensional contour depth map reconstruction step.

[0030] The grayscale statistics module extracts the normal distortion component through a positioning mask. The surface normal deviation field is a two-dimensional vector field, with each pixel coordinate position corresponding to a surface normal deviation field vector. The grayscale statistics module traverses all pixel coordinate positions covered by the positioning mask, extracting the surface normal deviation field vector corresponding to each pixel coordinate position within the positioning mask to form the normal distortion component. The normal distortion component is a subset of the surface normal deviation field, containing only the surface normal deviation field vector within the positioning mask area.

[0031] The grayscale statistics module performs anisotropic filtering on the normal distortion component to obtain the corrected normal deviation field. The anisotropic filtering is implemented as follows: the grayscale statistics module performs smoothing diffusion processing on the normal distortion component along both the horizontal and vertical directions. Horizontal smoothing diffusion is achieved by applying a one-dimensional Gaussian filter to both the horizontal and vertical components of each surface normal deviation field vector in the normal distortion component, with the Gaussian kernel standard deviation set to 1.0 pixel. Vertical smoothing diffusion is also achieved by applying a one-dimensional Gaussian filter to both the horizontal and vertical components of each surface normal deviation field vector in the normal distortion component, with the Gaussian kernel standard deviation set to 1.0 pixel. The horizontal and vertical smoothing diffusion processes are executed sequentially, with the horizontal smoothing diffusion performed first, followed by the vertical smoothing diffusion. The anisotropic filtering only smooths the normal distortion component within the positioning mask area; the surface normal deviation field vector outside the positioning mask area remains unchanged. After anisotropic filtering, the high-frequency noise components in the normal distortion component within the positioning mask are suppressed. The grayscale statistics module writes the processed normal distortion component back to the corresponding pixel coordinates in the surface normal deviation field, thus obtaining the corrected normal deviation field.

[0032] The grayscale statistics module integrates and reconstructs the corrected normal deviation field along the spatial path to generate a 3D contour depth map of the defect region. In the corrected normal deviation field, the grayscale statistics module uses the starting point of the boundary chain code string of the defect region as the origin of integration. The starting point of the boundary chain code string is the tracking start pixel coordinate position recorded by the texture parsing module during the generation of the boundary chain code string, denoted as... The grayscale statistics module starts with the row containing the origin of integration and accumulates the normal deviation value row by row along the horizontal scan line. For the corrected normal deviation field, the [value is missing here]. The horizontal scan line is processed by the grayscale statistics module, which starts from the leftmost pixel of the horizontal scan line and accumulates the vertical component of the surface normal deviation field vector pixel by pixel along the horizontal direction to obtain the result. The initial depth value is determined for each pixel coordinate position in each row. After accumulating the depth line by line across all horizontal scan lines, the grayscale statistics module obtains the initial depth value for each row. The initial depth value for each row is then calculated on the [number]th [number]th [number]. Line 1 The value at the column pixel coordinate position is denoted as .

[0033] The grayscale statistics module applies consistency constraints to the initial depth values ​​of each row along the vertical direction, generating a 3D contour depth map of the defect area. The consistency constraint correction is achieved using the following formula: ; in, The third dimension in the 3D contour depth map representing the defect region Line 1 The final depth value at the column pixel coordinate position. Indicates the first Line 1 Initial value of row depth at column pixel coordinate position This represents the half-height of the window constrained in the vertical direction. The value of is 3. The setting is based on the fact that the vertical continuity span of the defect area on the surface of the motor insulation cover is 5 to 7 pixels, and the half-height is set accordingly. Setting it to 3 pixels can cover a vertical range of 7 pixels, which constrains vertical consistency while avoiding excessive smoothing that obscures true depth details. Indicates the vertical offset. The range of values ​​is from arrive integers, Indicates the vertical offset All values ​​within the range Summation is performed. The grayscale statistics module performs a vertical consistency constraint correction operation on the vertical direction of each pixel coordinate position within the defect area, using the final depth value. Replace the corresponding initial value of the row depth After all pixel coordinates are processed, a 3D contour depth map of the defect area is generated. Example 5:

[0034] In practice, the rating module obtains the three-dimensional contour depth map generated by the grayscale statistics module, and extracts the maximum depth value and depth change rate sequence of the defect area based on the three-dimensional contour depth map.

[0035] The grading module iterates through the pixel depth values ​​corresponding to the defect areas in the 3D contour depth map and selects the maximum depth value. The pixel range corresponding to the defect area is determined by the boundary chain code string generated by the texture parsing module. The grading module maps all pixel coordinate positions enclosed within the boundary chain code string to the 3D contour depth map and extracts the final depth value corresponding to each pixel coordinate position. The grading module compares all extracted final depth values ​​one by one, records the maximum value that occurs during the comparison, and takes this maximum value as the maximum depth value of the defect area, denoted as... .

[0036] The grading module calculates the depth difference ratio between adjacent pixels sequentially along the main extension direction of the defect region, generating a depth change rate sequence. The main extension direction of the defect region is determined by analyzing the geometry of the boundary chain code string. The grading module calculates the covariance matrix of the pixel set enclosed by the boundary chain code string, performs eigenvalue decomposition on the covariance matrix to obtain the eigenvector corresponding to the largest eigenvalue, and uses the direction pointed to by the eigenvector corresponding to the largest eigenvalue as the main extension direction of the defect region. Along the main extension direction, starting from the beginning point of the boundary chain code string and with a step size of pixels, the grading module sequentially extracts the pixel coordinate position sequence arranged along the main extension direction. For the pixel coordinate position sequence arranged along the main extension direction... The pixel coordinate position and the first The grading module extracts the pixel coordinates from the 3D contour depth map. The final depth value corresponding to each pixel coordinate position and the The final depth value corresponding to each pixel coordinate position The depth change rate sequence of the th element The calculation formula is: ; in, Represents the depth change rate sequence of the th The depth change rate value of each element, Indicates the first in the main extension direction pixel coordinates The final depth value in the 3D contour depth map. Indicates the first in the main extension direction pixel coordinates The final depth value in the 3D contour depth map. Indicates the first The final depth value at the coordinate position of the nth pixel is related to the nth pixel. The absolute value of the difference between the final depth values ​​of the pixel coordinates. Indicates the first The coordinate position of the pixel is related to the . Spatial distance between pixel coordinates It is obtained by calculating the Euclidean distance between the two pixel coordinates. The units are consistent with the units of pixel spacing in the 3D contour depth map. The grading module calculates the depth change rate value for all adjacent pixel pairs in the main extension direction, arranges all the calculated depth change rate values ​​in order, and generates a depth change rate sequence.

[0037] The grading module maps the maximum depth value and depth change rate sequence to preset damage level judgment intervals, outputting the surface damage level of the defective area. The preset damage level judgment intervals include a maximum depth value judgment interval and a depth change rate judgment interval. The maximum depth value judgment interval is divided into three level intervals: the first maximum depth value interval is for maximum depth values ​​less than 0.5 mm, the second maximum depth value interval is for maximum depth values ​​greater than or equal to 0.5 mm and less than 2.0 mm, and the third maximum depth value interval is for maximum depth values ​​greater than or equal to 2.0 mm. The depth change rate judgment interval is also divided into three level intervals: the first depth change rate interval is for the average value of all elements in the depth change rate sequence to be less than 0.1, the second depth change rate interval is for the average value of all elements in the depth change rate sequence to be greater than or equal to 0.1 and less than 0.5, and the third depth change rate interval is for the average value of all elements in the depth change rate sequence to be greater than or equal to 0.5. The surface damage level includes three levels: minor damage, moderate damage, and severe damage. The rating module maps the maximum depth value to the maximum depth value judgment interval and maps the average value of all elements in the depth change rate sequence to the depth change rate judgment interval. When the maximum depth value and the average value of the depth change rate fall into different rating intervals, the higher level of the two rating intervals is taken as the output result, and the surface damage level of the defect area is output.

[0038] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A visual recognition-based system for detecting surface defects in motor insulation covers, characterized in that, The system includes: The image acquisition and inversion module acquires the initial reflection image sequence of the motor insulation cover surface under preset lighting conditions, and performs light source direction inversion on the initial reflection image sequence to obtain the surface normal deviation field. The texture analysis module analyzes the micro-texture gradient map of the cover plate surface based on the surface normal deviation field, and separates the boundary chain code string of the suspected defect area through the micro-texture gradient map. The grayscale statistics module determines the internal grayscale distribution histogram of the suspected defect area based on the boundary chain code string, and calculates the difference between the internal grayscale distribution histogram and the reference grayscale histogram of the adjacent non-defect area to obtain the global morphological parameters of the defect area. The grayscale statistics module uses global morphological parameters to correct the normal distortion component in the surface normal deviation field, and reconstructs the three-dimensional contour depth map of the defect area through the corrected normal deviation field. The rating module extracts the maximum depth value and depth change rate sequence of the defect area based on the 3D contour depth map, and determines the surface damage level of the defect area through the maximum depth value and depth change rate sequence.

2. The visual recognition-based surface defect detection system for motor insulation covers according to claim 1, characterized in that, The process of obtaining an initial reflection image sequence of the motor insulation cover surface under preset lighting conditions, and then performing a light source direction inversion on the initial reflection image sequence to obtain the surface normal deviation field specifically includes: Under preset lighting conditions, multiple frames of initial reflection images of the cover plate surface corresponding to different incident light angles are acquired to form an initial reflection image sequence. The response curves of the reflection intensity of each pixel as a function of the incident light angle are extracted from the initial reflection image sequence, and the light source direction vector corresponding to each pixel is inferred from the peak position of the response curve. The surface normal deviation field is generated by performing vector difference calculation between the light source direction vector and the ideal plane normal direction.

3. The visual recognition-based surface defect detection system for motor insulation covers according to claim 1, characterized in that, The micro-texture gradient map of the cover plate surface is analyzed based on the surface normal deviation field, and the boundary chain code string of the suspected defect area is separated by the micro-texture gradient map. Specifically, it includes: The partial derivatives of the surface normal deviation field along the horizontal and vertical directions are calculated to obtain the micro-region texture gradient map of the cover plate surface; In the micro-area texture gradient map, identify the pixel neighborhood where the gradient magnitude exceeds a preset mutation threshold, and mark the pixel neighborhood as candidate defect seed points; Starting from the candidate defect seed point, the adjacent pixels are traced along the gradient direction to generate a boundary chain code string covering the suspected defect region.

4. The visual recognition-based surface defect detection system for motor insulation covers according to claim 1, characterized in that, The internal grayscale distribution histogram of the suspected defective region is determined based on the boundary chain code string. The difference between the internal grayscale distribution histogram and the reference grayscale histogram of the adjacent non-defective region is accumulated to calculate the global morphological parameters of the defective region, specifically including: Extract the grayscale values ​​of each pixel inside the suspected defect area based on the pixel set surrounded by the boundary chain code string, and construct an internal grayscale distribution histogram; A reference grayscale histogram is constructed by expanding a predetermined pixel width outward from the bounding rectangle of the boundary chain code string and selecting the grayscale values ​​of non-defective region pixels in the expanded region. The absolute values ​​of the frequency differences between the internal gray-level distribution histogram and the reference gray-level histogram at the same gray level are summed to obtain the global morphological parameters of the defect region.

5. The visual recognition-based surface defect detection system for motor insulation covers according to claim 1, characterized in that, The process of correcting the normal distortion component in the surface normal deviation field using global morphological parameters and reconstructing the three-dimensional contour depth map of the defect region using the corrected normal deviation field specifically includes: The positioning mask for the distorted region in the surface normal deviation field is determined based on the global morphological parameters, and the normal distortion component is extracted through the positioning mask. Anisotropic filtering is applied to the normal distortion component to obtain the corrected normal deviation field. The corrected normal deviation field is then integrated and reconstructed along the spatial path to generate a three-dimensional contour depth map of the defect region.

6. The visual recognition-based surface defect detection system for motor insulation covers according to claim 1, characterized in that, The maximum depth value and depth change rate sequence of the defect area are extracted from the 3D contour depth map, and the surface damage level of the defect area is determined by the maximum depth value and depth change rate sequence. Specifically, this includes: Iterate through the pixel depth values ​​corresponding to the defect area in the 3D contour depth map and filter out the maximum depth value. The depth difference ratio between adjacent pixels is calculated sequentially along the main extension direction of the defect region to generate a depth change rate sequence. The maximum depth value and depth change rate sequence are mapped to the preset damage level judgment interval, and the surface damage level of the defect area is output.

7. A visual recognition-based surface defect detection system for motor insulation covers according to claim 2, characterized in that, Extracting the response curve of the reflection intensity of each pixel as a function of the incident light angle from the initial reflection image sequence, and inferring the light source direction vector corresponding to each pixel based on the peak position of the response curve, specifically includes: In the initial reflection image sequence, the same pixel coordinate position is fixed, and the reflection intensity value of the pixel in each frame image is extracted and arranged in order of incident light angle to form a response curve; Peak detection is performed on the response curve, and the incident light angle value corresponding to the peak intensity is recorded; The light source direction vector of the pixel is calculated based on the incident light angle value corresponding to the peak value and the preset light source azimuth information.

8. The visual recognition-based surface defect detection system for motor insulation covers according to claim 3, characterized in that, Identifying pixel neighborhoods with gradient magnitudes exceeding a preset abrupt change threshold in the micro-region texture gradient map and marking these pixel neighborhoods as candidate defect seed points specifically includes: Calculate the gradient magnitude of each pixel in the micro-region texture gradient map and compare it with a preset mutation threshold. Select pixels with gradient magnitudes exceeding the preset mutation threshold as high-response pixels. Aggregate high-response pixels and pixels in their eight neighborhoods that also exceed a preset mutation threshold into a pixel neighborhood; The geometric center pixel of the aggregated pixel neighborhood is marked as a candidate defect seed point.

9. A visual recognition-based surface defect detection system for motor insulation covers according to claim 4, characterized in that, Expanding outwards by a predetermined pixel width from the bounding rectangle of the boundary chain code string, and constructing a reference grayscale histogram by selecting the grayscale values ​​of pixels in the non-defective areas within the expanded region, specifically includes: Generate the minimum bounding rectangle of the boundary chain code string, and translate the four sides of the minimum bounding rectangle outward by a predetermined pixel width to form an extended rectangular region; Remove pixels from the extended rectangular region that overlap with the defect region enclosed by the boundary chain code string, and treat the remaining pixels as non-defect region pixels; Extract the grayscale values ​​of pixels in non-defective areas and count their frequency distribution to construct a reference grayscale histogram.

10. A visual recognition-based surface defect detection system for motor insulation covers according to claim 5, characterized in that, Anisotropic filtering is applied to the normal distortion component to obtain the corrected normal deviation field. The corrected normal deviation field is then integrated and reconstructed along the spatial path to generate a 3D contour depth map of the defect region. Specifically, this includes: The normal distortion component is smoothed and diffused along the horizontal and vertical directions respectively to suppress the high-frequency noise components in the normal distortion component, and the corrected normal deviation field is obtained. In the corrected normal deviation field, the starting point of the boundary chain code string of the defect region is taken as the origin of integration, and the normal deviation value is accumulated row by row along the horizontal scan line to obtain the initial value of the depth of each row. The initial depth values ​​of each row are corrected by consistency constraints along the vertical direction to generate a three-dimensional contour depth map of the defect area.