Beispiel #1
0
 /**
  * Returns reciproc Wiener denominator. 'Reciproc' means the vector can directly be multiplied to
  * spectrum.
  *
  * @param wParam Wiener filter parameter
  */
 public Vec2d.Real getDenominator(double wParam) {
   Vec2d.Real ret = wDenom.duplicate();
   final int w = ret.vectorWidth(), h = ret.vectorHeight();
   for (int y = 0; y < h; y++)
     for (int x = 0; x < w; x++) ret.set(x, y, 1 / (ret.get(x, y) + (float) (wParam * wParam)));
   return ret;
 }
Beispiel #2
0
  /**
   * Returns a denominator for filtering the wide-field, OTF band 0 with no attenuation.
   *
   * @param wParam Wiener filter parameter
   */
  public Vec2d.Real getWidefieldDenominator(double wParam) {

    Vec2d.Real ret = Vec2d.createReal(sp, 2);
    addWienerDenominator(ret, 0, 0, false);

    final int w = ret.vectorWidth(), h = ret.vectorHeight();
    for (int y = 0; y < h; y++)
      for (int x = 0; x < w; x++) ret.set(x, y, 1 / (ret.get(x, y) + (float) (wParam * wParam)));
    return ret;
  }
Beispiel #3
0
  /**
   * Returns a copy of a per-band, per-direction Wiener denominator. This is used mostly for
   * filtering intermediate results.
   *
   * @param d Direction
   * @param b Band
   * @param wParam Wiener filter parameter
   */
  public Vec2d.Real getIntermediateDenominator(int d, int b, double wParam) {

    // get the otf
    Vec2d.Real ret = Vec2d.createReal(sp, 2);
    addWienerDenominator(ret, d, b, sp.otf().isAttenuate());

    // add the wiener parameter
    final int w = ret.vectorWidth(), h = ret.vectorHeight();
    for (int y = 0; y < h; y++)
      for (int x = 0; x < w; x++) ret.set(x, y, 1 / (ret.get(x, y) + (float) (wParam * wParam)));
    return ret;
  }