A binocular vision stereo matching method based on deconvolutional neural network
By using the twin convolutional neural network model and semi-global matching algorithm that first deconvolves and then convolves in binocular vision stereo matching, the problem of image input block size limitation is solved and the accuracy and robustness of the matching results are improved. , achieving more sufficient network training and information acquisition.
Patent Information
- Application Number
- CN202011143651.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-23
- Publication Date
- 2024-08-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing binocular vision stereo matching methods have limitations in the size of the image input block, resulting in limited matching accuracy, increased computation, smaller disparity map size, reduced depth information, and insufficient network training.
Using a twin convolutional neural network model that performs deconvolution first and then convolution, the size of the input image block is expanded through deconvolution and the information resolution is enhanced. The semi-global matching algorithm and median filtering are combined in post-processing to generate the optimal Excellent disparity map.
It improves the resolution of image input and the information acquisition capability of the convolutional network, enhances the robustness and accuracy of the matching results, reduces computational noise, and improves the training effect of the network.
Smart Images

Figure CN114494025B
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of image processing and relates to a binocular vision stereo matching method. Background Art
[0002] Jure Zbontar et al. proposed using convolutional networks to calculate matching errors and then match image blocks in CVPR 2015. The input is a 9x9 grayscale image block, and a 5x5 convolution kernel is used to convolve the image block. Then, the network layer uses a 1x1 convolution kernel for convolution operations. The article uses AD (Absolute Difference) to calculate the matching error, and combines cross-cost aggregation and sub-pixel enhancement methods to optimize the disparity. The article finally achieved an error rate of 2.61% in the KITTY dataset. Xiao Liu et al. added dilated convolution to the network structure and connected features of different scales, and proposed a new convolutional network structure called MC-DCNN. The advantage of dilated convolution compared to ordinary convolution is that it can obtain a larger receptive field while using the same convolution kernel size, so that each convolution output contains a larger range of information. Xiao Liu et al. conducted experiments on the Middlebury dataset and achieved good results. Luo et al. proposed a more effective deep learning method in CVPR2016. They abandoned the ordinary convolutional network structure and used a twin convolutional network, that is, the left and right network layers shared weights. At the same time, the input of the network layer was changed. Instead of using the traditional image block input, the standard disparity map was used as the benchmark to select coordinates to generate the left image input block. According to the coordinates in the left image block and the pixel values in the disparity map, the coordinates in the right image were found, and the same length was extended to the left and right as the right image input block. Luo et al. finally achieved good matching results. In the KITTI2015 dataset, the 2-pixel error was 11.67%, the 3-pixel error was 8.97%, and the 4-pixel error was 7.62%. The single-image matching time was 0.34s. In view of the fact that occlusion, boundaries and low-texture areas are difficult to match in deep learning, Feng et al. combined semi-global matching, sub-pixel interpolation, median filter and other methods and used larger image blocks in the network structure, making the stereo matching results more robust in low-texture areas and repeated texture areas. The experimental results in the article show that they were able to achieve an error rate of 4.42% in the KITTI2015 dataset and it only took 0.8 seconds to complete the matching of a pair of images.
[0003] In most of the above methods, it is mentioned that the size of the image input block will directly affect the matching accuracy. Feng et al. also conducted experiments to verify that, however, unlimited increase in the size of the input image block does not allow the matching rate to continue to increase. It will also increase the amount of calculation and the number of parameters of the network model. In addition, in the generated disparity map, the larger the image block size, the smaller the size of the disparity map, and the less depth information is obtained. In addition, during the training process, the above method will ultimately place the disparity judgment in the last layer, ignoring the information in other convolution processes, and the network cannot be fully trained. Summary of the invention
[0004] The purpose of the present invention is to overcome the defects in the prior art and provide a binocular vision stereo matching method based on a deconvolutional neural network.
[0005] To achieve the above object, the technical solution adopted by the present invention is:
[0006] Build a twin convolutional neural network model that performs deconvolution first and then convolution;
[0007] The optimal disparity value is obtained, and after post-processing optimization, the final disparity map is generated.
[0008] As a preferred embodiment of the present invention, the convolutional neural network model first deconvolutions the input image block; then convolutions it through the convolutional layers in sequence; performs dot product operations on the convolutional layer feature planes generated by the left and right network models of each layer, and superimposes the calculated matching costs on the last layer.
[0009] Further preferably, the output size calculation formula of the image block after passing through the deconvolution layer is as follows:
[0010] o = s(i-1)-2p+k;
[0011] The output size calculation formula after the convolution layer is as follows:
[0012]
[0013] Among them, o represents the output feature map size, i represents the input feature map size, s represents the step size, p represents the padding size, and k represents the convolution kernel size.
[0014] Further preferably, a semi-global matching algorithm is used in combination with the calculated matching cost to obtain an optimal disparity value.
[0015] Further preferably, the semi-global matching algorithm is a four-path aggregation matching algorithm.
[0016] Further preferably, the post-processing optimization refers to performing median filtering on the generated disparity map to reduce noise.
[0017] Further preferably, the training set of the convolutional neural network model is constructed based on the KITTI201 dataset.
[0018] The present invention brings the deconvolution operation to the beginning of the network, uses the form of a convolutional network, does not perform weight sharing, accelerates the convergence of the network, performs dot product operation on the convolution results obtained by each convolutional layer, obtains the matching cost, and combines post-processing algorithms such as SGM in post-processing to obtain the optimal disparity map. Adding a deconvolution structure to the front of the network can allow the network to be more fully trained, and can also increase the image input size. Compared with simply increasing the image patch size, deconvolution can introduce a parameterized adjustment method to the beginning, increase the size and resolution of the convolutional network input image, so that the convolutional network can learn more information. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 Flow chart of a binocular vision stereo matching method based on a deconvolutional neural network in an embodiment of the present invention;
[0020] Figure 2 is a schematic diagram of a sample of the KITTI2015 dataset (a) is the left image, and (b) is the right image;
[0021] Figure 3 Select a schematic diagram for the image;
[0022] Figure 4 Schematic diagram of the twin convolutional neural network model structure;
[0023] Figure 5 Schematic diagram of an image block passing through a deconvolution layer;
[0024] Figure 6 Schematic diagram of an image block passing through a convolutional layer;
[0025] Figure 7 Schematic diagram of the deconvolution process;
[0026] Figure 8 It is the OneHot weight distribution diagram;
[0027] Fig. 9 is the stereo matching weight distribution map;
[0028] Fig.10 is the path aggregation graph;
[0029] Fig.11 Fill map for invalid parallax. DETAILED DESCRIPTION
[0030] In order to facilitate the understanding of the present invention, the present invention is described in more detail below in conjunction with the accompanying drawings and specific embodiments. Preferred embodiments of the present invention are provided in the accompanying drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described in this specification. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present invention more thorough and comprehensive.
[0031] The present invention provides a binocular vision stereo matching method based on deconvolution neural network, the process is as follows Figure 1 As shown, the specific steps are as follows:
[0032] 1. Based on the KITTI2015 dataset, a binocular stereo matching training set and test set based on a convolutional neural network are constructed. According to the standard disparity map provided by KITTI2015, points with valid disparity value positions, that is, pixels with non-zero pixel values in the standard disparity map, are selected to construct the dataset.
[0033] The convolutional neural network performs disparity calculation by selecting local pixel blocks for matching, which is a local matching method. The image size in the KITTI2015 binocular dataset is 1242x375. The KITTI2015 dataset sample is shown in Figure 2 (a) and (b). The images in the dataset cannot be directly used as the input of the convolutional neural network, so the original images need to be processed:
[0034] (1) Select new samples
[0035] First, select the pixel point p whose pixel value is not 0 in the left disparity map (disp_noc_*) of the KITTI dataset, and record the image coordinates (x p ,y p ), then extract the image block centered at pixel p in the left image, and determine the size of the left input image block to be 37x37. In the right image, find pixel q according to the pixel value in the real disparity map, and record the image coordinates of the pixel (x q ,y q ), select an image block of size 37x237 pixels to the right with pixel q as the center. The schematic diagram of the selected image is as follows Figure 3 shown.
[0036] (2) Image sample processing
[0037] In the KITTI2015 dataset, the disparity map is saved in png format, and the data type is uint16. In the disparity map, a point with an image grayscale value of 0 is an invalid pixel, that is, the point has no real disparity value.
[0038] The disparity map processing is expressed as follows:
[0039] DispValue(x,y)=((float)Disp(x,y)) / 256.0
[0040] ValidValue(x,y)=DispValue(x,y)>0
[0041] Where Disp(x, y) represents the original disparity map, DispValue(x, y) represents the processed disparity map, and ValidValue(x, y) represents the valid disparity map.
[0042] Since the pixel value range of the processed disparity map is [0, 255], it still cannot be directly used as the input of the network, so the image needs to be normalized and used as the network input:
[0043] I={I1,I2,…,I N}
[0044] Among them, I is the input image, N is the number of pixels in the image, and O is the normalized output image.
[0045] 2. Build a network model that first deconvolution and then convolution. The model structure is as follows Figure 4 As shown in the figure, the input image block size is enlarged through deconvolution operation to enhance the input information of the image block; then convolution is performed through the convolution layer in sequence; the convolution layer feature plane generated by each layer of the left and right network model is dot-producted, and the calculated matching cost is superimposed on the last layer.
[0046] Deconvolution is introduced at the beginning of the convolutional network, followed by convolution. Deconvolution can play the role of upsampling, and the image size after convolution is larger than the image size before convolution. After the image is deconvolved, the corresponding calculation information will not be lost, and the resolution of the image can be improved. In the convolution process, the 3D convolution vectors of each convolution part are multiplied, and a 1x1x201 vector is generated in each layer and superimposed on the last layer. In the last layer of the network, the cross entropy function is used to calculate the loss, and the Softmax function is used to calculate the probability of each label value and compare it with the fixed label value.
[0047] The calculation process of deconvolution is similar to that of convolution, and the convolution process can be expressed as follows:
[0048]
[0049]
[0050] The deconvolution process can be expressed as:
[0051] D=Padding(I)
[0052]
[0053] Where I represents the input image, D d represents the output image after deconvolution, K represents the convolution kernel, d represents the deconvolution rate, and Padding represents the padding function.
[0054] The relationship for calculating the size of the deconvolution network is:
[0055] o=s(i-1)-2p+k
[0056] The deconvolved image is Figure 5 shown.
[0057] The relationship between the convolutional network size calculation is:
[0058]
[0059] The image after the convolution layer is Figure 6 shown.
[0060] Among them, o represents the output feature map size, i represents the input feature map size, s represents the step size, p represents the padding size, and k represents the convolution kernel size.
[0061] The overall convolutional network structure after adding deconvolution is shown in the table:
[0062]
[0063]
[0064] 1Deconv(5)&4Conv represents a deconvolution layer with a convolution kernel size of 5, 4Conv represents 4 convolution layers, and Conv9 represents a convolution layer volume.
[0065] The convolution process can be expressed as:
[0066] Y=CX
[0067] Among them, X represents the input image, Y represents the output image, and C represents the matrix in the convolution process;
[0068] Deconvolution can be expressed as:
[0069] C T Y=X
[0070] At this time, Y represents the input image and X represents the input image.
[0071] The deconvolution process is as follows Figure 7 As shown, the explanation is as follows:
[0072] I d =[i 11 ,i 12 ,i 21 ,i 22 ] T
[0073] O=[o 11 ,o 12 ,o 13 ,o 21 ,o 22 ,o 23 ,o 31 ,o 32 ,o 33 ] T
[0074]
[0075] W d I d =O
[0076] Among them, O represents the output image, I d represents the input image, W d is the weight matrix.
[0077] After the convolution layer, let the convolution layer weight matrix be W c , then the input into the convolutional network layer is:
[0078] I c =W c W d I d
[0079] The dot product calculation formula is as follows:
[0080]
[0081]
[0082]
[0083]
[0084]
[0085] Among them, A left is the left convolutional network output, B right is the output of the right convolutional network.
[0086] 3. Import the training sets constructed in step 1 into the twin convolutional neural network model built in step 2 to train the network model.
[0087] In network training, the cross loss entropy is minimized according to the weight, where w represents the weight and y represents the weight. i represents the image ordinate, represents the standard disparity value, p gt (y i ) is the target smooth distribution, λ1=0.5, λ2=0.2, λ3=0.05.
[0088]
[0089]
[0090] It can also be compared to the impulse function. For image recognition methods with clear targets, the result of image recognition is attributed to 01 judgment. In stereo matching, the distribution of weights can be adjusted within an appropriate error range, such as Figure 8 , Fig. 9 shown.
[0091] 4. The trained neural network structure can effectively extract the corresponding image block feature description of the left and right image points. L (p) and Charac R (q), perform dot product operation on these two feature descriptions, and use the WTA (winner-take-all) principle to select the best disparity value to generate a disparity map.
[0092] Charac L (p) represents a 1×1×64 dimensional vector, Charac R (p) represents a 1×201×64 dimensional vector.
[0093] After the A-DCNN network, each pixel will correspond to 200 matching costs. At this time, the WTA (Winner-Take-All) principle can be directly selected to directly generate the disparity map, but the disparity map generated in this way is relatively rough.
[0094] Therefore, it is necessary to further combine the generated matching cost with the semi-global matching algorithm to optimize the selection of disparity. The cost aggregation in the semi-global matching algorithm mainly adopts the idea of dynamic programming and establishes a global energy function E(d):
[0095]
[0096] D represents the possible disparity value of each pixel;
[0097] p,q represents a pixel in the image;
[0098] N pRefers to the neighboring pixels of pixel p, which are generally considered to be 8-connected. Here, 4 directions are used;
[0099] C(p,D p ) refers to the possible disparity value of the current pixel point D p When , the matching cost value of the pixel point;
[0100] P1 is a penalty coefficient, which is applicable to those pixels whose disparity values among the neighboring pixels of pixel p differ from the disparity value of p by 1, and P2 is a penalty coefficient, which is applicable to those pixels whose disparity values among the neighboring pixels of pixel q differ from the disparity value of q by more than 1;
[0101] T[.] function, returns 1 if the argument in the function is true, otherwise it returns 0.
[0102] In order to reduce the time complexity and space complexity of the calculation, the present invention adopts the idea of dynamic programming and replaces the idea of global cost by aggregating local matching costs through four paths.
[0103]
[0104] P1 and P2 represent penalty coefficients, which are 30 and 160 in this invention. Cost(p,d) represents the matching cost directly obtained from the convolutional network, with dimensions of H×W×d, where H is the image height, W is the image width, and d is the disparity range. s represents the path direction. If the aggregation direction is downward, ps represents the previous pixel, such as Fig.10 As shown, L r (p,d) represents the aggregation cost.
[0105] In the left-right consistency detection, the present invention adopts an internal inspection method to complete it. The cost matrix of the right image is generated according to its own disparity range through the aggregated cost matrix of the left image, and the optimal disparity value is selected according to the WTA principle. If the pixels at the corresponding positions of the left and right disparity images differ by less than 1 pixel, they are retained, otherwise they are regarded as invalid disparity values.
[0106] The invalid disparity value filling adopts the eight-ray filling method, which means that the invalid pixel is taken as the center, rays are emitted in eight angles to the surrounding areas, the first valid pixel encountered by each ray is collected, and the minimum value of these eight pixel values is taken and assigned to the current invalid pixel, such as Fig.11 shown.
[0107] Finally, the median filtering method is used to further fit the disparity map and reduce the sharp noise in the local area of the image.
[0108] Median filtering is similar to convolution operation. It is a nonlinear signal processing technology based on statistical theory that can effectively suppress noise. The basic principle is to replace the pixel values of all pixels in the window neighborhood of a certain point with the median value. It has the best suppression effect on pulse-level salt and pepper noise. While suppressing noise, it will not cause a serious blurring effect on the edges.
Claims
1. Binocular vision stereo matching method based on deconvolution neural network, It is characterized in that include: Construct binocular stereo matching training and test sets based on convolutional neural networks, including: (1) First, select a pixel point p whose pixel value is not 0 in the left disparity map (disp_noc_*) of the KITTI dataset and record the image coordinates (x p ,y p ), then extract the image block centered at pixel p in the left image, and determine the size of the left input image block to be 37x37; in the right image, find pixel q according to the pixel value in the real disparity map, and record the pixel image coordinates (x q ,y q ), select an image block with a size of 37x237 pixels to the right with the q pixel point as the center; (2) Perform disparity map processing on image samples: DispValu(ex,y)=((float)Disp(x,y)) / 256.0 ValidValu(ex,y)=DispValu(ex,y)>0 Where Disp(x, y) represents the original disparity map, DispValu(ex, y) represents the processed disparity map, and ValidValu(ex, y) represents the valid disparity map; (3) Normalize the image and use it as network input: Where I is the input image, N is the number of pixels in the image, and O is the normalized output image. A twin convolutional neural network model is built that first performs deconvolution and then convolution; and the model is trained using the constructed training set; The twin convolutional neural network model first deconvolves the input image block, then convolves it through the convolutional layers in sequence, performs dot product operations on the convolutional layer feature planes generated by the left and right network models of each layer, and superimposes the calculated matching costs on the last layer; The semi-global matching algorithm is combined with the calculated matching cost to obtain the optimal disparity value, and the final disparity map is generated after post-processing optimization.
2. The binocular vision stereo matching method based on deconvolutional neural network according to claim 1, It is characterized in that The output size of the image block after passing through the deconvolution layer is calculated as follows: 0 = s(i-1)-2p+k; The output size calculation formula after the convolution layer is as follows: Among them, o represents the output feature map size, i represents the input feature map size, s represents the step size, p represents the padding size, and k represents the convolution kernel size.
3. The binocular vision stereo matching method based on deconvolutional neural network according to claim 1, It is characterized in that The semi-global matching algorithm is a four-path aggregation matching algorithm.
4. The binocular vision stereo matching method based on deconvolutional neural network according to claim 1, It is characterized in that The post-processing optimization refers to performing median filtering on the generated disparity map.
