/** * @return a matcher with a homographic constraint */ private static LocalFeatureMatcher<Keypoint> createConsistentRANSACHomographyMatcher() { final ConsistentLocalFeatureMatcher2d<Keypoint> matcher = new ConsistentLocalFeatureMatcher2d<Keypoint>( createFastBasicMatcher()); matcher.setFittingModel(new RobustHomographyEstimator(10.0, 1000, new RANSAC.BestFitStoppingCondition(), HomographyRefinement.NONE)); return matcher; }
public Snap() { loadMapData(); engine = new DoGSIFTEngine(); // engine.getOptions().setDoubleInitialImage(false); final FastBasicKeypointMatcher<Keypoint> innerMatcher = new FastBasicKeypointMatcher<Keypoint>(8); matcher = new ConsistentLocalFeatureMatcher2d<Keypoint>(innerMatcher); final RobustAffineTransformEstimator estimator = new RobustAffineTransformEstimator(0.5); matcher.setFittingModel(estimator); matcher.setModelFeatures(mapData); }
@Override public void beforeUpdate(MBFImage image) { final FImage greyFrame = Transforms.calculateIntensityNTSC(image); if (needsReset()) { tracker.selectGoodFeatures(greyFrame); } else { fl2 = fl1.clone(); tracker.trackFeatures(oldFrame, greyFrame); tracker.replaceLostFeatures(greyFrame); final List<Pair<Point2d>> corres = new ArrayList<Pair<Point2d>>(); for (int i = 0; i < fl1.features.length; i++) { final Feature p = fl2.features[i]; final Feature c = fl1.features[i]; if (c.val == 0) { corres.add(new Pair<Point2d>(p, c)); } } try { final RobustFundamentalEstimator rfe = new RobustFundamentalEstimator(0.35, FundamentalRefinement.SAMPSON); rfe.fitData(corres); rfe.getModel().getF().print(5, 5); } catch (final Exception e) { } } fl1.drawFeatures(image); this.oldFrame = greyFrame; this.firstFrame = false; }
DisplayUtilities.display(basicMatches); final RobustAffineTransformEstimator modelFitter = new RobustAffineTransformEstimator(50.0, 1500, new RANSAC.PercentageInliersStoppingCondition(0.5)); DisplayUtilities.display(consistentMatches); target.drawShape(query.getBounds().transform(modelFitter.getModel().getTransform().inverse()), 3, RGBColour.BLUE); DisplayUtilities.display(target);
private void initObjectFinder(MBFImage frame, Polygon p) { modelImage = frame.process(new PolygonExtractionProcessor<Float[], MBFImage>(p, RGBColour.BLACK)); // configure the matcher siftMatcher = new ConsistentLocalFeatureMatcher2d<Keypoint>(new FastBasicKeypointMatcher<Keypoint>(8)); siftMatcher.setFittingModel(new RobustHomographyEstimator(10.0, 1500, new RANSAC.PercentageInliersStoppingCondition(0.5), HomographyRefinement.NONE)); engine = new DoGSIFTEngine(); engine.getOptions().setDoubleInitialImage(true); final FImage modelF = Transforms.calculateIntensityNTSC(modelImage); siftMatcher.setModelFeatures(engine.findFeatures(modelF)); }
@Override public void beforeUpdate(MBFImage image) { final FImage greyFrame = Transforms.calculateIntensityNTSC(image); if (needsReset()) { tracker.selectGoodFeatures(greyFrame); } else { fl2 = fl1.clone(); tracker.trackFeatures(oldFrame, greyFrame); tracker.replaceLostFeatures(greyFrame); final List<Pair<Point2d>> corres = new ArrayList<Pair<Point2d>>(); for (int i = 0; i < fl1.features.length; i++) { final Feature p = fl2.features[i]; final Feature c = fl1.features[i]; if (c.val == 0) { corres.add(new Pair<Point2d>(p, c)); } } try { final RobustFundamentalEstimator rfe = new RobustFundamentalEstimator(0.35, FundamentalRefinement.SAMPSON); rfe.fitData(corres); rfe.getModel().getF().print(5, 5); } catch (final Exception e) { } } fl1.drawFeatures(image); this.oldFrame = greyFrame; this.firstFrame = false; }
public Snap() { loadMapData(); engine = new DoGSIFTEngine(); // engine.getOptions().setDoubleInitialImage(false); final FastBasicKeypointMatcher<Keypoint> innerMatcher = new FastBasicKeypointMatcher<Keypoint>(8); matcher = new ConsistentLocalFeatureMatcher2d<Keypoint>(innerMatcher); final RobustAffineTransformEstimator estimator = new RobustAffineTransformEstimator(0.5); matcher.setFittingModel(estimator); matcher.setModelFeatures(mapData); }
private void initObjectFinder(MBFImage frame, Polygon p) { modelImage = frame.process(new PolygonExtractionProcessor<Float[], MBFImage>(p, RGBColour.BLACK)); // configure the matcher siftMatcher = new ConsistentLocalFeatureMatcher2d<Keypoint>(new FastBasicKeypointMatcher<Keypoint>(8)); siftMatcher.setFittingModel(new RobustHomographyEstimator(10.0, 1500, new RANSAC.PercentageInliersStoppingCondition(0.5), HomographyRefinement.NONE)); engine = new DoGSIFTEngine(); engine.getOptions().setDoubleInitialImage(true); final FImage modelF = Transforms.calculateIntensityNTSC(modelImage); siftMatcher.setModelFeatures(engine.findFeatures(modelF)); }
@Override public void keyPressed(KeyEvent key) { if (key.getKeyCode() == KeyEvent.VK_SPACE) { this.videoFrame.togglePause(); } else if (key.getKeyChar() == 'r') { vwv.display.seek(0); } else if (key.getKeyChar() == 'c' && this.polygonListener.getPolygon().getVertices().size() > 2) { try { ransacReader = false; final Polygon p = this.polygonListener.getPolygon().clone(); this.polygonListener.reset(); modelImage = this.vwv.capture.getCurrentFrame().process( new PolygonExtractionProcessor<Float[], MBFImage>(p, RGBColour.BLACK)); // configure the matcher matcher = new ConsistentLocalFeatureMatcher2d<Keypoint>(new FastBasicKeypointMatcher<Keypoint>(8)); matcher.setFittingModel(new RobustHomographyEstimator(3.0, 1500, new RANSAC.PercentageInliersStoppingCondition(0.01), HomographyRefinement.NONE)); final DoGSIFTEngine engine = new DoGSIFTEngine(); engine.getOptions().setDoubleInitialImage(false); final FImage modelF = Transforms.calculateIntensityNTSC(modelImage); matcher.setModelFeatures(engine.findFeatures(modelF)); vwv.display.seek(0); ransacReader = true; } catch (final Exception e) { e.printStackTrace(); } } }
final RobustHomographyEstimator ransac = new RobustHomographyEstimator(0.5, 1500, new RANSAC.PercentageInliersStoppingCondition(0.6), HomographyRefinement.NONE, new TransformMatrixConditionCheck<HomographyModel>(10000));
final RobustHomographyEstimator ransac = new RobustHomographyEstimator(0.5, 1500, new RANSAC.PercentageInliersStoppingCondition(0.6), HomographyRefinement.NONE, new TransformMatrixConditionCheck<HomographyModel>(10000));
@Override public void keyPressed(KeyEvent key) { if (key.getKeyCode() == KeyEvent.VK_SPACE) { this.videoFrame.togglePause(); } else if (key.getKeyChar() == 'r') { vwv.display.seek(0); } else if (key.getKeyChar() == 'c' && this.polygonListener.getPolygon().getVertices().size() > 2) { try { ransacReader = false; final Polygon p = this.polygonListener.getPolygon().clone(); this.polygonListener.reset(); modelImage = this.vwv.capture.getCurrentFrame().process( new PolygonExtractionProcessor<Float[], MBFImage>(p, RGBColour.BLACK)); // configure the matcher matcher = new ConsistentLocalFeatureMatcher2d<Keypoint>(new FastBasicKeypointMatcher<Keypoint>(8)); matcher.setFittingModel(new RobustHomographyEstimator(3.0, 1500, new RANSAC.PercentageInliersStoppingCondition(0.01), HomographyRefinement.NONE)); final DoGSIFTEngine engine = new DoGSIFTEngine(); engine.getOptions().setDoubleInitialImage(false); final FImage modelF = Transforms.calculateIntensityNTSC(modelImage); matcher.setModelFeatures(engine.findFeatures(modelF)); vwv.display.seek(0); ransacReader = true; } catch (final Exception e) { e.printStackTrace(); } } }
matcher.setFittingModel(new RobustHomographyEstimator(10.0, 1500, new RANSAC.PercentageInliersStoppingCondition(0.5), HomographyRefinement.NONE)); } else {
matcher.setFittingModel(new RobustHomographyEstimator(10.0, 1500, new RANSAC.PercentageInliersStoppingCondition(0.5), HomographyRefinement.NONE)); } else {