📄 xform_8h.html
字号:
<td class="paramtype">int * </td> <td class="paramname"> <em>n_in</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Calculates a best-fit image transform from image <a class="el" href="structfeature.html" title="Structure to represent an affine invariant image feature.">feature</a> correspondences using RANSAC. <p>For more information refer to:<p>Fischler, M. A. and Bolles, R. C. Random sample consensus: a paradigm for model fitting with applications to image analysis and automated cartography. <em>Communications of the ACM, 24</em>, 6 (1981), pp. 381--395.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>features</em> </td><td>an array of features; only features with a non-NULL match of type <em>mtype</em> are used in homography computation </td></tr> <tr><td valign="top"></td><td valign="top"><em>n</em> </td><td>number of features in <em>feat</em> </td></tr> <tr><td valign="top"></td><td valign="top"><em>mtype</em> </td><td>determines which of each feature's match fields to use for transform computation; should be one of FEATURE_FWD_MATCH, FEATURE_BCK_MATCH, or FEATURE_MDL_MATCH; if this is FEATURE_MDL_MATCH, correspondences are assumed to be between a feature's img_pt field and its match's mdl_pt field, otherwise correspondences are assumed to be between the the feature's img_pt field and its match's img_pt field </td></tr> <tr><td valign="top"></td><td valign="top"><em>xform_fn</em> </td><td>pointer to the function used to compute the desired transformation from <a class="el" href="structfeature.html" title="Structure to represent an affine invariant image feature.">feature</a> correspondences </td></tr> <tr><td valign="top"></td><td valign="top"><em>m</em> </td><td>minimum number of correspondences necessary to instantiate the transform computed by <em>xform_fn</em> </td></tr> <tr><td valign="top"></td><td valign="top"><em>p_badxform</em> </td><td>desired probability that the final transformation returned by RANSAC is corrupted by outliers (i.e. the probability that no samples of all inliers were drawn) </td></tr> <tr><td valign="top"></td><td valign="top"><em>err_fn</em> </td><td>pointer to the function used to compute a measure of error between putative correspondences and for a given transform </td></tr> <tr><td valign="top"></td><td valign="top"><em>err_tol</em> </td><td>correspondences within this distance of each other are considered as inliers for a given transform </td></tr> <tr><td valign="top"></td><td valign="top"><em>inliers</em> </td><td>if not NULL, output as an array of pointers to the final set of inliers </td></tr> <tr><td valign="top"></td><td valign="top"><em>n_in</em> </td><td>if not NULL, output as the final number of inliers</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns a transformation matrix computed using RANSAC or NULL on error or if an acceptable transform could not be computed. </dd></dl></div></div><p><a class="anchor" name="a294258ca8bc70d38cf1cc7fbc864e8d"></a><!-- doxytag: member="xform.h::lsq_homog" ref="a294258ca8bc70d38cf1cc7fbc864e8d" args="(CvPoint2D64f *pts, CvPoint2D64f *mpts, int n)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">CvMat* lsq_homog </td> <td>(</td> <td class="paramtype">CvPoint2D64f * </td> <td class="paramname"> <em>pts</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">CvPoint2D64f * </td> <td class="paramname"> <em>mpts</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>n</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Calculates a least-squares planar homography from point correspondeces. <p>Intended for use as a ransac_xform_fn.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>pts</em> </td><td>array of points </td></tr> <tr><td valign="top"></td><td valign="top"><em>mpts</em> </td><td>array of corresponding points; each <em>pts</em>[<em>i</em>], <em>i=0</em>..<em>n-1</em>, corresponds to <em>mpts</em>[<em>i</em>] </td></tr> <tr><td valign="top"></td><td valign="top"><em>n</em> </td><td>number of points in both <em>pts</em> and <em>mpts</em>; must be at least 4</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns the <img class="formulaInl" alt="$3 \times 3$" src="form_4.png"> least-squares planar homography matrix that transforms points in <em>pts</em> to their corresponding points in <em>mpts</em> or NULL if fewer than 4 correspondences were provided </dd></dl></div></div><p><a class="anchor" name="323525d6ce2d21bc668267d5734737cd"></a><!-- doxytag: member="xform.h::homog_xfer_err" ref="323525d6ce2d21bc668267d5734737cd" args="(CvPoint2D64f pt, CvPoint2D64f mpt, CvMat *H)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">double homog_xfer_err </td> <td>(</td> <td class="paramtype">CvPoint2D64f </td> <td class="paramname"> <em>pt</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">CvPoint2D64f </td> <td class="paramname"> <em>mpt</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">CvMat * </td> <td class="paramname"> <em>H</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Calculates the transfer error between a point and its correspondence for a given homography, i.e. <p>for a point <img class="formulaInl" alt="$x$" src="form_5.png">, it's correspondence <img class="formulaInl" alt="$x'$" src="form_6.png">, and homography <img class="formulaInl" alt="$H$" src="form_7.png">, computes <img class="formulaInl" alt="$d(x', Hx)^2$" src="form_8.png">. Intended for use as a ransac_err_fn.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>pt</em> </td><td>a point </td></tr> <tr><td valign="top"></td><td valign="top"><em>mpt</em> </td><td><em>pt's</em> correspondence </td></tr> <tr><td valign="top"></td><td valign="top"><em>H</em> </td><td>a homography matrix</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns the transfer error between <em>pt</em> and <em>mpt</em> given <em>H</em> </dd></dl></div></div><p><a class="anchor" name="9e3482c9323d073713babce91097a139"></a><!-- doxytag: member="xform.h::persp_xform_pt" ref="9e3482c9323d073713babce91097a139" args="(CvPoint2D64f pt, CvMat *T)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">CvPoint2D64f persp_xform_pt </td> <td>(</td> <td class="paramtype">CvPoint2D64f </td> <td class="paramname"> <em>pt</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">CvMat * </td> <td class="paramname"> <em>T</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Performs a perspective transformation on a single point. <p>That is, for a point <img class="formulaInl" alt="$(x, y)$" src="form_9.png"> and a <img class="formulaInl" alt="$3 \times 3$" src="form_4.png"> matrix <img class="formulaInl" alt="$T$" src="form_10.png"> this function returns the point <img class="formulaInl" alt="$(u, v)$" src="form_11.png">, where<br><p><img class="formulaInl" alt="$[x' \ y' \ w']^T = T \times [x \ y \ 1]^T$" src="form_12.png">,<br><p>and<br><p><img class="formulaInl" alt="$(u, v) = (x'/w', y'/w')$" src="form_13.png">.<p>Note that affine transforms are a subset of perspective transforms.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>pt</em> </td><td>a 2D point </td></tr> <tr><td valign="top"></td><td valign="top"><em>T</em> </td><td>a perspective transformation matrix</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns the point <img class="formulaInl" alt="$(u, v)$" src="form_11.png"> as above. </dd></dl></div></div><p><hr size="1"><address style="text-align: right;"><small>Generated on Tue Oct 30 11:37:27 2007 for SIFT by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.2 </small></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -