<p>I assume that your "<code>LATCH_match.cpp</code> in <code>opencv_3.1.0</code>" is
<a href="https://github.com/Itseez/opencv/blob/3.1.0/samples/cpp/tutorial_code/xfeatures2D/LATCH_match.cpp" rel="nofollow noreferrer">https://github.com/Itseez/opencv/blob/3.1.0/samples/cpp/tutorial_code/xfeatures2D/LATCH_match.cpp</a></p>

<p>In that file, you <a href="https://github.com/Itseez/opencv/blob/3.1.0/samples/cpp/tutorial_code/xfeatures2D/LATCH_match.cpp#L13" rel="nofollow noreferrer">find</a>:</p>

<pre><code>// If you find this code useful, please add a reference to the following paper in your work:
// Gil Levi and Tal Hassner, "LATCH: Learned Arrangements of Three Patch Codes", arXiv preprint arXiv:1501.03719, 15 Jan. 2015
</code></pre>

<p>And so, looking at <a href="http://arxiv.org/pdf/1501.03719v1.pdf" rel="nofollow noreferrer">http://arxiv.org/pdf/1501.03719v1.pdf</a> you will find</p>

<blockquote>
  <p>For each set, we compare the first image against each of the remaining
  five and check for correspondences. Performance is measured using the
  code from [16, 17]<sup>1</sup> , which computes recall and 1-precision
  using <strong>known ground truth homographies between the images</strong>.</p>
</blockquote>

<p>I think that the image <code>../data/graf1.png</code> is <a href="https://github.com/Itseez/opencv/blob/3.1.0/samples/data/graf1.png" rel="nofollow noreferrer">https://github.com/Itseez/opencv/blob/3.1.0/samples/data/graf1.png</a> that I show here:</p>

<p><a href="https://i.stack.imgur.com/ZpO0H.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZpO0H.jpg" alt="enter image description here"></a></p>

<p>According to the comment <a href="https://stackoverflow.com/questions/37564541/homography-matrix-in-opencv/37565570?noredirect=1#comment62624557_37565570">Homography matrix in Opencv?</a> by <a href="https://stackoverflow.com/users/6055233/catree">Catree</a>  the original dataset is at <a href="http://www.robots.ox.ac.uk/~vgg/research/affine/det_eval_files/graf.tar.gz" rel="nofollow noreferrer">http://www.robots.ox.ac.uk/~vgg/research/affine/det_eval_files/graf.tar.gz</a> where it is said that</p>

<blockquote>
  <p>Homographies between image pairs included.</p>
</blockquote>

<p>So I think that the homography stored in file <code>../data/H1to3p.xml</code> is the homography between image 1 and image 3.</p>
Homography matrix in Opencv?
<p>In <code>LATCH_match.cpp</code> in <code>opencv_3.1.0</code> the homography matrix is defined and used as:</p>

<pre><code>Mat homography;
FileStorage fs("../data/H1to3p.xml", FileStorage::READ);
...
fs.getFirstTopLevelNode() &gt;&gt; homography;
...
Mat col = Mat::ones(3, 1, CV_64F);
col.at&lt;double&gt;(0) = matched1[i].pt.x;
col.at&lt;double&gt;(1) = matched1[i].pt.y;
col = homography * col;
...
</code></pre>

<p>Why <code>H1to3p.xml</code> is:</p>

<pre><code>&lt;opencv_storage&gt;&lt;H13 type_id="opencv-matrix"&gt;&lt;rows&gt;3&lt;/rows&gt;&lt;cols&gt;3&lt;/cols&gt;&lt;dt&gt;d&lt;/dt&gt;&lt;data&gt;
    7.6285898e-01  -2.9922929e-01   2.2567123e+02
    3.3443473e-01   1.0143901e+00  -7.6999973e+01
    3.4663091e-04  -1.4364524e-05   1.0000000e+00 &lt;/data&gt;&lt;/H13&gt;&lt;/opencv_storage&gt;
</code></pre>

<p>With which criteria these numbers were chosen? They can be used for any other homography test for filtering keypoints (as in <code>LATCH_match.cpp</code>)?</p>