public static void parseDepth( String fileName , GrayU16 depth , GrowQueue_I8 data ) throws IOException { DataInputStream in = new DataInputStream(new FileInputStream(fileName)); String s[] = readLine(in).split(" "); int w = Integer.parseInt(s[0]); int h = Integer.parseInt(s[1]); int length = w*h*2; if( data == null ) data = new GrowQueue_I8(length); else data.resize(length); in.read(data.data,0,length); depth.reshape(w,h); UtilOpenKinect.bufferDepthToU16(data.data, depth); }
/** * Converts a {@link InterleavedU16} into a {@link GrayU16} by computing the average value of each pixel * across all the bands. * * @param input (Input) The ImageInterleaved that is being converted. Not modified. * @param output (Optional) The single band output image. If null a new image is created. Modified. * @return Converted image. */ public static GrayU16 average( InterleavedU16 input , GrayU16 output ) { if (output == null) { output = new GrayU16(input.width, input.height); } else { output.reshape(input.width,input.height); } ConvertInterleavedToSingle.average(input, output); return output; }
/** * <p> * Converts an {@link boofcv.struct.image.GrayS32} into a {@link boofcv.struct.image.GrayU16}. * </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 GrayU16 convert(GrayS32 input, GrayU16 output) { if (output == null) { output = new GrayU16(input.width, input.height); } else { output.reshape(input.width,input.height); } ImplConvertImage.convert(input, output); return output; }
/** * Converts a {@link Planar} into a {@link ImageGray} by computing the average value of each pixel * across all the bands. * * @param input Input Planar image that is being converted. Not modified. * @param output (Optional) The single band output image. If null a new image is created. Modified. * @return Converted image. */ public static GrayU16 average( Planar<GrayU16> input , GrayU16 output ) { if (output == null) { output = new GrayU16(input.width, input.height); } else { output.reshape(input.width,input.height); } ImplConvertPlanarToGray.average(input, output); return output; }
/** * <p> * Converts an {@link boofcv.struct.image.GrayS8} into a {@link boofcv.struct.image.GrayU16}. * </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 GrayU16 convert(GrayS8 input, GrayU16 output) { if (output == null) { output = new GrayU16(input.width, input.height); } else { output.reshape(input.width,input.height); } ImplConvertImage.convert(input, output); return output; }
/** * <p> * Converts an {@link boofcv.struct.image.GrayS64} into a {@link boofcv.struct.image.GrayU16}. * </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 GrayU16 convert(GrayS64 input, GrayU16 output) { if (output == null) { output = new GrayU16(input.width, input.height); } else { output.reshape(input.width,input.height); } ImplConvertImage.convert(input, output); return output; }
/** * <p> * Converts an {@link boofcv.struct.image.GrayF32} into a {@link boofcv.struct.image.GrayU16}. * </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 GrayU16 convert(GrayF32 input, GrayU16 output) { if (output == null) { output = new GrayU16(input.width, input.height); } else { output.reshape(input.width,input.height); } ImplConvertImage.convert(input, output); return output; }
/** * <p> * Converts an {@link boofcv.struct.image.GrayU8} into a {@link boofcv.struct.image.GrayU16}. * </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 GrayU16 convert(GrayU8 input, GrayU16 output) { if (output == null) { output = new GrayU16(input.width, input.height); } else { output.reshape(input.width,input.height); } ImplConvertImage.convert(input, output); return output; }
/** * <p> * Converts an {@link boofcv.struct.image.GrayS16} into a {@link boofcv.struct.image.GrayU16}. * </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 GrayU16 convert(GrayS16 input, GrayU16 output) { if (output == null) { output = new GrayU16(input.width, input.height); } else { output.reshape(input.width,input.height); } ImplConvertImage.convert(input, output); return output; }
/** * <p> * Converts an {@link boofcv.struct.image.GrayF64} into a {@link boofcv.struct.image.GrayU16}. * </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 GrayU16 convert(GrayF64 input, GrayU16 output) { if (output == null) { output = new GrayU16(input.width, input.height); } else { output.reshape(input.width,input.height); } ImplConvertImage.convert(input, output); return output; }
depth.reshape(w,h); rgb.reshape(w,h);