コード例 #1
0
  private void equalsTranVertical(
      WaveletDescription<?> desc,
      ImageSingleBand input,
      ImageSingleBand expected,
      ImageSingleBand found) {
    int w = expected.width;
    int h = expected.height;

    int lowerBorder = UtilWavelet.borderForwardLower(desc.getInverse().getInnerCoefficients());
    int upperBorder =
        input.height
            - UtilWavelet.borderForwardUpper(
                desc.getInverse().getInnerCoefficients(), input.height);

    equalsTranVertical(
        expected.subimage(0, 0, w, h / 2),
        found.subimage(0, 0, w, h / 2),
        lowerBorder / 2,
        upperBorder / 2,
        "top");
    equalsTranVertical(
        expected.subimage(0, h / 2, w, h),
        found.subimage(0, h / 2, w, h),
        lowerBorder / 2,
        upperBorder / 2,
        "bottom");
  }
コード例 #2
0
  /**
   * Compares two wavelet transformations while ignoring the input image borders. Input borders
   * affect the borders of internal segments inside the transformation.
   */
  private void equalsTranHorizontal(
      WaveletDescription<?> desc,
      ImageSingleBand input,
      ImageSingleBand expected,
      ImageSingleBand found) {
    int w = expected.width;
    int h = expected.height;

    int lowerBorder = UtilWavelet.borderForwardLower(desc.getInverse().getInnerCoefficients());
    int upperBorder =
        input.width
            - UtilWavelet.borderForwardUpper(desc.getInverse().getInnerCoefficients(), input.width);

    equalsTranHorizontal(
        expected.subimage(0, 0, w / 2, h),
        found.subimage(0, 0, w / 2, h),
        lowerBorder / 2,
        upperBorder / 2,
        "left");
    equalsTranHorizontal(
        expected.subimage(w / 2, 0, w, h),
        found.subimage(w / 2, 0, w, h),
        lowerBorder / 2,
        upperBorder / 2,
        "right");
  }