fasteraster-package: Raster Image Processing and Vector Recognition

Description Details Author(s) See Also Examples

Description

If there is a need to recognise edges on a raster image or a bitmap or any kind of a matrix, one can find packages that does only 90 degrees vectorization. Typically the nature of artefact images is linear and can be vectorized in much more efficient way than draw a series of 90 degrees lines. The fasteraster package does recognition of lines using only one pass. It also allows to calculate weight and the mass centers for the recognized zones or polygons.

Details

Use raster2vector to vectorize input matrix. Use rasterZoneAnalyzer to break the input matrix by zones and get their weight and mass center.

Author(s)

Andy Bosyi <andy@bosyi.com>.

Maintainer: Andy Bosyi <andy@bosyi.com>

See Also

http://bosyi.com/craft/

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
  ## Not run: 
  library(fasteraster);
  library(datasets);

  polygons <- raster2vector(volcano, 120, 200, 20, 1);
  image(volcano, col = rev(grey.colors(100)), useRaster = TRUE)
  plot(0, type = "l", xlim = c(0, nrow(volcano)), ylim = c(0, ncol(volcano)))
  a <- lapply(polygons, function(x) lines(rbind(x, x[1,])))

  zones <- rasterZoneAnalyzer(volcano, 120, 200, 20);
  a <- text(zones[ , 3], zones[ , 4], labels = zones[ , 2]);
  
## End(Not run)

Example output



fasteraster documentation built on May 2, 2019, 3:35 p.m.