Converts a {@link Planar} into the equivalent {@link InterleavedF32}

@param input (Input) Planar image that is being converted. Not modified.
@param output (Optional) The output image.  If null a new image is created. Modified.
@return Converted image.
485906
public static InterleavedF32 convertU8F32( Planar<GrayU8> input , InterleavedF32 output ) {
		if (output == null) {
			output = new InterleavedF32(input.width, input.height,input.getNumBands());
		} else {
			output.reshape(input.width,input.height,input.getNumBands());
		}

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

		return output;
	}
813301
public static DMatrix3x3 convert(DMatrixRMaj input , DMatrix3x3 output ) {
        if( output == null)
            output = new DMatrix3x3();

        if( input.getNumRows() != output.getNumRows() )
            throw new IllegalArgumentException("Number of rows do not match");
        if( input.getNumCols() != output.getNumCols() )
            throw new IllegalArgumentException("Number of columns do not match");

        output.a11 = input.data[0];
        output.a12 = input.data[1];
        output.a13 = input.data[2];
        output.a21 = input.data[3];
        output.a22 = input.data[4];
        output.a23 = input.data[5];
        output.a31 = input.data[6];
        output.a32 = input.data[7];
        output.a33 = input.data[8];

        return output;
    }
146240
public static int[] getImageSize(InputStream input) throws IOException
    {
        try {
            ImageInputStream imageInput = ImageIO.createImageInputStream(input);
            BufferedImage image = ImageIO.read(imageInput);
            return new int[]{image.getWidth(), image.getHeight()};
        } finally {
            input.close();
        }
    }
681076
public static  <T extends ImageGray<T>>
	void rgbToYuv(Planar<T> rgb , Planar<T> yuv) {
		yuv.reshape(rgb.width,rgb.height,3);

		if( rgb.getBandType() == GrayF32.class ) {
			if (BoofConcurrency.USE_CONCURRENT) {
				ImplColorYuv_MT.rgbToYuv_F32((Planar<GrayF32>) rgb, (Planar<GrayF32>) yuv);
			} else {
				ImplColorYuv.rgbToYuv_F32((Planar<GrayF32>) rgb, (Planar<GrayF32>) yuv);
			}
		} else {
			throw new IllegalArgumentException("Unsupported band type "+rgb.getBandType().getSimpleName());
		}
	}
1188307
@Override
	public Planar<T> createNew(int imgWidth, int imgHeight) {
		return new Planar<>(type, imgWidth, imgHeight, bands.length);
	}
821722
public static void rotateCW( InterleavedS64 input , InterleavedS64 output ) {
		if( input.width != output.height || input.height != output.width || input.numBands != output.numBands )
			throw new IllegalArgumentException("Incompatible shapes");

		int h = input.height-1;

		for( int y = 0; y < input.height; y++ ) {
			int indexSrc = input.startIndex + y*input.stride;
			for (int x = 0; x < input.width; x++) {
				int indexDst = output.getIndex(h-y,x);

				int end = indexSrc + input.numBands;
				while( indexSrc != end ) {
					output.data[indexDst++] = input.data[indexSrc++];
				}
			}
		}
	}
