@Override protected void beforeProcess(GaussianOctave<FImage> octave) { scales = octave.options.getScales(); // the magnitude threshold must be adjusted based on the number of // scales, // as more scales will result in smaller differences between scales normMagnitudeScales = magnitudeThreshold / octave.options.getScales(); }
private void findAcrossScales(FImage image, InterestPointFeatureCollector<T> collector) { final OctaveInterestPointFinder<T> finder = constructFinder(); finder.setOctaveInterestPointListener(collector); final GaussianPyramidOptions<FImage> options = new GaussianPyramidOptions<FImage>(); options.setDoubleInitialImage(false); options.setInitialSigma(1.0f); options.setExtraScaleSteps(0); options.setOctaveProcessor(finder); final GaussianPyramid<FImage> pyr = new GaussianPyramid<FImage>(options); pyr.process(image); finder.finish(); }
@Override public void process(GaussianOctave<MBFImage> octave) { images = new FImage[options.getScales() + options.getExtraScaleSteps()]; //compute DoG by subtracting adjacent levels for (int i = 0; i < images.length; i++) { images[i] = octave.images[i].bands.get(0).clone(); images[i].subtractInplace(octave.images[i + 1].bands.get(0)); } } }
final GaussianPyramidOptions<FImage> gpo = new GaussianPyramidOptions<FImage>(); gpo.setScales( 1 ); gpo.setExtraScaleSteps( 1 ); gpo.setPyramidProcessor( ped ); gpo.setDoubleInitialImage( this.doubleSizePyramid ); final GaussianPyramid<FImage> gp = new GaussianPyramid<FImage>( gpo ); image.analyseWith( gp );
@Override public void process(GaussianOctave<MBFImage> octave) { gaussianOctave = octave; GaussianPyramidOptions<FImage> opts = new GaussianPyramidOptions<FImage>(octave.options); GaussianPyramid<FImage> gp = new GaussianPyramid<FImage>(opts); dogOctave = new FirstBandDoGOctave(gp, octave.octaveSize); dogOctave.process(octave); innerFinder.process(dogOctave); }
@Override public void process(GaussianOctave<FImage> octave) { for (int currentScaleIndex = 0; currentScaleIndex < octave.images.length; currentScaleIndex++) { final FImage fImage = octave.images[currentScaleIndex]; final float currentScale = (float) (octave.options.getInitialSigma() * Math.pow(2, (float) currentScaleIndex / octave.options.getScales())); detector.setDetectionScale(currentScale); detector.findInterestPoints(fImage); final List<T> points = this.selectionMode.selectPoints(detector); processOctaveLevelPoints(fImage, points, currentScale, octave.octaveSize); } }
@Override public void process(OCTAVE octave) { beforeProcess(octave); this.octave = octave; final FImage[] images = octave.images; final int height = images[0].height; final int width = images[0].width; final int borderDist = octave.options.getBorderPixels(); // search through the scale-space images, leaving a border for (currentScaleIndex = 1; currentScaleIndex < images.length - 1; currentScaleIndex++) { for (int y = borderDist; y < height - borderDist; y++) { for (int x = borderDist; x < width - borderDist; x++) { final float val = images[currentScaleIndex].pixels[y][x]; if (firstCheck(val, x, y, currentScaleIndex, images) && isLocalExtremum(val, images[currentScaleIndex - 1], x, y) && isLocalExtremum(val, images[currentScaleIndex], x, y) && isLocalExtremum(val, images[currentScaleIndex + 1], x, y) && isNotEdge(images[currentScaleIndex], x, y)) { processExtrema(images, currentScaleIndex, x, y, octave.octaveSize); } } } } }
/** * {@inheritDoc} * @see org.openimaj.image.analysis.pyramid.PyramidProcessor#process(org.openimaj.image.analysis.pyramid.gaussian.GaussianPyramid) */ @Override public void process( final GaussianPyramid<FImage> pyramid ) { FImage fmap = null; // Process each of the octaves in the pyramid for( final GaussianOctave<FImage> octave : pyramid ) { // Extract text regions using the basic text extractor FImage octaveFMap = LiuSamarabanduTextExtractorMultiscale.this.basicTextExtractor.textRegionDetection( octave.getNextOctaveImage() ); if( fmap == null ) fmap = octaveFMap; else { // Fuse across scales octaveFMap = ResizeProcessor.resample( octaveFMap, fmap.getWidth(), fmap.getHeight() ).normalise(); if( LiuSamarabanduTextExtractorMultiscale.DEBUG ) DisplayUtilities.display( octaveFMap, "Resized feature map" ); fmap.addInplace( octaveFMap ); } } this.featureMap = fmap; } }
@Override protected void processExtrema(FImage[] dogs, int s, int x, int y, float octSize) { // calculate the actual scale within the octave final float octaveScale = octave.options.getInitialSigma() * (float) Math.pow(2.0, s / scales); // fire the listener if (listener != null) listener.foundInterestPoint(this, x, y, octaveScale); } }
private void findAcrossScales(FImage image, InterestPointFeatureCollector<T> collector) { final OctaveInterestPointFinder<T> finder = constructFinder(); finder.setOctaveInterestPointListener(collector); final GaussianPyramidOptions<FImage> options = new GaussianPyramidOptions<FImage>(); options.setDoubleInitialImage(false); options.setInitialSigma(1.0f); options.setExtraScaleSteps(0); options.setOctaveProcessor(finder); final GaussianPyramid<FImage> pyr = new GaussianPyramid<FImage>(options); pyr.process(image); finder.finish(); }
@Override public void process(GaussianOctave<MBFImage> octave) { gaussianOctave = octave; GaussianPyramidOptions<FImage> opts = new GaussianPyramidOptions<FImage>(octave.options); GaussianPyramid<FImage> gp = new GaussianPyramid<FImage>(opts); dogOctave = new FirstBandDoGOctave(gp, octave.octaveSize); dogOctave.process(octave); innerFinder.process(dogOctave); }
@Override public void process(GaussianOctave<MBFImage> octave) { images = new FImage[options.getScales() + options.getExtraScaleSteps()]; //compute DoG by subtracting adjacent levels for (int i = 0; i < images.length; i++) { images[i] = octave.images[i].bands.get(0).clone(); images[i].subtractInplace(octave.images[i + 1].bands.get(0)); } } }
@Override public void process(GaussianOctave<FImage> octave) { for (int currentScaleIndex = 0; currentScaleIndex < octave.images.length; currentScaleIndex++) { final FImage fImage = octave.images[currentScaleIndex]; final float currentScale = (float) (octave.options.getInitialSigma() * Math.pow(2, (float) currentScaleIndex / octave.options.getScales())); detector.setDetectionScale(currentScale); detector.findInterestPoints(fImage); final List<T> points = this.selectionMode.selectPoints(detector); processOctaveLevelPoints(fImage, points, currentScale, octave.octaveSize); } }
@Override public void process(OCTAVE octave) { beforeProcess(octave); this.octave = octave; final FImage[] images = octave.images; final int height = images[0].height; final int width = images[0].width; final int borderDist = octave.options.getBorderPixels(); // search through the scale-space images, leaving a border for (currentScaleIndex = 1; currentScaleIndex < images.length - 1; currentScaleIndex++) { for (int y = borderDist; y < height - borderDist; y++) { for (int x = borderDist; x < width - borderDist; x++) { final float val = images[currentScaleIndex].pixels[y][x]; if (firstCheck(val, x, y, currentScaleIndex, images) && isLocalExtremum(val, images[currentScaleIndex - 1], x, y) && isLocalExtremum(val, images[currentScaleIndex], x, y) && isLocalExtremum(val, images[currentScaleIndex + 1], x, y) && isNotEdge(images[currentScaleIndex], x, y)) { processExtrema(images, currentScaleIndex, x, y, octave.octaveSize); } } } } }
@Override protected void beforeProcess(GaussianOctave<FImage> octave) { scales = octave.options.getScales(); // the magnitude threshold must be adjusted based on the number of // scales, // as more scales will result in smaller differences between scales normMagnitudeScales = magnitudeThreshold / octave.options.getScales(); }
@Override protected void processExtrema(FImage[] dogs, int s, int x, int y, float octSize) { // calculate the actual scale within the octave final float octaveScale = octave.options.getInitialSigma() * (float) Math.pow(2.0, s / scales); // fire the listener if (listener != null) listener.foundInterestPoint(this, x, y, octaveScale); } }
@SuppressWarnings("unchecked") @Override public void process(GaussianOctave<I> octave) { images = (I[]) Array.newInstance(octave.images[0].getClass(), options.getScales() + options.getExtraScaleSteps()); //compute DoG by subtracting adjacent levels for (int i = 0; i < images.length; i++) { images[i] = octave.images[i].clone(); images[i].subtractInplace(octave.images[i + 1]); } } }
scales = ((GaussianPyramidOptions<IMAGE>) octave.options).getScales(); octaveScale = ((GaussianPyramidOptions<IMAGE>) octave.options).getInitialSigma() * (float) Math.pow(2.0, currentScaleIndex / scales);
@SuppressWarnings("unchecked") @Override public void process(GaussianOctave<I> octave) { images = (I[]) Array.newInstance(octave.images[0].getClass(), options.getScales() + options.getExtraScaleSteps()); //compute DoG by subtracting adjacent levels for (int i = 0; i < images.length; i++) { images[i] = octave.images[i].clone(); images[i].subtractInplace(octave.images[i + 1]); } } }
scales = ((GaussianPyramidOptions<IMAGE>) octave.options).getScales(); octaveScale = ((GaussianPyramidOptions<IMAGE>) octave.options).getInitialSigma() * (float) Math.pow(2.0, currentScaleIndex / scales);