@Override public InterleavedF64 createNew(int imgWidth, int imgHeight) { if (imgWidth == -1 || imgHeight == -1) return new InterleavedF64(); return new InterleavedF64(imgWidth, imgHeight, numBands); } }
/** * <p> * Converts an {@link boofcv.struct.image.InterleavedS16} into a {@link boofcv.struct.image.InterleavedF64}. * </p> * * @param input Input image which is being converted. Not modified. * @param output (Optional) The output image. If null a new image is created. Modified. * @return Converted image. */ public static InterleavedF64 convert(InterleavedS16 input, InterleavedF64 output) { if (output == null) { output = new InterleavedF64(input.width, input.height, input.numBands); } else { output.reshape(input.width,input.height,input.numBands); } ImplConvertImage.convert(input, output); return output; }
/** * <p> * Converts an {@link boofcv.struct.image.InterleavedF32} into a {@link boofcv.struct.image.InterleavedF64}. * </p> * * @param input Input image which is being converted. Not modified. * @param output (Optional) The output image. If null a new image is created. Modified. * @return Converted image. */ public static InterleavedF64 convert(InterleavedF32 input, InterleavedF64 output) { if (output == null) { output = new InterleavedF64(input.width, input.height, input.numBands); } else { output.reshape(input.width,input.height,input.numBands); } ImplConvertImage.convert(input, output); return output; }
/** * <p> * Converts an {@link boofcv.struct.image.InterleavedS8} into a {@link boofcv.struct.image.InterleavedF64}. * </p> * * @param input Input image which is being converted. Not modified. * @param output (Optional) The output image. If null a new image is created. Modified. * @return Converted image. */ public static InterleavedF64 convert(InterleavedS8 input, InterleavedF64 output) { if (output == null) { output = new InterleavedF64(input.width, input.height, input.numBands); } else { output.reshape(input.width,input.height,input.numBands); } ImplConvertImage.convert(input, output); return output; }
/** * <p> * Converts an {@link boofcv.struct.image.InterleavedS32} into a {@link boofcv.struct.image.InterleavedF64}. * </p> * * @param input Input image which is being converted. Not modified. * @param output (Optional) The output image. If null a new image is created. Modified. * @return Converted image. */ public static InterleavedF64 convert(InterleavedS32 input, InterleavedF64 output) { if (output == null) { output = new InterleavedF64(input.width, input.height, input.numBands); } else { output.reshape(input.width,input.height,input.numBands); } ImplConvertImage.convert(input, output); return output; }
/** * <p> * Converts an {@link boofcv.struct.image.InterleavedU8} into a {@link boofcv.struct.image.InterleavedF64}. * </p> * * @param input Input image which is being converted. Not modified. * @param output (Optional) The output image. If null a new image is created. Modified. * @return Converted image. */ public static InterleavedF64 convert(InterleavedU8 input, InterleavedF64 output) { if (output == null) { output = new InterleavedF64(input.width, input.height, input.numBands); } else { output.reshape(input.width,input.height,input.numBands); } ImplConvertImage.convert(input, output); return output; }
/** * <p> * Converts an {@link boofcv.struct.image.InterleavedU16} into a {@link boofcv.struct.image.InterleavedF64}. * </p> * * @param input Input image which is being converted. Not modified. * @param output (Optional) The output image. If null a new image is created. Modified. * @return Converted image. */ public static InterleavedF64 convert(InterleavedU16 input, InterleavedF64 output) { if (output == null) { output = new InterleavedF64(input.width, input.height, input.numBands); } else { output.reshape(input.width,input.height,input.numBands); } ImplConvertImage.convert(input, output); return output; }
/** * <p> * Converts an {@link boofcv.struct.image.InterleavedS64} into a {@link boofcv.struct.image.InterleavedF64}. * </p> * * @param input Input image which is being converted. Not modified. * @param output (Optional) The output image. If null a new image is created. Modified. * @return Converted image. */ public static InterleavedF64 convert(InterleavedS64 input, InterleavedF64 output) { if (output == null) { output = new InterleavedF64(input.width, input.height, input.numBands); } else { output.reshape(input.width,input.height,input.numBands); } ImplConvertImage.convert(input, output); return output; }
/** * Converts a {@link Planar} into the equivalent {@link InterleavedF64} * * @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. */ public static InterleavedF64 convert( Planar<GrayF64> input , InterleavedF64 output ) { if (output == null) { output = new InterleavedF64(input.width, input.height,input.getNumBands()); } else { output.reshape(input.width,input.height,input.getNumBands()); } ImplConvertImage.convert(input,output); return output; }
public static <T extends ImageInterleaved<T>> T createInterleaved(Class<T> type, int width, int height , int numBands) { type = BoofTesting.convertGenericToSpecificType(type); if (type == InterleavedU8.class) { return (T)new InterleavedU8(width, height,numBands); } else if (type == InterleavedS8.class) { return (T)new InterleavedS8(width, height,numBands); } else if (type == InterleavedU16.class) { return (T)new InterleavedU16(width, height,numBands); } else if (type == InterleavedS16.class) { return (T)new InterleavedS16(width, height,numBands); } else if (type == InterleavedS32.class) { return (T)new InterleavedS32(width, height,numBands); } else if (type == InterleavedS64.class) { return (T)new InterleavedS64(width, height,numBands); } else if (type == InterleavedF32.class) { return (T)new InterleavedF32(width, height,numBands); } else if (type == InterleavedF64.class) { return (T)new InterleavedF64(width, height,numBands); } else if( (Class)type == ImageInterleaved.class ) { // ImageInteger is a generic type, so just create something return (T)new InterleavedS32(width,height,numBands); } throw new RuntimeException("Unknown type: "+type.getSimpleName()); }
InterleavedF64 storageTL = new InterleavedF64(hw1,hh1,2); storageTL.setTo(transform.subimage(0, 0, hw1, hh1, null)); InterleavedF64 storageTR = new InterleavedF64(hw,hh1,2); storageTR.setTo(transform.subimage(hw1, 0, w, hh1, null)); transform.subimage(0,hh,hw,h, null).setTo(storageTR); } else { InterleavedF64 storageBL = new InterleavedF64(hw,hh1,2); storageBL.setTo(transform.subimage(0, hh, hw, h, null)); InterleavedF64 storageBR = new InterleavedF64(hw1,hh1,2); storageBR.setTo(transform.subimage(hw, hh, w, h, null));