Parallax estimation and positioning method for power grid operators based on monocular and binocular vision collaboration
By using the method of single- and binocular visual collaboration in power grid inspection operations, we build a self-supervised monocular disparity estimation network and perform filtering optimization, which solves the problems of false alarms, missed detections and reduced accuracy in traditional methods, and achieves higher accuracy. Disparity estimation accuracy and target location accuracy.
Patent Information
- Application Number
- CN202310982023.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-07
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2043-08-07
AI Technical Summary
In power grid inspection operations, traditional two-dimensional image detection and tracking is difficult to accurately obtain personnel location information and is prone to false alarms or missed detections. Moreover, monocular parallax estimation lacks paired viewing angle references, resulting in relative parallax in the estimation results and difficulty in directly obtaining distances. Coordinates, especially in areas with complex lighting and depth discontinuities, have reduced accuracy.
A method based on single- and binocular vision collaboration is used to collect perspective images through binocular cameras, and a self-supervised monocular disparity estimation network is constructed. Combined with MiDaS and spatial deformation networks, a self-supervised binocular loss function is designed for training, and monocular vision is used for training. The difference map performs filtering optimization on the binocular disparity map, and extracts local pixel block evaluation to obtain distance coordinates.
There is no need for monocular disparity label training, which improves disparity estimation accuracy, reduces background interference, enhances target positioning accuracy, and adapts to application needs in complex scenes.
Smart Images

