public SegmentProcess() { super(ImageType.il(3,InterleavedU8.class)); }
public ClassifierProcessing() { super(ImageType.il(3, InterleavedU8.class)); textPaint.setARGB(255, 255, 100, 100); textPaint.setTextSize(18*displayMetrics.density); textPaint.setTypeface(Typeface.create("monospace", Typeface.NORMAL)); textPaint.setTextAlign(Paint.Align.CENTER); bestPaint.setARGB(255, 255, 0, 0); bestPaint.setTextSize(18*displayMetrics.density); bestPaint.setTypeface(Typeface.create("monospace", Typeface.BOLD)); bestPaint.setTextAlign(Paint.Align.CENTER); dimPaint.setARGB(200,0,0,0); }
public static <I extends ImageBase<I>, D extends ImageBase<D>> ImageType<D> getDerivativeType( ImageType<I> imageType ) { switch( imageType.getFamily() ) { case GRAY: return ImageType.single(getDerivativeType(imageType.getImageClass())); case PLANAR: { int numBands = imageType.getNumBands(); return ImageType.pl(numBands, getDerivativeType(imageType.getImageClass())); } case INTERLEAVED: int numBands = imageType.getNumBands(); switch ( imageType.getDataType() ) { case F32: return (ImageType)ImageType.il(numBands, ImageDataType.F32); case F64: return (ImageType)ImageType.il(numBands, ImageDataType.F64); case U8: return (ImageType)ImageType.il(numBands, ImageDataType.S16); case U16: return (ImageType)ImageType.il(numBands, ImageDataType.S32); } } throw new IllegalArgumentException("Unknown image type"); }
public BackgroundMovingBasic_IL(float learnRate, float threshold, Point2Transform2Model_F32<Motion> transform, InterpolationType interpType, ImageType<T> imageType) { super(learnRate, threshold,transform, imageType); this.interpolationInput = FactoryInterpolation.createPixelMB(0, 255, interpType,BorderType.EXTENDED,imageType); int numBands = imageType.getNumBands(); background = new InterleavedF32(1,1,numBands); this.interpolationBG = FactoryInterpolation.createPixelMB( 0, 255, interpType, BorderType.EXTENDED, ImageType.il(numBands, InterleavedF32.class)); this.interpolationBG.setImage(background); pixelInput = new float[numBands]; pixelBack = new float[numBands]; inputWrapper = FactoryGImageMultiBand.create(imageType); }
model = FactoryBackgroundModel.stationaryBasic(configBasic,(ImageType)ImageType.il(3, ImageDataType.U8)); break; model = FactoryBackgroundModel.stationaryGaussian(configGaussian, (ImageType)ImageType.il(3, ImageDataType.U8)); break; model = FactoryBackgroundModel.stationaryGmm(configGmm, (ImageType)ImageType.il(3, ImageDataType.U8)); break;
/** * Configurations background removal. * * @param learnRate Specifies how quickly the background is updated. 0 = static 1.0 = instant. Try 0.05 * @param threshold Threshold for background. Consult a chi-square table for reasonably values. * 10 to 16 for 1 to 3 bands. * @param transform Used to apply motion model * @param interpType Type of interpolation. BILINEAR recommended for accuracy. NEAREST_NEIGHBOR for speed. . * @param imageType Type of input image. */ public BackgroundMovingGaussian_IL(float learnRate, float threshold, Point2Transform2Model_F32<Motion> transform, InterpolationType interpType, ImageType<T> imageType) { super(learnRate, threshold, transform, imageType); int numBands = imageType.getNumBands(); this.interpolateInput = FactoryInterpolation.createPixelMB(0, 255, InterpolationType.BILINEAR, BorderType.EXTENDED, imageType); background = new InterleavedF32(1,1,2*numBands); this.interpolationBG = FactoryInterpolation.createPixelMB( 0, 255, interpType, BorderType.EXTENDED, ImageType.il(numBands*2, InterleavedF32.class)); this.interpolationBG.setImage(background); inputWrapper = FactoryGImageMultiBand.create(imageType); pixelBG = new float[2*numBands]; pixelInput = new float[numBands]; }