@Override public Homography2D_F64 newInstanceModel() { return new Homography2D_F64(); } }
private IT createInitialTransform() { float scale = 0.8f; if( fitModel instanceof Affine2D_F64 ) { Affine2D_F64 H = new Affine2D_F64(scale,0,0,scale, stitchWidth /4, stitchHeight /4); return (IT)H.invert(null); } else if( fitModel instanceof Homography2D_F64 ) { Homography2D_F64 H = new Homography2D_F64(scale,0,stitchWidth /4,0,scale,stitchHeight /4,0,0,1 ); return (IT)H.invert(null); } else { throw new RuntimeException("Need to support this model type: "+fitModel.getClass().getSimpleName()); } }
public void setCurrToWorld(Homography2D_F64 currToWorld) { this.currToWorld.set(currToWorld); }
gui.setAllTracks(null); Homography2D_F64 H = alg.getWorldToCurr(null).invert(null); gui.setCurrToWorld(H);
@Override public void process(GrayU8 gray) { if( !resetRequested && alg.process(gray) ) { convertToBitmapDisplay(alg.getStitchedImage()); synchronized ( lockGui ) { alg.getImageCorners(gray.width,gray.height,corners); ImageMotion2D<?,?> motion = alg.getMotion(); if( showFeatures && (motion instanceof AccessPointTracks) ) { AccessPointTracks access = (AccessPointTracks)motion; alg.getWorldToCurr(imageToDistorted); imageToDistorted.invert(distortedToImage); inliersGui.reset();outliersGui.reset(); List<Point2D_F64> points = access.getAllTracks(); for( int i = 0; i < points.size(); i++ ) { HomographyPointOps_F64.transform(distortedToImage,points.get(i),distPt); if( access.isInlier(i) ) { inliersGui.grow().set(distPt.x,distPt.y); } else { outliersGui.grow().set(distPt.x,distPt.y); } } } } } else { resetRequested = false; alg.reset(); } }
public Homography2D_F64 createModelInstance() { return new Homography2D_F64(); }
@Override public void setModel(Homography2D_F64 o) { homo.set(o); }
imageToDistorted.invert(distortedToImage); inliersGui.reset();outliersGui.reset(); List<Point2D_F64> points = access.getAllTracks();
@Override protected void drawFeatures( float scale, Graphics2D g2 ) { int scaledInputWidth = (int)(scale*input.getWidth()); drawFeatures(scale,0,0,allTracks,inliers,new Homography2D_F64(),g2); drawFeatures(scale,scaledInputWidth+outputBorder,0,allTracks,inliers,currToWorld,g2); } }
public void set(DMatrix transform ) { this.homo.set(transform); }
int distortOffX; Homography2D_F64 currToWorld = new Homography2D_F64();
public VideoMosaicSequentialPointApp(Class<I> imageType, Class<D> derivType) { super(2,imageType,true,new Mosaic2DPanel()); PkltConfig config = new PkltConfig(); config.templateRadius = 3; config.pyramidScaling = new int[]{1,2,4,8}; ConfigFastHessian configFH = new ConfigFastHessian(); configFH.initialSampleSize = 2; configFH.maxFeaturesPerScale = 200; addAlgorithm(0, "KLT", FactoryPointTracker.klt(config, new ConfigGeneralDetector(maxFeatures, 3, 1), imageType, derivType)); addAlgorithm(0, "ST-BRIEF", FactoryPointTracker. dda_ST_BRIEF(150, new ConfigGeneralDetector(400, 1, 10), imageType, null)); // size of the description region has been increased to improve quality. addAlgorithm(0, "ST-NCC", FactoryPointTracker. dda_ST_NCC(new ConfigGeneralDetector(500, 3, 9), 10, imageType, derivType)); addAlgorithm(0, "FH-SURF", FactoryPointTracker.dda_FH_SURF_Fast(configFH, null, null, imageType)); addAlgorithm(0, "ST-SURF-KLT", FactoryPointTracker. combined_ST_SURF_KLT(new ConfigGeneralDetector(400, 3, 1), config, 75, null, null, imageType, derivType)); addAlgorithm(0, "FH-SURF-KLT", FactoryPointTracker.combined_FH_SURF_KLT( config, 75, configFH, null, null, imageType)); addAlgorithm(1,"Affine", new Affine2D_F64()); addAlgorithm(1,"Homography", new Homography2D_F64()); absoluteMinimumTracks = 40; respawnTrackFraction = 0.3; respawnCoverageFraction = 0.8; maxJumpFraction = 0.3; inlierThreshold = 4; }
public VideoStabilizeSequentialPointApp(Class<I> imageType, Class<D> derivType) { super(2,imageType,true,new Stabilize2DPanel()); PkltConfig config = new PkltConfig(); config.templateRadius = 3; config.pyramidScaling = new int[]{1,2,4,8}; ConfigFastHessian configFH = new ConfigFastHessian(); configFH.maxFeaturesPerScale = 200; configFH.initialSampleSize = 2; addAlgorithm(0, "KLT", FactoryPointTracker.klt(config, new ConfigGeneralDetector(maxFeatures, 1, 3), imageType,derivType)); addAlgorithm(0, "ST-BRIEF", FactoryPointTracker. dda_ST_BRIEF(100, new ConfigGeneralDetector(400, 1, 10), imageType, derivType)); // size of the description region has been increased to improve quality. addAlgorithm(0, "ST-NCC", FactoryPointTracker. dda_ST_NCC(new ConfigGeneralDetector(500, 3, 10), 5, imageType, derivType)); addAlgorithm(0, "FH-SURF", FactoryPointTracker.dda_FH_SURF_Fast(configFH, null, null, imageType)); addAlgorithm(0, "ST-SURF-KLT", FactoryPointTracker. combined_ST_SURF_KLT(new ConfigGeneralDetector(400, 3, 1), config, 50, null, null, imageType, derivType)); addAlgorithm(0, "FH-SURF-KLT", FactoryPointTracker.combined_FH_SURF_KLT( config, 50, configFH, null, null, imageType)); addAlgorithm(1,"Affine", new Affine2D_F64()); addAlgorithm(1,"Homography", new Homography2D_F64()); absoluteMinimumTracks = 40; respawnTrackFraction = 0.3; respawnCoverageFraction = 0.5; maxJumpFraction = 0.3; inlierThreshold = 4; }