use of boofcv.alg.tracker.klt.ConfigPKlt in project BoofCV by lessthanoptimal.
the class VisualizeMonocularPlaneVisualOdometryApp method createVisualOdometry.
private MonocularPlaneVisualOdometry<I> createVisualOdometry(int whichAlg) {
Class derivType = GImageDerivativeOps.getDerivativeType(imageClass);
if (whichAlg == 0) {
var config = new ConfigPlanarTrackPnP();
config.tracker.typeTracker = ConfigPointTracker.TrackerType.KLT;
config.tracker.klt.pyramidLevels = ConfigDiscreteLevels.levels(4);
config.tracker.klt.templateRadius = 3;
config.tracker.detDesc.detectPoint.type = PointDetectorTypes.SHI_TOMASI;
config.tracker.detDesc.detectPoint.general.maxFeatures = 600;
config.tracker.detDesc.detectPoint.general.radius = 3;
config.tracker.detDesc.detectPoint.general.threshold = 1;
config.thresholdAdd = 75;
config.thresholdRetire = 2;
config.ransac.iterations = 200;
config.ransac.inlierThreshold = 1.5;
return FactoryVisualOdometry.monoPlaneInfinity(config, imageClass);
} else if (whichAlg == 1) {
ConfigPKlt configKlt = new ConfigPKlt();
configKlt.pyramidLevels = ConfigDiscreteLevels.levels(4);
configKlt.templateRadius = 3;
ConfigPointDetector configDetector = new ConfigPointDetector();
configDetector.type = PointDetectorTypes.SHI_TOMASI;
configDetector.general.maxFeatures = 600;
configDetector.general.radius = 3;
configDetector.general.threshold = 1;
PointTracker<I> tracker = FactoryPointTracker.klt(configKlt, configDetector, imageClass, derivType);
double cellSize = 0.06;
double inlierGroundTol = 1.5;
return FactoryVisualOdometry.monoPlaneOverhead(cellSize, 25, 0.7, inlierGroundTol, 300, 2, 100, 0.5, 0.6, tracker, imageType);
} else {
throw new RuntimeException("Unknown selection");
}
}
Aggregations