Patent Publication Number: US-2022215569-A1

Title: Acceleration method of depth estimation for multiband stereo cameras

Description:
TECHNICAL FIELD 
     The present invention belongs to the field of image processing and computer vision, and relates to multiband stereo depth estimation and an acceleration method thereof, and particularly to an acceleration method of a depth estimation process for multiband stereo cameras. 
     BACKGROUND 
     The binocular stereo vision technology based on visible light band is developed to be relatively mature. Visible light imaging has rich contrast, color and shape information, so matching information between binocular images can be obtained accurately and quickly so as to obtain scenario depth information. However, visible light band imaging has defects, and the imaging quality thereof is greatly reduced, for example, in strong light, fog, rain, snow or night, which affects the matching precision. Therefore, the establishment of a multiband stereo vision system by using the complementarity of different band information sources is an effective way to realize three-dimensional reconstruction of space in special environments. 
     For example, a visible light band binocular camera and an infrared band binocular camera are used to constitute a multiband stereo vision system, and the advantage of not being affected by fog, rain, snow and light of infrared imaging is used to make up for the deficiency of visible light band imaging so as to obtain more complete and precise depth information. 
     In the multiband information complementary system, it is critical to fuse the multiband information to obtain the final depth information. A mainstream multiband information fusion mode is the fusion of point cloud information obtained in multiple bands, i.e., the infrared binocular image and the visible light binocular image as well as the calibration data of the infrared binocular camera and the calibration data of visible light are used for respectively generating point cloud corresponding to the infrared band and the visible light band and the fusion of the multiband binocular point cloud is explored by means of rigid transformation between an infrared unit and a visible light unit and various point cloud registration and fusion algorithms (Research on Integration Algorithm of Infrared and Visible 3D Point Cloud). The above method respectively matches the binocular cameras in different bands, maps the images into three-dimensional information according to matching results, and fuse the information on a point cloud level, thereby greatly increasing the calculation amount and resource consumption and making it difficult to apply to actual products. 
     In order to reduce the calculation consumption, the researchers have studied and improved the multiband stereo imaging system composed of infrared and visible light bands. For example, Dr. Tong Ying fused infrared and visible light information at a two-dimensional image level, used infrared band information to repair and enhance the missing visible light band information, and conducted stereo matching and three-dimensional reconstruction on the basis of the generated fusion image (Research on Several Key Techniques of 3D Reconstruction Based on Infrared and Visible Light Image Fusion [D], Tianjin University, 2015). The key step of binocular depth estimation is to obtain the position, i.e., binocular matching information, of each pixel of the left  FIG. 1  in the right figure R according to pixel intensity and relative position information between pixels, and the corresponding pixels of binocular images need to satisfy strict geometrical relationships so that the binocular depth information can be obtained according to the binocular matching information. Although the above method for fusing the visible light image and the infrared image at the two-dimensional image level recovers the approximate structure of the image and the pixel intensity information, the errors and uncertainty factors in the fusion process may change the geometrical relationships between matching pixel pairs. In addition, because the slight change of the pixel intensity and the slight change of the local structure caused by the uncertainty factors of the fusion may lead to the increase of the matching cost among the corresponding pixel points, the matching precision is influenced. 
     In view of the above situation, to avoid the influence of deep fusion on the matching precision, the present invention proposes a multiband depth estimation method. Each band image is subjected to stereo matching before image fusion; secondly, multiband information fusion is conducted at a disparity level according to confidence; and finally, disparity is converted into depth information. In order to ensure calculation efficiency, the present invention proposes an acceleration strategy according to the proposed depth estimation method for multiband stereo cameras, i.e., a strategy of energy propagation conducted after compressing images to be matched and compressing initial matching cost. Image compression and sparse propagation ensure disparity accuracy and simultaneously greatly reduce calculation overhead. In addition, depth information fusion does not need the operation of conversion between two dimensions and three dimensions and projection mapping optimization, and greatly increases the efficiency compared with fusion on the point cloud information. 
     SUMMARY 
     The present invention aims to overcome the defects of the prior art and provides a depth estimation method for multiband stereo cameras and an acceleration strategy thereof, which reduces calculation overhead by compressing matched images and conducting sparse propagation, and fuses disparity diagrams obtained by sensors under different modes to obtain all-weather, more complete and more accurate depth information. 
     The specific solution comprises the following steps: 
     An acceleration method of depth estimation for multiband stereo cameras comprises the following steps: 
     step 1, calibrating respective internal and external parameters of multiband binocular cameras, wherein the internal parameters comprise a focal length and an optical center, and the external parameters comprise rotation and translation; correcting binocular images outputted by the binocular cameras in different bands into a parallel equipotential relationship; and jointly calibrating the multiband binocular cameras to obtain position relationship parameters among devices of different bands, comprising rotation and translation; 
     step 2, registering the multiband binocular cameras to obtain a coordinate conversion matrix of corresponding pixels among images collected by the devices of different bands, i.e., a homography matrix; denoising a binocular image pair in each band; and conducting longitudinal compression on the image pair in each band to save matching efficiency; 
     step 3, matching the binocular images according to a semi-global matching (SGM) method to obtain respective initial cost diagrams of the multiband binocular images; compressing the initial cost diagrams to increase propagation efficiency; conducting energy propagation on the compressed sparse cost diagrams to correct and optimize error matching; finding a disparity corresponding to minimum energy for each pixel position according to an energy propagation diagram to obtain a disparity diagram; 
     step 4, optimizing the disparity diagram, recovering the optimized disparity into an original scale through an upsampling method, and obtaining a final depth map according to a disparity fusion method. 
     The present invention has the following beneficial effects: 
     The present invention proposes an acceleration method of depth estimation for multiband stereo cameras based on multiband binocular depth estimation to ensure calculation efficiency, satisfy real-time requirements of practical application and simultaneously obtain a high-quality fused depth image. The present invention has the following advantages: 
     1 The present invention proposes an acceleration method of depth estimation for stereo cameras. In the process of depth estimation, during binocular stereo matching in each band, through compression of the matched images, on one hand, parallel equipotential errors caused by binocular image correction can be offset to make the matching more accurate, and on the other hand, calculation overhead is reduced. In addition, before cost aggregation, the cost diagrams are transversely compressed and sparsely matched, thereby reducing the calculation overhead again. 
     2 The present invention proposes an acceleration method of all-weather depth estimation for multiband stereo cameras. The disparity diagram participating in fusion is obtained according to the binocular images of corresponding bands. The strategy of matching first and then disparity fusion reduces the matching error caused by the error of multiband image fusion; the disparity level fusion avoids the calculation consumption of three-dimensional point cloud level fusion; and the disparity estimation speed is further increased through longitudinal compression images and transverse compression cost diagrams. The method can select the accurate information of each band and achieve the purpose of complementary advantages of multiband equipment. 
    
    
     
       DESCRIPTION OF DRAWINGS 
         FIG. 1  is an overall flow chart of a solution; 
         FIG. 2  shows a detailed flow of a disparity fusion module; and 
         FIG. 3  is an effect diagram after disparity fusion. 
     
    
    
     DETAILED DESCRIPTION 
     The present invention fuses the disparity diagrams obtained based on a multiband device according to a multiband sensor device and a binocular disparity estimation method, and calculates distance information according to the triangulation measurement principle and the fused disparity to use the imaging advantages of devices of different bands under different environments. By taking the depth estimation of a pair of visible light binocular cameras and a pair of infrared binocular cameras as an example, a specific implementation solution is as follows: 
       FIG. 1  shows an overall flow of the solution. 
     Step 1, respectively calibrating each lens of a visible light binocular camera and an infrared binocular camera and jointly calibrating respective systems; 
     1.1 Respectively calibrating the infrared camera and the visible light camera by the Zhangzhengyou calibration method to obtain internal parameters such as focal length and principal point position and external parameters such as rotation and translation of each camera. 
     1.2 Jointly calibrating the visible light binocular camera to obtain external parameters such as rotation and translation of two cameras of a binocular camera system; jointly calibrating the infrared binocular camera to obtain external parameters such as rotation and translation of two cameras of an infrared binocular system; correcting output image pairs according to the respective external parameters of the binocular camera system so that the binocular images outputted by the same binocular camera system satisfy the parallel equipotential relationship. 
     Step 2, jointly calibrating and registering the visible light binocular camera system and the infrared camera system; 
     2.1 Jointly calibrating the left lens of the visible light binocular system and the left lens of the infrared binocular system by the Zhangzhengyou calibration method to obtain external parameters such as rotation and translation of the visible light camera and the infrared camera. 
     2.2 Simultaneously shooting the images of checkers in different planes by two pairs of binocular cameras, calculating the positional relationship of the same plane in the visible light image and the infrared image by using RT obtained by joint calibration and the detected checker corners, and representing the positional relationship with a homography matrix H. 
     2.3 Denoising and filtering input images by a Gaussian filtering algorithm. The weight of a Gaussian filtering window is determined by a Gaussian function, formula 1. 
     
       
         
           
             
               
                 
                   
                     h 
                     ⁡ 
                     
                       ( 
                       
                         x 
                         , 
                         y 
                       
                       ) 
                     
                   
                   = 
                   
                     e 
                     
                       - 
                       
                         
                           
                             x 
                             2 
                           
                           + 
                           
                             y 
                             2 
                           
                         
                         
                           2 
                           ⁢ 
                           
                             σ 
                             2 
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   1 
                   ) 
                 
               
             
           
         
       
     
     wherein (x,y) is a point coordinate and a is a standard deviation. The Gaussian function is discretized to obtain a weight matrix, i.e., a Gaussian filter. 
     Through Gaussian filtering, noise can be effectively suppressed and the image is smoothed. Subsequent matching errors caused by the noise are prevented. 
     2.4 Longitudinally compressing the left input image and the right input image, so that on one hand, parallel equipotential errors caused by binocular correction are offset, and on the other hand, matching speed is increased. 
     The longitudinal compression method is: two adjacent rows take a mean value and compressed into one row, i.e., 
         I ( x,y  quotient 2)=( I ( x,y )+ I ( x,y+ 1))/2 
     wherein quotient represents quotient operation. I is an image to be compressed, (x,y quotient 2) is the image coordinate after compression, and (x,y) is the image coordinate before compression. 
     Step 3, 3.1 conducting initial cost calculation. Sliding window matching based on Census features is taken as an example herein to describe the flow of matching cost calculation. 
     A Census feature descriptor of each pixel is obtained. A sliding window is used for search on a scanning line to calculate the cost corresponding to the possible disparity of each pixel, formula 2: 
       Cost d,d∈D     max   ( x,y )= HD (CensusL( x,y ),CensusR( x−d,y ))  (2)
 
     In the formula, HD( ) represents a Hamming distance, and CensusL and CensusR are respectively Census feature descriptors of a left diagram pixel and a right diagram pixel. The output of cost calculation is a tensor of size height(H)×width(W)×maximum disparity(D), i.e., the initial cost diagram. 
     3.2 Transversely compressing the initial cost diagram. Energy propagation needs to select the information of the position similar to the current position in the semi-global as a reference to update the cost of the current position. In order to improve the calculation efficiency, semi-global propagation is changed to sparse propagation, and through experiments, it is found that the operation can reduce the calculation overhead without losing the accuracy. The specific mode is to conduct transverse down-sampling for the initial cost diagram and keep data in alternate columns. 
     3.3 Conducting energy propagation on the sparse cost diagram to obtain an energy diagram and then to obtain the disparity diagram. 
     The energy is described as follows: 
     
       
         
           
             
               
                 
                   
                     
                       E 
                       ⁡ 
                       
                         ( 
                         D 
                         ) 
                       
                     
                     = 
                     
                       
                         
                           ∑ 
                           p 
                         
                         ⁢ 
                         
                           C 
                           ⁡ 
                           
                             ( 
                             
                               p 
                               , 
                               
                                 D 
                                 p 
                               
                             
                             ) 
                           
                         
                       
                       + 
                       
                         
                           ∑ 
                           
                             q 
                             ∈ 
                             
                               N 
                               p 
                             
                           
                         
                         ⁢ 
                         
                           
                             P 
                             1 
                           
                           ⁢ 
                           
                             T 
                             ⁡ 
                             
                               [ 
                               
                                 
                                    
                                   
                                     
                                       D 
                                       p 
                                     
                                     - 
                                     
                                       D 
                                       q 
                                     
                                   
                                    
                                 
                                 = 
                                 1 
                               
                               ] 
                             
                           
                         
                       
                       + 
                       
                         
                           ∑ 
                           
                             q 
                             ∈ 
                             
                               N 
                               p 
                             
                           
                         
                         ⁢ 
                         
                           
                             P 
                             2 
                           
                           ⁢ 
                           
                             T 
                             ⁡ 
                             
                               [ 
                               
                                 
                                    
                                   
                                     
                                       D 
                                       p 
                                     
                                     - 
                                     
                                       D 
                                       q 
                                     
                                   
                                    
                                 
                                 &gt; 
                                 1 
                               
                               ] 
                             
                           
                         
                       
                     
                   
                   ] 
                 
               
               
                 
                   ( 
                   3 
                   ) 
                 
               
             
           
         
       
     
     wherein C(p,D p ) is the cost at position p when the disparity is D p , T[⋅] is an indicator function, and the output is 1 when the input satisfies the conditions within [ ], otherwise, is 0. P 1  and P 2  are penalty terms. D q  is a disparity value at position q. 
     According to formula (4), in accordance with the global structure of the image, the cost distribution information of surrounding pixels is transmitted to the center pixel from multiple directions. 
     
       
         
           
             
               
                 
                   
                     
                       L 
                       r 
                     
                     ⁡ 
                     
                       ( 
                       
                         p 
                         , 
                         d 
                       
                       ) 
                     
                   
                   = 
                   
                     
                       C 
                       ⁡ 
                       
                         ( 
                         
                           p 
                           , 
                           d 
                         
                         ) 
                       
                     
                     + 
                     
                       min 
                       ⁡ 
                       
                         ( 
                         
                           
                             
                               
                                 
                                   
                                     L 
                                     r 
                                   
                                   ⁡ 
                                   
                                     ( 
                                     
                                       
                                         p 
                                         - 
                                         r 
                                       
                                       , 
                                       d 
                                     
                                     ) 
                                   
                                 
                                 , 
                                 
                                   
                                     
                                       L 
                                       r 
                                     
                                     ⁡ 
                                     
                                       ( 
                                       
                                         
                                           p 
                                           - 
                                           r 
                                         
                                         , 
                                         
                                           d 
                                           - 
                                           1 
                                         
                                       
                                       ) 
                                     
                                   
                                   + 
                                   
                                     P 
                                     1 
                                   
                                 
                                 , 
                               
                             
                           
                           
                             
                               
                                 
                                   
                                     
                                       L 
                                       r 
                                     
                                     ⁡ 
                                     
                                       ( 
                                       
                                         
                                           p 
                                           - 
                                           r 
                                         
                                         , 
                                         
                                           d 
                                           + 
                                           1 
                                         
                                       
                                       ) 
                                     
                                   
                                   + 
                                   
                                     P 
                                     1 
                                   
                                 
                                 , 
                               
                             
                           
                           
                             
                               
                                 
                                   
                                     min 
                                     i 
                                   
                                   ⁢ 
                                   
                                     
                                       L 
                                       r 
                                     
                                     ⁡ 
                                     
                                       ( 
                                       
                                         
                                           p 
                                           - 
                                           r 
                                         
                                         , 
                                         i 
                                       
                                       ) 
                                     
                                   
                                 
                                 + 
                                 
                                   P 
                                   2 
                                 
                               
                             
                           
                         
                         ) 
                       
                     
                     - 
                     
                       
                         min 
                         k 
                       
                       ⁢ 
                       
                         
                           L 
                           r 
                         
                         ⁡ 
                         
                           ( 
                           
                             
                               p 
                               - 
                               r 
                             
                             , 
                             k 
                           
                           ) 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   4 
                   ) 
                 
               
             
           
         
       
     
     L r (p,d) is aggregation energy when the disparity at position p is d, and r is a transfer direction. 
     After energy propagation, a tensor of size height(H)×width(W)×maximum disparity(D), i.e., the energy diagram, is obtained. Energy propagation conducted successively in four directions of from top to bottom (TB), from left top to bottom right (LTB), from left to right (LR) and from right to left (RL) is taken as an example. 
     A disparity corresponding to minimum energy is found for each pixel position according to an energy propagation diagram, which is the integer disparity d(x,y) of the pixel. 
     
       
         
           
             
               
                 
                   
                     d 
                     ⁡ 
                     
                       ( 
                       
                         x 
                         , 
                         y 
                       
                       ) 
                     
                   
                   = 
                   
                     arg 
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     
                       
                         min 
                         
                           i 
                           ∈ 
                           
                             D 
                             max 
                           
                         
                       
                       ⁢ 
                       
                         energy 
                         ⁡ 
                         
                           ( 
                           i 
                           ) 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   5 
                   ) 
                 
               
             
           
         
       
     
     The energy (⋅) is the energy after aggregation. 
     A subpixel level disparity diagram is calculated by using the energy diagram and an integral pixel disparity diagram. 
     Step 4, 4.1 Filtering the obtained disparity diagram to remove invalid disparity. 
     Firstly, speckle filtering is conducted on the image to remove the outlier in the disparity diagram. 
     
       
         
           
             
               
                 
                   
                     p 
                     ⁡ 
                     
                       ( 
                       
                         x 
                         , 
                         y 
                       
                       ) 
                     
                   
                   = 
                   
                     { 
                     
                       
                         
                           
                             0 
                             , 
                           
                         
                         
                           
                             
                               
                                 
                                   
                                     ∑ 
                                     
                                       
                                         ( 
                                         
                                           i 
                                           , 
                                           j 
                                         
                                         ) 
                                       
                                       ∈ 
                                       
                                         Ω 
                                         ⁡ 
                                         
                                           ( 
                                           
                                             x 
                                             , 
                                             y 
                                           
                                           ) 
                                         
                                       
                                     
                                   
                                   ⁢ 
                                   T 
                                 
                               
                             
                             
                               
                                 
                                   
                                     [ 
                                     
                                       
                                         
                                           
                                             
                                               p 
                                               ⁡ 
                                               
                                                 ( 
                                                 
                                                   i 
                                                   , 
                                                   j 
                                                 
                                                 ) 
                                               
                                             
                                             &gt; 
                                             
                                               
                                                 
                                                   ( 
                                                   
                                                     1 
                                                     + 
                                                     t 
                                                   
                                                   ) 
                                                 
                                                 · 
                                                 
                                                   p 
                                                   ⁡ 
                                                   
                                                     ( 
                                                     
                                                       x 
                                                       , 
                                                       y 
                                                     
                                                     ) 
                                                   
                                                 
                                               
                                               ⁢ 
                                               
                                                  
                                                  
                                               
                                             
                                           
                                         
                                       
                                       
                                         
                                           
                                             
                                               p 
                                               ⁡ 
                                               
                                                 ( 
                                                 
                                                   i 
                                                   , 
                                                   j 
                                                 
                                                 ) 
                                               
                                             
                                             &lt; 
                                             
                                               
                                                 ( 
                                                 
                                                   1 
                                                   - 
                                                   t 
                                                 
                                                 ) 
                                               
                                               · 
                                               
                                                 p 
                                                 ⁡ 
                                                 
                                                   ( 
                                                   
                                                     x 
                                                     , 
                                                     y 
                                                   
                                                   ) 
                                                 
                                               
                                             
                                           
                                         
                                       
                                     
                                     ] 
                                   
                                   &gt; 
                                   
                                     t 
                                     ⁢ 
                                     
                                         
                                     
                                     ⁢ 
                                     1 
                                   
                                 
                               
                             
                           
                         
                       
                       
                         
                           
                             
                               p 
                               ⁡ 
                               
                                 ( 
                                 
                                   x 
                                   , 
                                   y 
                                 
                                 ) 
                               
                             
                             , 
                           
                         
                         
                           other 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   6 
                   ) 
                 
               
             
           
         
       
     
     p(x,y) is a disparity value at position (x,y); t and t1 are thresholds, counted and obtained by experiments and stored in hardware in advance; T[⋅] is an indicator function; and the output is 1 when the input satisfies the conditions within [ ], otherwise, is 0. Ω(x,y) is a local region centered on (x,y). 
     Median filtering is conducted on the disparity diagram. 
         p ( x,y )=median (i,j)∈Ω(x,y) ( p ( i,j ))  (7)
 
     Step 4, restoring the scale of the disparity image. The width and the height of the disparity image obtained in the above process are both ½ of the original scale; and the nearest neighbor interpolation mode is selected to amplify the disparity image in the transverse and longitudinal directions to restore the scale. 
     The disparity fusion method is specifically operated as follows: 
     1. The disparity diagram disparity vis  obtained by the visible light binocular camera and the disparity diagram disparity ir  obtained by the infrared binocular camera are fused according to the homography matrix H, the translation and rotation positional relationships between the visible light system and the infrared system and two confidence marker bits. 
     2 Finally, the depth diagram is calculated according to the fused disparity, and the relationship formula between the disparity and the depth is as follows: 
     
       
         
           
             
               
                 
                   Z 
                   = 
                   
                     
                       B 
                       × 
                       f 
                     
                     d 
                   
                 
               
               
                 
                   ( 
                   8 
                   ) 
                 
               
             
           
         
       
     
     wherein B is baseline length, f is the focal length, Z is the depth and d is the disparity.