Image processing-based optical cable joint box appearance detection method and system
Patent Information
- Application Number
- CN202611082202.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-21
- Publication Date
- 2026-08-18
AI Technical Summary
[0003]现有光缆接头盒外观检测技术通常采用人工目检、模板匹配或基于边缘检测的视觉识别方式,对表面划痕、裂纹及变形等缺陷进行识别,该类方法在结构规则、灰度边界明显的区域具有一定检测效果,但在接头盒肋条区域、端盖结合缝区域等复杂结构区域中,容易受到光照变化、边缘模糊及结构纹理干扰的影响,导致裂纹边界不连续、路径识别中断或缺陷误判等问题,尤其在结合缝附近的细微裂纹检测过程中,传统方法通常依赖局部灰度突变或单一边缘特征进行判别,缺乏对裂纹路径连续性、方向变化关系以及结构区域关联性的综合分析能力,难以准确还原裂纹在复杂结构区域中的延展趋势,从而影响缺陷定位准确性与分类可靠性
本发明中,通过对压痕区域边缘像素的连续连接关系进行分析,能够提高复杂结构区域边界轮廓的完整性与稳定性,降低因光照变化或边缘模糊导致的轮廓识别误差;通过对裂纹路径方向变化及空间连通关系进行联合分析,能够提高结合缝区域细微裂纹的连续识别能力,减少裂纹路径中断或误检情况;同时,通过将裂纹终止位置与接头盒端盖结合部进行关联分类,能够增强复杂结构区域裂纹缺陷的定位准确性与分类可靠性,从而提高光缆接头盒复杂区域外观缺陷检测的稳定性与识别精度。
Smart Images

