Esempio n. 1
0
    @Override
    public Param clone() {
      final Param clone = new Param();
      clone.po = po.clone();
      clone.tilesAreInPlace = tilesAreInPlace;

      clone.isAligned = isAligned;

      clone.bmScale = bmScale;
      clone.bmMinR = bmMinR;
      clone.bmMaxCurvatureR = bmMaxCurvatureR;
      clone.bmRodR = bmRodR;

      clone.bmUseLocalSmoothnessFilter = bmUseLocalSmoothnessFilter;
      clone.bmLocalModelIndex = bmLocalModelIndex;
      clone.bmLocalRegionSigma = bmLocalRegionSigma;
      clone.bmMaxLocalEpsilon = bmMaxLocalEpsilon;
      clone.bmMaxLocalTrust = bmMaxLocalTrust;

      clone.springLengthSpringMesh = springLengthSpringMesh;
      clone.stiffnessSpringMesh = stiffnessSpringMesh;
      clone.dampSpringMesh = dampSpringMesh;
      clone.maxStretchSpringMesh = maxStretchSpringMesh;
      clone.maxIterationsSpringMesh = maxIterationsSpringMesh;
      clone.maxPlateauwidthSpringMesh = maxPlateauwidthSpringMesh;
      clone.useLegacyOptimizer = useLegacyOptimizer;

      clone.visualize = visualize;

      clone.maxNumThreads = maxNumThreads;

      return clone;
    }
Esempio n. 2
0
 {
   po.maxEpsilon = 25.0f;
   po.minInlierRatio = 0.0f;
   po.minNumInliers = 12;
   po.expectedModelIndex = 0;
   po.desiredModelIndex = 0;
   po.rejectIdentity = true;
   po.identityTolerance = 5.0f;
 }
Esempio n. 3
0
    public boolean setup() {
      /* Block Matching */
      if (bmBlockRadius < 0) {
        bmBlockRadius = Util.roundPos(springLengthSpringMesh / 2);
      }
      final GenericDialog gdBlockMatching =
          new GenericDialog("Elastic montage: Block Matching and Spring Meshes");

      gdBlockMatching.addMessage("Block Matching:");
      gdBlockMatching.addNumericField("patch_scale :", bmScale, 2);
      gdBlockMatching.addNumericField("search_radius :", bmSearchRadius, 0, 6, "px");
      gdBlockMatching.addNumericField("block_radius :", bmBlockRadius, 0, 6, "px");

      gdBlockMatching.addMessage("Correlation Filters:");
      gdBlockMatching.addNumericField("minimal_PMCC_r :", bmMinR, 2);
      gdBlockMatching.addNumericField("maximal_curvature_ratio :", bmMaxCurvatureR, 2);
      gdBlockMatching.addNumericField("maximal_second_best_r/best_r :", bmRodR, 2);

      gdBlockMatching.addMessage("Local Smoothness Filter:");
      gdBlockMatching.addCheckbox("use_local_smoothness_filter", bmUseLocalSmoothnessFilter);
      gdBlockMatching.addChoice(
          "approximate_local_transformation :",
          ParamOptimize.modelStrings,
          ParamOptimize.modelStrings[bmLocalModelIndex]);
      gdBlockMatching.addNumericField("local_region_sigma:", bmLocalRegionSigma, 2, 6, "px");
      gdBlockMatching.addNumericField(
          "maximal_local_displacement (absolute):", bmMaxLocalEpsilon, 2, 6, "px");
      gdBlockMatching.addNumericField("maximal_local_displacement (relative):", bmMaxLocalTrust, 2);

      gdBlockMatching.addMessage("Montage :");
      gdBlockMatching.addCheckbox("tiles_are_pre-montaged", isAligned);

      gdBlockMatching.showDialog();

      if (gdBlockMatching.wasCanceled()) return false;

      bmScale = gdBlockMatching.getNextNumber();
      bmSearchRadius = (int) gdBlockMatching.getNextNumber();
      bmBlockRadius = (int) gdBlockMatching.getNextNumber();
      bmMinR = (float) gdBlockMatching.getNextNumber();
      bmMaxCurvatureR = (float) gdBlockMatching.getNextNumber();
      bmRodR = (float) gdBlockMatching.getNextNumber();

      bmUseLocalSmoothnessFilter = gdBlockMatching.getNextBoolean();
      bmLocalModelIndex = gdBlockMatching.getNextChoiceIndex();
      bmLocalRegionSigma = (float) gdBlockMatching.getNextNumber();
      bmMaxLocalEpsilon = (float) gdBlockMatching.getNextNumber();
      bmMaxLocalTrust = (float) gdBlockMatching.getNextNumber();

      isAligned = gdBlockMatching.getNextBoolean();

      final GenericDialog gdSpringMesh = new GenericDialog("Elastic montage: Spring Meshes");

      /* TODO suggest a resolution that matches maxEpsilon */
      gdSpringMesh.addNumericField("spring_length :", springLengthSpringMesh, 2, 6, "px");
      gdSpringMesh.addNumericField("stiffness :", stiffnessSpringMesh, 2);
      gdSpringMesh.addNumericField("maximal_stretch :", maxStretchSpringMesh, 2, 6, "px");
      gdSpringMesh.addNumericField("maximal_iterations :", maxIterationsSpringMesh, 0);
      gdSpringMesh.addNumericField("maximal_plateauwidth :", maxPlateauwidthSpringMesh, 0);
      gdSpringMesh.addCheckbox("use_legacy_optimizer :", useLegacyOptimizer);

      gdSpringMesh.showDialog();

      if (gdSpringMesh.wasCanceled()) return false;

      springLengthSpringMesh = gdSpringMesh.getNextNumber();
      stiffnessSpringMesh = gdSpringMesh.getNextNumber();
      maxStretchSpringMesh = gdSpringMesh.getNextNumber();
      maxIterationsSpringMesh = (int) gdSpringMesh.getNextNumber();
      maxPlateauwidthSpringMesh = (int) gdSpringMesh.getNextNumber();
      useLegacyOptimizer = gdSpringMesh.getNextBoolean();

      if (isAligned) po.desiredModelIndex = 3;
      else {
        if (!po.setup("Elastic montage : SIFT based pre-montage")) return false;

        final GenericDialog gdSIFT =
            new GenericDialog("Elastic montage : SIFT based pre-montage: Miscellaneous");
        gdSIFT.addCheckbox("tiles_are_roughly_in_place", tilesAreInPlace);
        gdSIFT.showDialog();
        if (gdSIFT.wasCanceled()) return false;

        tilesAreInPlace = gdSIFT.getNextBoolean();
      }

      return true;
    }