@Override public Homography2D_F32 newInstanceModel() { return new Homography2D_F32(); } }
@Override public Homography2D_F64 newInstanceModel() { return new Homography2D_F64(); } }
@Override public void setModel(Homography2D_F32 o) { homo.set(o); }
@Override public boolean fitModel(List<AssociatedPair> dataSet, Homography2D_F64 initial, Homography2D_F64 found) { if( !alg.process(dataSet,H) ) return false; UtilHomography.convert(H,found); return true; }
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()); } }
@Override public void setModel(Homography2D_F64 o) { homo.set(o); }
public PointTransformHomography_F64(DMatrixRMaj homo) { UtilHomography_F64.convert(homo, this.homo); }
public PointTransformHomography_F32(FMatrixRMaj homo) { UtilHomography_F32.convert(homo, this.homo); }
public Homography2D_F64 createModelInstance() { return new Homography2D_F64(); }
@Override public boolean generate(List<AssociatedPair> dataSet, Homography2D_F64 model ) { if( !alg.process(dataSet,H) ) return false; UtilHomography.convert(H,model); return true; }
public void setCurrToWorld(Homography2D_F64 currToWorld) { this.currToWorld.set(currToWorld); }
@Override public boolean generate(List<AssociatedPair> dataSet, Homography2D_F64 model ) { if( !alg.process(dataSet,H) ) return false; UtilHomography_F64.convert(H,model); return true; }
public void set(FMatrix transform ) { this.homo.set(transform); }
@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 boolean generate(List<AssociatedPair> pairs, Homography2D_F64 H) { if( !alg.process(pairs.get(0),pairs.get(1),pairs.get(2)) ) return false; UtilHomography.convert(alg.getHomography(),H); return true; }
public void set(DMatrix transform ) { this.homo.set(transform); }
@Override public boolean fitModel(List<AssociatedPair> dataSet, Homography2D_F64 initial, Homography2D_F64 found) { if( !alg.process(dataSet,H) ) return false; UtilHomography_F64.convert(H,found); return true; }
public void set(Homography2D_F32 transform ) { this.homo.set(transform); }
int distortOffX; Homography2D_F64 currToWorld = new Homography2D_F64();
/** * Estimate the plane's normal and the distance from the plane. From the set of matched pairs a homography * is estimated. The homography is then decomposed to find the camera baseline and a description of the plane. * The decomposition generates several hypotheses, but only the one which is the best match to the known camera * baseline is used. */ private boolean estimatePlane(List<AssociatedPair> matches) { // RANSAC to find best homography if( !robustH.process(matches) ) return false; DenseMatrix64F Hd = UtilHomography.convert(robustH.getModelParameters(), (DenseMatrix64F) null); selectBest.process(Hd,true); return true; }