コード例 #1
0
  private void printMultiToInterleaved(AutoTypeImage imageIn) {
    String outputName = imageIn.getInterleavedName();
    String bandName = imageIn.getSingleBandName();

    out.print(
        "\t/**\n"
            + "\t * Converts a {@link MultiSpectral} into the equivalent {@link "
            + outputName
            + "}\n"
            + "\t *\n"
            + "\t * @param input (Input) MultiSpectral image that is being converted. Not modified.\n"
            + "\t * @param output (Optional) The output image.  If null a new image is created. Modified.\n"
            + "\t * @return Converted image.\n"
            + "\t */\n"
            + "\tpublic static "
            + outputName
            + " convert( MultiSpectral<"
            + bandName
            + "> input , "
            + outputName
            + " output ) {\n"
            + "\t\tif (output == null) {\n"
            + "\t\t\toutput = new "
            + outputName
            + "(input.width, input.height,input.getNumBands());\n"
            + "\t\t} else {\n"
            + "\t\t\tInputSanityCheck.checkSameShape(input, output);\n"
            + "\t\t}\n"
            + "\n"
            + "\t\tImplConvertImage.convert(input,output);\n"
            + "\n"
            + "\t\treturn output;\n"
            + "\t}\n\n");
  }
コード例 #2
0
  private void printInterleaveAverage(AutoTypeImage imageIn) {

    String inputName = imageIn.getInterleavedName();
    String outputName = imageIn.getSingleBandName();

    out.print(
        "\t/**\n"
            + "\t * Converts a {@link "
            + inputName
            + "} into a {@link "
            + outputName
            + "} by computing the average value of each pixel\n"
            + "\t * across all the bands.\n"
            + "\t * \n"
            + "\t * @param input (Input) The ImageInterleaved that is being converted. Not modified.\n"
            + "\t * @param output (Optional) The single band output image.  If null a new image is created. Modified.\n"
            + "\t * @return Converted image.\n"
            + "\t */\n"
            + "\tpublic static "
            + outputName
            + " average( "
            + inputName
            + " input , "
            + outputName
            + " output ) {\n"
            + "\t\tif (output == null) {\n"
            + "\t\t\toutput = new "
            + outputName
            + "(input.width, input.height);\n"
            + "\t\t} else {\n"
            + "\t\t\tInputSanityCheck.checkSameShape(input, output);\n"
            + "\t\t}\n"
            + "\n"
            + "\t\tConvertInterleavedToSingle.average(input, output);\n"
            + "\n"
            + "\t\treturn output;\n"
            + "\t}\n\n");
  }
コード例 #3
0
  private void printConvertInterleaved(AutoTypeImage imageIn, AutoTypeImage imageOut) {

    out.print(
        "\t/**\n"
            + "\t * <p>\n"
            + "\t * Converts an {@link boofcv.struct.image."
            + imageIn.getInterleavedName()
            + "} into a {@link boofcv.struct.image."
            + imageOut.getInterleavedName()
            + "}.\n"
            + "\t * </p>\n"
            + "\t *\n"
            + "\t * @param input Input image which is being converted. Not modified.\n"
            + "\t * @param output (Optional) The output image.  If null a new image is created. Modified.\n"
            + "\t * @return Converted image.\n"
            + "\t */\n"
            + "\tpublic static "
            + imageOut.getInterleavedName()
            + " convert("
            + imageIn.getInterleavedName()
            + " input, "
            + imageOut.getInterleavedName()
            + " output) {\n"
            + "\t\tif (output == null) {\n"
            + "\t\t\toutput = new "
            + imageOut.getInterleavedName()
            + "(input.width, input.height, input.numBands);\n"
            + "\t\t} else {\n"
            + "\t\t\tInputSanityCheck.checkSameShape(input, output);\n"
            + "\t\t}\n"
            + "\n"
            + "\t\tImplConvertImage.convert(input, output);\n"
            + "\n"
            + "\t\treturn output;\n"
            + "\t}\n\n");
  }