Binocular identification-based cable hole site identification method in cable trench
Through binocular recognition technology, combined with image preprocessing and feature matching algorithm, the rapid identification of cable holes inside the cable trench and the occupancy judgment are achieved, the problem of time-consuming and labor-consuming manual inspections is solved, and the information acquisition of power systems is improved Efficiency and accuracy.
Patent Information
- Application Number
- CN202411219860.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2024-12-13
AI Technical Summary
The existing technology relies on manual inspection of the cable hole position in the cable trench, which is time-consuming and labor-intensive, and it is difficult to quickly obtain information. The number of cable trenches is large and manual maintenance costs are high.
Using the cable hole position recognition method based on binocular recognition, images are collected through binocular vision modules, image preprocessing and Canny edge extraction are performed, and cable hole number information is identified through three-dimensional Reconstruct and obtain position information, evaluate the orientation alignment between the cable and the hole, and judge the cable hole occupancy.
It realizes rapid acquisition of internal information of cable trench, reduces labor and time costs, improves identification accuracy and efficiency, and adapts to the rapid development needs of the power system.
Smart Images

Figure CN119131138A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of power cables and relates to a method for identifying cable hole positions inside a cable trench based on binocular recognition. Background Art
[0002] Cable trenches are underground pipelines used to lay and replace power or telecommunication cable facilities. They are also the enclosure structures for the laid cable facilities. In today's era of rapid development, the number of power transmission and distribution lines is gradually increasing, and the cable placement situation inside the cable trench is often changing. For the subsequent cable placement, it is necessary to always understand the number and occupancy of cable holes inside the cable trench. However, since most cable trenches are arranged underground, the internal environment of underground cable trenches is small and complex, and there are a large number of cable trenches in cities, the number of cable holes inside each cable trench is even larger. There are about 160,000 cable holes in Nan'an District, Chongqing alone. However, the current inspection method still relies on manual inspection by experienced technicians, and inspection is particularly time-consuming and difficult. Therefore, a new detection method is needed to quickly understand the number and occupancy of cable holes inside the cable trench.
[0003] The current mainstream inspection method relies on manual work. Technicians need to enter the cable trench and use their eyes and experience to determine the number and occupancy of cable holes inside the trench.
[0004] The mainstream cable trench inspection method is extremely dependent on the experience of technicians, but the internal structure of the cable trench is complex and narrow, which increases the difficulty of inspection. In addition, the power system is developing rapidly, there are many cable trenches in cities, and the internal cable placement situation changes rapidly. It takes a lot of time to rely on manual inspection to keep track of the internal information of the cable trench. Relying solely on manual work is no longer suitable for the development speed of today's power grid. Through the invention, the cable hole position information inside the cable trench can be quickly obtained, which greatly reduces the labor cost and time cost of inspection, and provides support for the subsequent development of the power system.
[0005] In view of the difficulty in obtaining information about the inside of the cable trench, this paper proposes a method for identifying the cable hole position inside the cable trench based on binocular recognition. The image of the cable hole position inside the cable trench is collected through the binocular vision module, and the collected image is preprocessed for subsequent feature recognition; the cable hole position is identified by using the Canny edge extraction algorithm and the improved ORB feature matching algorithm for the cable hole image to obtain the number of cable holes; the cable hole position and the cable are reconstructed in three dimensions using the binocular vision system to obtain the position information, calculate the main axis direction and center of mass of the cable and the cable hole position, evaluate the alignment of the direction of the cable and the hole, and then judge the occupancy of the cable hole position. The present invention realizes the rapid acquisition of information inside the cable trench, saving a lot of manpower and time. Summary of the invention
[0006] In view of this, the purpose of the present invention is to provide a method for identifying cable holes inside a cable trench based on binocular recognition, in order to improve the problem of time-consuming and labor-intensive traditional manual inspection of the internal conditions of the cable trench.
[0007] In order to achieve the above object, the present invention provides the following technical solutions:
[0008] A method for identifying cable hole positions in a cable trench based on binocular recognition comprises the following steps:
[0009] Use binocular vision module to collect images of cable holes inside the cable trench;
[0010] Perform image preprocessing on the acquired images, including image filtering and histogram equalization;
[0011] The Canny edge extraction algorithm is used to extract the edge contour of the cable hole image;
[0012] The improved ORB feature matching algorithm is used to match the edge contours of cable holes to obtain the number of cable holes.
[0013] Use binocular vision system to perform 3D reconstruction of cable hole positions and cables to obtain position information;
[0014] Calculate the main axis direction and centroid of the cable and cable hole, evaluate the alignment of the cable and the hole, and determine the occupancy of the cable hole.
[0015] Furthermore, the image filtering adopts bilateral filtering.
[0016] Further, the improved ORB feature matching algorithm comprises the following steps:
[0017] o-FAST feature point extraction;
[0018] r-BRIEF feature description;
[0019] The RANSAC algorithm is used to eliminate false matches.
[0020] Further, the three-dimensional reconstruction comprises the following steps:
[0021] Camera calibration;
[0022] Stereo correction;
[0023] Stereo matching;
[0024] Calculate 3D coordinates based on disparity.
[0025] Further, the determining of the cable hole occupancy status includes the following steps:
[0026] Calculate the centroid of cables and cable holes;
[0027] Calculate the main axis directions of cables and cable holes;
[0028] The Euclidean distance between the cable centroid and the hole centroid and the angular difference between the main axis directions of the cable and the hole are compared, and the cable hole occupancy is determined based on the preset threshold.
[0029] Furthermore, the stereo matching adopts a grayscale-based template matching BM algorithm.
[0030] The beneficial effects of the present invention are: improving the problem of relying on manual labor to check the cable hole positions inside the existing cable trench, which is time-consuming and labor-intensive, and providing a method for identifying direct buried hole positions inside the cable trench based on binocular recognition, which has high recognition accuracy and fast recognition efficiency, saves a lot of labor and time costs, and facilitates rapid acquisition of information inside the cable trench.
[0031] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:
[0033] Figure 1 Provide a technical roadmap for cable hole location identification;
[0034] Figure 2 This is the histogram equalization flow chart;
[0035] Figure 3 Flowchart for cable hole identification. DETAILED DESCRIPTION
[0036] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.
[0037] Among them, the drawings are only used for illustrative explanations, and they only represent schematic diagrams rather than actual pictures, and should not be understood as limitations on the present invention. In order to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of actual products. For those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted.
[0038] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if the terms "upper", "lower", "left", "right", "front", "rear", etc. indicate the orientation or position relationship, they are based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation. Therefore, the terms describing the position relationship in the drawings are only used for illustrative purposes and cannot be understood as limiting the present invention. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.
[0039] 1. Cable hole image preprocessing
[0040] In the process of collecting cable hole images, defects may occur in the collected images due to defects in the camera itself and the influence of the operating environment. After many field surveys, this distortion is mainly reflected in noise interference, overexposure of the collected images (under the midday sun) or too dark images (there is no direct light source in the cable trench). These phenomena will cause the loss of features of the cable holes, thereby affecting the identification and positioning of the cable holes. Therefore, it is necessary to preprocess the collected images to lay the foundation for feature extraction and identification of the cable holes.
[0041] 1.1 Image Filtering
[0042] When the images collected by the system contain noise, the details of the cable hole positions will be lost, resulting in errors in feature extraction and matching. Therefore, image filtering is needed to eliminate or reduce the noise. The present invention selects bilateral filtering as a method for denoising the cable hole position image.
[0043] On the basis of Gaussian filtering, pixel value weights are added, and the influence of distance and pixel value differences is considered at the same time. Similar pixel values have greater weights, while farther pixels have less impact on the edge. Bilateral filtering can be used as shown in formula (1):
[0044]
[0045] In the formula, g(x,y) is the output pixel value; f(s,t) is the input pixel value; ω(x,y,s,t) is the weighting coefficient.
[0046] 1.2 Histogram Equalization
[0047] Since the cable hole identification and positioning system works in the underground cable trench, it is easily affected by external light when the cable well is opened. The image inside the cable trench will become dark due to the lack of light source. In this environment, the cable hole image will lose details, reduce the amount of available information, and affect its feature detection and matching operations. In addition, when the camera exposure parameters are improperly set, the image contrast will be low. Therefore, it is necessary to enhance the image to enrich the edge feature information of the cable hole.
[0048] Histogram equalization increases the image contrast by broadening the grayscale values of pixels with a large number of pixels and merging the values with a small number of pixels, making the contour edges of cable holes more obvious and easier to detect.
[0049] First, the grayscale value of the input image is obtained, and the number of pixels at each grayscale level is counted. Then, the probability histogram is normalized to [0, 1] to obtain the grayscale distribution probability. The mapping relationship between the input and output grayscale levels is based on the mapping relationship. The grayscale level of each pixel of the output image is cyclically output as shown in formula (2):
[0050]
[0051] Where: M, N are the length and width of the image in pixels; L is the grayscale level; cdf min is the minimum value of the cumulative distribution function.
[0052] The specific operation process is as follows Figure 2 The gray value distribution of the image after equalization is more uniform. The image after histogram equalization makes up for the image defects under overexposure and dark conditions, making its brightness more uniform and the cable hole contour clearer, which provides conditions for the subsequent feature detection and identification of cable holes.
[0053] 2. Cable hole identification algorithm
[0054] 2.1Canny edge detection algorithm
[0055] Since the cable hole recognition system will be disturbed by factors such as dust and cables buried directly in the holes when collecting images, thus affecting the normal recognition of the holes, image segmentation technology is used here to eliminate the interference of other factors and highlight the characteristics of the cable holes.
[0056] Good feature detection effect is conducive to improving the cable hole recognition rate, shortening the recognition time and improving real-time performance. Since there are obvious differences in the edge pixels between the hole where the cable is directly buried and the cable, and between the cable hole and the wall, edge detection is selected to achieve the segmentation between the hole, the cable and the wall.
[0057] The present invention uses the Canny algorithm to detect the edge contour of the cable hole on the preprocessed image. The algorithm has good noise reduction capability and can detect continuous image edges.
[0058] The Canny algorithm process is as follows:
[0059] 1) Calculate the gradient magnitude and direction: The edges of an image can point in different directions. The Sobel operator is used to calculate the magnitude and direction of four angles in the horizontal, vertical and diagonal directions respectively. The gradient direction takes one of the four possible angles.
[0060] The magnitude of the gradient can combine the horizontal gradient with the vertical gradient:
[0061]
[0062] Where: G x and G y Represent the gradient of the target point in the x and y directions respectively.
[0063] The gradient direction is expressed as:
[0064]
[0065] 2) Maximum suppression: The gradient edge obtained by the Sobel operator is multiple pixels wide, which makes the gradient image more "blurry". By comparing the gradient strength of the current point and the points in the positive and negative gradient directions, if the point is the maximum, its value is retained, otherwise it is suppressed. Finally, all pixel points are traversed and the non-maximum suppression process is completed to obtain the processed edge detection result.
[0066] 3) Double threshold edge screening: The gradient image after non-maximum suppression is classified according to the two set thresholds. The higher threshold is usually called the strong edge threshold, and the lower threshold is called the weak edge threshold. Pixels exceeding the strong edge threshold are regarded as strong edges and retained; pixels less than the weak edge threshold are regarded as non-edges and suppressed; pixels between the two thresholds are regarded as weak edges, and whether to retain them depends on whether they are connected to strong edge pixels. Finally, the weak edge part is processed for edge connection. If a weak edge pixel is directly or indirectly connected to at least one strong edge pixel, it is classified as a strong edge; otherwise it is classified as a non-edge. This method can restore broken edge lines by connecting weak edges.
[0067] When the pixel value of the cable hole contour edge and the cable contour edge suddenly changes, Canny edge detection can obtain the accurate hole edge and cable edge, and the algorithm responds quickly, meeting the requirements of the cable hole recognition system.
[0068] 2.2 Feature Matching Algorithm
[0069] Matching of feature points is a key technology in the field of machine vision and a key step in identifying cable holes. An ideal matching effect should be highly robust. Although the binocular camera can basically obtain a stable image of the front cable hole position by moving downward along the inside of the cable trench during operation, the complex internal structure of the cable trench and the differences in the layout of different cable trenches may cause the collected images to rotate, translate, and scale. In order to ensure that the system can still accurately identify the cable hole position under these special circumstances, it is necessary to select a feature matching method with scale invariance, good robustness, and fast algorithm speed.
[0070] The present invention adopts an improved ORB algorithm, and the feature extraction process of the ORB algorithm includes o-FAST feature point extraction and r-BRIEF feature description.
[0071] ① o-FAST feature point extraction
[0072] FAST feature extraction is to detect corner points in the image by using the gray value of each pixel.
[0073] |I i -I p |>T (5)
[0074] In the formula, I p Indicates the gray value of the pixel to be tested; I i represents the gray value of the neighborhood pixel; T represents the threshold.
[0075] r-BRIEF Characterization
[0076] After extracting the feature points, the descriptor needs to be calculated. The description vector of BRIEF consists of multiple 0s and 1s. This representation method makes the algorithm run fast and has good real-time performance. N pairs of pixels are randomly selected in the neighborhood and the pixel values of the two points are compared, as shown in formula (6):
[0077]
[0078] Where p(x) and p(y) represent the pixel values at x and y, respectively; τ is the resulting binary number.
[0079] A set of points can uniquely generate an N-dimensional binary code as the eigenvalue of point p. The binary string is expressed as formula (7)
[0080]
[0081] When the ORB algorithm is used for matching, if the image is rotated or distorted, the feature points may deviate, thus causing matching errors. Therefore, the present invention uses the RANSAC (random sampling consensus) algorithm to eliminate the mismatching phenomenon.
[0082] RANSAC is a robust parameter estimation method that aims to find the most reasonable model for matching feature points in the source image and the target image. The algorithm determines whether two feature points are correct matching points through the following formula.
[0083] x′ T Fx=0 (8)
[0084]
[0085] Where (x, y) represents the feature points of the template image; (x′, y′) represents the feature points of the image to be matched; and F represents the basic matrix.
[0086] First, the matrix F is preliminarily solved through some point pairs in ORB matching, and then other feature point pairs are compared with F. If the match is successful, the point pair is expanded, otherwise it is considered to be a wrong match; F is recalculated based on the expanded matching point pairs, and then the point pair is compared with F; repeated iterations are performed to obtain the matrix F with the lowest matching error rate.
[0087] Canny edge detection is used to extract the edge contours of holes and cables, and the ORB+RANSAC algorithm is used to perform feature matching of cable holes, which can accurately identify the cable hole positions and provide information on the number of cable hole positions.
[0088] 3. Cable hole occupancy determination method based on 3D reconstruction
[0089] Simply relying on the Canny edge detection algorithm and the improved ORB algorithm is not enough to determine whether the cable is directly buried in the cable hole. Neither the Canny nor the ORB algorithm can directly provide depth information of the object. Whether the cable is directly buried in the hole usually requires considering the position relationship of the object in three-dimensional space.
[0090] The binocular vision system can calculate the depth information of each pixel in the scene by utilizing multi-view information and parallax information, and perform stereo modeling of the environment and shape recognition of objects. Therefore, the present invention performs stereo correction processing on the cable hole image based on the binocular vision system to facilitate parallax calculation; then calculates the image parallax through stereo matching; finally, performs three-dimensional reconstruction to obtain posture information, and then determines the occupancy of the cable hole.
[0091] 3.1 Stereo Vision Processing
[0092] 1) Camera calibration: The camera is the basis for obtaining 3D visual information, and its calibration is the prerequisite for its correct use; the accuracy of the internal and external parameters and distortion parameters in the binocular camera directly affects the accuracy of subsequent measurements. The present invention adopts the classic Zhang Zhengyou calibration method. This method is a unique single-plane measurement method, and its biggest feature is that the feature points in the spatial environment are coplanar.
[0093] 2) Stereo correction: Stereo correction mainly optimizes the stereo imaging process to ensure that the images obtained from the two cameras can be accurately matched; the two images that are not aligned in coplanar rows in practice are corrected to coplanar row alignment to improve the efficiency of matching search. The two images after distortion are strictly matched, and the epipolar line constraints are used to make the epipolar lines of the two images exactly on the same horizontal line. In this way, any point on one image and its corresponding point on the other image must have the same row number, and only one-dimensional search is required in the row to match the corresponding point. The left and right views are dedistorted and aligned according to the binocular relative position obtained after camera calibration.
[0094] 3) Stereo matching: Stereo matching is the main means of recovering depth information. After stereo correction, the matching points and points to be matched are found in the left and right views of an image. After matching, the disparity is obtained, and then the depth information of the image is calculated based on the relationship between them. Therefore, it determines the accuracy of the entire algorithm.
[0095] The present invention selects a grayscale-based template matching (BM) algorithm, which divides the frames of the two cameras into many small blocks, uses a known template image, moves the small blocks to match the small blocks in the other image, compares the positional relationship between the two pixel points, and calculates the actual depth of the object.
[0096] The BM algorithm steps are as follows:
[0097] On the left image taken, select a window W l , as the center of the window;
[0098] For window W l The gray value and S are calculated;
[0099] ③ On the right side of the captured image, select a window W r , and W l The same size, set d to the search range, (xd, y) is the center position of the window, for W r Perform the following steps: When (xd≤x′≤x+d) is satisfied, find W r The gray value and A x , translate x' to the right by one unit (or pixel). Where x' is W r center.
[0100] ④ When S-Ax′ takes the minimum value, the window W r It is the module with the best effect in the matching process. It calculates the position of x′ at this time and obtains the disparity, so as to obtain the disparity map.
[0101] 3.2 Acquisition of pose information based on 3D reconstruction
[0102] 3D reconstruction is also called parallax ranging. After stereo matching obtains the parallax, the dense pixel depth information on the image can be obtained through the prior camera internal and external parameters.
[0103] Let the space point P(X w ,Y w ,Z w ) is projected at the left camera point P l (X l ,Y l ,Z l ), the pixel coordinate is (u l ,v l ), the projection point of the right camera is P r (X r ,Y r ,Z r ), the pixel coordinate is (u r ,v r ), the distance between the optical centers of the two cameras is T, the focal length is f, and the triangle similarity principle can be obtained:
[0104]
[0105] Transform the above formula to get the three-dimensional coordinates of point P as follows:
[0106]
[0107] In this way, the position information of each pixel in the cable and cable hole image can be obtained.
[0108] 3.3 Determination of cable hole occupancy
[0109] The cable buried directly in the cable hole is usually close to the center of the hole. The main axis direction can provide the direction information of the cable and the hole. Combined with the centroid position, it can be used to evaluate the alignment of the cable and the hole and then determine the occupancy of the cable hole. The specific steps are as follows:
[0110] 1) Centroid calculation: The position information of each point is obtained through 3D reconstruction, and the centroid of the cable or hole can be calculated using 3D coordinates. For N points, the coordinates of each point are (X i ,Y i ,Z i ), then the centroid is the average position of all points:
[0111]
[0112] From this, the centroid coordinates of the cable and the cable hole (c x,cable ,c y,cable ,c z,cable ), (c x,hole ,c y,hole ,c z,hole ).
[0113] 2) Calculation of the main axis direction: For the point cloud data of cables or holes, we calculate the covariance matrix C. This matrix reflects the distribution of the point cloud data in the three directions of X, Y, and Z, as well as the correlation between these two directions.
[0114] First calculate the offset of each point relative to the centroid:
[0115] (X i ′,Y i ′,Z i ′)=(X i -c X ,Y i -c Y ,Z i -c Z ) (13)
[0116] The covariance matrix between cables and cable holes can be calculated using the following formula:
[0117]
[0118] Perform eigenvalue decomposition on the covariance matrix:
[0119] Cv i =λ i v i (15)
[0120] Among them, v i is the eigenvector, λ i is the corresponding eigenvalue.
[0121] Main axis direction v of cable and cable hole cable , v hole is the eigenvector with the largest eigenvalue.
[0122] 3) Determine the occupancy: First, calculate the Euclidean distance d between the cable centroid and the hole centroid:
[0123]
[0124] If d is less than the set distance threshold, it means that the centroid of the cable is close to the centroid of the hole, that is, they are aligned in position.
[0125] The angular difference between the directions of the main axes of the cable and the hole is then calculated:
[0126]
[0127] If θ is less than the set angle threshold, it means they are aligned in direction.
[0128] If both conditions are met, the cable can be considered to be buried straight into the cable hole. Otherwise, it means that the cable is not correctly aligned with the hole.
[0129] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.
Claims
1. A method for identifying cable hole positions inside cable trenches based on binocular recognition. Features: The following steps are involved: Use binocular vision module to collect images of cable holes inside the cable trench; Perform image preprocessing on the acquired images, including image filtering and histogram equalization; The Canny edge extraction algorithm is used to extract the edge contour of the cable hole image; The improved ORB feature matching algorithm is used to match the edge contours of cable holes to obtain the number of cable holes. Use binocular vision system to perform 3D reconstruction of cable hole positions and cables to obtain position information; Calculate the main axis direction and centroid of the cable and cable hole, evaluate the alignment of the cable and the hole, and determine the occupancy of the cable hole.
2. According to the method for identifying cable holes in a cable trench based on binocular recognition according to claim 1, Features: The image filtering adopts bilateral filtering.
3. According to the method for identifying cable hole positions in a cable trench based on binocular recognition according to claim 1, Features: The improved ORB feature matching algorithm comprises the following steps: o-FAST feature point extraction; r-BRIEF feature description; The RANSAC algorithm is used to eliminate false matches.
4. According to the method for identifying cable holes in cable trenches based on binocular recognition according to claim 1, Features: The three-dimensional reconstruction comprises the following steps: Camera calibration; Stereo correction; Stereo matching; Calculate 3D coordinates based on disparity.
5. According to the method for identifying cable hole positions in a cable trench based on binocular recognition according to claim 1, Features: Determining the occupancy of the cable hole comprises the following steps: Calculate the centroid of cables and cable holes; Calculate the main axis directions of cables and cable holes; The Euclidean distance between the cable centroid and the hole centroid and the angular difference between the main axis directions of the cable and the hole are compared, and the cable hole occupancy is determined based on the preset threshold.
6. According to the method for identifying cable holes in cable trenches based on binocular recognition according to claim 1, Features: The stereo matching adopts a grayscale-based template matching BM algorithm.
Citation Information
Cited By
Method for detecting cable in working well
CN120125852A