Figure CN122597415A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of visual inspection technology, and in particular to a method and system for inspecting the appearance of optical cable junction boxes based on image processing. Background Technology
[0002] The field of visual inspection technology encompasses a technological system that utilizes computer vision and image processing to automatically identify and analyze target objects. The core of this field involves judging the appearance, structure, or functional state of products or objects through processes such as image acquisition, image preprocessing, feature extraction, and recognition. Visual inspection technology is widely used in industrial automated production, particularly for tasks such as surface defect identification, dimensional measurement, and target positioning and recognition. This technological field typically integrates image acquisition equipment, digital image processing methods, and classification algorithms to form inspection systems with real-time performance and high precision, and has been systematically applied in various industries such as electronics manufacturing, mechanical assembly, and food packaging.
[0003] Existing optical cable junction box appearance inspection technologies typically employ manual visual inspection, template matching, or edge detection-based visual recognition methods to identify defects such as surface scratches, cracks, and deformations. These methods are effective in areas with regular structures and clear grayscale boundaries. However, in complex structural areas such as the junction box rib area and end cap joint area, they are easily affected by changes in lighting, blurred edges, and interference from structural textures, leading to problems such as discontinuous crack boundaries, interrupted path recognition, or misjudgment of defects. Especially in the detection of fine cracks near the joint, traditional methods usually rely on local grayscale abrupt changes or single edge features for discrimination, lacking the ability to comprehensively analyze the continuity of crack paths, directional changes, and structural regional correlations. This makes it difficult to accurately reconstruct the extension trend of cracks in complex structural areas, thus affecting the accuracy of defect location and the reliability of classification.
[0004] In traditional visual inspection, the identification of abnormal conditions such as indentations, cracks, or deformations relies on template matching and edge comparison of edge regions in preprocessed images. Contour extraction is easily affected by image noise and lighting variations, leading to significant fluctuations in recognition accuracy. Path features are not fully utilized, and changes in direction and structural connections are not incorporated into the judgment process, resulting in fuzzy recognition of complex structural areas such as ribs or seams. Texture recognition mainly relies on intuitive features of grayscale distribution, failing to combine spatial arrangement and gradient trends, causing a significant drop in recognition performance in areas with weakened textures, blurred transitions, or inconspicuous contrast. In crack detection, continuity judgment is usually based on local pixel abrupt changes, lacking topological path construction logic, making it difficult to reconstruct the complete structural direction of the crack, easily leading to breakage or misidentification. Classification judgment usually relies on surface visible features, failing to combine the spatial correspondence between termination points and structural regions, limiting the systematic classification of abnormal conditions in key areas such as joints, thus affecting the final defect location accuracy and targeted processing. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of the existing technology and to propose an image processing-based method and system for inspecting the appearance of optical cable junction boxes.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: an image processing-based method for inspecting the appearance of optical cable junction boxes, comprising the following steps: S1: Extract the grayscale change features of the indentation area in the image of the optical cable junction box shell, obtain continuous edge pixels and establish coordinate order, construct the contour space connection map according to the trajectory, and obtain the edge contour line sequence of the indentation area. S2: Based on the path change in the edge contour sequence of the indentation area, identify the points of abrupt change in direction, and mark the structural turning points of the rib area according to the distribution pattern to generate a curvature abrupt change point map of the rib area. S3: Based on the connection relationship between adjacent points in the curvature change point map of the rib region, locate the corresponding region of the connecting line in the image, extract the set of pixels arranged along the target direction, delineate the texture information distribution range based on the gray-level gradient features, and generate a texture gray-level gradient channel identifier set. S4: Based on the boundary information defined in the texture grayscale gradient channel, extract the grayscale discontinuous pixel sequence from the crack region, construct the crack structure path, and generate a crack continuous direction path map. S5: Based on the path direction change pattern in the crack continuous path map, extract the path segments with abrupt change characteristics, and classify them according to the spatial location of the path termination point and the joint of the junction box end cap, to generate a crack morphology classification list at the joint.
[0007] As a further aspect of the present invention, the indentation region edge contour sequence includes the sequential relationship of continuous edge pixel coordinates and a spatial connection diagram; the rib region curvature abrupt change point map includes the distribution pattern of directional abrupt change points and structural turning point annotations; the texture grayscale gradient channel identifier set includes the location information of the region corresponding to the connecting line, the set of pixels arranged in the target direction, and the grayscale gradient feature boundary range; the crack continuous direction path map includes the grayscale discontinuous pixel sequence, the spatial connectivity of the crack structure path, and the path direction and node position record; the crack morphology classification list at the joint includes the characteristics of the abrupt change path segment, the spatial position classification of the path termination point, and the classification of the correspondence between the end cap joint and the crack.
[0008] As a further aspect of the present invention, the specific steps of S1 are as follows: S101: Obtain grayscale data of the indentation area in the image of the optical cable junction box shell. Based on the grayscale change of each pixel in the image, after defining the indentation area, extract the pixel grayscale difference features within the area. Combine the continuity of grayscale change to filter edge pixels and obtain the grayscale gradient value sequence of edge pixels. S102: Based on the spatial position of the pixels in the edge pixel grayscale gradient value sequence, analyze the consistency of the grayscale change direction between pixels, construct a coordinate chain according to the arrangement order of adjacent pixels, and obtain the edge pixel trajectory connection path. S103: Based on the coordinate order in the edge pixel trajectory connection path, determine the spatial relationship between adjacent coordinate points, establish a connection diagram between edge pixels according to the arrangement structure, mark the position of the boundary segments in sequence, and generate a sequence of edge contour lines of the indentation area.
[0009] As a further aspect of the present invention: the process of extracting the gray-scale change features of the indentation area in the image of the optical cable junction box includes using a neighborhood operator to calculate the pixel gray-scale difference, and determining pixels whose gray-scale difference exceeds a preset change threshold as edge candidate pixels.
[0010] As a further aspect of the present invention, the specific steps of S2 are as follows: S201: Obtain the direction change of each path segment in the edge contour line sequence of the indentation area, extract the directional relationship between adjacent coordinate points, construct the directional change sequence of the continuous path, identify nodes with prominent directional changes as directional anomalies, and generate a sequence of directional anomaly path point position angle differences. S202: Based on the distribution of mutation points in the angle difference sequence of the abnormal path points, and combined with the edge structure length of the corresponding path, determine whether the mutation points form a repeating interval distribution, identify path segments with interval patterns, and obtain a suspected rib path segment interval difference sequence. S203: Based on the edge abrupt change points of the path segments in the suspected rib path segment interval difference sequence, extract the contour curvature change at the corresponding positions, filter out the points with prominent curvature changes, mark them as structural turning points of the rib region, and generate a curvature abrupt change point map of the rib region.
[0011] As a further aspect of the present invention, the specific steps of S3 are as follows: S301: Based on the connection relationship between adjacent points in the curvature change point map of the rib region, extract the connection position of the point pair in the image, determine the positioning area of each connection in the image matrix, extract the corresponding pixel set in the area according to the continuous distribution of pixel values, and obtain the pixel extraction value set of the connection line. S302: Based on the arrangement characteristics of the pixels in the pixel extraction value set of the connecting line, analyze the coordinate change trend in the target direction, extract continuously distributed and consistent pixel segments, summarize them to form a densely arranged pixel set in the target direction, and obtain the directionally dense pixel sequence value. S303: Based on the grayscale changes in the dense pixel sequence values, extract pixel regions with significant grayscale changes, identify the correspondence between coordinate information and grayscale gradient within the region, construct a channel index structure, and obtain a texture grayscale gradient channel identifier set.
[0012] As a further aspect of the present invention, the specific steps of S4 are as follows: S401: Based on the boundary information defined by the texture gray-level gradient channel identifier set, extract the gray-level value sequence within the crack manifestation area, identify the pixel positions where gray-level value changes are discontinuous, and filter and collect them to form a gray-level abrupt change pixel index sequence. S402: Call the grayscale abrupt change pixel index sequence, construct a pixel chain that satisfies the connectivity condition based on the spatial adjacency relationship between pixels in the image, and generate a set of crack candidate paths; S403: Call the set of candidate crack paths, extract the position coordinate information of the path nodes, record the turning direction and sequence of the path, integrate the structural morphology of the path, and obtain the crack continuous direction path map.
[0013] As a further aspect of the present invention, the specific steps of S5 are as follows: S501: Based on the change in the direction of the path segments in the crack continuity path map, identify the location of abrupt changes in direction in the path, extract the corresponding path segments, and form a path abrupt change interval sequence. S502: Based on the spatial location of the path termination point in the path mutation interval sequence, determine whether it is located within the joint of the junction box end cap, complete the spatial classification of the path segment, and generate the path segment group to which the joint belongs. S503: Based on the path morphology characteristics of the path segment group to which the part belongs, and according to the offset direction and direction change trend, summarize the different crack path morphology and establish a classification list of crack morphology at the joint.
[0014] As a further aspect of the present invention: the process of identifying the direction change point includes calculating the included angle formed by three consecutive edge pixels, and marking the pixel point with an included angle change greater than 30 degrees as the direction change point.
[0015] The image processing-based optical cable junction box appearance inspection system includes: The contour extraction module acquires the image of the optical cable junction box shell, extracts the grayscale content, selects continuous edge pixels based on the grayscale change trend of the indentation area in the image, establishes coordinate order relationship, constructs spatial connection path corresponding to the contour, and generates indentation area contour line sequence. The transition recognition module calls the contour line sequence of the indentation area, identifies the points of abrupt change features based on the directional changes in the path sequence, and determines the transition nodes of the rib structure by combining the distribution position in the image, generating a curvature abrupt change point map of the rib area. The channel calibration module locates the corresponding region in the image based on the connection relationship between adjacent points in the curvature change point map of the rib region, extracts the set of pixels arranged along the target direction within the region, delineates the texture distribution range based on the gray-level gradient change characteristics, and generates a texture gray-level gradient channel identifier set. The crack tracking module calls the boundary information marked by the texture gray-level gradient channel identifier set, extracts the pixel sequence of gray-level discontinuity in the crack display area, constructs the crack structure path by combining spatial connectivity, records the direction of the path and the position of the nodes, and generates a crack continuous direction path map. Based on the crack continuous path map, the crack classification module identifies the changing characteristics of the path direction, combines the path termination position with the correspondence between the joint box end cover joint, performs crack type collection processing, and generates a crack morphology classification list at the joint seam. The contour extraction module, the turning point recognition module, the channel calibration module, the crack tracking module, and the crack classification module perform data interaction sequentially according to the image feature processing order.
[0016] Compared with the prior art, the advantages and positive effects of the present invention are as follows: In this invention, by analyzing the continuous connection relationship of edge pixels in the indentation area, the integrity and stability of the boundary contour of complex structural areas can be improved, and the contour recognition error caused by changes in illumination or edge blurring can be reduced. By jointly analyzing the changes in crack path direction and spatial connectivity, the continuous recognition capability of fine cracks in the joint area can be improved, and the interruption of crack path or false detection can be reduced. At the same time, by associating the crack termination position with the joint of the connector box end cap, the positioning accuracy and classification reliability of crack defects in complex structural areas can be enhanced, thereby improving the stability and recognition accuracy of appearance defect detection in complex areas of optical cable connector boxes. Attached Figure Description
[0017] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a system module diagram of the present invention. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0019] This embodiment provides a method for visual inspection of optical cable junction boxes based on image processing. In practical applications, such as during the visual image inspection of optical cable junction boxes after assembly, the image acquisition end acquires visual images of the junction box shell, rib area, end cap joint, and crack manifestation area. The image processing node converts the shell image into grayscale content and forms the inspection result according to the processing sequence of indentation contour extraction, rib turning identification, texture channel calibration, crack path tracing, and joint crack classification, including the following steps: Please see Figure 1 S1: Extract the grayscale change features of the indentation area in the image of the optical cable junction box shell, obtain continuous edge pixels and establish coordinate order, construct the contour space connection map according to the trajectory, and obtain the edge contour line sequence of the indentation area. The indentation region edge contour sequence is a data object representing the continuous distribution of indentation boundaries in the image matrix, containing the sequential relationship of continuous edge pixel coordinates and a spatial connectivity map. The sequential relationship of continuous edge pixel coordinates records the adjacency order of edge pixels in the image, and the spatial connectivity map represents the connection direction, boundary segments, and contour closure state between adjacent edge pixels. The input source for this sequence is a grayscale image of the fiber optic cable junction box shell, and the output destination is the path direction change recognition process in S2. The grayscale variation characteristics of the indentation area are the differences in grayscale states between the inside of the indentation area and the surrounding outer shell surface, originating from pixel grayscale variations in the image. The extraction process uses a neighborhood operator to perform neighborhood difference analysis on the pixel grayscale states, and pixels whose grayscale changes meet preset change judgment conditions are selected as edge candidate pixels. The preset change judgment conditions are jointly determined by the imaging rules of the optical cable junction box outer shell surface, the imaging contrast relationship of the indentation edges, and image acquisition quality constraints. These conditions are used to distinguish the indentation boundary from the background texture and are not disclosed as specific quantitative data. S101: Obtain grayscale data of the indentation area in the image of the optical cable junction box shell. Based on the grayscale changes of pixels in the image, after defining the indentation area, extract the pixel grayscale difference features in the area. Combine the continuity of grayscale changes to filter edge pixels and obtain the grayscale gradient value sequence of edge pixels. The edge pixel grayscale gradient value sequence is the grayscale change sequence data of candidate edge pixels within the indentation area, carrying pixel coordinates, neighborhood grayscale difference status, edge candidate status, and continuity indicator. The grayscale image data originates from the grayscale processing result of the optical cable junction box shell image. The indentation area is jointly defined by local depressions on the shell surface, shadow transitions, and the boundary between light and dark areas. Grayscale change continuity is used to determine whether adjacent candidate pixels belong to the same indentation edge; isolated pixels that do not meet the continuity rule are marked as noise candidates and retained as anomalies. When a grayscale image has local overexposure, shadow occlusion, incomplete boundaries of indentation areas, or missing pixel coordinates, the corresponding pixel segment is written to a grayscale pending confirmation state. This grayscale pending confirmation state is not directly incorporated into the contour connection process, but is retained in the edge pixel grayscale gradient value sequence for subsequent verification. This sequence is output to S102, used to establish edge trajectories based on spatial location. S102: Based on the spatial position of pixels in the edge pixel grayscale gradient value sequence, analyze the consistency of grayscale change direction between pixels, construct coordinate chains according to the arrangement order of adjacent pixels, and obtain the edge pixel trajectory connection path. The edge pixel trajectory connection path is a path data object formed by connecting the coordinates of adjacent edge pixels. It carries the coordinate chain, grayscale change direction, pixel adjacency status, and trajectory extension direction. The consistency of grayscale change direction is used to confirm whether adjacent edge pixels extend along the same indentation boundary, and the arrangement order is formed according to the spatial adjacency relationship in the image matrix. Each segment in the coordinate chain contains the adjacency relationship of the preceding and following pixels and the consistency status of grayscale change direction. If coordinate breaks, grayscale direction conflicts, or duplicate pixels occur between adjacent pixels, the relevant path segments are marked as connection pending confirmation and treated as boundary breakpoints in subsequent spatial connection maps. The effective edge pixel trajectory connection paths are output to S103 to construct the indentation region edge contour sequence; S103: Based on the coordinate order in the edge pixel trajectory connection path, determine the spatial relationship between adjacent coordinate points, establish a connection map between edge pixels according to the arrangement structure, mark the position of the boundary segments in sequence, and generate a sequence of edge contour lines of the indentation area.
[0020] Spatial relationship determination is used to confirm whether adjacent coordinate points are located in the same boundary segment, the same contour direction, or the same indentation closure area. The connection map between edge pixels converts the coordinate chain into the connection relationship between contour nodes and boundary segments, and marks the start boundary, turning boundary, and end boundary in the indentation area. The boundary segment position serves as input for subsequent path direction change recognition; When unclosed edges, intersecting connections, local breakpoints, or background textures are found in the connection graph, the corresponding paragraphs are marked with connection anomalies. The generated indentation area edge contour sequence is output to S2, where the sequential relationship of continuous edge pixel coordinates is used for orientation change recognition, and the spatial connection graph is used for marking structural turning points in the rib area.
[0021] Please see Figure 1 S2: Based on the path changes in the edge contour sequence of the indentation area, identify the points of abrupt changes in direction, and mark the structural turning points of the rib area according to the distribution pattern to generate a curvature change point map of the rib area. The rib region curvature abrupt change point map is a data object representing the turning points at the edges of the joint box rib structure. It includes the distribution pattern of directional abrupt change points and structural turning point annotations. The distribution pattern of directional abrupt change points is used to record the positional relationships of concentrated directional changes in the contour path, and the structural turning point annotations are used to indicate the nodes where the rib region edge and the indentation region contour undergo morphological changes. This point map receives the indentation region edge contour line sequence generated by S1 and outputs it to S3 for locating adjacent point connections and texture gradient channels; When identifying points of abrupt directional change, the judgment is based on the change in the angle between the paths formed by consecutive adjacent edge pixels. Pixels whose angle changes satisfy the preset directional change conditions are marked as directional change points. The preset directional change conditions are derived from the polygonal line orientation rules of the rib edges in the image, and the specific angle values are not disclosed. S201: Obtain the direction change of each path segment in the edge contour line sequence of the indentation area, extract the directional relationship between adjacent coordinate points, construct the directional change sequence of the continuous path, identify nodes with prominent directional changes as directional anomalies, and generate a sequence of directional anomaly path point position angle difference. The directional anomaly path point angle difference sequence is a data object recording the directional change state along the indentation edge contour path. It carries the path segment number, the directional relationship between adjacent coordinate points, the directional change state, the location of directional anomalies, and the source of boundary segments. The path direction change is derived from the spatial connection diagram and coordinate order relationship in S1. Directional anomalies indicate the location where the directional relationship between adjacent path segments changes from a smooth extension to an abrupt state. If a path segment has breaks, intersections, or repeated coordinates, the direction change status is marked as "direction pending confirmation." Segments with pending direction confirmation are not included in rib turning point annotations, but their path origin is retained. The sequence of angle differences between path points with abnormal directions is output to S202 to determine whether abrupt changes form the interval distribution of rib regions. S202: Based on the distribution of mutation points in the angle difference sequence of abnormal path points, combined with the edge structure length of the corresponding path, determine whether the mutation points form a repeating interval distribution, identify path segments with interval patterns, and obtain the interval difference sequence of suspected rib path segments. The suspected rib path segment interval difference sequence is a data object describing the arrangement pattern of directional abrupt change points along the edge of the rib structure. It carries the distribution status of abrupt change points, the length relationship of the edge structure, the interval pattern status, and the suspected rib path segments. In this embodiment, the edge structure length is a textual representation of the path extension range, used to explain the relative relationship of the abrupt change points along the same edge structure, and the length data is not output. When abrupt changes occur along the same contour path with repeated intervals, and this distribution corresponds to the folding shape of the junction box rib's appearance structure, the path segment is recorded as a suspected rib path segment. If the abrupt change distribution is affected by noise, indentation shadows, or shell texture interference, causing the interval pattern to be invalid, a suspected rib status pending confirmation is output. The interval difference sequence of suspected rib path segments is output to S203; S203: Based on the edge abrupt change points of the path segments in the suspected rib path segment interval difference sequence, extract the contour curvature change at the corresponding positions, filter out the points with prominent curvature changes, mark them as structural turning points of the rib region, and generate a curvature abrupt change point map of the rib region.
[0022] The change in contour curvature indicates the morphological change of a path segment in the image, transitioning from a smooth direction to a zigzag direction. This is derived from the connection relationships of adjacent edge abrupt change points within suspected rib path segments. Points with prominent curvature changes are marked as structural turning points in the rib region and included in the rib region curvature abrupt change point map. This point map includes point coordinates, connections between adjacent points, rib structure attribution, and directional change status. If the curvature change does not correspond to the rib structure, or if the point is located in the indentation noise area, the relevant point is marked as a transition point awaiting confirmation. The curvature change point map of the effective rib area is output to S3 as the basis for texture grayscale gradient channel localization.
[0023] Please see Figure 1 S3: Based on the connection relationship between adjacent points in the curvature change point map of the rib area, locate the corresponding area of the connecting line in the image, extract the set of pixels arranged along the target direction, delineate the distribution range of texture information based on the gray-level gradient features, and generate a texture gray-level gradient channel identifier set. The texture grayscale gradient channel identifier set is a data object describing the grayscale texture direction channel between the rib region and the crack manifestation region. It includes the location information of the region corresponding to the connecting line, the set of pixels arranged in the target direction, and the grayscale gradient feature boundary range. The location information of the region corresponding to the connecting line indicates the position of the connecting line between adjacent structural turning points in the image matrix. The set of pixels arranged in the target direction indicates the pixel segments arranged continuously along the preset texture direction. The grayscale gradient feature boundary range indicates the boundary state between the texture change and the background region. This identifier set is output to S4 to limit the extraction range of grayscale discontinuous pixels in the crack. S301: Based on the connection relationship between adjacent points in the curvature change point map of the rib region, extract the connection position of the point pair in the image, determine the positioning area of each connection in the image matrix, extract the corresponding pixel set in the area based on the continuous distribution of pixel values, and obtain the pixel extraction value set of the connection line. The pixel extraction set for the connecting line is a collection of pixel data objects within the region connecting adjacent structural inflection points. It carries information such as point pair relationships, connection positions, image matrix positioning areas, pixel continuous distribution status, and coordinate sources. Point pair relationships originate from the curvature abrupt change point map of the rib region generated by S2. The positioning area is obtained by connecting the image positions between adjacent structural inflection points and is limited to the junction box shell area. When the line connecting point pairs crosses a background area, an end cap shadow area, or an image defect area, the relevant pixel set is written to the positioning pending confirmation state. The effective connection line pixel extraction value set is output to S302 for analysis of target orientation alignment characteristics; S302: Based on the arrangement characteristics of pixels in the pixel extraction value set of the connecting line, analyze the coordinate change trend in the target direction, extract continuously distributed and consistent pixel segments, summarize them to form a densely arranged pixel set in the target direction, and obtain the directionally dense pixel sequence value. The directional dense pixel sequence value is a pixel state data object arranged and continuously distributed along the target direction, carrying coordinate variation trends, consistent orientation, continuous pixel segments, and densely arranged regions. The target direction comes from the extension direction of the line connecting adjacent structural turning points and the image direction of the rib texture. Pixel segments with consistent orientation indicate that the region has a stable texture direction and can serve as a reference for identifying the boundary of the crack manifestation area; If the pixel segment direction conflicts with the rib structure direction, or if the continuous distribution is interrupted by lighting and shadows, the directionally dense pixel sequence value is marked as having an orientation that needs to be confirmed. Valid directionally dense pixel sequence values are output to S303; S303: Based on the grayscale changes in the directional dense pixel sequence values, extract pixel regions with significant grayscale changes, identify the coordinate information and grayscale gradient correspondence within the region, construct a channel index structure, and obtain the texture grayscale gradient channel identifier set.
[0024] The channel index structure is an index data object that maps grayscale variation areas to image coordinate areas, carrying the texture channel number, channel boundary, coordinate range, grayscale gradient state, and target direction. Pixel areas with significant grayscale changes represent areas where texture information changes from smooth to discontinuous or from background texture to crack candidate texture. These areas are defined by preset grayscale variation rules, and the specific determination quantities are not disclosed. If noise stripes, light reflections, or shell material texture interference exist within the texture channel, the channel index structure is written to a texture pending confirmation state. The texture grayscale gradient channel identifier set is output to S4 to extract the crack grayscale discontinuous pixel sequence within the defined boundaries.
[0025] Please see Figure 1 S4: Based on the boundary information defined in the texture grayscale gradient channel, extract the grayscale discontinuous pixel sequence from the crack region, construct the crack structure path, and generate a crack continuous direction path map. The crack continuity path map is a data object describing the continuous extension state of crack pixels in an image. It includes a sequence of discontinuous grayscale pixels, spatial connectivity of the crack structure path, and records of path direction and node positions. The sequence of discontinuous grayscale pixels represents the grayscale fracture state of candidate crack pixels within the texture channel. The spatial connectivity of the crack structure path indicates whether candidate crack pixels are connected to form a crack path. The records of path direction and node positions store the start point, turning point, and end point of the crack path. This map is output to S5 for extracting abrupt path segments and classifying the crack morphology at the end cap joint. S401: Based on the boundary information defined by the texture gray-level gradient channel identifier set, extract the gray-level value sequence within the crack manifestation area, identify the pixel positions where gray-level value changes are discontinuous, and filter and collect them to form a gray-level abrupt change pixel index sequence. The grayscale abrupt change pixel index sequence is an index data object for pixels with discontinuous grayscale values in the crack manifestation region. It carries the texture channel source, crack manifestation region, grayscale discontinuity state, pixel coordinates, and index order. The crack manifestation region is defined by the channel boundaries in the texture grayscale gradient channel identifier set. The grayscale discontinuity state is used to distinguish the crack's linear dark areas, fracture boundaries, and the normal texture of the outer shell. If a pixel with discontinuous grayscale is located outside the channel boundary, or is interfered with by changes in lighting, stains, or indentation shadows, the relevant pixel is written into the crack candidate pending confirmation state. The index sequence of effective grayscale abrupt change pixels is output to S402 to construct the crack candidate path; S402: Call the grayscale abrupt change pixel index sequence, construct a pixel chain that satisfies the connectivity condition based on the spatial adjacency relationship between pixels in the image, and generate a set of crack candidate paths; The crack candidate path set is a path data object obtained by connecting pixels with abrupt grayscale changes according to spatial adjacency. It carries the pixel chain, connectivity condition, path start and end positions, path continuity status, and channel source. Spatial adjacency is used to determine whether candidate crack pixels extend along the same linear structure. Pixel chains that satisfy the connectivity condition are grouped into the same crack candidate path. When a candidate pixel chain contains a breakpoint, an intersection, or coincides with a rib edge, the path is marked as connected and awaits confirmation. The crack candidate path set is output to S403 to record the path direction and node position; S403: Call the crack candidate path set, extract the position coordinate information of the path nodes, record the turning direction and sequence of the path, integrate the structural morphology of the path, and obtain the crack continuous direction path map.
[0026] The location coordinates of path nodes include the starting node, turning node, branching node, and ending node in the crack candidate path. The turning direction and order are used to describe the change in the direction of the crack path as it extends from one node to subsequent nodes in the image. When integrating the path structure, candidate paths belonging to the same crack extension direction and spatially adjacent are merged into a continuous path. If a candidate crack path coincides with the shell texture boundary and cannot be distinguished, the relevant path is written to the crack path pending confirmation status. The effective crack continuous path map is output to S5 for crack morphology classification at the joint of the end cap.
[0027] Please see Figure 1 S5: Based on the path direction change pattern in the crack continuous path map, extract the path segment with abrupt path change characteristics, and classify it according to the spatial location of the path termination point and the joint of the junction box end cap, and generate a crack morphology classification list at the joint seam. The crack morphology classification list at the joint is a data object output from the visual inspection, including features of abruptly changing path segments, spatial location classification of path termination points, and classification of correspondences at the end cap joint. The abruptly changing path segment features represent segments in the crack path with significant directional changes; the spatial location classification of path termination points determines whether the crack termination point is located within the end cap joint area; and the classification of correspondences at the end cap joint indicates the spatial correspondence between the crack path and the joint structure. This list serves as the output of the visual inspection results for the optical cable splice closure. S501: Based on the change in the direction of the path segments in the crack continuity path map, identify the locations of abrupt changes in direction in the path, extract the corresponding path segments, and form a sequence of path abrupt change intervals. The path abrupt change interval sequence is a data object that records segments of crack path direction change. It contains the crack path number, abrupt change location, the direction before the abrupt change, the direction after the abrupt change, the start and end nodes of the path segment, and the source of the path segment. The change in path segment direction originates from the position coordinates of the path nodes and the turning direction records in S4. The abrupt change location indicates the node where the crack path changes from its original extension direction to another extension direction. If the path direction change is caused by image noise, local occlusion, or path breakage, the relevant path segment is marked as a mutation awaiting confirmation. The valid path mutation interval sequence is output to S502 to determine its spatial relationship with the endcap joint. S502: Based on the spatial location of the path termination point in the path mutation interval sequence, determine whether it is located within the joint of the junction box end cap, complete the spatial classification of the path segment, and generate the path segment group to which the joint belongs. The joint path segment group is a data object that corresponds the crack abrupt change path segment to the joint of the junction box end cap. It includes the location of the path termination point, the range of the end cap joint, the spatial classification status, and the source of the path segment. The range of the end cap joint is derived from the structural boundary of the area where the end cap and the box body meet in the image of the optical cable junction box. Spatial classification is used to determine whether the path termination point falls within this boundary area. If the boundary of the end cap joint cannot be confirmed due to shadows, changes in shooting angle, or reflections from the outer shell structure, the relevant path segment is written to the joint pending confirmation status. The valid joint belongs to the path segment group and is output to S503. S503: Based on the path morphology characteristics of the joint and the path segment group, and according to the offset direction and direction change trend, the differential crack path morphology is summarized, and a list of crack morphology classifications at the joint is established.
[0028] Crack path morphology characteristics include the offset direction of the crack path, the trend of directional change, the path termination position, and the corresponding state with the end cap joint. When summarizing crack path morphology, path segments terminating at the end cap joint and having the same directional change trend are grouped into the same crack morphology category, while path segments with different offset directions or termination positions are grouped into different categories. The classification results do not output quantitative statistics and measurement indicators, but only record the category name, path origin, termination position attribution, and morphology label. When the crack morphology classification list is output, it is possible to trace back to the edge contour sequence of the indentation area, the curvature change point map of the rib area, the texture grayscale gradient channel identifier set, and the crack continuous direction path map, forming a continuous data link from the input of the shell grayscale image to the output of the crack morphology classification.
[0029] Please see Figure 2Contour extraction module: The contour extraction module includes an image input interface, a grayscale image processing interface and a contour sequence output interface. It is configured to acquire an image of the outer shell of the optical cable junction box, extract grayscale image content, select continuous edge pixels according to the grayscale change trend of the indentation area in the image, establish coordinate order relationship, construct spatial connection path corresponding to the contour, and generate a contour line sequence of the indentation area. The contour extraction module is limited to grayscale image acquisition, indentation region boundary extraction, continuous edge pixel filtering, coordinate sequence establishment, and spatial connection path construction. It does not handle rib turn identification, texture channel delineation, or crack classification. Input data comes from the appearance image acquisition unit, and output data is a sequence of indentation region contour lines. If the input image is missing, grayscale conversion fails, the indentation region is not closed, or the coordinate sequence cannot be formed, the module outputs a contour pending confirmation status and transmits the abnormal status along with the contour candidate data to the turn identification module. Please see Figure 2 Turning point recognition module: The turning point recognition module includes a contour sequence input interface, a path direction analysis interface, and a point map output interface. It is configured to call the contour line sequence of the indentation area, identify the points of abrupt change features based on the direction change in the path sequence, determine the turning points of the rib structure in combination with the distribution position in the image, and generate a point map of curvature change in the rib area. The responsibilities of the turning point recognition module are limited to identifying path direction changes, extracting directional anomalies, determining the distribution patterns of abrupt change points, and marking turning points in the rib structure. It does not handle texture pixel set extraction or crack path construction. The module receives the indentation region contour sequence output by the contour extraction module and outputs a bitmap of curvature abrupt change points in the rib region to the channel calibration module. If the directional abrupt change points do not correspond to the rib structure distribution, the module outputs a turning point pending confirmation status. Please see Figure 2 Channel calibration module: The channel calibration module includes a point map input interface, a connection line positioning interface, a pixel set extraction interface and a channel identifier output interface. It is configured to locate the corresponding region in the image based on the connection relationship between adjacent points in the point map of the rib region curvature change, extract the pixel set arranged along the target direction in the region, delineate the texture distribution range based on the gray-level gradient change characteristics, and generate a texture gray-level gradient channel identifier set. The responsibilities of the channel calibration module are limited to locating adjacent point connections, extracting pixel segments in the target direction, defining grayscale gradient boundaries, and generating channel index structures. It does not undertake the responsibility of confirming crack connectivity paths or classifying crack morphology. The module receives the curvature abrupt change point map of the rib region output by the transition recognition module and outputs a set of texture grayscale gradient channel identifiers to the crack tracking module. If the connecting area crosses the background area or the grayscale boundary is unclear, the module outputs a texture pending confirmation status. Please see Figure 2Crack tracing module: The crack tracing module includes a channel identifier input interface, a grayscale discontinuous pixel extraction interface, a path connectivity interface, and a path map output interface. It is configured to call the boundary information calibrated by the texture grayscale gradient channel identifier set, extract the grayscale discontinuous pixel sequence in the crack display area, construct the crack structure path by combining spatial connectivity, record the direction of the path and the node position, and generate a crack continuous direction path map. The crack tracking module's responsibilities are limited to defining the crack display area, generating grayscale discontinuous pixel indices, connecting crack candidate paths, and recording path nodes; it does not handle end cap joint classification. The module receives the texture grayscale gradient channel identifier set output by the channel calibration module and outputs a continuous crack path map to the crack classification module. If grayscale discontinuous pixels cannot be distinguished from texture noise, the module outputs a crack path pending confirmation status. Please see Figure 2 Crack Classification Module: The crack classification module includes a path map input interface, a direction change path segment identification interface, an end cap joint classification interface, and a classification list output interface. It is configured to identify the change characteristics of the path direction based on the continuous crack path map, combine the path termination position with the correspondence between the joint box end cap joint, perform crack type collection processing, and generate a crack morphology classification list at the joint.
[0030] The crack classification module's responsibilities are limited to extracting path abrupt change intervals, spatially classifying path termination points, establishing correspondences at end cap joints, and outputting a crack morphology classification list. It does not undertake preceding tasks such as contour extraction, inflection point annotation, or texture channel delineation. The module receives the crack continuity path map output by the crack tracing module and outputs a crack morphology classification list at the joint. The contour extraction module, inflection point recognition module, channel calibration module, crack tracing module, and crack classification module perform data interaction sequentially according to the image feature processing order. The output of the previous module serves as the input of the next module, and abnormal states are passed along with the data object and used to limit subsequent misidentification.
[0031] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.
Claims
1. A method for visual inspection of optical cable junction boxes based on image processing, characterized in that, Includes the following steps: S1: Extract the grayscale change features of the indentation area in the image of the optical cable junction box shell, obtain continuous edge pixels and establish coordinate order, construct the contour space connection map according to the trajectory, and obtain the edge contour line sequence of the indentation area. S2: Based on the path change in the edge contour sequence of the indentation area, identify the points of abrupt change in direction, and mark the structural turning points of the rib area according to the distribution pattern to generate a curvature abrupt change point map of the rib area. S3: Based on the connection relationship between adjacent points in the curvature change point map of the rib region, locate the corresponding region of the connecting line in the image, extract the set of pixels arranged along the target direction, delineate the texture information distribution range based on the gray-level gradient features, and generate a texture gray-level gradient channel identifier set. S4: Based on the boundary information defined in the texture grayscale gradient channel, extract the grayscale discontinuous pixel sequence from the crack region, construct the crack structure path, and generate a crack continuous direction path map. S5: Based on the path direction change pattern in the crack continuous path map, extract the path segments with abrupt change characteristics, and classify them according to the spatial location of the path termination point and the joint of the junction box end cap, to generate a crack morphology classification list at the joint.
2. The image processing-based optical cable junction box appearance inspection method according to claim 1, characterized in that, The indentation region edge contour sequence includes the sequential relationship of continuous edge pixel coordinates and a spatial connection map. The rib region curvature change point map includes the distribution pattern of directional change points and structural turning point annotations. The texture grayscale gradient channel identifier set includes the location information of the region corresponding to the connecting line, the set of pixels arranged in the target direction, and the grayscale gradient feature boundary range. The crack continuous direction path map includes the grayscale discontinuous pixel sequence, the spatial connectivity of the crack structure path, and the path direction and node position record. The crack morphology classification list at the joint includes the characteristics of the path segment with directional change, the spatial position classification of the path termination point, and the classification of the correspondence between the end cap joint and the crack.
3. The optical cable junction box appearance inspection method based on image processing according to claim 1, characterized in that, The specific steps of S1 are as follows: S101: Obtain grayscale data of the indentation area in the image of the optical cable junction box shell. Based on the grayscale change of each pixel in the image, after defining the indentation area, extract the pixel grayscale difference features within the area. Combine the continuity of grayscale change to filter edge pixels and obtain the grayscale gradient value sequence of edge pixels. S102: Based on the spatial position of the pixels in the edge pixel grayscale gradient value sequence, analyze the consistency of the grayscale change direction between pixels, construct a coordinate chain according to the arrangement order of adjacent pixels, and obtain the edge pixel trajectory connection path. S103: Based on the coordinate order in the edge pixel trajectory connection path, determine the spatial relationship between adjacent coordinate points, establish a connection diagram between edge pixels according to the arrangement structure, mark the position of the boundary segments in sequence, and generate a sequence of edge contour lines of the indentation area.
4. The optical cable junction box appearance inspection method based on image processing according to claim 1, characterized in that: The process of extracting the grayscale change features of the indentation area in the image of the optical cable junction box includes using a neighborhood operator to calculate the pixel grayscale difference and determining pixels with grayscale differences exceeding a preset change threshold as edge candidate pixels.
5. The image processing-based optical cable junction box appearance inspection method according to claim 3, characterized in that, The specific steps of S2 are as follows: S201: Obtain the direction change of each path segment in the edge contour line sequence of the indentation area, extract the directional relationship between adjacent coordinate points, construct the directional change sequence of the continuous path, identify nodes with prominent directional changes as directional anomalies, and generate a sequence of directional anomaly path point position angle differences. S202: Based on the distribution of mutation points in the angle difference sequence of the abnormal path points, and combined with the edge structure length of the corresponding path, determine whether the mutation points form a repeating interval distribution, identify path segments with interval patterns, and obtain a suspected rib path segment interval difference sequence. S203: Based on the edge abrupt change points of the path segments in the suspected rib path segment interval difference sequence, extract the contour curvature change at the corresponding positions, filter out the points with prominent curvature changes, mark them as structural turning points of the rib region, and generate a curvature abrupt change point map of the rib region.
6. The image processing-based optical cable junction box appearance inspection method according to claim 5, characterized in that, The specific steps for S3 are as follows: S301: Based on the connection relationship between adjacent points in the curvature change point map of the rib region, extract the connection position of the point pair in the image, determine the positioning area of each connection in the image matrix, extract the corresponding pixel set in the area according to the continuous distribution of pixel values, and obtain the pixel extraction value set of the connection line. S302: Based on the arrangement characteristics of the pixel points in the pixel extraction value set of the connecting line, analyze the coordinate change trend in the target direction, extract continuously distributed and consistent pixel segments, summarize them to form a densely arranged pixel set in the target direction, and obtain the directionally dense pixel sequence value. S303: Based on the grayscale changes in the dense pixel sequence values, extract pixel regions with significant grayscale changes, identify the coordinate information and grayscale gradient correspondence within the regions, construct a channel index structure, and obtain a texture grayscale gradient channel identifier set.
7. The optical cable junction box appearance inspection method based on image processing according to claim 6, characterized in that, The specific steps of S4 are as follows: S401: Based on the boundary information defined by the texture gray-level gradient channel identifier set, extract the gray-level value sequence within the crack manifestation area, identify the pixel positions where gray-level value changes are discontinuous, and filter and collect them to form a gray-level abrupt change pixel index sequence. S402: Call the grayscale abrupt change pixel index sequence, construct a pixel chain that satisfies the connectivity condition based on the spatial adjacency relationship between pixels in the image, and generate a set of crack candidate paths; S403: Call the set of candidate crack paths, extract the position coordinate information of the path nodes, record the turning direction and sequence of the path, integrate the structural morphology of the path, and obtain the crack continuous direction path map.
8. The image processing-based optical cable junction box appearance inspection method according to claim 7, characterized in that, The specific steps of S5 are as follows: S501: Based on the change in the direction of the path segments in the crack continuity path map, identify the location of abrupt changes in direction in the path, extract the corresponding path segments, and form a path abrupt change interval sequence. S502: Based on the spatial location of the path termination point in the path mutation interval sequence, determine whether it is located within the joint of the junction box end cap, complete the spatial classification of the path segment, and generate the path segment group to which the joint belongs. S503: Based on the path morphology characteristics of the path segment group to which the part belongs, and according to the offset direction and direction change trend, summarize the different crack path morphology and establish a classification list of crack morphology at the joint.
9. The optical cable junction box appearance inspection method based on image processing according to claim 1, characterized in that: The process of identifying points of sudden change in direction includes calculating the angle formed by three consecutive edge pixels and marking pixels with an angle change greater than 30 degrees as points of sudden change in direction.
10. An image processing-based optical cable junction box appearance inspection system, characterized in that, The optical cable junction box appearance inspection method based on image processing according to any one of claims 1-9, the system comprising: The contour extraction module acquires the image of the optical cable junction box shell, extracts the grayscale content, selects continuous edge pixels based on the grayscale change trend of the indentation area in the image, establishes coordinate order relationship, constructs spatial connection path corresponding to the contour, and generates indentation area contour line sequence. The turning point recognition module calls the contour line sequence of the indentation area, identifies the points of abrupt change features based on the directional changes in the path sequence, and determines the turning points of the rib structure by combining the distribution positions in the image, thereby generating a curvature abrupt change point map of the rib area. The channel calibration module locates the corresponding region in the image based on the connection relationship between adjacent points in the curvature change point map of the rib region, extracts the set of pixels arranged along the target direction within the region, delineates the texture distribution range based on the gray-level gradient change characteristics, and generates a texture gray-level gradient channel identifier set. The crack tracking module calls the boundary information marked by the texture gray-level gradient channel identifier set, extracts the pixel sequence of gray-level discontinuity in the crack display area, constructs the crack structure path by combining spatial connectivity, records the direction of the path and the position of the nodes, and generates a crack continuous direction path map. Based on the crack continuous path map, the crack classification module identifies the changing characteristics of the path direction, combines the path termination position with the correspondence between the joint box end cover joint, performs crack type collection processing, and generates a crack morphology classification list at the joint seam. The contour extraction module, the turning point recognition module, the channel calibration module, the crack tracking module, and the crack classification module perform data interaction sequentially according to the image feature processing order.