LiuSamarabanduTextExtractorMultiscale extends TextExtractor<FImage> { @Override public void processImage( final FImage image ) { final PyramidTextExtractor ped = new PyramidTextExtractor(); 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 ); FImage msFMap = ped.getFeatureMap(); FImage fmap = this.basicTextExtractor.textRegionDetection( image ); if( this.doubleSizePyramid ) fmap = ResizeProcessor.doubleSize( fmap ); msFMap = fmap.add( msFMap ); if( LiuSamarabanduTextExtractorMultiscale.DEBUG ) DisplayUtilities.display( msFMap.normalise(), "Fused Feature Map" ); this.basicTextExtractor.processFeatureMap( msFMap, image ); this.extractedRegions = this.basicTextExtractor.getTextRegions(); if( this.doubleSizePyramid ) for( final Rectangle r : this.extractedRegions.keySet() ) r.scale( 0.5f ); image.internalAssign( fmap ); }  @Override void processImage( final FImage image ); @Override Map<Rectangle, FImage> getTextRegions(); boolean isDoubleSizePyramid(); void setDoubleSizePyramid( final boolean doubleSizePyramid );  }
@Test public void testExtractRegions() { try { final FImage testImage = ImageUtilities.readF( this.getClass().getResource("signtext.jpg") ).normalise() .process( new ResizeProcessor( 400 ) ); final LiuSamarabanduTextExtractorMultiscale te = new LiuSamarabanduTextExtractorMultiscale(); te.processImage( testImage ); } catch( final IOException e ) { e.printStackTrace(); } }