Abstract:
A method for analyzing related images corresponding system and vehicle including such system as well as a computer program product for executing the method. The method comprises obtaining at least a first and a second image, defining a pixel patch in the first image for which a correlation shall be calculated, calculating matching cost values between each pixel of the pixel patch in the first image and its corresponding pixel in each of a plurality of pixel patches in the second image, wherein the pixel patches in the second image differ in position in the second image and include the pixel patch with a target position, aggregating the matching cost values of those corresponding pixels of all patches in the second image which match best to generate an aggregation window associated with the target position, and producing a signal including information on the target position.

Description:
BACKGROUND 
       [0001]    1. Field 
         [0002]    The invention relates to a method for analyzing related images, a corresponding image processing system, a vehicle comprising such a system and a corresponding computer program product. In particular the analysis of the related images relates to depth estimation from stereo images which is preferably used in vehicles that are equipped with driver assistance systems taking advantage of image processing, or autonomous vehicles. 
         [0003]    2. Description of the Related Art 
         [0004]    Over the last years a large progress has been made in the field of image processing. The improved analysis results therefore can be used to produce and output information of a real situation in which an image or a sequence of images was captured. Since the result reflects a particular aspect of the real situation it can be used either to assist a person to be aware of this situation and act accordingly or even to assist in performing a necessary action directly. Such systems are known as Advance Driver Assistance Systems (ADAS) for example. Here images of a traffic situation are captured and an analysis of the captured images is performed in order to decelerate or accelerate a vehicle or to alarm the driver when an imminent collision might be observed. 
         [0005]    Many other applications might be considered as well, of course. A prominent example for use of image processing systems as well are autonomous devices which become more and more popular to increase the comfort of its owner and/or safety of its user. Such autonomous devices can be autonomous lawn mowers, autonomous cleaning machines that might be used in contaminated areas without the need of an operator in dangerous areas and the like. Nevertheless such autonomous devices still need additional sensors like radar or sonar sensors, bump sensors or the like, because depth estimation is still problematic. For the bump sensors it is a particular disadvantage that in some cases they will not lead to the desired change of driving direction. When for example an obstacle like a branch of a tree that is too high for being hit by the bump sensor is approached the collision cannot be avoided. 
         [0006]    All of these vehicles have the problem that using conventional equipment such as cameras only 2D-images can be captured from the real 3D environment. In order to overcome this problem stereoscopic cameras have been developed. With these stereoscopic cameras two images are captured. These two images are captured at the same time but from different locations, because the stereoscopic cameras have two image capturing units, each having its own lens and image sensor. Naturally the two images will differ, because the scenery is captured from two distinct positions of the cameras units. In the past there have already been attempts to exploit such pairs of related images for estimation of depth of object or locations in the images. If such calculation of depth can be performed with satisfying accuracy and reliability advantageous over other distance measurement means can be exploited. Cameras, and consequently also stereoscopic cameras, are of passive nature and therefore energy efficiency is one advantage. Energy efficiency is a general issue, but of course of particular relevance for systems that need to have an energy storage onboard like the accumulator of an autonomous lawn mower. Further scalability of such systems ease the adaptation of the systems, since only the distance between the two camera units (baseline) needs to be altered for using it for another range of distances. 
         [0007]    In order to improve the performance of stereoscopic image processing systems different limitations have been addressed in the past. EP 2 386 998 A1 for example suggests a two-stage correlation method for correspondence search in stereoscopic images that deals with the problem of conventional approaches with respect to high contrast. Like in already known calculation of depth in stereoscopic image processing a patch of one of the two images is correlated with patches of corresponding size in the second image to find that patch in the second image that matches the patch in the first image best. From the distance of the best matching patch in the second picture from the patch in the first picture measured in pixels (disparity) it is then possible to calculate a distance or depth of the object. 
         [0008]    For so called fronto-parallel objects in the images, this gives satisfying results. Each pixel of the patch that is defined in the first image finds its equivalent in a corresponding patch of same size and shape in the second image. This corresponding patch is similar to the patch in the first image but is located at a position in the second image that is different from the position of the patch in the first image. Thus, it is easy to calculate a measure for the similarity of the two corresponding patches. But naturally not all objects that can be identified in an image are fronto-parallel. This leads to a strong limitation of the usability of stereoscopic image analysis with respect to distance evaluation, for example in driver assistance systems, where typically objects like a road are present which is obviously not fronto-parallel. Not fronto-parallel objects lead to a spatially different arrangement of corresponding pixels in the first image and in the second image. The calculation of a measure for the similarity of pixels of a patch in the first image and of pixels of patch of same size and shape in the second image will lead to difficulties in identifying a disparity for such non fronto-parallel objects. 
         [0009]    Stereo computation algorithms which are commonly known are described in “Scharstein, D. and Szeliski, R., (2002). A taxonomy and evaluation of dense two-frame stereo correspondence algorithms. International Journal of Computer Vision 47 (1-3):7-42.” But the problem of not fronto-parallel objects is not addressed there. 
       SUMMARY 
       [0010]    It is therefore an object of the present invention to improve the analysis of related images, particularly of at least of one pair of related images. 
         [0011]    The problems of the known techniques are overcome by the inventive method, system, vehicles and computer program products according to the appended claims. 
         [0012]    With the inventive method related images such as a pair of images that are captured by distinct camera units at the same time are analyzed. The method comprises the steps of: 
         [0013]    obtaining at least a first and a second image 
         [0014]    defining a pixel patch in the first image for which a correlation shall be calculated 
         [0015]    calculating matching cost values for each pixel of the pixel patch in the first image and its corresponding pixel in each of a plurality of pixel patches in the second image, wherein the pixel patches in the second image differ in position in the second image and include the pixel patch with a target position 
         [0016]    aggregating the matching cost values of those corresponding pixels of all patches in the second image which match best to generate an aggregation window associated with the target position and 
         [0017]    producing a signal including information on the target position. 
         [0018]    It is obvious that the method and its corresponding apparatus can be applied not only to systems where a pair of images being captured at the same time but from different locations, but also to systems where an optical flow shall be calculated, for example for motion vector estimation/compensation. In that case the pair of images for which the inventive method is performed are consecutive images of one single camera unit. Further, the invention is not limited to only a single pair of related images. Multi camera systems may comprise an arbitrary number of camera units in a known spatial relation to each other. Thus, there may be defined either camera pairs of two camera units like using a plurality of stereoscopic cameras each comprising two camera units. Alternatively one of the camera units may be designated as providing a reference image and each of the other camera units then provides a second image thereby establishing as many pairs of related images as other cameras exist. 
         [0019]    The invention has the advantage that not only the pixels that belong to one patch (the one that is located at the target position in the second image) are taken into consideration, when the similarity between a patch of the first image and an area in the second image shall be evaluated. In addition to the pixels of that patch at the target position also pixels of patches that are shifted starting from the patch at the target position are included in the evaluation. Thus, if a pixel that lies out of the patch at the target position in the second image due to distortion of a non fronto-parallel object, it will still contribute to the identification of the target position. 
         [0020]    Further advantages and aspects are defined in the subclaims. 
         [0021]    It is particularly advantageous that the matching cost values of the corresponding pixels which match best are penalized according to the distance between the target position and their position. Doing so leads to a contribution of those pixels that originally belong to the patch at the target position more than those pixels which belong to one of the others of the plurality of patch in the second image. 
         [0022]    For improvement of the result of the inventive method the plurality of patches can comprise a plurality of neighboring patches that are arranged symmetrically with respect to the patch at the target position in the second image. When thus at either side of the patch at the target position at least two patches are present it is preferred that the penalization increases with increasing distance of the position of the pixels which matches best from the target position. This means that pixels for which best matching is determined and which originate from a patch which is closer to the patch at the target position contribute more than pixels for which best matching is determined but which originate from a patch that is farther away from the patch at the target position. 
         [0023]    Especially according to a preferred embodiment no penalization is performed for best matching pixels originating from the patch at the target position and penalization for all other best matching pixels is performed using a constant value. 
         [0024]    It is preferred that the first and the second image are obtained from a stereo camera, in particular that such stereo camera is used in an advanced driver system or a sensing means of an autonomous device. 
         [0025]    When the related images of the pairs are provided by a stereo camera, the positions of the patches in the second image are preferably defined by disparities. 
         [0026]    Furthermore it is preferred that a stereoscopic depth is calculated on the basis of the signal including information on the target position. 
         [0027]    As a preferred alternative an optical flow is calculated based on the signal including information on the target position. 
         [0028]    The present invention generally works for systems in which any measure of a similarity of a defined area in the first image and its corresponding area in the second image shall be evaluated. But it is particularly preferred that the matching cost values are calculated as squared or absolute differences, as normalized cross-correlation values, as absolute differences of rank transformed image values or as hamming distances of census transformed images and that the aggregation of the matching cost values is performed by an averaging summation. 
         [0029]    As it was already mentioned, the number of patches in addition to the patch at the target position may be adjusted to the needs concerning the computational performance of the system, the required accuracy or other boundaries. The positions of the neighboring patches of the patch at the target position are thus defined by the target position and a predetermined range. For example, a range can be set by a manufacturer of the inventive system that defines that in addition to the patch at the target position a range of X pixels to either side of the patch at the target position shall be taken into account. According to settings of the system the positions of the neighboring patch can then be determined to cover that range. Either the number of neighboring patches (at each lateral side of the patch at the target position) equals the range defined in pixels so that the resulting neighboring patch overlap, or in order to reduce the computational effort the range is divided by the patch length in that direction so that the neighboring patches do not overlap. 
         [0030]    The invention preferably is a vehicle that is equipped with a system configured to carry out the processes and method steps that are explained above, wherein the vehicle is one of a robot device, in particular an autonomous robot device like an autonomous lawn mower; a land vehicle, in particular a car or motorcycle; a sea vehicle; an air or space vehicle. 
         [0031]    According to another aspect, a computer program product performing the above method, when executed on a computer, is provided. 
         [0032]    Further aspects and features of the invention will now be described with reference to the embodiments shown in the annexed drawings throughout which like references denote like parts and in which            
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0033]      FIG. 1  shows exemplarily and schematically an autonomous vehicle, 
           [0034]      FIG. 2  shows exemplarily and schematically a captured left and right image of a stereo image, 
           [0035]      FIG. 3  shows the patches that are evaluated in conventional methods, 
           [0036]      FIG. 4  shows exemplarily and schematically plurality of patches used for determination of corresponding pixels and aggregation of thereof, and 
           [0037]      FIG. 5  shows a flowchart illustrating the method steps of the inventive method. 
       
    
    
     DETAILED DESCRIPTION 
       [0038]    An autonomous vehicle  1 , as schematically and exemplarily shown in  FIG. 1 , autonomously moves from a starting point to a destination without planned intervention by a passenger of the autonomous vehicle. On the movement path from the starting point to the destination, the autonomous vehicle en route automatically adapts its movement path to traffic conditions. 
         [0039]    In order to perceive its environment, the autonomous vehicle typically comprises a number of sensors sensing the environment but at least an optical sensor system  2 , which comprises at least an optical sensor. Basically, sensing in this case means that the autonomous vehicle processes data supplied by the sensors in a processing unit  3  to derive parameters that describe aspects of the environment. Together, the derived parameters form a virtual model of the vehicle&#39;s view of the environment. 
         [0040]    The autonomous vehicle  1  continuously monitors the parameters and makes decisions based on the parameters, i.e. the result of a calculation or parameter comparison leads to a result which leads to an execution of a specified process. A decision is made, when specific constraints or thresholds are reached by the parameters. While a number of different decisions can be made, for autonomous movement, decisions that lead to movement changes of the vehicle are of interest, as they influence other traffic participants. 
         [0041]    For effecting movement changes, the vehicle  1  typically comprises at least actuators for actuating steering, for accelerating or decelerating (braking) the vehicle and/or for communicating with the passengers. After a decision is made, i.e. a process is started, the autonomous vehicle  1  actuates the actuators in accordance with steps, calculations and/or comparisons specified in the respective process. 
         [0042]    At least one of the optical sensors is a stereo camera, which is used to produce preferably a sequence of image pairs, e.g. for calculating depth of an object in order to enhance navigation and to avoid objects/obstacles in the movement path of the autonomous vehicle  1  by providing a signal including information of a target position which then allows calculation from the disparity a depth of an object in the image. Of course calculation of a depth of an object might also be combined with calculation of an optical flow from the sequence. 
         [0043]    A stereo camera is a type of camera with two lenses with a separate image sensor for each lens. Often, a stereo camera actually consists of two separate cameras attached to a rig. In this case the cameras might either be fixed or movable. In the fixed case the cameras are usually aligned with image sensors being coplanar (parallel setup). In the movable case such a stereo camera is usually used to mimic the vergence movement of human eyes. 
         [0044]    The main intention of this invention is to improve the depth estimation performance or depth estimation in stereo or multi-camera systems by supporting the correspondence search between images recorded by the camera systems. 
         [0045]    For estimating depth from stereo or multi-camera images it is necessary to find correlating image pixels in the images which belong to one 3D instance in the scene observed with the camera. A multi camera system is similar in the sense that either each pair of cameras can be used as a stereo camera or that one camera is defined as a reference camera and all other cameras are treated like the second camera of a stereo camera system. This means that correlating pixels are either searched in each camera pair or between the reference camera images and the images of all other cameras. In the following, when a stereo camera is referred to, it should be understood, that a multi-camera system can be also used. 
         [0046]    Before details of the invention will be explained the principle of performing depth estimation from a pair of images is explained. 
         [0047]    After pixel correlations have been found the depth can be easily calculated from the distance between the correlating pixels. The distance between correlating pixels is called disparity and is measured in number of pixels. For example, if the correlating pixels are 5 pixels apart they have a disparity of 5. The depth is computed by the simple formula: 
         [0000]      Depth= f*b /disparity 
         [0048]    Here, f is the focal length of the camera and b is the baseline. The baseline is the 3D distance between the two cameras. 
         [0049]    Finding single pixel correlations is hard. Hence, an area (patch) around each pixel is used for finding correlations. If this area has a rectangular shape this approach is called block-matching. A major problem in finding correlations with patches is that this constitutes an inherent assumption that the depth (or disparity) values of all pixels within that patch are the same because only pixels from the same depth are depicted in the same spatial arrangement in both stereo images. Since the scene observed by a (stereo) camera consists of many surfaces that are not fronto-parallel, the assumption is violated quite often. Fortunately, the approach works well as long as the differences between the different pixel&#39;s depth values are not too large. 
         [0050]    However, for strongly slanted surfaces like a street surface this leads to gross errors as shown on  FIG. 2 . While fronto-parallel objects like houses or trees look the same in both stereo camera images, strongly slanted surfaces like the street change their spatial 2D layout between the two stereo camera images. Due to this, trying to correlate patches from the left image (e.g. a 3×3 patch around the center pixel R) will fail as the spatial layout of the pixels has changed in the right image. 
         [0051]    Typically patch-matching stereo works as follows: In the left image which is the first image in the described embodiment a patch is defined as shown in  FIG. 2  by the square of 3×3 pixels in bold lines. This patch is compared to candidate patches in the right image which is in the present example the second image. The comparison is done by computing patch-matching cost (or correlation) values between the respective two patches. The patch in the second image with the best match is determined as corresponding patch, i.e. as being that patch that corresponds to the patch defined in the first image. In most cases this matching cost value is computed by first computing pixel-level cost values and then aggregating the pixel-level cost values over the full patch: 
         [0000]    
       
         
           
             
               C 
               d 
             
             = 
             
               
                 ∑ 
                 i 
               
                
               
                 c 
                 
                   i 
                   , 
                   d 
                 
               
             
           
         
       
     
         [0052]    Where C d  is the aggregated patch matching cost value and c i,d  is the pixel-level cost of pixel i in the left image patch and its corresponding pixel in the right image patch. In parallel stereo camera setups corresponding pixels are always on the same image line thus, 
         [0000]        c   i,d   =f   c ( p ( x   i   ,y   i ) L   ,p ( x   i   −d,y   i ) R ) 
         [0053]    Where f c  is the pixel-level matching cost function, p(x i , y i ) L  is pixel i in the left image and p(x i +d, y i ) R  the corresponding pixel in the right image. 
         [0054]    After the corresponding patch in the right image is determined further evaluation of the position of the patch in the second (right) image can be performed. The position of the corresponding pixels differs by the disparity d. The essence of the fronto-parallel assumption in standard stereo processing is that all pixels in a patch have the same disparity d and consequently known methods determine only a corresponding patch of equal patch size and patch shape to further determine the disparity of this determined corresponding patch from the patch defined in the first image. Hence, for each disparity d the matching cost value of the patch is also computed from the pixel-level matching cost values of disparity d. The pixel-level cost value may be computed in many ways. In simple cases it might be the absolute difference (AD) between the intensities of the corresponding pixels or in more advances cases it could even incorporate yet another patch (e.g. for computing normalized cross-correlation, rank transform or census transform as mentioned earlier). 
         [0055]    As is shown in  FIG. 3  such approach will lead to failure in finding a corresponding patch. 
         [0056]    In contrast this invention does not simply aggregate the pixel-level cost values of disparity d for the patch disparity d but incorporates pixel-level cost values of multiple disparities (favorably similar for the patch target disparity d) by selecting the best pixel-level disparity (the disparity where the pixel-level cost value is best) for each pixel from a set of disparities, 
         [0000]    
       
         
           
             
               C 
               d 
             
             = 
             
               
                 ∑ 
                 i 
               
                
               
                 
                   max 
                   
                     s 
                      
                     
                         
                     
                      
                     ε 
                      
                     
                         
                     
                      
                     
                       d 
                       s 
                     
                   
                 
                  
                 
                     
                 
                  
                 
                   c 
                   
                     i 
                     , 
                     s 
                   
                 
               
             
           
         
       
     
         [0000]    where d s  is a set of disparities (favorably similar to the patch target disparity d). One realization of such a set might be a simple disparity range like ±2 pixels, i.e. d s ={d−2,d−1,d,d+1,d+2}. The patch target disparity is the distance of a target position of the patch in the second (here: right) image from the position of the defined patch in the left image that is to be determined as corresponding patch for center pixel R. 
         [0057]    The problem of the max selection for finding the best pixel-level disparity is that this might cause plateaus in the patch-level matching cost function for neighboring disparities. Hence, it is preferred to penalize pixel-level matching cost values that are from a disparity different than the patch disparity, 
         [0000]    
       
         
           
             
               C 
               d 
             
             = 
             
               
                 ∑ 
                 i 
               
                
               
                 
                   max 
                   
                     s 
                      
                     
                         
                     
                      
                     ε 
                      
                     
                         
                     
                      
                     
                       d 
                       s 
                     
                   
                 
                  
                 
                   
                     P 
                      
                     
                       ( 
                       
                         s 
                         , 
                         d 
                       
                       ) 
                     
                   
                    
                   
                     c 
                     
                       i 
                       , 
                       s 
                     
                   
                 
               
             
           
         
       
     
         [0058]    Where P is a penalization that typically increases with the difference between the patch target disparity d and the pixel-level disparity however, it might also be a fixed penalization for all disparities that do not equal the target disparity, or any other kind of penalization. 
         [0059]      FIG. 4  visualizes the concept in an abstract fashion using the same example as in  FIG. 2 . While the correlation failed in  FIG. 3 , now the pixel-level correlation for the patch target disparity d and two further disparities, (d−1) and (d+1), are computed first for all of a plurality of patches in the right image, including the patch at a position corresponding to the patch target disparity d. These patches are depicted in the  FIG. 4  as the three dashed patches on the lower right. From these pixel-level correlations the best matching for each pixel is selected. In this simplified example the best correlations for the lower pixels are from disparity (d−1), the best for the middle pixels are from the patch target disparity (d) and the best for the upper pixels are from disparity (d+1). These best pixel-level correlations are then aggregated to generate an aggregation window in the second image, possibly with a penalty, to generate a new patch correlation the basis of the patch defined in the first image and the aggregation window in the second image. This is illustrated in the upper half of  FIG. 4 . It is to be noted that, although the combination is visualized as building a new path, in fact the pixel-level correlation values are not used to actually build a new patch. In fact the pixel-level correlation cost values are aggregated (for example with a weighted average) to calculate the patch-level correlation cost value as mentioned above. 
         [0060]    While all the above explanations are concentrating on computing depth from stereo camera images it is also possible to use the same method to improve patch-matching optical flow algorithms. There are two slight differences between the two approaches: First, optical flow is typically computed between two consecutive images from the same camera instead of from two images captured at the same time from two cameras as in the stereo case. Second, it is necessary to look for correlations not only along image lines but within a search window. Thus, the disparities in stereo processing become two-dimensional vectors in optical flow. These vectors are related to the two-dimensional shift that an image patch can undergo from one image to the next. This can be described by whole image shift, i.e. shift one image in the opposite direction of the patch movement. Regarding the search for the best pixel-level correlation, in optical flow the set of possible disparities becomes a set of possible image shifts. Despite these two differences the computation is the same. 
         [0061]    In  FIG. 5  there is shown a simplified flowchart of the method steps that have been explained in greater detail above. At first in step S 1  the two related images are obtained for which the correlation of patches shall be analyzed. A pair of related images in the sense of the invention can be a pair of images captured at the same time by a stereo camera. Alternatively the related images of the pair have a time relationship, because they have been captured as consecutive images by a single camera unit. A combination of both could also be used as a starting point. This means a sequence of image pairs could be captured by a stereo camera and then either an optical flow or a depth of both could be calculated. 
         [0062]    Then in step S 2  in a first image which can be any one of the two related images a patch is defined for which a distance of a corresponding patch in the second image shall be determined. For the determination at first matching cost values are calculated. This calculation includes calculating for each pixel of the patch defined in the first image and its corresponding pixel in each of a plurality of patches that have different positions in the second image, a pixel-level cost value. Thus, for each pixel of the patch defined in the first image a plurality of matching cost values is calculated. 
         [0063]    Now for each pixel of the patch of the first image the corresponding pixel which matches best is selected. The corresponding matching cost values of all of these best matching pixels originating from any of the plurality of patches in the second image are aggregated in step  4 . Thereby an aggregation window is generated associated with the patch target disparity. 
         [0064]    The aggregation window which matches best to the patch defined in the first image is then the one that gives the disparity which is output in a signal (step S 6 ). On the basis of such signal it is then possible to further exploit the knowledge about the disparity in step S 7 . Such exploitation could for example be alarming a driver in an ADAS that a person or another obstacle is in the way and a collision might occur. Also a direct action may be taken on the basis of an estimated distance of an object. For example the route of an autonomous lawn mower may be corrected in order to avoid a collision or in case that the system is implemented in an Advanced Driver Assistance System automated braking may be performed.