示例#1
0
  /**
   * Setup the Wiener filter. This (re)initiates the cached filter values. Has to be called if the
   * OTF or the shift parameters change.
   */
  public void updateCache() {

    Tool.Timer t1 = Tool.getTimer();
    final int w = sp.vectorWidth(), h = sp.vectorHeight();

    t1.start();
    wDenom = Vec2d.createReal(2 * w, 2 * h);
    boolean useAtt = sp.otf().isAttenuate();

    // loop directions, bands
    for (int d = 0; d < sp.nrDir(); d++) {
      for (int b = 0; b < sp.dir(d).nrBand(); b++) {
        addWienerDenominator(wDenom, d, b, useAtt);
      }
    }
    t1.stop();

    Tool.trace("Wiener filter setup complete, took " + t1);
  }