@Override public void reset() { background.reshape(1,1); }
@Override public void reset() { background.reshape(1,1); }
@Override public void reset() { background.reshape(1,1); }
public void process( final BufferedImage image ) { input.reshape(image.getWidth(),image.getHeight()); output.reshape(image.getWidth(),image.getHeight()); ConvertBufferedImage.convertFromPlanar(image, input,true, GrayF32.class); SwingUtilities.invokeLater(new Runnable() { public void run() { setInputImage(image); doRefreshAll(); }}); }
public void process( final BufferedImage image ) { input.reshape(image.getWidth(),image.getHeight()); output.reshape(image.getWidth(),image.getHeight()); storage.reshape(image.getWidth(),image.getHeight()); ConvertBufferedImage.convertFromPlanar(image, input, true, imageType); SwingUtilities.invokeLater(new Runnable() { public void run() { setInputImage(image); renderedImage = new BufferedImage(input.width, input.height,BufferedImage.TYPE_INT_BGR); gui.setImage(renderedImage); gui.setPreferredSize(new Dimension(input.width,input.height)); gui.repaint(); processedImage = true; doRefreshAll(); }}); }
@Override public void initialize(int imageWidth, int imageHeight, int sensorOrientation) { gray.reshape(imageWidth,imageHeight); enhanced.reshape(imageWidth,imageHeight); }
/** * Converts a {@link InterleavedU8} into the equivalent {@link Planar} * * @param input (Input) ImageInterleaved 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 Planar<GrayU8> convert( InterleavedU8 input , Planar<GrayU8> output ) { if (output == null) { output = new Planar<GrayU8>(GrayU8.class,input.width, input.height,input.numBands); } else { output.reshape(input.width,input.height,input.numBands); } ImplConvertImage.convert(input,output); return output; }
/** * Converts a {@link InterleavedS8} into the equivalent {@link Planar} * * @param input (Input) ImageInterleaved 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 Planar<GrayS8> convert( InterleavedS8 input , Planar<GrayS8> output ) { if (output == null) { output = new Planar<GrayS8>(GrayS8.class,input.width, input.height,input.numBands); } else { output.reshape(input.width,input.height,input.numBands); } ImplConvertImage.convert(input,output); return output; }
/** * Converts a {@link InterleavedS16} into the equivalent {@link Planar} * * @param input (Input) ImageInterleaved 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 Planar<GrayS16> convert( InterleavedS16 input , Planar<GrayS16> output ) { if (output == null) { output = new Planar<GrayS16>(GrayS16.class,input.width, input.height,input.numBands); } else { output.reshape(input.width,input.height,input.numBands); } ImplConvertImage.convert(input,output); return output; }
/** * Converts a {@link InterleavedF32} into the equivalent {@link Planar} * * @param input (Input) ImageInterleaved 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 Planar<GrayF32> convert( InterleavedF32 input , Planar<GrayF32> output ) { if (output == null) { output = new Planar<GrayF32>(GrayF32.class,input.width, input.height,input.numBands); } else { output.reshape(input.width,input.height,input.numBands); } ImplConvertImage.convert(input,output); return output; }
/** * Converts a {@link InterleavedS64} into the equivalent {@link Planar} * * @param input (Input) ImageInterleaved 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 Planar<GrayS64> convert( InterleavedS64 input , Planar<GrayS64> output ) { if (output == null) { output = new Planar<GrayS64>(GrayS64.class,input.width, input.height,input.numBands); } else { output.reshape(input.width,input.height,input.numBands); } ImplConvertImage.convert(input,output); return output; }
public void process( BufferedImage image , Gaussian3D_F64 model ) { binary.reshape(image.getWidth(),image.getHeight()); colorRGB.reshape(image.getWidth(),image.getHeight()); ConvertBufferedImage.convertFrom(image, colorRGB, true); GaussianColorClassifier.classify(colorRGB,model,12,binary); int color = 0xe394bb; for( int y = 0; y < binary.height; y++ ) { for( int x = 0; x < binary.width; x++ ) { int[] data = new int[1]; binary.get(x,y, data); if( data[0] != 0 ) { image.setRGB(x,y,color); } } } ShowImages.showWindow(image,"Segmented"); }
@Override public void initialize(int backgroundWidth, int backgroundHeight, Motion homeToWorld) { background.reshape(backgroundWidth,backgroundHeight); GImageMiscOps.fill(background, Float.MAX_VALUE); this.homeToWorld.set(homeToWorld); this.homeToWorld.invert(worldToHome); this.backgroundWidth = backgroundWidth; this.backgroundHeight = backgroundHeight; }
private void renderPinhole() { if( distortImage == null ) return; imageRendered.reshape(pinholeModel.width,pinholeModel.height); distortImage.apply(imageFisheye,imageRendered); bufferedRendered = ConvertBufferedImage.checkDeclare( imageRendered.width,imageRendered.height,bufferedRendered,BufferedImage.TYPE_INT_RGB); ConvertBufferedImage.convertTo(imageRendered,bufferedRendered,true); }
@Override public void initialize(int backgroundWidth, int backgroundHeight, Motion homeToWorld) { background.reshape(backgroundWidth,backgroundHeight); GImageMiscOps.fill(background.getBand(0),0); GImageMiscOps.fill(background.getBand(1),-1); this.homeToWorld.set(homeToWorld); this.homeToWorld.invert(worldToHome); this.backgroundWidth = backgroundWidth; this.backgroundHeight = backgroundHeight; }
@Override public void initialize(int backgroundWidth, int backgroundHeight, Motion homeToWorld) { background.reshape(backgroundWidth,backgroundHeight); for (int i = 0; i < background.getNumBands(); i+=2) { GImageMiscOps.fill(background.getBand(i),0); GImageMiscOps.fill(background.getBand(i+1),-1); } this.homeToWorld.set(homeToWorld); this.homeToWorld.invert(worldToHome); this.backgroundWidth = backgroundWidth; this.backgroundHeight = backgroundHeight; }
@Override public void setImage(Planar<T> image) { gray.reshape(image.width,image.height); grayII.reshape(image.width,image.height); bandII.reshape(image.width,image.height); GConvertImage.average(image, gray); GIntegralImageOps.transform(gray, grayII); for( int i = 0; i < image.getNumBands(); i++) GIntegralImageOps.transform(image.getBand(i), bandII.getBand(i)); alg.setImage(grayII,bandII); }
private void undoRadialDistortion(BufferedImage image) { if( undoRadial == null ) return; ConvertBufferedImage.convertFrom(image,origMS,true); if( correctedMS.getNumBands() != origMS.getNumBands() ) correctedMS.setNumberOfBands(origMS.getNumBands()); correctedMS.reshape(origMS.width,origMS.height); for( int i = 0; i < origMS.getNumBands(); i++ ) { GrayF32 in = origMS.getBand(i); GrayF32 out = correctedMS.getBand(i); undoRadial.apply(in,out); } undistorted = ConvertBufferedImage.checkDeclare(origMS.width,origMS.height,undistorted,image.getType()); ConvertBufferedImage.convertTo(correctedMS,undistorted,true); }
@Override public void detect(Planar<T> input) { gray.reshape(input.width,input.height); grayII.reshape(input.width,input.height); bandII.reshape(input.width,input.height); GConvertImage.average(input,gray); GIntegralImageOps.transform(gray, grayII); for( int i = 0; i < input.getNumBands(); i++) GIntegralImageOps.transform(input.getBand(i), bandII.getBand(i)); alg.detect(grayII,bandII); }