next up previous contents
Next: Edges Up: Stereo matching Previous: Stereo matching   Contents

Stereo Index

Prior to matching primitives are indexed according to epipolar bands. This simplifies (in terms of both code complexity and computational efficiency) the subsequent matching problem. The easiest way to do this is to transform edge (or other feature primitives) to a suitable and equivalent virtual parallel camera set up. It is important here to note that it is only the geometry of the primitive, as opposed to the physical image location through which it is indexed (cf. the Imrect data structure), that requires transformation.

After transformation the pseudo rasters of the parallel camera images correspond to the original epipolar indices. When identifying which primitives are located on each raster care must be taken to allow for possible distortion in the image geometry that may have occurred during the transformation process. This can result in both multiple and zero mappings from physical image to pseudo image rasters (see below for the case of edge strings).

The Windex data structure is used

typedef struct windex /* generic window index structure */
{
    Ts_id ts_id;                /* Tina structure identifier */
    int type;
    int m, n;  /* m rows n cols */
    struct imregion *region; /* region covered */
    void ***index;
} Windex;

This is a general purpose 2D index. In the stereo case the first dimension is epipolar/raster and the second position along the raster quantised by m and n (ie m buckets of width n pixels). The region of interest covered by the index is given by the Imregion structure region.

Windex *w;
int x,y;

   .
   .

    List *r_index;
    Imregion *roi;
    int c; 

    roi = w->region;
    c = (x-roi->lx)/w->n;  /* column offset within region of interest */ 

    if (c<w->m) /* covered by region */
  r_index = w->index[y][c]
The above code sample illustrates use of the indexing scheme to recover a list (ordered along the raster) of all primitives that occur in and beyond the raster bucket that includes edge location column x on raster y (where x and y are in chosen image coordinates). All edges in the raster can be indexed by the degenerate case

w->index[y][0]

Note that all indices refer to the same list, that is

for all (j>i) w->index[y][j] is a subset of w->index[y][i]

Stereo indices can be allocated and freed.

Windex *sx_alloc(Imregion *region,int n,int type)

void sx_free(Windex *w)


next up previous contents
Next: Edges Up: Stereo matching Previous: Stereo matching   Contents
root 2017-11-18