Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First, aren't you supposed to be using vl_sift instead of sift?</p> <p>Second, you can use SIFT feature matching to find correspondences in the two images. Here's some sample code: </p> <pre><code> I = imread('p1.jpg'); J = imread('p2.jpg'); I = single(rgb2gray(I)); % Conversion to single is recommended J = single(rgb2gray(J)); % in the documentation [F1 D1] = vl_sift(I); [F2 D2] = vl_sift(J); % Where 1.5 = ratio between euclidean distance of NN2/NN1 [matches score] = vl_ubcmatch(D1,D2,1.5); subplot(1,2,1); imshow(uint8(I)); hold on; plot(F1(1,matches(1,:)),F1(2,matches(1,:)),'b*'); subplot(1,2,2); imshow(uint8(J)); hold on; plot(F2(1,matches(2,:)),F2(2,matches(2,:)),'r*'); </code></pre> <p>vl_ubcmatch() essentially does the following:</p> <p>Suppose you have a point P in F1 and you want to find the "best" match in F2. One way to do that is to compare the descriptor of P in F1 to all the descriptors in D2. By compare, I mean find the Euclidean distance (or the L2-norm of the difference of the two descriptors).</p> <p>Then, I find two points in F2, say U &amp; V which have the lowest and second-lowest distance (say, Du and Dv) from P respectively.</p> <p>Here's what Lowe recommended: if Dv/Du >= threshold (I used 1.5 in the sample code), then this match is acceptable; otherwise, it's ambiguously matched and is rejected as a correspondence and we don't match any point in F2 to P. Essentially, if there's a big difference between the best and second-best matches, you can expect this to be a quality match. </p> <p>This is important since there's a lot of scope for ambiguous matches in an image: imagine matching points in a lake or a building with several windows, the descriptors can look very similar but the correspondence is obviously wrong.</p> <p>You can do the matching in any number of ways .. you can do it yourself very easily with MATLAB or you can speed it up by using a KD-tree or an approximate nearest number search like <a href="http://people.cs.ubc.ca/~mariusm/index.php/FLANN/FLANN" rel="noreferrer">FLANN</a> which has been implemented in <a href="http://opencv.org" rel="noreferrer">OpenCV</a>.</p> <p>EDIT: Also, there are several <a href="http://www.mathworks.com/matlabcentral/fileexchange/4586" rel="noreferrer">kd-tree implementations in MATLAB</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload