Vignette for imagine package

Wencheng Lau-Medrano

2018-05-06

imagine

IMAGing engINE, Tools for Application of Image Filters to Data Matrices

This package was built to take numeric data matrices and apply image-filtering algoriths.

Algoriths used by imagine include median-filter and 2D-convolution based algoriths implemented on Rcpp (C++) due to the high intensiveness and time expensiveness in the application of this filters to large numeric matrices.

Installation

For installing imagine, as follows:

Engines

imagine performs algorithms written in Rcpp (called ‘engines’), ensuring a faster application of filters. At version 1.2.2, imagine include four main engines, described as follows:

Main functions

There are 4 main functions and 2 wrappers:

Kernel application

In the field of image processing, one of the tools most commonly used are the convolutions, which consist of operations between two arrays: The array of image data (as a big matrix) and kernels (as small matrices) which weighs each pixel values by the values of its corresponding neighborhood. Different kernels produce different effects, for instance: blur, shifted images (right, left, up or down), sharpening, etc.

The users must be cautious with the size of the kernel because the larger the radius, the more pixels remain unanalyzed at the edges. In addition, kernel argument of convolution2D is a matrix and it should not necessarily have squared dimensions. So, if the user specifies a rectangular kernel, the function will use the neighborhood as the Figure 3 shows.

Figure 3: Neighborhood kernel application for different kernel dimensions. Black dot indicates the position of the pixel over the filter will be applied. Arrows indicates the direction of filter application

Figure 3: Neighborhood kernel application for different kernel dimensions. Black dot indicates the position of the pixel over the filter will be applied. Arrows indicates the direction of filter application