@Override public int getPixelStride() { return image.getNumBands(); }
@Override public int getNumberOfBands() {return image.getNumBands();}
@Override protected void init(Input srcImg, Output dstImg) { super.init(srcImg,dstImg); if( values.length != srcImg.getNumBands() ) { values = new float[ srcImg.getNumBands() ]; } }
/** * Checks to see if the image and its transform are appropriate sizes . The transform should have * twice the width and twice the height as the image. * * @param image Storage for an image * @param transform Storage for a Fourier Transform */ public static void checkImageArguments( ImageBase image , ImageInterleaved transform ) { InputSanityCheck.checkSameShape(image,transform); if( 2 != transform.getNumBands() ) throw new IllegalArgumentException("The transform must have two bands"); }
numBands = raster.getNumBands(); if( dst.getNumBands() != numBands ) throw new IllegalArgumentException("Expected "+numBands+" bands in dst not "+dst.getNumBands());
@Override protected void updateBackground(int x0, int y0, int x1, int y1, T frame) { transform.setModel(worldToCurrent); interpolationInput.setImage(frame); final int numBands = frame.getNumBands(); float minusLearn = 1.0f - learnRate; for (int y = y0; y < y1; y++) { int indexBG = background.startIndex + y*background.stride + x0*numBands; for (int x = x0; x < x1; x++ ) { transform.compute(x,y,work); if( work.x >= 0 && work.x < frame.width && work.y >= 0 && work.y < frame.height) { interpolationInput.get(work.x, work.y, pixelInput); for (int band = 0; band < numBands; band++, indexBG++) { float value = pixelInput[band]; float bg = background.data[indexBG]; if( bg == Float.MAX_VALUE ) { background.data[indexBG] = value; } else { background.data[indexBG] = minusLearn*bg + learnRate*value; } } } else { indexBG += numBands; } } } }
for (int i = 0; i < il.getNumBands(); i++) { GImageMiscOps.insertBand(sb, i, il);