/** * Configures the descriptor. * * @param widthSubregion Width of sub-region in samples. Try 4 * @param widthGrid Width of grid in subregions. Try 4. * @param numHistogramBins Number of bins in histogram. Try 8 * @param sigmaToPixels Conversion of sigma to pixels. Used to scale the descriptor region. Try 1.5 ?????? * @param weightingSigmaFraction Sigma for Gaussian weighting function is set to this value * region width. Try 0.5 * @param maxDescriptorElementValue Helps with non-affine changes in lighting. See paper. Try 0.2 */ public DescribePointSift(int widthSubregion, int widthGrid, int numHistogramBins, double sigmaToPixels, double weightingSigmaFraction, double maxDescriptorElementValue , Class<Deriv> derivType ) { super(widthSubregion,widthGrid,numHistogramBins,weightingSigmaFraction,maxDescriptorElementValue); this.sigmaToPixels = sigmaToPixels; imageDerivX = FactoryGImageGray.create(derivType); imageDerivY = FactoryGImageGray.create(derivType); }
/** * 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. Try 10. * @param imageType Type of input image. */ public BackgroundStationaryGaussian_SB(float learnRate, float threshold, Class<T> imageType) { super(learnRate, threshold, ImageType.single(imageType)); inputWrapper = FactoryGImageGray.create(imageType); }
/** * Configures orientation estimation * * @param histogramSize Number of elements in the histogram. Standard is 36 * @param sigmaEnlarge How much the scale is enlarged by. Standard is 1.5 */ public OrientationHistogramSift(int histogramSize , double sigmaEnlarge , Class<Deriv> derivType ) { this.histogramMag = new double[ histogramSize ]; this.histogramX = new double[ histogramSize ]; this.histogramY = new double[ histogramSize ]; this.sigmaEnlarge = sigmaEnlarge; this.histAngleBin = 2.0*Math.PI/histogramSize; // compute an approximation of a Gaussian distribution as a function of the distance squared double samples[] = new double[ (int)(4*4/approximateStep) ]; for( int i = 0; i < samples.length; i++ ) { double dx2 = i*approximateStep; samples[i] = Math.exp(-0.5*dx2 ); } approximateGauss = new InterpolateArray(samples); this.derivX = FactoryGImageGray.create(derivType); this.derivY = FactoryGImageGray.create(derivType); }
public BaseIntegralEdge(Class<T> imageType) { this.imageType = imageType; this.integral = new ImageLineIntegral(); this.integralImage = FactoryGImageGray.create(imageType); }
public BackgroundStationaryBasic_SB(float learnRate, float threshold, Class<T> imageType) { super(learnRate, threshold, ImageType.single(imageType)); inputWrapper = FactoryGImageGray.create(imageType); }
/** * Specifies SIFT descriptor structure and sampling frequency. * @param widthSubregion Width of sub-region in samples. Try 4 * @param widthGrid Width of grid in subregions. Try 4. * @param numHistogramBins Number of bins in histogram. Try 8 * @param weightingSigmaFraction Sigma for Gaussian weighting function is set to this value * region width. Try 0.5 * @param maxDescriptorElementValue Helps with non-affine changes in lighting. See paper. Try 0.2 * @param periodColumns Number of pixels between samples along x-axis * @param periodRows Number of pixels between samples along y-axis * @param derivType Type of input derivative image */ public DescribeDenseSiftAlg(int widthSubregion, int widthGrid, int numHistogramBins, double weightingSigmaFraction , double maxDescriptorElementValue, double periodColumns, double periodRows , Class<D> derivType ) { super(widthSubregion,widthGrid,numHistogramBins,weightingSigmaFraction,maxDescriptorElementValue); this.periodRows = periodRows; this.periodColumns = periodColumns; final int DOF = getDescriptorLength(); imageDerivX = FactoryGImageGray.create(derivType); imageDerivY = FactoryGImageGray.create(derivType); descriptors = new FastQueue<TupleDesc_F64>(TupleDesc_F64.class,true) { @Override protected TupleDesc_F64 createInstance() { return new TupleDesc_F64(DOF); } }; }
/** * Used to specify a transform that is applied to pixel coordinates to bring them back into original input * image coordinates. For example if the input image has lens distortion but the edge were found * in undistorted coordinates this code needs to know how to go from undistorted back into distorted * image coordinates in order to read the pixel's value. * * @param undistToDist Pixel transformation from undistorted pixels into the actual distorted input image.. */ public void setTransform( PixelTransform2_F32 undistToDist ) { if( undistToDist != null ) { InterpolatePixelS<T> interpolate = FactoryInterpolation.bilinearPixelS(imageType, BorderType.EXTENDED); integralImage = new GImageGrayDistorted<>(undistToDist, interpolate); } else { integralImage = FactoryGImageGray.create(imageType); } }
public BackgroundMovingBasic_SB(float learnRate, float threshold, Point2Transform2Model_F32<Motion> transform, InterpolationType interpType, Class<T> imageType) { super(learnRate, threshold, transform, ImageType.single(imageType)); this.interpolateInput = FactoryInterpolation.bilinearPixelS(imageType, BorderType.EXTENDED); this.interpolationBG = FactoryInterpolation.createPixelS(0, 255, interpType, BorderType.EXTENDED, GrayF32.class); this.interpolationBG.setBorder(FactoryImageBorder.single(GrayF32.class, BorderType.EXTENDED)); this.interpolationBG.setImage(background); inputWrapper = FactoryGImageGray.create(imageType); }
/** * 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. Try 10. * @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_SB(float learnRate, float threshold, Point2Transform2Model_F32<Motion> transform, InterpolationType interpType, Class<T> imageType) { super(learnRate, threshold, transform, ImageType.single(imageType)); this.interpolateInput = FactoryInterpolation.bilinearPixelS(imageType, BorderType.EXTENDED); this.interpolationBG = FactoryInterpolation.createPixelMB( 0, 255, interpType, BorderType.EXTENDED, ImageType.pl(2, GrayF32.class)); this.interpolationBG.setImage(background); inputWrapper = FactoryGImageGray.create(imageType); }
public static GImageMultiBand create( ImageType imageType ) { if( imageType.getFamily() == ImageType.Family.GRAY ) { return new GSingleToMB(FactoryGImageGray.create(imageType.getImageClass())); } if( imageType.getFamily() == ImageType.Family.PLANAR) { return new PL(); } else if( imageType.getFamily() == ImageType.Family.INTERLEAVED ) { switch( imageType.getDataType() ) { case U8: return new IL_U8(); case S8: return new IL_S8(); case F32: return new IL_F32(); default: throw new IllegalArgumentException("Need to support more data types"); } } else { throw new RuntimeException("Add support for more families"); } }