664277
public static InterleavedS64 convert( Planar<GrayS64> input , InterleavedS64 output ) {
		if (output == null) {
			output = new InterleavedS64(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;
	}
266800
public static DMatrix4x4 convert(DMatrixRMaj input , DMatrix4x4 output ) {
        if( output == null)
            output = new DMatrix4x4();

        if( input.getNumRows() != output.getNumRows() )
            throw new IllegalArgumentException("Number of rows do not match");
        if( input.getNumCols() != output.getNumCols() )
            throw new IllegalArgumentException("Number of columns do not match");

        output.a11 = input.data[0];
        output.a12 = input.data[1];
        output.a13 = input.data[2];
        output.a14 = input.data[3];
        output.a21 = input.data[4];
        output.a22 = input.data[5];
        output.a23 = input.data[6];
        output.a24 = input.data[7];
        output.a31 = input.data[8];
        output.a32 = input.data[9];
        output.a33 = input.data[10];
        output.a34 = input.data[11];
        output.a41 = input.data[12];
        output.a42 = input.data[13];
        output.a43 = input.data[14];
        output.a44 = input.data[15];

        return output;
    }
1295533
@Override
    public ImageSource apply(ImageSource input) {
        int w = input.getWidth();
        int h = input.getHeight();

        MatrixSource output = new MatrixSource(w, h);

        Vector3 s = new Vector3(1, 0, 0);
        Vector3 t = new Vector3(0, 1, 0);

        for (int y = 0; y < h; y++) {
            for (int x = 0; x < w; x++) {

                if (x < border || x == w - border || y < border || y == h - border) {
                    output.setRGB(x, y, VectorHelper.Z_NORMAL);
                    continue;
                }

                float dh = input.getR(x + 1, y) - input.getR(x - 1, y);
                float dv = input.getR(x, y + 1) - input.getR(x, y - 1);

                s.set(scale, 0, dh);
                t.set(0, scale, dv);

                Vector3 cross = s.crs(t).nor();
                int rgb = VectorHelper.vectorToColor(cross);
                output.setRGB(x, y, rgb);
            }
        }

        return new MatrixSource(output);
    }
807655
public static void grayToBitmap( ImageGray input , Bitmap output , byte[] storage) {
		if( input instanceof GrayU8 )
			grayToBitmap((GrayU8)input,output,storage);
		else if( input instanceof GrayF32 )
			grayToBitmap((GrayF32)input,output,storage);
		else
			throw new IllegalArgumentException("Unsupported BoofCV Type: "+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;
	}
278421
public static <T extends ImageGray<T>> void median(Planar<T> input, T output) {
		median(input, output, 0, input.getNumBands() - 1);
	}
811389
public static void nv21ToBoof(byte[] data, int width, int height, ImageBase output) {

		if( output instanceof Planar) {
			Planar ms = (Planar) output;

			if (ms.getBandType() == GrayU8.class) {
				ConvertNV21.nv21TPlanarRgb_U8(data, width, height, ms);
			} else if (ms.getBandType() == GrayF32.class) {
				ConvertNV21.nv21ToPlanarRgb_F32(data, width, height , ms);
			} else {
				throw new IllegalArgumentException("Unsupported output band format");
			}
		} else if( output instanceof ImageGray) {
			if (output.getClass() == GrayU8.class) {
				nv21ToGray(data, width, height, (GrayU8) output);
			} else if (output.getClass() == GrayF32.class) {
				nv21ToGray(data, width, height, (GrayF32) output);
			} else {
				throw new IllegalArgumentException("Unsupported output type");
			}
		} else if( output instanceof ImageInterleaved ) {
			if( output.getClass() == InterleavedU8.class ) {
				ConvertNV21.nv21ToInterleaved(data, width, height, (InterleavedU8) output);
			} else if( output.getClass() == InterleavedF32.class ) {
				ConvertNV21.nv21ToInterleaved(data, width, height, (InterleavedF32) output);
			} else {
				throw new IllegalArgumentException("Unsupported output type");
			}
		} else {
			throw new IllegalArgumentException("Boofcv image type not yet supported");
		}
	}
582293
public static void convert(ComplexPolar_F64 input , Complex_F64 output ) {
        output.real = input.r * Math.cos(input.theta);
        output.imaginary = input.r * Math.sin(input.theta);
    }
281254
public static <T extends ImageBase<T>> void sharpen4(T input , T output ) {
		if( input instanceof Planar ) {
			Planar pi = (Planar)input;
			Planar po = (Planar)output;
			for (int i = 0; i < pi.getNumBands(); i++) {
				sharpen4(pi.getBand(i),po.getBand(i));
			}
		} else {
			if (input instanceof GrayU8) {
				EnhanceImageOps.sharpen4((GrayU8) input, (GrayU8) output);
			} else if (input instanceof GrayF32) {
				EnhanceImageOps.sharpen4((GrayF32) input, (GrayF32) output);
			} else {
				throw new IllegalArgumentException("Image type not supported. " + input.getClass().getSimpleName());
			}
		}
	}
1083852
public static <T extends ImageGray<T>> void minimum(Planar<T> input, T output) {
		minimum(input, output, 0, input.getNumBands() - 1);
	}
23420
public static void RGB_to_PLU8(Picture input, Planar<GrayU8> output) {
		if( input.getColor() != ColorSpace.RGB )
			throw new RuntimeException("Unexpected input color space!");
		if( output.getNumBands() != 3 )
			throw new RuntimeException("Unexpected number of bands in output image!");

		output.reshape(input.getWidth(),input.getHeight());

		int dataIn[] = input.getData()[0];

		GrayU8 out0 = output.getBand(0);
		GrayU8 out1 = output.getBand(1);
		GrayU8 out2 = output.getBand(2);

		int indexIn = 0;
		int indexOut = 0;
		for (int i = 0; i < output.height; i++) {
			for (int j = 0; j < output.width; j++, indexOut++ ) {
				int r = dataIn[indexIn++];
				int g = dataIn[indexIn++];
				int b = dataIn[indexIn++];

				out2.data[indexOut] = (byte)r;
				out1.data[indexOut] = (byte)g;
				out0.data[indexOut] = (byte)b;
			}
		}
	}