Converts a regular image into an integral image.

@param input Regular image. Not modified.
@param transformed Integral image. If null a new image will be created. Modified.
@return Integral image.
186820
public static GrayF64 transform(GrayF64 input , GrayF64 transformed ) {
		transformed = InputSanityCheck.checkDeclare(input,transformed);

		ImplIntegralImageOps.transform(input,transformed);

		return transformed;
	}
463841
def get_image(self, img, is_train):
        """"""
        img_arr = mx.image.imread(img)
        img_arr = transform(img_arr, 256, 256, is_train, self.boxes[img])
        return img_arr
371024
public PolygonTo toTransferObject(Polygon input) {
        PolygonTo result = new PolygonTo();
        result.setCrs(GeoJsonTo.createCrsTo("EPSG:" + input.getSRID()));
        double[][][] rings = new double[input.getNumInteriorRing() + 1][][];
        // Exterior ring:
        rings[0] = getPoints(input.getExteriorRing());
        // Interior rings!
        for (int i = 0; i < input.getNumInteriorRing(); i++) {
            rings[i + 1] = getPoints(input.getInteriorRingN(i));
        }
        result.setCoordinates(rings);
        return result;
    }
1307283
@Override
    public ImageSource apply(ImageSource input) {
        final int[][] pixelMatrix = new int[3][3];

        int w = input.getWidth();
        int h = input.getHeight();

        int[][] output = new int[h][w];

        for (int j = 1; j < h - 1; j++) {
            for (int i = 1; i < w - 1; i++) {
                pixelMatrix[0][0] = input.getR(i - 1, j - 1);
                pixelMatrix[0][1] = input.getRGB(i - 1, j);
                pixelMatrix[0][2] = input.getRGB(i - 1, j + 1);
                pixelMatrix[1][0] = input.getRGB(i, j - 1);
                pixelMatrix[1][2] = input.getRGB(i, j + 1);
                pixelMatrix[2][0] = input.getRGB(i + 1, j - 1);
                pixelMatrix[2][1] = input.getRGB(i + 1, j);
                pixelMatrix[2][2] = input.getRGB(i + 1, j + 1);

                int edge = (int) convolution(pixelMatrix);
                int rgb = (edge << 16 | edge << 8 | edge);
                output[j][i] = rgb;
            }
        }

        MatrixSource source = new MatrixSource(output);
        return source;
    }
465254
public static PixelTransform<Point2D_F32> createPixelTransform(InvertibleTransform transform) {
		PixelTransform<Point2D_F32> pixelTran;
		if( transform instanceof Homography2D_F64) {
			Homography2D_F32 t = ConvertFloatType.convert((Homography2D_F64) transform, null);
			pixelTran = new PixelTransformHomography_F32(t);
		} else if( transform instanceof Homography2D_F32) {
				pixelTran = new PixelTransformHomography_F32((Homography2D_F32)transform);
		} else if( transform instanceof Affine2D_F64) {
			Affine2D_F32 t = UtilAffine.convert((Affine2D_F64) transform, null);
			pixelTran = new PixelTransformAffine_F32(t);
		} else if( transform instanceof Affine2D_F32) {
			pixelTran = new PixelTransformAffine_F32((Affine2D_F32)transform);
		} else {
			throw new RuntimeException("Unknown model type");
		}
		return pixelTran;
	}
405151
public static <T extends ImageBase<T>> T checkDeclare(T input, T output) {
		if (output == null) {
			output = (T) input.createNew(input.width, input.height);
		} else {
			output.reshape(input.width, input.height);
		}
		return output;
	}
327111
byte[] encodeLikeAnEngineer(final byte[] input) {

        if (input == null) {
            throw new NullPointerException("input");
        }

        final byte[] output = new byte[input.length << 1];

        int index = 0; // index in output
        for (int i = 0; i < input.length; i++) {
            output[index++] = (byte) encodeHalf((input[i] >> 4) & 0x0F);
            output[index++] = (byte) encodeHalf((input[i] & 0x0F));
        }

        return output;
    }
356234
function transformRaw(input, options) {
  const transformStream = new TransformStream(options);
  pipe(input, transformStream.writable);
  return transformStream.readable;
}
847501
@Override
    public Object transform( Object input ) {

        // Wrap the input in a map to fool the CompositeSpec to recurse itself.
        Map<String,Object> wrappedMap = new HashMap<>();
        wrappedMap.put(ROOT_KEY, input);
        rootSpec.applyToMap( wrappedMap );
        return input;
    }
750609
public static InterleavedU16 convert( Planar<GrayU16> input , InterleavedU16 output ) {
		if (output == null) {
			output = new InterleavedU16(input.width, input.height,input.getNumBands());
		} else {
			output.reshape(input.width,input.height,input.getNumBands());
		}

		if( BoofConcurrency.USE_CONCURRENT ) {
			ImplConvertImage_MT.convert(input,output);
		} else {
			ImplConvertImage.convert(input,output);
		}

		return output;
	}
747909
@Override
    public Object transform( Object input ) {

        Map<String,Object> output = new HashMap<>();

        // Create a root LiteralPathElement so that # is useful at the root level
        MatchedElement rootLpe = new MatchedElement( ROOT_KEY );
        WalkedPath walkedPath = new WalkedPath();
        walkedPath.add( input, rootLpe );

        rootSpec.apply( ROOT_KEY, Optional.of( input ), walkedPath, output, null );

        return output.get( ROOT_KEY );
    }
219149
public static RenderedImage toRenderedImage(Image img) {
		if (img instanceof RenderedImage) {
			return (RenderedImage) img;
		}

		return copyImage(img, BufferedImage.TYPE_INT_RGB);
	}
961048
public static void applyTransform(GrayS8 input , int transform[] , int minValue, GrayS8 output ) {
		output.reshape(input.width,input.height);

		if( BoofConcurrency.USE_CONCURRENT ) {
			ImplEnhanceHistogram_MT.applyTransform(input, transform, minValue, output);
		} else {
			ImplEnhanceHistogram.applyTransform(input, transform, minValue, output);
		}
	}
527079
public static GrayS64 transform(GrayS64 input , GrayS64 transformed ) {
		transformed = InputSanityCheck.checkDeclare(input,transformed,GrayS64.class);

		ImplIntegralImageOps.transform(input, transformed);

		return transformed;
	}
1219851
@Override
    public ImageHeader readHeader(InputStream input) throws IOException
    {
        final int toSkip = 3 + 15;
        long skipped = input.skip(toSkip);
        checkSkippedError(skipped, toSkip);
        final int width = readInt(input, 2, true);
        skipped = input.skip(2);
        checkSkippedError(skipped, 2);
        final int height = readInt(input, 2, true);
        final ImageFormat format = ImageFormat.PNG;

        return new ImageHeaderModel(width, height, format);
    }
108196
public final String transform(CharSequence content, File inputFile) {
		return transform(content, inputFile, true);
	}
372748
public static String getImageFormat(ImageInputStream input) {
        Iterator<ImageReader> readers = ImageIO.getImageReaders(input);
        String format = "unknown";
        if (readers.hasNext()) {
            ImageReader reader = readers.next();
            try {
                format = reader.getFormatName();
            } catch (IOException e) {
                e.printStackTrace();
            } finally {
                reader.dispose();
            }
        }

        return format;
    }