Figure CN117372494B
Abstract
Description
Technical Field
[0001] The invention belongs to the field of computer vision, image processing and analysis, and specifically is a parallax estimation and positioning method for power grid operators based on monocular and binocular vision collaboration. Background Art
[0002] During the power grid patrol operation, the spatial topology of the operators changes frequently, and there is usually mutual occlusion. In addition, the target background is complex and diverse. Traditional two-dimensional images lack depth information, which is prone to false alarms and missed detections during the detection and tracking process, making it difficult to accurately obtain personnel location information. With the help of binocular visual imaging, stereo matching of the left and right perspectives can obtain the parallax information of the scene, thereby perceiving the positional relationship between the operators, electrical equipment and the environment, and warning of dangerous operating behaviors, which is of great significance to ensuring the safe operation of the power grid. The real depth of the target scene can be obtained through binocular vision, but complex conditions such as actual lighting and weak textures will interfere with the binocular stereo matching results. In the depth discontinuous area, the parallax estimation will have a large deviation, resulting in a decrease in the target positioning accuracy.
[0003] Compared with binocular vision imaging, monocular disparity estimation has lower hardware costs. Combined with end-to-end deep learning technology, it can achieve pixel-by-pixel disparity estimation. Although the current monocular disparity estimation method based on deep learning has achieved high estimation accuracy, the monocular disparity does not have a paired perspective as a reference. The estimated result is relative disparity, and the disparity range of different scenes is different. Therefore, it is difficult to directly obtain the distance coordinates of the scene through the monocular disparity value. In addition, high-precision monocular disparity estimation generally requires a large number of disparity labels for training, which is difficult to achieve in real application scenarios. Summary of the invention
[0004] In order to solve the shortcomings of the above-mentioned prior art, the present invention proposes a parallax estimation and positioning method for power grid operators based on monocular and binocular vision collaboration, in order to improve the estimation accuracy in real scenarios by combining the advantages of monocular and binocular parallax estimation, thereby achieving target positioning of power grid operators.
[0005] In order to achieve the above-mentioned purpose, the present invention adopts the following technical scheme:
[0006] The parallax estimation and positioning method for power grid operators based on monocular and binocular vision coordination of the present invention is characterized in that it is performed according to the following steps:
[0007] Step 1: Use a binocular camera to collect N images of power grid workers from left and right perspectives, so as to obtain a set of left-perspective worker images. And right-view operator image collection in, represents the nth left-view operator image, represents the nth right-view operator image, and calibrates the binocular camera to obtain the baseline distance B and focal length f;
[0008] Step 2: Build a self-supervised monocular disparity estimation network, including: a monocular disparity estimation network based on MiDaS, a left spatial deformation network STN l , right space deformation network STN r , and designed a self-supervised stereo loss function to train the network;
[0009] Step 2.1: Take the nth left-view operator image Input into the MiDaS-based monocular disparity estimation network to obtain the nth left disparity map and the nth right disparity map and will and Input to STN r The nth reconstructed right-view operator image is obtained At the same time and Input to STN l Get the nth reconstructed left-view operator image
[0010] Step 2.2: Construct the reconstruction loss of the nth left-view operator image through formula (1): And the image reconstruction loss of the right-view operator
[0011]
[0012] In formula (1), Loss ssim is the structural similarity loss, α is the weighting coefficient, H, W represent the height and width of the image, (i, j) represents the pixel coordinate point;
[0013] The parallax smoothing loss of the nth left-view operator image is constructed by formula (2): And the parallax smoothing loss of the right-view operator image
[0014]
[0015] In formula (2), ▽ is the gradient operator;
[0016] The parallax consistency loss of the nth left-view operator image is constructed by formula (3): And the parallax consistency loss of the right-view operator image
[0017]
[0018] Step 2.3: Establish the nth total loss function L of the self-supervised dual-purpose through formula (4): n ;
[0019]
[0020] In formula (4), λ1, λ2, λ3 are three weighting coefficients;
[0021] Worker image collection based on left perspective And right-view operator image collection The self-supervised monocular disparity estimation network is trained using the gradient descent algorithm, and the total loss function is calculated to update the network parameters. When the number of training iterations reaches the set number or the total loss error is less than the set threshold, the training stops, thereby obtaining the trained self-supervised monocular disparity estimation network;
[0022] Step 3: Using the monocular disparity map to perform filtering optimization operation on the binocular disparity map;
[0023] Step 3.1: Use the trained MiDaS-based monocular disparity estimation network to estimate the nth left-view operator image. Perform disparity estimation and output Corresponding monocular disparity map of power grid operators
[0024] Step 3.2: Use the SGBM semi-global block matching algorithm to and Estimation is performed to obtain the nth binocular power grid operator disparity map d n ;
[0025] Step 3.3: Use formula (5) to calculate d n Perform adaptive normalization processing to obtain the nth normalized disparity map
[0026]
[0027] In formula (5), μ(·) and σ(·) are the mean and standard deviation operations, respectively;
[0028] Step 3.4: As a guide map, the nth binocular power grid operator disparity map d n Perform guided filtering to obtain the nth guided filtered binocular disparity map g n ;
[0029] Step 4: Detection through YOLOv5 model The coordinates of the operator's position in the binocular disparity map g after guiding filtering n Extract the operator disparity map p of the corresponding coordinate area n , and then the disparity map p n Divide it into M×M local pixel blocks, and transform the disparity map p n The bth local pixel block in is denoted as b∈[1,M 2 ];
[0030] The b-th local pixel block is given by equation (6) Conduct an assessment and obtain the corresponding score Thus, the score corresponding to each local pixel block is obtained;
[0031]
[0032] Select the pixel block with the highest score among the M×M local pixel blocks And calculate the pixel block The mean parallax of So we can calculate it by formula (7): The distance coordinate D of the operator n :
[0033]
[0034] An electronic device of the present invention includes a memory and a processor, wherein the memory is used to store a program that supports the processor to execute the parallax estimation and positioning method for power grid operators, and the processor is configured to execute the program stored in the memory.
[0035] The present invention provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and the computer program executes the steps of the method for parallax estimation and positioning of power grid operators when the computer program is executed by a processor.
[0036] Compared with the prior art, the present invention has the following beneficial effects:
[0037] 1. Compared with the supervised monocular disparity estimation method, the present invention designs a self-supervised binocular loss function to train the monocular disparity estimation model without providing a monocular disparity label, thereby being able to adapt to the application requirements of actual scenes.
[0038] 2. The present invention combines the advantages of monocular and binocular disparity estimation, uses the monocular disparity map to perform adaptive normalization and guided filtering operations on the binocular disparity estimation results, and improves the estimation performance of the binocular disparity estimation in depth discontinuous areas.
[0039] 3. In order to effectively obtain the distance coordinates of the power grid workers, the present invention divides and evaluates the workers' parallax pixel blocks under the binocular perspective, extracts effective parallax pixel values, thereby reducing the background parallax interference of the power grid workers and improving the target positioning accuracy of the workers. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is a general flow chart of the parallax estimation and positioning method for power grid operators in the present invention;
[0041] Figure 2 This is a flow chart of the self-supervised training of the monocular disparity estimation model in the present invention;
[0042] Figure 3 This is a flow chart of the joint filtering of monocular and binocular disparity maps in the present invention;
[0043] Figure 4 This is a flow chart of target positioning of power grid operators in the present invention. DETAILED DESCRIPTION
[0044] In this embodiment, a method for disparity estimation and positioning of power grid operators based on monocular and binocular vision collaboration is designed based on the consistency of binocular disparity, and the binocular disparity estimation performance is improved by using a monocular disparity map, thereby reducing the background disparity interference of power grid operators and improving the target positioning accuracy of operators. Specifically, Figure 1 As shown, the method is performed in the following steps:
[0045] Step 1: Use a binocular camera to collect N images of power grid workers from left and right perspectives, so as to obtain a set of left-perspective worker images. And right-view operator image collection in, represents the nth left-view operator image, Indicates the nth right-view operator image, and calibrates the binocular camera to obtain the baseline distance B and focal length f; after the camera is calibrated, the left and right view images are on the same horizontal line by default;
[0046] Step 2: Build a self-supervised monocular disparity estimation network, including: a monocular disparity estimation network based on MiDaS, a left spatial deformation network STN l , right space deformation network STN r , and design a self-supervised binocular loss function to train the network; Figure 2 As shown, in this embodiment, the depth estimation model MiDaS is used as a monocular disparity estimation network to obtain scene disparity, and the spatial deformation network (Spatial Transformer Network) STNl 、STN r To achieve the conversion of left and right perspective operator images and disparity, and finally use the self-supervised binocular loss function to train the monocular disparity estimation network;
[0047] Step 2.1: Take the nth left-view operator image Input into the MiDaS-based monocular disparity estimation network to obtain the nth left disparity map and the nth right disparity map and will and Input to STN r The nth reconstructed right-view operator image is obtained At the same time and Input to STN l Get the nth reconstructed left-view operator image
[0048] Step 2.2: Construct the reconstruction loss of the nth left-view operator image through formula (1): And the image reconstruction loss of the right-view operator
[0049]
[0050] In formula (1), Loss ssim is the structural similarity loss, α is the weighting coefficient, H, W represent the height and width of the image, (i, j) represents the pixel coordinate point; in this embodiment, according to the consistency of the binocular perspective, the monocular disparity estimation network MiDaS is constrained by reconstructing the left and right perspectives to obtain effective left and right disparity maps, and the weighting coefficient α is 0.85;
[0051] The parallax smoothing loss of the nth left-view operator image is constructed by formula (2): And the parallax smoothing loss of the right-view operator image In this embodiment, the disparity map is regularized by using the left and right viewing angle images, so that the edge contour features of the disparity map can be effectively preserved;
[0052]
[0053] In formula (2), ▽ is the gradient operator;
[0054] The parallax consistency loss of the nth left-view operator image is constructed by formula (3): And the parallax consistency loss of the right-view operator image In this embodiment, the parallax consistency loss can be established by obtaining the offset of the left and right viewing angles, thereby ensuring the consistency of the left and right parallaxes;
[0055]
[0056] Step 2.3: Establish the nth total loss function L of the self-supervised dual-purpose through formula (4): n ;
[0057]
[0058] In formula (4), λ1, λ2, λ3 are three weighting coefficients;
[0059] Worker image collection based on left perspective And right-view operator image collection The self-supervised monocular disparity estimation network is trained using the gradient descent algorithm, and the total loss function is calculated to update the network parameters. When the number of training iterations reaches the set number or the total loss error is less than the set threshold, the training stops, thereby obtaining the trained self-supervised monocular disparity estimation network;
[0060] Step 3: Using the monocular disparity map to perform filtering optimization operation on the binocular disparity map;
[0061] Step 3.1: Use the trained MiDaS-based monocular disparity estimation network to estimate the nth left-view operator image. Perform disparity estimation and output Corresponding monocular disparity map of power grid operators In this embodiment, during the training phase of the MiDaS monocular disparity estimation network, the left-view operator image is used as input, and the left and right disparity maps are obtained at the same time. The left and right viewpoints are transformed with the help of the spatial deformation network, and the loss is calculated for training. In the test phase, only the left disparity map, i.e., the monocular disparity map of the power grid operator from the left viewpoint, is obtained from the output of the MiDaS monocular disparity estimation network.
[0062] Step 3.2: Use the SGBM semi-global block matching algorithm to and Estimation is performed to obtain the nth binocular disparity map d of the power grid operator n ;
[0063] Step 3.3: Use formula (5) to calculate d n Perform adaptive normalization processing to obtain the nth normalized disparity map
[0064]
[0065] In formula (5), μ(·) and σ(·) are the mean and standard deviation operations respectively; Figure 3 As shown, in this embodiment, the advantages of monocular and binocular disparity are combined to improve the disparity estimation method, the binocular disparity is adaptively normalized through the monocular disparity map, and the normalized disparity map is used as a guide map to filter and optimize the original binocular disparity map, thereby improving the effect of disparity estimation of operators in depth discontinuous areas;
[0066] Step 3.4: As a guide map, the nth binocular power grid operator disparity map d n Perform guided filtering to obtain the nth guided filtered binocular disparity map g n ;
[0067] Step 4: Detection through YOLOv5 model The coordinates of the operator's position in the binocular disparity map g after guiding filtering n Extract the operator disparity map p of the corresponding coordinate area n , and then the disparity map p n Divide it into M×M local pixel blocks, and transform the disparity map p n The bth local pixel block in is denoted as b∈[1,M 2 ];
[0068] The b-th local pixel block is given by equation (6) Conduct an assessment and obtain the corresponding score Thus, the score corresponding to each local pixel block is obtained;
[0069]
[0070] Select the pixel block with the highest score among the M×M local pixel blocks And calculate the pixel block The mean parallax of So we can calculate it by formula (7): The distance coordinate D of the operator n :
[0071]
[0072] After obtaining the operator's disparity map, the operator's distance coordinates still need to be calculated. However, the operator's disparity will be affected by the background. The deviation between the operator and the background in different areas is large. Therefore, it is necessary to extract effective disparity pixels from the operator's disparity map. Figure 4The target positioning process of power grid operators is introduced. By dividing and evaluating the parallax pixel blocks of operators and extracting effective parallax pixel values, the background parallax interference of power grid operators is reduced and the target positioning accuracy of operators is improved.
[0073] In this embodiment, an electronic device includes a memory and a processor, wherein the memory is used to store a program that supports the processor to execute the above method, and the processor is configured to execute the program stored in the memory.
[0074] In this embodiment, a computer-readable storage medium stores a computer program on the computer-readable storage medium, and the computer program executes the steps of the above method when executed by a processor.
Claims
1. A parallax estimation and positioning method for power grid operators based on monocular and binocular vision collaboration, characterized in that: The steps are as follows: Step 1: Use a binocular camera to collect N images of power grid workers from left and right perspectives, so as to obtain a set of left-perspective worker images. And right-view operator image collection in, represents the nth left-view operator image, represents the nth right-view operator image, and calibrates the binocular camera to obtain the baseline distance B and focal length f; Step 2: Build a self-supervised monocular disparity estimation network, including: a monocular disparity estimation network based on MiDaS, a left spatial deformation network STN l , right space deformation network STN r , and designed a self-supervised stereo loss function to train the network; Step 2.1: Take the nth left-view operator image Input into the MiDaS-based monocular disparity estimation network to obtain the nth left disparity map and the nth right disparity map and will and Input to STN r The nth reconstructed right-view operator image is obtained At the same time and Input to STN l Get the nth reconstructed left-view operator image Step 2.2: Construct the reconstruction loss of the nth left-view operator image through formula (1): And the image reconstruction loss of the right-view operator In formula (1), Loss ssim is the structural similarity loss, α is the weighting coefficient, H, W represent the height and width of the image, (i, j) represents the pixel coordinate point; The parallax smoothing loss of the nth left-view operator image is constructed by formula (2): And the parallax smoothing loss of the right-view operator image In formula (2), is the gradient operator; The parallax consistency loss of the nth left-view operator image is constructed by formula (3): And the parallax consistency loss of the right-view operator image Step 2.3: Establish the nth total loss function L of the self-supervised dual-purpose through formula (4): n ; In formula (4), λ1, λ2, λ3 are three weighting coefficients; Worker image collection based on left perspective And right-view operator image collection The self-supervised monocular disparity estimation network is trained using the gradient descent algorithm, and the total loss function is calculated to update the network parameters. When the number of training iterations reaches the set number or the total loss error is less than the set threshold, the training stops, thereby obtaining the trained self-supervised monocular disparity estimation network; Step 3: Using the monocular disparity map to perform filtering optimization operation on the binocular disparity map; Step 3.1: Use the trained MiDaS-based monocular disparity estimation network to estimate the nth left-view operator image I l n Perform disparity estimation and output Corresponding monocular disparity map of power grid operators Step 3.2: Use the SGBM semi-global block matching algorithm to and Estimation is performed to obtain the nth binocular disparity map d of the power grid operator n ; Step 3.3: Use formula (5) to calculate d n Perform adaptive normalization processing to obtain the nth normalized disparity map In formula (5), μ(·) and σ(·) are the mean and standard deviation operations, respectively; Step 3.4: As a guide map, the nth binocular power grid operator disparity map d n Perform guided filtering to obtain the nth guided filtered binocular disparity map g n ; Step 4: Detection through YOLOv5 model The coordinates of the operator's position in the binocular disparity map g after guiding filtering n Extract the operator disparity map p of the corresponding coordinate area n , and then the disparity map p n Divide it into M×M local pixel blocks, and transform the disparity map p n The bth local pixel block in is denoted as b∈[1,M 2 ]; The b-th local pixel block is given by equation (6) Conduct an assessment and obtain the corresponding score Thus, the score corresponding to each local pixel block is obtained; Select the pixel block with the highest score among the M×M local pixel blocks And calculate the pixel block The mean parallax of So we can calculate it by formula (7): The distance coordinate D of the operator n :
2. An electronic device, comprising a memory and a processor, characterized in that: The memory is used to store a program that supports the processor to execute the parallax estimation and positioning method for power grid workers as described in claim 1, and the processor is configured to execute the program stored in the memory.
3. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for parallax estimation and positioning of power grid operators according to claim 1 are executed.
