Matching – Tasks

  1. Using the codes and MEX modules listed below implement two methods of automatic correspondence search in image:
    1. Method 1: detect interest points by Harris detector, describe by 11×11 neighborhood.
    2. Method 2: detect interest points by MSER detector, describe by SIFT.
  2. Using correspondences, estimate projective transform between images by RANSAC.
  3. Test on images: img1 and one of: t1, t2, t3 and t4.
  4. Compare usability of both methods on further images by using img2, img3, img4 and img5 as the second image. What are the pros/cons of the method using Harris corner detector? Try to think of another descriptor of interest point, e.g. circle instead of rectangle and/or histogram instead of direct intensities of pixels. Compare with original method. Jaké jsou výhody a nevýhody metody založené na Harrisově detektoru?

Notes: put complete m-file into your report. For each experiment, give the transformation matrix, transformed first image and difference image (from the second image).

Harris detector code: harris.m, getMaxima.m. Usage:

pts1 = getMaxima (harris (im1, scale));
pts2 = getMaxima (harris (im2, scale));

Returns [x y score].

MSER detector MEX module: MSER detektor. Usage:

p.min_margin = 10;
p.min_size   = 30;
oblasti1 = extrema(im1, p, [1 2]);
oblasti2 = extrema(im2, p, [1 2]);

Create descriptor pt for each interest point, e.g.:

function pts = describePts(img, detected_points)

pts = [];

for i=1:number_of_detected_points
  pt.drid = i;
  pt.x = x coordinate
  pt.y = y coordinate
  pt.s = scale used for detection
  pt.desc = generate_description(img, pt.x, pt.y);
  pts = [pts pt];
end;

For MSER-found interest points use describeRegions.m which calls SIFT MEX module to create SIFT descriptors:

  pts = describeRegions(img, detection_points);

in the form:

  pt.drid = number
  pt.x = x coordinate of centroid
  pt.y = y coordinate of centroid
  pt.a11, pt.a12, pt.a21, pt.a22 = ellipse parameters
  pt.desc = sift descriptor

For RANSAC, you can use use sample.m to generate permutations and nsamples.m to calculate number of iterations needed to be done.

You can use showRegions.m to display results of MSER detector.