Learn R Programming

RsimMosaic (version 1.0.2)

RsimMosaic-package: R Simple IMage Mosaic creation library

Description

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).

Arguments

Details

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:

RsimMosaic-ExampleImage.jpgRsimMosaicExample

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.

See Also

composeMosaicFromImageRandom, composeMosaicFromImageRegular, createTiles

Examples

Run this code
# 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)

Run the code above in your browser using DataLab