3.6.1 Estimate epipolar geometry transformation

The aim of this application is to generate resampled grids to transform images in epipolar geometry. Epipolar geometry is the geometry of stereo vision (see here). The operation of stereo rectification determines transformations to apply to each image such that pairs of conjugate epipolar lines become collinear, parallel to one of the image axes and aligned. In this geometry, the objects present on a given row of the left image are also located on the same line in the right image.

Applying this transformation reduces the problem of elevation (or stereo correspondences determination) to a 1-D problem. We have two images image1 and image2 over the same area (the stereo pair) and we assume that we know the localization functions (forward and inverse) associated for each of these images.

The forward function allows to go from the image referential to the geographic referential:

(long,lat)= fforward(i,j,h)
           image1
(3.2)

where h is the elevation hypothesis, (i,j) are the pixel coordinates in image1 and (long,lat) are geographic coordinates. As you can imagine, the inverse function allows to go from geographic coordinates to the image geometry.

For the second image, in that case, the expression of the inverse function is:

             inverse
(long,lat,h)= fimage2(i,j)
(3.3)

Using jointly the forward and inverse functions from the image pair, we can construct a co-localization function fimage1image2 between the position of a pixel in the first and its position in the second one:

(iimage2,jimage2)= fimage1→image2(iimage1,jimage1,h)
(3.4)

The expression of this function is:

                            inverse forward
fimage1→image2(iimage1,jimage1,h)= fimage2fimage1 ((iimage1,jimage1),h)
(3.5)

The expression is not really important, what we need to understand is that if we are able to determine for a given pixel in image1 the corresponding pixel in image2, as we know the expression of the co-localization function between both images, we can determine by identification the information about the elevation (variable h in the equation)!

We now have the mathematical basis to understand how 3-D information can be extracted by examination of the relative positions of objects in the two 2-D epipolar images.

The construction of the two epipolar grids is a little bit more complicated in the case of VHR optical images.That is because most of passive remote sensing from space use a push-broom sensor, which corresponds to a line of sensors arranged perpendicularly to the flight direction of the spacecraft. This acquisition configuration implies a slightly different strategy for stereo-rectification (see here).

We will now explain how to use the StereoRectificationGridGenerator application to produce two images which are deformation grids to resample the two images in epipolar geometry.

otbcli_StereoRectificationGridGenerator -io.inleft image1.tif  
                                        -io.inright image2.tif  
                                        -epi.elevation.avg.value 50  
                                        -epi.step 5  
                                        -io.outimage1 outimage1_grid.tif  
                                        -io.outright outimage1_grid.tif

The application estimates the displacement to apply to each pixel in both input images to obtain epipolar geometry.The application accept a ‘step’ parameter to estimate displacements on a coarser grid. Here we estimate the displacements every 10 pixels. This is because in most cases with a pair of VHR and a small angle between the two images, this grid is very smooth. Moreover, the implementation is not streamable and uses potentially a lot of memory. Therefore it is generally a good idea to estimate the displacement grid at a coarser resolution.

The application outputs the size of the output images in epipolar geometry. Note these values, we will use them in the next step to resample the two images in epipolar geometry.

In our case, we have:

Output parameters value:  
epi.rectsizex: 4462  
epi.rectsizey: 2951  
epi.baseline:  0.2094

The epi.baseline parameter provides the mean value (in pixels.meters1) of the baseline to sensor altitude ratio. It can be used to convert disparities to physical elevation, since a disparity of this value will correspond to an elevation offset of one meter with respect to the mean elevation.

we can now move forward to the resampling in epipolar geometry.