Intelligent visual detection method for inner cavity of hydraulic element
Patent Information
- Application Number
- CN202611142227.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-30
- Publication Date
- 2026-10-16
AI Technical Summary
在进一步分析过程中,即使能够确定异常区域对应的流道区域,也难以对异常区域与多个相邻流道区域之间的影响差异进行刻画,无法有效表征异常区域在内腔结构中的空间扩展方向及影响分布特征,从而限制异常检测结果的结构化表达能力与分析深度
[0006]The technical solution provided in this invention has at least the following technical effects or advantages: Addressing the problem of inaccurate characterization of the correlation between abnormal regions and flow channel structures, and the difficulty in effectively analyzing the direction of abnormal influence during the detection of abnormalities in the internal cavity of hydraulic components, this invention extracts flow channel regions from visual images of the internal cavity of hydraulic components, identifies abnormal regions, and establishes spatial correlations between abnormal regions and flow channel structures, thereby achieving intelligent visual detection of abnormal regions within the internal cavity of hydraulic components. Specifically, flow channel regions are extracted based on visual images covering the internal cavity of hydraulic components, and spatial adjacency relationships between flow channel regions are established, providing a structural basis for spatial correlation analysis of abnormal regions; by identifying abnormal regions in the visual images and combining the overlap ratio between abnormal regions and flow channel regions, the flow channel regions corresponding to the abnormal regions are accurately determined, achieving a correspondence match between abnormal regions and flow channel structures; based on the flow channel regions corresponding to the abnormal regions and the spatial adjacency relationships between flow channel regions, adjacent flow channel regions corresponding to the abnormal regions are determined, and the influence weight of the abnormal regions on each adjacent flow channel region is calculated, achieving a quantitative expression of the spatial influence degree of the abnormal regions; based on the influence weight of the abnormal regions on each adjacent flow channel region, the influence weights of each adjacent flow channel region are determined. The system prioritizes the impact of adjacent flow channel regions, ranking and expressing the degree of influence of abnormal regions on surrounding flow channel regions. Based on the spatial location information of each flow channel region in the visual image, it determines the direction of the spatial adjacency between flow channel regions, forming directional adjacency relationships between flow channel regions. It also determines the directional adjacency relationship between the flow channel region corresponding to the abnormal region and each adjacent flow channel region, achieving an accurate expression of the spatial influence direction of the abnormal region. Based on the flow channel region corresponding to the abnormal region, the priority of the abnormal region's impact on each adjacent flow channel region, and the directional adjacency relationship between the flow channel region corresponding to the abnormal region and each adjacent flow channel region, it generates anomaly detection results, achieving integrated detection output of the location, degree of influence, and direction of influence of the abnormal region.
Smart Images

