Description Details Author(s) See Also Examples
RsimMosaic is a package for transforming an image into a mosaic composed from a set of smaller images (tiles). This library also contains a simple function for creating the tiles from a folder of images directly through R, without the need of any external code. At this moment only the JPEG format is supported, either as input (image and tiles) or output (mosaic transformed image).
Package: | RsimMosaic |
Type: | Package |
Version: | 1.0.2 |
Date: | 2014-08-23 |
License: | GPL (>= 2) |
The RsimMosaic, or the R Simple IMage Mosaic creation library, is a package for the production of mosaics. From a set of images that are called tiles, the implemented methods are able to compose a mosaic that mimics a user selected image. One example is represented in the figure below:
Note that the larger and the more varied is the adopted tile library, the more faithful will be the resulting mosaic. This package comes with a very small library, containing only 100 stamps of astronomical sources (called Messier objects) from the 2MASS catalogue, for example and test purposes.
Author: Alberto Krone-Martins
Maintainer: Alberto Krone-Martins <algol@sim.ul.pt>
composeMosaicFromImageRandom
, composeMosaicFromImageRegular
, createTiles
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # This example will transform an image of the Moon into a mosaic
# composed by objects from the Messier catalogue. The tiles were
# created from the images of the 2MASS catalogue.
#
# Set the filename of the original image
#origImgFileN <- system.file("extdata", "verySmallMoon.jpg", package="RsimMosaic")
origImgFileN <- system.file("extdata", "reallyVerySmallMoon.jpg", package="RsimMosaic")
# Set the folder where the tiles library is located
pathToTileLib <- system.file("extdata/2Massier", package="RsimMosaic")
# Set the filename of the output image (the mosaic!)
outImgFileN <- file.path(tempdir(), "verySmallMoon-2MASS-Mosaic.jpg")
# Create the mosaic
composeMosaicFromImageRandom(origImgFileN, outImgFileN, pathToTileLib, removeTiles=FALSE)
|
------------------------------------------------
R Simple Mosaic composer - random version
------------------------------------------------
Creating the library...
-- Tiles in the Library : 100
-- Tile dimensions : 60 x 60
Reading the original image...
-- Original image dimensions : 38 x 40
-- Output image dimensions : 2160 x 2280
Computing the mosaic...
Done!
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.