corrmatch

This program is a correspondence matcher. It takes a set of corner points from each image and produces a list of potential matches. The basic idea is to take a window of small size (-w pixels) around each corner and match this window against all corners in the other image that are within a given distance (-x pixels, and -y pixels) of that corner. The matching process returns the best match for a corner that passes a threshold (always need a p, and one of -rgbavg, or r, -g, -b, or I).

For a correspondence between two corners to be accepted it must also pass a symmetry test. Assume we have corner p in image lf, and corner q in image rf. Then the match between p and q must be the best in both directions (the max in the x and y pixels box) both ways. The symmetry test can be relaxed using the t flag, which means that all matches that are one of the t symmetric are accepted. In other words, the default is t 1, and t 2 would mean accept the two strongest matches with individually pass the symmetry test (assuming the previous match is removed).

This corner matching is often done twice. The first time the result is used to compute a fundamental matrix, which is then used to guide the matching a second time (with the f flag). This flag is the name of a previous fundamental matrix, and along with the e flag restricts the matching process to be within e pixels of the epipolar lines defined by the given fundamental matrix. The idea is that the second corrmatch (with an already computed fundamental matrix) tends to produce better quality matches, and also more matches.

Finally, the correlation matcher can perform a fixed number of rotations in order to deal with images that are rotated.

USAGE:

corrmatch -lf file -rf file

  • [-a angle of rotations] [-s rotation steps]

  • [-c (use cross correlation] [-l (use least squares correlation)] [-o (use ordinal measure)]

    [-f fundamental matrix file] [-e distance from epipolar line]

    [-i Intensity Correlation Threshold (I)]

    [-p Pixel Difference Threshold]

    [-rgbavg Correlation must pass given average]

    [-r Correlation Threshold(R)][-g Correlation Threshold(G)][-b Correlation Threshold(B)]

    [-t symmetry accept count]

    [-w Correlation Window Size]
  • [-x X-Translation] [-y Y-Translation]

  • [-sX fraction of image size X-Translation] [-sY fraction of image size Y-Translation]

    [-z Zhang style i/o]

    Parameters:

    -lf: the left input corner file (a sequence of x, y pixel co-ordinates for the corners).

    This is a mandatory input.

    -rf: the right input image (a sequence of x, y pixel co-ordinates for the corners).

    This is a mandatory input.

    -a: the angle of rotations to check, this is used in conjunction with -s.

    -s: the number of rotational steps to try.

    -c: use cross correlation for window comparing.

    -l: use least squares correlation for window comparing.

    -o: use ordinal correlation measure (not yet implemented)

    -f: fundamental matrix file to constrain the search for correspondences.

    -e: distance from epipolar line defined by the previous fundamental matrix in order to constrain the search for correspondences.

    -i: intensity correlation threshold (I)

    -p: pixel difference threshold (max pixel difference of actual corner point)

    -rgbavg: correlation threshold, for Red, Green, and Blue average correlation.

    -r: correlation Threshold for the Red plane(R)

    -g: correlation Threshold for the Green plane(G)

    -b: correlation Threshold for the Blue plane(B)

    -t: symmetry accept count, accepts matches that are one of the t strongest, and also pass a symmetry test

    -x: specifies the magnitude of the search window in the X direction in pixels

    -y: specifies the magnitide of the search window in the Y direction in pixels

    -sx: specifies the magnitude of the search window in the X direction as a fraction of the image x size

    -sy: specifies the magnitide of the search window in the Y direction as a fraction of the image y size

    -w: specifies the neighbourhood size (Use an odd number)

    -z: specifies to output match data in separate files ala Zhang

    -debug: output the interim vector JPG files.

    Notes:

    Default values:

    128 pixels in X and Y translations

    CROSS correlation method

    Intensity correlation only

    0.80 correlation (Intensity) threshold

    0.0 correlation (R) threshold

    0.0 correlation (G) threshold

    0.0 correlation (B) threshold

    0.0 correlation RGB Average threshold

    7x7 pixel window size

    40 pixel difference threshold

    0.0 degrees rotation

    0 rotational steps

    4.0 pixels distance from epipolar line

    0 symmetry count

    NO affine warping

    NO weighted matching

    NO Zhang output

    Output:

    Upon completion, a file of the form leftimage.ext-rightimg.ext.matches is produced. In this file is a list of all correspondence points found. Also generated are two JPEG images that have the motion vectors drawn in. These images have the form leftimage.ext-rightimg.ext.L.vect.jpg and leftimage.ext-rightimg.ext.R.vect.jpg for the left and right images respectively.