Figure CN122928819A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial visual inspection technology, and specifically to an intelligent visual inspection method for the internal cavity of hydraulic components. Background Technology
[0002] Hydraulic components are widely used in industrial systems, and their internal flow channel structure has a significant impact on media transmission efficiency and operational stability. During actual production and service, local abnormal areas may appear in the internal cavity of hydraulic components due to factors such as machining residues, wear, corrosion, or foreign matter adhesion. These abnormalities are often spatially related to the flow channel structure.
[0003] Current methods for detecting the internal cavities of hydraulic components largely rely on industrial endoscopes to obtain visual images of the cavities. These methods typically focus only on the presence or absence of abnormal regions, lacking further analysis of the spatial correspondence between abnormal regions and the flow channel structure. This makes it difficult to accurately reflect the specific role of abnormal regions within the cavity structure. Specifically, in the cavity image processing, some existing methods only segment regions based on pixel features or local grayscale information, insufficiently considering the spatial adjacency relationships between flow channel regions, leading to discrepancies between the flow channel structure segmentation results and the actual cavity structure. In the abnormal region identification process, existing methods usually only match the degree of overlap between the abnormal region and the flow channel region, lacking the ability to comprehensively analyze the spatial relationship between the abnormal region and surrounding flow channel regions. Even when the flow channel region corresponding to the abnormal region can be identified in further analysis, it is difficult to characterize the differences in influence between the abnormal region and multiple adjacent flow channel regions. This fails to effectively represent the spatial expansion direction and influence distribution characteristics of the abnormal region within the cavity structure, thus limiting the structured expression and analytical depth of the anomaly detection results. Summary of the Invention
[0004] To address the aforementioned problems, this invention proposes an intelligent visual inspection method for the internal cavity of hydraulic components. By establishing the spatial correlation between abnormal areas and the flow channel structure, and determining the spatial influence relationship of abnormal areas, intelligent visual inspection of abnormal areas within the internal cavity of hydraulic components can be achieved.
[0005] To achieve the above objectives, the present invention provides an intelligent visual inspection method for the internal cavity of hydraulic components, comprising the following steps: Acquire visual images covering the inner cavity of hydraulic components, extract flow channel regions based on visual images, and determine the spatial adjacency relationships between flow channel regions; Based on visual image recognition of the inner cavity of hydraulic components, abnormal areas are identified, and the flow channel area corresponding to the abnormal area is determined according to the overlap ratio between the abnormal area and each flow channel area. Based on the flow channel region corresponding to the abnormal region and the spatial adjacency relationship between the flow channel regions, the adjacent flow channel regions corresponding to the abnormal region are determined, and the influence weight of the abnormal region on each adjacent flow channel region is calculated according to the minimum boundary distance between the flow channel region corresponding to the abnormal region and each adjacent flow channel region. The priority of the impact of the abnormal region on each adjacent flow channel region is determined based on the weight of the effect of the abnormal region on each adjacent flow channel region. Based on the spatial location information of each flow channel region in the visual image, the spatial adjacency relationship between flow channel regions is determined to form the directional adjacency relationship between flow channel regions. Based on the flow channel region corresponding to the abnormal region, the adjacent flow channel region corresponding to the abnormal region, and the directional adjacency relationship between flow channel regions, the directional adjacency relationship between the flow channel region corresponding to the abnormal region and each adjacent flow channel region is determined. Based on the priority of the impact of the abnormal region on each adjacent flow channel region and the directional adjacency relationship between the flow channel region corresponding to the abnormal region and each adjacent flow channel region, the abnormal impact direction corresponding to the abnormal region is determined, and the abnormal detection result is generated.
[0006] The technical solution provided in this invention has at least the following technical effects or advantages: Addressing the problem of inaccurate characterization of the correlation between abnormal regions and flow channel structures, and the difficulty in effectively analyzing the direction of abnormal influence during the detection of abnormalities in the internal cavity of hydraulic components, this invention extracts flow channel regions from visual images of the internal cavity of hydraulic components, identifies abnormal regions, and establishes spatial correlations between abnormal regions and flow channel structures, thereby achieving intelligent visual detection of abnormal regions within the internal cavity of hydraulic components. Specifically, flow channel regions are extracted based on visual images covering the internal cavity of hydraulic components, and spatial adjacency relationships between flow channel regions are established, providing a structural basis for spatial correlation analysis of abnormal regions; by identifying abnormal regions in the visual images and combining the overlap ratio between abnormal regions and flow channel regions, the flow channel regions corresponding to the abnormal regions are accurately determined, achieving a correspondence match between abnormal regions and flow channel structures; based on the flow channel regions corresponding to the abnormal regions and the spatial adjacency relationships between flow channel regions, adjacent flow channel regions corresponding to the abnormal regions are determined, and the influence weight of the abnormal regions on each adjacent flow channel region is calculated, achieving a quantitative expression of the spatial influence degree of the abnormal regions; based on the influence weight of the abnormal regions on each adjacent flow channel region, the influence weights of each adjacent flow channel region are determined. The system prioritizes the impact of adjacent flow channel regions, ranking and expressing the degree of influence of abnormal regions on surrounding flow channel regions. Based on the spatial location information of each flow channel region in the visual image, it determines the direction of the spatial adjacency between flow channel regions, forming directional adjacency relationships between flow channel regions. It also determines the directional adjacency relationship between the flow channel region corresponding to the abnormal region and each adjacent flow channel region, achieving an accurate expression of the spatial influence direction of the abnormal region. Based on the flow channel region corresponding to the abnormal region, the priority of the abnormal region's impact on each adjacent flow channel region, and the directional adjacency relationship between the flow channel region corresponding to the abnormal region and each adjacent flow channel region, it generates anomaly detection results, achieving integrated detection output of the location, degree of influence, and direction of influence of the abnormal region.
[0007] Compared with existing technologies, this invention establishes a spatial correlation analysis mechanism between abnormal regions and flow channel structures. Based on the identification of abnormal regions, it further realizes the expression of the degree of influence and spatial direction of the abnormal regions, improves the completeness, accuracy and structured expression of the detection results of abnormalities in the internal cavity of hydraulic components, and provides a more comprehensive detection basis for the analysis of abnormal states in the internal cavity of hydraulic components. Attached Figure Description
[0008] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0009] Figure 1A flowchart illustrating an intelligent visual inspection method for the internal cavity of a hydraulic component, provided in an embodiment of this application; Detailed Implementation This invention introduces a flow channel structure correlation analysis mechanism, an anomaly space influence analysis mechanism, and an anomaly influence direction analysis mechanism, and proposes an intelligent visual inspection method for the internal cavity of hydraulic components. This method solves the problems of unclear correlation between anomaly regions and flow channel structures, insufficient expression of anomaly space influence features, and limited depth of anomaly detection result analysis in the traditional visual inspection process of the internal cavity of hydraulic components.
[0010] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0011] It should be noted that the terms "first," "second," etc., used in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, platform, product, or server that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or modules not explicitly listed or inherent to these processes, methods, products, or devices.
[0012] Example 1, as Figure 1 As shown, a method for intelligent visual inspection of the internal cavity of a hydraulic component includes the following steps: S1. Obtain a visual image covering the inner cavity of the hydraulic component, extract the flow channel region based on the visual image, and determine the spatial adjacency relationship between the flow channel regions. Furthermore, the flow channel region is extracted based on the visual image, including, The visual image is processed by grayscale conversion and noise suppression to obtain a preprocessed image. A gradient image is then generated by calculating the grayscale gradient values of each pixel in the preprocessed image. The boundary determination threshold is determined based on the statistical results of the gray-level gradient values corresponding to each pixel in the gradient image. Then, based on this threshold, all pixels in the gradient image are filtered to identify boundary pixels, forming a boundary pixel set. Boundary connection processing is performed using any boundary pixel in the boundary pixel set as the starting boundary pixel to form a closed boundary contour. Boundary connection processing is then repeated for boundary pixels that do not belong to any closed boundary contour until multiple closed boundary contours are obtained. Obtain all pixels within the bounding area corresponding to each closed boundary contour, and define all pixels as the same flow channel region to form the flow channel region corresponding to each closed boundary contour.
[0013] Furthermore, the spatial adjacency relationships between flow channel regions are determined, including, For any flow channel region, calculate the pixel distance between the corresponding boundary pixel of this flow channel region and the corresponding boundary pixel of other flow channel regions, and determine the minimum value among all pixel distances as the minimum boundary distance between this flow channel region and its corresponding counterpart. The minimum boundary distance between the flow channel region and the corresponding flow channel region is compared with an adjacency determination threshold. If the minimum boundary distance is less than the adjacency determination threshold, it is determined that there is a spatial adjacency relationship between the flow channel region and the corresponding flow channel region; if the minimum boundary distance is greater than or equal to the adjacency determination threshold, it is determined that there is no spatial adjacency relationship between the flow channel region and the corresponding flow channel region. By associating flow channel regions that have spatial adjacency relationships, the spatial adjacency relationships between flow channel regions can be obtained.
[0014] Specifically, an industrial endoscope is used to optically scan the internal cavity of the hydraulic component. During the scanning process, visual images of different locations within the hydraulic component's internal cavity are continuously acquired, and the acquisition position corresponding to each visual image is recorded. Based on the acquisition position corresponding to each visual image, position registration processing is performed on the continuously acquired visual images, and image stitching processing is performed on the position-registered visual images to generate a visual image I covering the internal cavity of the hydraulic component.
[0015] The visual image I is subjected to grayscale conversion and noise suppression to obtain a preprocessed image. Then, all pixels in the preprocessed image are traversed. For any pixel in the preprocessed image, its corresponding pixel coordinates are denoted as (x,y), and its grayscale change amplitude is denoted as F(x,y). The grayscale difference between the pixel and its neighboring pixels is calculated, and the grayscale gradient value G(x,y) of the corresponding pixel is calculated based on the grayscale difference. The gradient image is constructed from the grayscale gradient values corresponding to all pixels.
[0016] The gray-level gradient values corresponding to all pixels in the gradient image are statistically analyzed, and the average value of all gray-level gradient values is calculated. Pixels whose gray-level gradient values are greater than the average value of all gray-level gradient values are selected as candidate gradient values, and the average value of these candidate gradient values is calculated. This average value is then used as the boundary judgment threshold T. Based on the boundary judgment threshold T, all pixels in the gradient image are filtered. When the gray-level gradient value G(x,y) of a pixel is greater than or equal to the boundary judgment threshold T, the pixel is marked as a boundary pixel, and all boundary pixels form a boundary pixel set {e1,e2,…,e...}. n}; where n represents the number of boundary pixels.
[0017] For each boundary pixel in the boundary pixel set, a boundary connection process is performed using any boundary pixel in the set as the starting boundary pixel. Other boundary pixels within the eight-neighborhood of the starting boundary pixel are searched and connected. Then, the newly connected boundary pixel is used as the current boundary pixel to continue the neighborhood search until a closed boundary contour is formed. This process is repeated for boundary pixels in the boundary pixel set E that do not belong to any closed boundary contour until all boundary pixels are connected, resulting in a closed boundary contour set {B1, B2, ..., B...}. m}, where m represents the number of closed boundary contours.
[0018] For closed boundary contour B i Given i∈{1,2,…,m}, obtain the closed boundary contour B. i The entire enclosed area contains all pixels, and all pixels are defined as the same flow channel region, forming a closed boundary contour B. i The corresponding flow channel region R i , where R i ={pi1,pi2,…,pi k};pi1 to pi k Indicates that it belongs to the flow channel region R i The pixels, k represents the flow channel region R i The number of pixels contained is used to perform flow channel region extraction processing on all closed boundary contours in the same way to obtain multiple flow channel regions {R1,R2,…,R} corresponding to the inner cavity of the hydraulic component. m}
[0019] In obtaining multiple flow channel regions {R1,R2,…,R} corresponding to the inner cavity of the hydraulic component, m After that, for the flow channel region R i In addition to any other flow channel region R j Given j∈{1,2,…,m} and i≠j, obtain the flow channel region R respectively. iThe corresponding closed boundary profile B i and flow channel region R j The corresponding closed boundary profile B j ; Calculate the closed boundary profile B respectively i Each boundary pixel and the closed boundary contour B j The pixel distance between each boundary pixel in the flow channel is used to determine the minimum value among all pixel distances as the flow channel region R. i With flow channel region R j Minimum boundary distance d between ij Wherein, the adjacency distance threshold d h The threshold d is determined by the statistical results of all minimum boundary distances. Specifically, the minimum boundary distances between all pairs of flow channel regions are calculated to obtain the set of minimum boundary distances, and the average distance value in the set of minimum boundary distances is determined as the adjacency determination threshold d. h , The flow channel region R i With flow channel region R j Minimum boundary distance d between ij Adjacency determination threshold d h When comparing, when d ij Less than d h At that time, determine the flow channel region R i With flow channel region R j There exists a spatial adjacency relationship; when d ij Greater than or equal to d h At that time, determine the flow channel region R i With flow channel region R j There is no spatial adjacency relationship between them. The correspondence between the flow channel regions that have spatial adjacency relationships is stored to obtain the spatial adjacency relationship between the flow channel regions.
[0020] S2. Based on visual images covering the inner cavity of hydraulic components, identify abnormal regions and determine the corresponding flow channel regions according to the overlap ratio between the abnormal regions and each flow channel region. Furthermore, based on the overlap ratio between the abnormal region and each flow channel region, the flow channel corresponding to the abnormal region is determined, including: The coordinates of the abnormal pixels corresponding to the abnormal region are compared with the coordinates of the pixels corresponding to each flow channel region. When the coordinates of the abnormal pixel are the same as the coordinates of the pixel in the corresponding flow channel region, the abnormal pixel is identified as an overlapping pixel between the abnormal region and the corresponding flow channel region, and the number of overlapping pixels between the abnormal region and each flow channel region is counted. Based on the number of overlapping pixels between the abnormal region and each flow channel region and the total number of abnormal pixels contained in the abnormal region, the overlap ratio between the abnormal region and each flow channel region is calculated. The overlap ratio between the abnormal region and each flow channel region is compared, and the flow channel region corresponding to the maximum value in the comparison result is determined as the flow channel region corresponding to the abnormal region.
[0021] Specifically, all pixels in the visual image I are traversed, and the features corresponding to each pixel are obtained. For any pixel, a local neighborhood window of a preset size is established with that pixel as the center. The pixels within a preset range outside the local neighborhood window constitute a reference neighborhood region. The differences in features of each type between the local neighborhood window and the reference neighborhood region are calculated. An anomaly detection threshold is determined based on the statistical results of the feature differences corresponding to all pixels. Pixels with feature differences greater than or equal to the anomaly detection threshold are identified as abnormal pixels, and all abnormal pixels form an abnormal pixel set {a1, a2, ..., a...}. v}; where v represents the number of abnormal pixels, For any abnormal pixel in the abnormal pixel set A, take any abnormal pixel in the abnormal pixel set A as the starting abnormal pixel and search for other abnormal pixels within the eight-neighbor range of the starting abnormal pixel. When a searched abnormal pixel is within the eight-neighbor range of the current abnormal pixel, the corresponding abnormal pixel is assigned to the same region. Then, the newly assigned abnormal pixel in that region is used as the current abnormal pixel to continue the neighborhood search until no more abnormal pixels are added, forming the corresponding abnormal region. The abnormal region division process is then repeated for abnormal pixels in the abnormal pixel set A that do not belong to any abnormal region until all abnormal pixels are divided, resulting in the abnormal region set {Q1, Q2, ..., Q...}. t}; where t represents the number of abnormal regions.
[0022] For any abnormal region Q in the set of abnormal regions u and the multiple flow channel regions {R1,R2,…,R} corresponding to the internal cavity of the hydraulic component. m}, where u∈{1,2,…,t}, to obtain the abnormal region Q. u The coordinates of all abnormal pixels and the coordinates of all pixels in each flow channel region are used to extract the abnormal region Q one by one. u The coordinates of abnormal pixels are calculated, and each abnormal pixel coordinate is compared with the corresponding pixel coordinates in each flow channel region. When the coordinates of an abnormal pixel are the same as the pixel coordinates in the corresponding flow channel region, the abnormal pixel is identified as an abnormal region Q. u Pixels overlapping with the corresponding flow channel region, and statistical analysis of abnormal regions Q. u The number of overlapping pixels corresponding to each flow channel region According to the abnormal region Q u The number of overlapping pixels corresponding to each flow channel region and the abnormal region Q u The total number of abnormal pixels included, and the abnormal region Q is calculated for each. u The overlap ratio between each flow channel region, and the abnormal region Q u The flow channel region corresponding to the maximum overlap ratio between each flow channel region is determined as the abnormal region Q. u The corresponding flow channel region.
[0023] According to the abnormal region Q u The number of overlapping pixels corresponding to each flow channel region and the abnormal region Q u The total number of abnormal pixels included, and the abnormal region Q is calculated for each. u The overlap ratio between each flow channel region, and the abnormal region Q u By comparing the overlap ratios between different flow channel regions, the flow channel region corresponding to the maximum value in the comparison results is identified as the abnormal region Q. u The corresponding flow channel region.
[0024] S3. Based on the flow channel regions corresponding to the abnormal regions and the spatial adjacency relationships between the flow channel regions, determine the adjacent flow channel regions corresponding to the abnormal regions, and calculate the influence weight of the abnormal regions on each adjacent flow channel region according to the minimum boundary distance between the flow channel regions corresponding to the abnormal regions and each adjacent flow channel region. Furthermore, the influence weight of the abnormal region on each adjacent flow channel region is calculated based on the minimum boundary distance between the flow channel region corresponding to the abnormal region and each adjacent flow channel region, including: Extract the minimum boundary distance d between the flow channel region corresponding to the abnormal region and each adjacent flow channel region, and determine the maximum value among the minimum boundary distances between the flow channel region corresponding to the abnormal region and each adjacent flow channel region as the distance normalization coefficient D. max , The minimum boundary distance d between the abnormal region and each adjacent flow channel region is calculated using the distance normalization coefficient D. max Normalization calculations are performed to obtain the normalized boundary distance N between the flow channel region corresponding to the abnormal region and each adjacent flow channel region, where N = d / D max , The influence weight W of the abnormal region on each adjacent flow channel region is calculated based on the normalized boundary distance between the flow channel region corresponding to the abnormal region and each adjacent flow channel region, where W = 1 - N.
[0025] Specifically, for the abnormal region Q u Get the abnormal region Q u The corresponding flow channel region, and based on the spatial adjacency relationship between flow channel regions, query the abnormal region Q.u All flow channel regions that have spatial adjacency with the corresponding flow channel region are identified, and all the retrieved flow channel regions are grouped into anomaly region Q. u The corresponding set of adjacent flow channel regions {L1,L2,…,L p}; where p represents the number of adjacent flow channel regions, For the abnormal region Q u Extracting the abnormal region Q u The minimum boundary distance between the corresponding flow channel region and each adjacent flow channel region forms the abnormal region Q. u The set of minimum boundary distances between the corresponding flow channel region and each adjacent flow channel region {D1,D2,…,D p}, and the abnormal region Q u The maximum value of the set of minimum boundary distances between the corresponding flow channel region and each adjacent flow channel region is determined as the distance normalization coefficient D. max , For the abnormal region Q u The corresponding flow channel region and any adjacent flow channel region L g Minimum boundary distance d between g This is compared with the distance normalization coefficient D. max Normalization calculations are performed to obtain the anomaly region Q. u Corresponding flow channel region and adjacent flow channel region L g Normalized boundary distance N between g , where N g =d g / D max , g∈{1,2,…,p}, According to the abnormal region Q u Corresponding flow channel region and adjacent flow channel region L g Normalized boundary distance N g Calculate the anomaly region Q u For adjacent flow channel regions L g The effect weight W g Among them, W g =1-N g And calculate the abnormal region Q u The influence weights of each adjacent flow channel region are used to form the abnormal region Q. u The set of weights for the effects on adjacent flow channel regions {W1, W2, ..., W p}, Abnormal region Q u The weight of the effect on each adjacent flow channel region represents the degree of attenuation of the influence of the abnormal region on the adjacent flow channel regions through the spatial structure relationship.
[0026] S4. Determine the priority of the impact of the abnormal region on each adjacent flow channel region based on the weight of the effect of the abnormal region on each adjacent flow channel region. Furthermore, S4 specifically includes, The influence weights of the abnormal region on each adjacent flow channel region are sorted in descending order of influence weight value, and the priority of the influence of the abnormal region on each adjacent flow channel region is determined according to the sorting order.
[0027] Specifically, for the abnormal region Q u For the abnormal region Q u The abnormal region Q in the set of weights for the effects on adjacent flow channel regions u The influence weights of adjacent flow channel regions are sorted from largest to smallest according to their numerical values. According to the abnormal region Q u The weighting results of the effects on each adjacent flow channel region are sorted, and the abnormal region Q is sorted according to the sorting order. u Each adjacent flow channel region is assigned a first influence priority, a second influence priority, and so on up to the p-th influence priority, thus obtaining the abnormal region Q. u The impact priority of each adjacent flow channel region is given, where the first impact priority represents the abnormal region Q. u The impact on the corresponding adjacent flow channel region has the highest priority, and the p-th impact priority represents the abnormal region Q. u The impact on the corresponding adjacent flow channel region has the lowest priority.
[0028] S5. Based on the spatial location information of each flow channel region in the visual image, determine the direction of the spatial adjacency relationship between flow channel regions to form the directional adjacency relationship between flow channel regions. Based on the flow channel region corresponding to the abnormal region, the adjacent flow channel regions corresponding to the abnormal region, and the directional adjacency relationship between flow channel regions, determine the directional adjacency relationship between the flow channel region corresponding to the abnormal region and each adjacent flow channel region. Furthermore, based on the spatial location information of each flow channel region in the visual image, the spatial adjacency relationship between flow channel regions is determined directionally, forming the directional adjacency relationship between flow channel regions, including... For any two flow channel regions that are spatially adjacent, calculate the difference in lateral and longitudinal coordinates between the center coordinates of the two flow channel regions, and compare the absolute value of the lateral coordinate difference with the absolute value of the longitudinal coordinate difference. When the absolute value of the lateral coordinate difference is greater than the absolute value of the longitudinal coordinate difference, the direction of the lateral coordinate difference is further determined. When the lateral coordinate difference is greater than zero, the directional adjacency relationship between the two flow channel regions is determined to be a right-hand adjacency relationship; when the lateral coordinate difference is less than zero, the directional adjacency relationship between the two flow channel regions is determined to be a left-hand adjacency relationship. When the absolute value of the lateral coordinate difference is less than or equal to the absolute value of the longitudinal coordinate difference, the direction of the longitudinal coordinate difference is further determined. When the longitudinal coordinate difference is greater than zero, the directional adjacency relationship between the two flow channel regions is determined to be a downward adjacency relationship; when the longitudinal coordinate difference is less than zero, the directional adjacency relationship between the two flow channel regions is determined to be an upward adjacency relationship. The left, right, up, and down adjacency relationships between each flow channel region are stored to form the directional adjacency relationships between flow channel regions.
[0029] Specifically, for the flow channel region R i Obtain the flow channel region R i The x-coordinate and y-coordinate of all pixels are calculated, and the average of the x-coordinates and y-coordinates of all pixels are calculated. The average of the x-coordinates and y-coordinates is used to determine the flow channel region R. i The corresponding center coordinates of the region C i =(X i ,Y i ), calculate the center coordinates of all flow channel regions respectively, and obtain multiple flow channel regions {R1,R2,…,R m The corresponding set of center coordinates of the region {C1,C2,…,C} m}, For flow channel regions R that have spatial adjacency relationships i With flow channel region R j Obtain the flow channel region R i The corresponding center coordinates of the region C i =(X i ,Y i and flow channel region R j The corresponding center coordinates of the region C j =(X j ,Y j ), and calculate the flow channel region R. i The corresponding center coordinates of the region C i With flow channel region R j The corresponding center coordinates of the region C j The difference in horizontal coordinates between them ΔX ij and the vertical coordinate difference ΔY ij , The difference in the horizontal coordinates ΔX ij The absolute value of the difference between the vertical coordinate and the vertical coordinate ΔY ij Compare the absolute values, when |ΔX ij |>|ΔY ij |At that time, the flow channel region R i With flow channel region R jThe positional relationship between them is determined to be a horizontal distribution, and the horizontal coordinate difference ΔX is further determined. ij The direction when ΔX ij When the value is greater than zero, the flow channel region R is determined. j Located in the flow channel region R i On the right side, and the flow channel region R i With flow channel region R j The directional adjacency relationship between them is determined to be a right adjacency relationship; when ΔX ij When it is less than zero, the flow channel region R is determined. j Located in the flow channel region R i On the left, and the flow channel area R i With flow channel region R j The directional adjacency relationship between them is determined to be a left-direction adjacency relationship. When |ΔX ij |≤|ΔY ij |At that time, the flow channel region R i With flow channel region R j The positional relationship between them is determined to be a vertical distribution; further, the vertical coordinate difference ΔY is determined. ij The direction when ΔY ij When the value is greater than zero, the flow channel region R is determined. j Located in the flow channel region R i Below, and the flow channel region R i With flow channel region R j The directional adjacency relationship between them is determined as a downward adjacency relationship; when ΔY ij When it is less than zero, the flow channel region R is determined. j Located in the flow channel region R i Above, and the flow channel region R i With flow channel region R j The directional adjacency relationship between them is determined to be an upward adjacency relationship.
[0030] For all flow channel regions with spatial adjacency, a direction determination process is performed to obtain the corresponding left-side adjacency, right-side adjacency, up-side adjacency, and down-side adjacency relationships between each flow channel region. These directional adjacency relationships are then stored to form the directional adjacency relationships between flow channel regions.
[0031] For the abnormal region Q u Get the abnormal region Q u The corresponding flow channel region and abnormal region Q u The corresponding set of adjacent flow channel regions {L1,L2,…,L p}, for the abnormal region Q u The corresponding adjacent flow channel region L g Query the abnormal region Q in the directional adjacency relationship between flow channel regions. uCorresponding flow channel region and adjacent flow channel region L g Determine the directional adjacency relationships between them, and complete the abnormal region Q in the same way. u The directional adjacency relationships of all adjacent flow channel regions are extracted to obtain the abnormal region Q. u The directional adjacency relationship between the corresponding flow channel region and each adjacent flow channel region.
[0032] S6. Based on the priority of the impact of the abnormal region on each adjacent flow channel region and the directional adjacency relationship between the flow channel region corresponding to the abnormal region and each adjacent flow channel region, determine the direction of the abnormal impact corresponding to the abnormal region, and generate the abnormal detection result. Specifically, for the abnormal region Q u Get the abnormal region Q u Corresponding flow channel region, abnormal region Q u Priority of impact on adjacent flow channel regions and abnormal region Q u The directional adjacency relationship between the corresponding flow channel region and each adjacent flow channel region. Extracting the abnormal region Q u The impact priority for each adjacent flow channel region is determined by the adjacent flow channel region corresponding to the first impact priority, and this adjacent flow channel region is identified as the target adjacent flow channel region. Anomaly region Q is then extracted. u The directional adjacency relationship between the corresponding flow channel region and the target adjacent flow channel region will be used to determine the abnormal region Q. u The directional adjacency relationship between the corresponding flow channel region and the target adjacent flow channel region is determined as the abnormal region Q. u The corresponding direction of the abnormal impact, According to the abnormal region Q u Corresponding flow channel region, abnormal region Q u The corresponding direction of the anomaly and the anomaly region Q u Prioritize the impact on each adjacent flow channel region and generate anomaly region Q. u The corresponding anomaly detection results, For the set of abnormal regions {Q1, Q2, ..., Q... t After all abnormal regions in the} have completed the abnormal detection results, the abnormal detection results corresponding to all abnormal regions are summarized and the abnormal detection results corresponding to the internal cavity of the hydraulic component are output.
[0033] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A method for intelligent visual inspection of the internal cavity of a hydraulic component, characterized in that, Includes the following steps, Acquire visual images covering the inner cavity of hydraulic components, extract flow channel regions based on visual images, and determine the spatial adjacency relationships between flow channel regions; Based on visual image recognition of the inner cavity of hydraulic components, abnormal areas are identified, and the flow channel area corresponding to the abnormal area is determined according to the overlap ratio between the abnormal area and each flow channel area. Based on the flow channel region corresponding to the abnormal region and the spatial adjacency relationship between the flow channel regions, the adjacent flow channel regions corresponding to the abnormal region are determined, and the influence weight of the abnormal region on each adjacent flow channel region is calculated according to the minimum boundary distance between the flow channel region corresponding to the abnormal region and each adjacent flow channel region. The priority of the impact of the abnormal region on each adjacent flow channel region is determined based on the weight of the effect of the abnormal region on each adjacent flow channel region. Based on the spatial location information of each flow channel region in the visual image, the spatial adjacency relationship between flow channel regions is determined to form the directional adjacency relationship between flow channel regions. Based on the flow channel region corresponding to the abnormal region, the adjacent flow channel region corresponding to the abnormal region, and the directional adjacency relationship between flow channel regions, the directional adjacency relationship between the flow channel region corresponding to the abnormal region and each adjacent flow channel region is determined. Based on the priority of the impact of the abnormal region on each adjacent flow channel region and the directional adjacency relationship between the flow channel region corresponding to the abnormal region and each adjacent flow channel region, the abnormal impact direction corresponding to the abnormal region is determined, and the abnormal detection result is generated.
2. The intelligent visual inspection method for the internal cavity of hydraulic components according to claim 1, characterized in that, The process of extracting the flow channel region based on the visual image. include, The visual image is processed by grayscale conversion and noise suppression to obtain a preprocessed image. A gradient image is then generated by calculating the grayscale gradient values of each pixel in the preprocessed image. The boundary determination threshold is determined based on the statistical results of the gray-level gradient values corresponding to each pixel in the gradient image. Then, based on this threshold, all pixels in the gradient image are filtered to identify boundary pixels, forming a boundary pixel set. Boundary connection processing is performed using any boundary pixel in the boundary pixel set as the starting boundary pixel to form a closed boundary contour. Boundary connection processing is then repeated for boundary pixels that do not belong to any closed boundary contour until multiple closed boundary contours are obtained. Obtain all pixels within the bounding area corresponding to each closed boundary contour, and define all pixels as the same flow channel region to form the flow channel region corresponding to each closed boundary contour.
3. The intelligent visual inspection method for the internal cavity of hydraulic components according to claim 2, characterized in that, The determination of the spatial adjacency relationship between the flow channel regions includes, For any flow channel region, calculate the pixel distance between the corresponding boundary pixel of this flow channel region and the corresponding boundary pixel of other flow channel regions, and determine the minimum value among all pixel distances as the minimum boundary distance between this flow channel region and its corresponding counterpart. The minimum boundary distance between the flow channel region and the corresponding flow channel region is compared with an adjacency determination threshold. If the minimum boundary distance is less than the adjacency determination threshold, it is determined that there is a spatial adjacency relationship between the flow channel region and the corresponding flow channel region; if the minimum boundary distance is greater than or equal to the adjacency determination threshold, it is determined that there is no spatial adjacency relationship between the flow channel region and the corresponding flow channel region. By associating flow channel regions that have spatial adjacency relationships, the spatial adjacency relationships between flow channel regions can be obtained.
4. The intelligent visual inspection method for the internal cavity of hydraulic components according to claim 3, characterized in that, The determination of the flow channel corresponding to the abnormal region based on the overlap ratio between the abnormal region and each flow channel region includes: The coordinates of the abnormal pixels corresponding to the abnormal region are compared with the coordinates of the pixels corresponding to each flow channel region. When the coordinates of the abnormal pixel are the same as the coordinates of the pixel in the corresponding flow channel region, the abnormal pixel is identified as an overlapping pixel between the abnormal region and the corresponding flow channel region, and the number of overlapping pixels between the abnormal region and each flow channel region is counted. Based on the number of overlapping pixels between the abnormal region and each flow channel region and the total number of abnormal pixels contained in the abnormal region, the overlap ratio between the abnormal region and each flow channel region is calculated. The overlap ratio between the abnormal region and each flow channel region is compared, and the flow channel region corresponding to the maximum value in the comparison result is determined as the flow channel region corresponding to the abnormal region.
5. The intelligent visual inspection method for the internal cavity of hydraulic components according to claim 4, characterized in that, The calculation of the effect weight of the abnormal region on each adjacent flow channel region based on the minimum boundary distance between the corresponding flow channel region and each adjacent flow channel region includes: Extract the minimum boundary distance d between the flow channel region corresponding to the abnormal region and each adjacent flow channel region, and determine the maximum value among the minimum boundary distances between the flow channel region corresponding to the abnormal region and each adjacent flow channel region as the distance normalization coefficient D. max , The minimum boundary distance d between the abnormal region and each adjacent flow channel region is calculated using the distance normalization coefficient D. max Normalization calculations are performed to obtain the normalized boundary distance N between the flow channel region corresponding to the abnormal region and each adjacent flow channel region, where N = d / D max , The influence weight W of the abnormal region on each adjacent flow channel region is calculated based on the normalized boundary distance between the flow channel region corresponding to the abnormal region and each adjacent flow channel region, where W = 1 - N.
6. The intelligent visual inspection method for the internal cavity of hydraulic components according to claim 5, characterized in that, The step of determining the priority of the impact of the abnormal region on each adjacent flow channel region based on the weight of the effect of the abnormal region on each adjacent flow channel region includes, The influence weights of the abnormal region on each adjacent flow channel region are sorted in descending order of influence weight value, and the priority of the influence of the abnormal region on each adjacent flow channel region is determined according to the sorting order.
7. The intelligent visual inspection method for the internal cavity of hydraulic components according to claim 6, characterized in that, The step of determining the direction of the spatial adjacency relationship between flow channel regions based on the spatial location information of each flow channel region in the visual image, and forming the directional adjacency relationship between flow channel regions, includes: For any two flow channel regions that are spatially adjacent, calculate the difference in lateral and longitudinal coordinates between the center coordinates of the two flow channel regions, and compare the absolute value of the lateral coordinate difference with the absolute value of the longitudinal coordinate difference. When the absolute value of the lateral coordinate difference is greater than the absolute value of the longitudinal coordinate difference, the direction of the lateral coordinate difference is further determined. When the lateral coordinate difference is greater than zero, the directional adjacency relationship between the two flow channel regions is determined to be a right-hand adjacency relationship; when the lateral coordinate difference is less than zero, the directional adjacency relationship between the two flow channel regions is determined to be a left-hand adjacency relationship. When the absolute value of the lateral coordinate difference is less than or equal to the absolute value of the longitudinal coordinate difference, the direction of the longitudinal coordinate difference is further determined. If the longitudinal coordinate difference is greater than zero, the directional adjacency relationship between the two flow channel regions is determined as a downward adjacency relationship; if the longitudinal coordinate difference is less than zero, the directional adjacency relationship between the two flow channel regions is determined as an upward adjacency relationship. The left, right, up, and down adjacency relationships between each flow channel region are stored to form the directional adjacency relationships between flow channel regions.