Learn R Programming

⚠️There's a newer version (1.0.3) of this package.Take me there.

imager (version 0.42.3)

Image Processing Library Based on 'CImg'

Description

Fast image processing for images in up to 4 dimensions (two spatial dimensions, one time/depth dimension, one colour dimension). Provides most traditional image processing tools (filtering, morphology, transformations, etc.) as well as various functions for easily analysing image data using R. The package wraps 'CImg', , a simple, modern C++ library for image processing.

Copy Link

Version

Install

install.packages('imager')

Monthly Downloads

12,098

Version

0.42.3

License

LGPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Shota Ochi

Last Published

May 11th, 2020

Functions in imager (0.42.3)

at

Return or set pixel value at coordinates
as.raster.cimg

Convert a cimg object to a raster object for plotting
as.pixset

Methods to convert various objects to pixsets
bucketfill

Bucket fill
cannyEdges

Canny edge detector
common_pixsets

Various useful pixsets
as.igraph.cimg

Form a graph from an image
boxblur

Blur image with a box filter (square window)
as.data.frame.pixset

Methods to convert pixsets to various objects
contours

Return contours of image/pixset
autocrop

Autocrop image region
cimg2im

Convert cimg to spatstat im object
boxblur_xy

Blur image with a box filter.
blur_anisotropic

Blur image anisotropically, in an edge-preserving way.
capture.plot

Capture the current R plot device as a cimg image
RasterPackage

Convert a RasterLayer/RasterBrick to a cimg image/image list
clean

Clean up and fill in pixel sets (morphological opening and closing)
boundary

Find the boundary of a shape in a pixel set
bbox

Compute the bounding box of a pixset
boats

Photograph of sailing boats from Kodak set
colorise

Fill in a colour in an area given by a pixset
as.igraph.pixset

Form an adjacency graph from a pixset
circles

Add circles to plot
display

Display object using CImg library
as.imlist.list

Convert various objects to image lists
display.list

Display image list using CImg library
distance_transform

Compute Euclidean distance function to a specified value.
get.stencil

Return pixel values in a neighbourhood defined by a stencil
center.stencil

Center stencil at a location
cimg.extract

Various shortcuts for extracting colour channels, frames, etc
deriche

Apply recursive Deriche filter.
channels

Split a colour image into a list of separate channels
cimg.use.openmp

Control CImg's parallelisation
display.cimg

Display image using CImg library
crop.borders

Crop the outer margins of an image
extract_patches

Extract image patches and return a list
get_gradient

Compute image gradient.
get_hessian

Return image hessian.
grab

Select image regions interactively
coord.index

Coordinates from pixel index
imrep

Replicate images
im_split

Split an image along a certain axis (producing a list)
imeval

Evaluation in an image context
imager

imager: an R library for image processing, based on CImg
imrotate

Rotate an image along the XY plane.
imdraw

Draw image on another image
ci

Concatenation for image lists
cimg

Create a cimg object
correlate

Correlation/convolution of image by filter
flatten.alpha

Flatten alpha channel
inpaint

Fill-in NA values in an image
load.image

Load image from file or URL
vanvliet

Young-Van Vliet recursive Gaussian filter.
plot.imlist

Plot an image list
interact

Build simple interactive interfaces using imager
px.flood

Select a region of homogeneous colour
permute_axes

Permute image axes
warp

Warp image
%>%

Pipe operator
load.example

Load example image
cimg.dimensions

Image dimensions
draw_text

Draw text on an image
haar

Compute Haar multiscale wavelet transform.
draw_circle

Draw circle on image
highlight

Highlight pixel set on image
gsdim

Grayscale dimensions of image
grow

Grow/shrink a pixel set
ilply

Split an image along axis, apply function, return a list
imcoord

Coordinates as images
im2cimg

Convert an image in spatstat format to an image in cimg format
erode

Erode/dilate image by a structuring element.
idply

Split an image along axis, map function, return a data.frame
iiply

Split an image, apply function, recombine the results as an image
draw_rect

Draw rectangle on image
imdirac

Generates a "dirac" image, i.e. with all values set to 0 except one.
imlap

Compute image Laplacian
imhessian

Compute image hessian.
is.imlist

Check that an object is an imlist object
imlist

Image list
is.pixset

Check that an object is a pixset object
%inr%

Check that value is in a range
grayscale

Convert an RGB image to grayscale
imager.replace

Replace part of an image with another
make.video

Make/save a video using ffmpeg
map_il

Type-stable map for use with the purrr package
diffusion_tensors

Compute field of diffusion tensors for edge-preserving smoothing.
mutate_plyr

Mutate a data frame by adding new or replacing existing columns.
iminfo

Return information on image file
imsplit

Split an image along a certain axis (producing a list)
nfline

Plot a line, Hesse normal form parameterisation
rm.alpha

Remove alpha channel and store as attribute
resize_doubleXY

Resize image uniformly
imsub

Select part of an image
displacement

Estimate displacement field between two images.
interp

Interpolate image values
mirror

Mirror image content along specified axis
pad

Pad image with n pixels along specified axis
medianblur

Blur image with the median filter. In a window of size n x n centered at pixel (x,y), compute median pixel value over the window. Optionally, ignore values that are too far from the value at current pixel.
patch_summary_cimg

Extract a numerical summary from image patches, using CImg's mini-language Experimental feature.
is.cimg

Checks that an object is a cimg object
resize

Resize image
split_connected

Split pixset into connected components
renorm

Renormalise image
squeeze

Remove empty dimensions from an array
get.locations

Return coordinates of subset of pixels
imfill

Create an image of custom size by filling in repeated values
frames

Split a video into separate frames
RGBtoHSL

Colour space conversions in imager
imager.combine

Combining images
hough_circle

Circle detection using Hough transform
imgradient

Compute image gradient
hough_line

Hough transform for lines
imwarp

Image warping
imappend

Combine a list of images into a single image
imnoise

Generate (Gaussian) white-noise image
imager.subset

Array subset operator for cimg objects
index.coord

Linear index in internal vector from pixel coordinates
imchange

Modify parts of an image
stencil.cross

A cross-shaped stencil
implot

Plot objects on image using base graphics
threshold

Threshold grayscale image
imsharpen

Sharpen image.
load.video

Load a video using ffmpeg
magick

Convert a magick image to a cimg image or image list and vice versa
patchstat

Return image patch summary
imshift

Shift image content.
periodic.part

Compute the periodic part of an image, using the periodic/smooth decomposition of Moisan (2011)
liply

Apply function to each element of a list, then combine the result as an image by appending along specified axis
label

Label connected components.
isoblur

Blur image isotropically.
load.dir

Load all images in a directory
pixel.grid

Return the pixel grid for an image
px.na

A pixset for NA values
save.image

Save image
rotate_xy

Rotate image by an arbitrary angle, around a center point.
pixset

Pixel sets (pixsets)
px.remove_outer

Remove all connected regions that touch image boundaries
watershed

Compute watershed transform.
plot.cimg

Display an image using base graphics
where

Return locations in pixel set
play

Play a video
as.cimg.array

Turn an numeric array into a cimg object
FFT

Compute the Discrete Fourier Transform of an image
as.data.frame.cimg

Convert a pixel image to a data.frame
as.cimg.raster

Convert a raster object to a cimg object
add.colour

Add colour channels to a grayscale image or pixel set
as.cimg.function

Create an image by sampling a function
as.cimg

Convert to cimg object
as.cimg.data.frame

Create an image from a data.frame
as.data.frame.imlist

Convert image list to data.frame