use of boofcv.alg.geo.robust.DistanceHomographySq in project BoofCV by lessthanoptimal.
the class FactoryMultiViewRobust method homographyLMedS.
/**
* Robust solution for estimating {@link Homography2D_F64} with {@link LeastMedianOfSquares LMedS}. Input
* observations are in pixel coordinates.
*
* <ul>
* <li>Four point linear is used internally</p>
* <li>inlierThreshold is in pixels</p>
* </ul>
*
* <p>See code for all the details.</p>
*
* @param homography Homography estimation parameters. If null default is used.
* @param configLMedS Parameters for LMedS. Can't be null.
* @return Homography estimator
*/
public static LeastMedianOfSquares<Homography2D_F64, AssociatedPair> homographyLMedS(ConfigHomography homography, ConfigLMedS configLMedS) {
if (homography == null)
homography = new ConfigHomography();
ModelManager<Homography2D_F64> manager = new ModelManagerHomography2D_F64();
GenerateHomographyLinear modelFitter = new GenerateHomographyLinear(homography.normalize);
DistanceHomographySq distance = new DistanceHomographySq();
LeastMedianOfSquares<Homography2D_F64, AssociatedPair> lmeds = new LeastMedianOfSquares<>(configLMedS.randSeed, configLMedS.totalCycles, manager, modelFitter, distance);
lmeds.setErrorFraction(configLMedS.errorFraction);
return lmeds;
}
use of boofcv.alg.geo.robust.DistanceHomographySq in project BoofCV by lessthanoptimal.
the class FactoryMultiViewRobust method homographyRansac.
/**
* Robust solution for estimating {@link Homography2D_F64} with {@link Ransac}. Input
* observations are in pixel coordinates.
*
* <ul>
* <li>Four point linear is used internally</p>
* <li>inlierThreshold is in pixels</p>
* </ul>
*
* <p>See code for all the details.</p>
*
* @param homography Homography estimation parameters. If null default is used.
* @param ransac Parameters for RANSAC. Can't be null.
* @return Homography estimator
*/
public static Ransac<Homography2D_F64, AssociatedPair> homographyRansac(ConfigHomography homography, ConfigRansac ransac) {
if (homography == null)
homography = new ConfigHomography();
ModelManager<Homography2D_F64> manager = new ModelManagerHomography2D_F64();
GenerateHomographyLinear modelFitter = new GenerateHomographyLinear(homography.normalize);
DistanceHomographySq distance = new DistanceHomographySq();
double ransacTol = ransac.inlierThreshold * ransac.inlierThreshold;
return new Ransac<>(ransac.randSeed, manager, modelFitter, distance, ransac.maxIterations, ransacTol);
}
Aggregations