Public Member Functions | |
| def | __init__ |
| def | extractpose |
| def | fit |
| def | get_error |
| def | random_partition |
| def | ransac |
Public Attributes | |
| besterr_thresh | |
| cvDist | |
| cvKK | |
| desckdtree | |
| image_points | |
| ninitial | |
| object_points | |
| points3d | |
| rvec | |
| tvec | |
| type | |
Core 2D/3D correspondence algorithm
Definition at line 47 of file PointPoseExtraction.py.
| def PointPoseExtraction.PointPoseExtractor.__init__ | ( | self, | |
| type, | |||
| points3d, | |||
| descriptors | |||
| ) |
Definition at line 49 of file PointPoseExtraction.py.
| def PointPoseExtraction.PointPoseExtractor.extractpose | ( | self, | |
| KK, | |||
| positions, | |||
| descriptors, | |||
| conf, | |||
| imagewidth, | |||
verboselevel = 1, |
|||
neighthresh = None, |
|||
thresh = None, |
|||
dminexpected = None, |
|||
ransaciters = None |
|||
| ) |
Definition at line 64 of file PointPoseExtraction.py.
| def PointPoseExtraction.PointPoseExtractor.fit | ( | self, | |
| data | |||
| ) |
Definition at line 92 of file PointPoseExtraction.py.
| def PointPoseExtraction.PointPoseExtractor.get_error | ( | self, | |
| data, | |||
| T | |||
| ) |
Definition at line 120 of file PointPoseExtraction.py.
| def PointPoseExtraction.PointPoseExtractor.random_partition | ( | self, | |
| n, | |||
| n_data | |||
| ) |
return n random rows of data (and also the other len(data)-n rows)
Definition at line 225 of file PointPoseExtraction.py.
| def PointPoseExtraction.PointPoseExtractor.ransac | ( | self, | |
| data, | |||
| model, | |||
| n, | |||
| k, | |||
| t, | |||
| d, | |||
debug = False, |
|||
return_all = False, |
|||
besterr_thresh = None |
|||
| ) |
fit model parameters to data using the RANSAC algorithm
This implementation written from pseudocode found at
http://en.wikipedia.org/w/index.php?title=RANSAC&oldid=116358182
{{{
Given:
data - a set of observed data points
model - a model that can be fitted to data points
n - the minimum number of data values required to fit the model
k - the maximum number of iterations allowed in the algorithm
t - a threshold value for determining when a data point fits a model
d - the number of close data values required to assert that a model fits well to data
Return:
bestfit - model parameters which best fit the data (or nil if no good model is found)
iterations = 0
bestfit = nil
besterr = something really large
while iterations < k {
maybeinliers = n randomly selected values from data
maybemodel = model parameters fitted to maybeinliers
alsoinliers = empty set
for every point in data not in maybeinliers {
if point fits maybemodel with an error smaller than t
add point to alsoinliers
}
if the number of elements in alsoinliers is > d {
% this implies that we may have found a good model
% now test how good it is
bettermodel = model parameters fitted to all points in maybeinliers and alsoinliers
thiserr = a measure of how well model fits these points
if thiserr < besterr {
bestfit = bettermodel
besterr = thiserr
}
}
increment iterations
}
return bestfit
}}}
Copyright (c) 2004-2007, Andrew D. Straw. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of the Andrew D. Straw nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
Definition at line 126 of file PointPoseExtraction.py.
Definition at line 49 of file PointPoseExtraction.py.
Definition at line 49 of file PointPoseExtraction.py.
Definition at line 49 of file PointPoseExtraction.py.
Definition at line 49 of file PointPoseExtraction.py.
Definition at line 49 of file PointPoseExtraction.py.
Definition at line 49 of file PointPoseExtraction.py.
Definition at line 49 of file PointPoseExtraction.py.
Definition at line 49 of file PointPoseExtraction.py.
Definition at line 49 of file PointPoseExtraction.py.
Definition at line 49 of file PointPoseExtraction.py.
Definition at line 49 of file PointPoseExtraction.py.