Learn R Programming

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

imager (version 0.42.8)

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

7,520

Version

0.42.8

License

LGPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Shota Ochi

Last Published

March 15th, 2021

Functions in imager (0.42.8)

as.cimg.function

Create an image by sampling a function
as.cimg.data.frame

Create an image from a data.frame
as.cimg

Convert to cimg object
RasterPackage

Convert a RasterLayer/RasterBrick to a cimg image/image list
add.colour

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

Turn an numeric array into a cimg object
as.cimg.raster

Convert a raster object to a cimg object
FFT

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

Convert a pixel image to a data.frame
at

Return or set pixel value at coordinates
as.data.frame.pixset

Methods to convert pixsets to various objects
bucketfill

Bucket fill
blur_anisotropic

Blur image anisotropically, in an edge-preserving way.
as.data.frame.imlist

Convert image list to data.frame
cannyEdges

Canny edge detector
bbox

Compute the bounding box of a pixset
boxblur

Blur image with a box filter (square window)
as.igraph.cimg

Form a graph from an image
boxblur_xy

Blur image with a box filter.
clean

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

Fill in a colour in an area given by a pixset
boats

Photograph of sailing boats from Kodak set
coord.index

Coordinates from pixel index
channels

Split a colour image into a list of separate channels
autocrop

Autocrop image region
boundary

Find the boundary of a shape in a pixel set
as.imlist.list

Convert various objects to image lists
as.igraph.pixset

Form an adjacency graph from a pixset
circles

Add circles to plot
ci

Concatenation for image lists
cimg2im

Convert cimg to spatstat im object
display.list

Display image list using CImg library
as.pixset

Methods to convert various objects to pixsets
haar

Compute Haar multiscale wavelet transform.
distance_transform

Compute Euclidean distance function to a specified value.
highlight

Highlight pixel set on image
cimg

Create a cimg object
common_pixsets

Various useful pixsets
crop.borders

Crop the outer margins of an image
draw_circle

Draw circle on image
contours

Return contours of image/pixset
deriche

Apply recursive Deriche filter.
imnoise

Generate (Gaussian) white-noise image
implot

Plot objects on image using base graphics
hough_circle

Circle detection using Hough transform
hough_line

Hough transform for lines
im_split

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

Draw rectangle on image
imager

imager: an R library for image processing, based on CImg
capture.plot

Capture the current R plot device as a cimg image
center.stencil

Center stencil at a location
as.raster.cimg

Convert a cimg object to a raster object for plotting
imcoord

Coordinates as images
imdirac

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

Correlation/convolution of image by filter
display

Display object using CImg library
cimg.dimensions

Image dimensions
display.cimg

Display image using CImg library
map_il

Type-stable map for use with the purrr package
make.video

Make/save a video using ffmpeg
displacement

Estimate displacement field between two images.
cimg.use.openmp

Control CImg's parallelisation
diffusion_tensors

Compute field of diffusion tensors for edge-preserving smoothing.
cimg.extract

Various shortcuts for extracting colour channels, frames, etc
get.stencil

Return pixel values in a neighbourhood defined by a stencil
play

Play a video
rotate_xy

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

Display an image using base graphics
get_gradient

Compute image gradient.
erode

Erode/dilate image by a structuring element.
grab

Select image regions interactively
draw_text

Draw text on an image
save.image

Save image
get_hessian

Return image hessian.
frames

Split a video into separate frames
get.locations

Return coordinates of subset of pixels
imager.subset

Array subset operator for cimg objects
imager.replace

Replace part of an image with another
ilply

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

Combine a list of images into a single image
im2cimg

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

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

Modify parts of an image
imwarp

Image warping
liply

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

Linear index in internal vector from pixel coordinates
patchstat

Return image patch summary
load.dir

Load all images in a directory
imsub

Select part of an image
inpaint

Fill-in NA values in an image
px.na

A pixset for NA values
periodic.part

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

Remove all connected regions that touch image boundaries
patch_summary_cimg

Extract a numerical summary from image patches, using CImg's mini-language Experimental feature.
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.
interact

Build simple interactive interfaces using imager
mirror

Mirror image content along specified axis
stencil.cross

A cross-shaped stencil
extract_patches

Extract image patches and return a list
imgradient

Compute image gradient
imlap

Compute image Laplacian
imfill

Create an image of custom size by filling in repeated values
flatten.alpha

Flatten alpha channel
resize

Resize image
renorm

Renormalise image
%inr%

Check that value is in a range
RGBtoHSL

Colour space conversions in imager
imager.combine

Combining images
grayscale

Convert an RGB image to grayscale
idply

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

Grow/shrink a pixel set
iiply

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

Grayscale dimensions of image
threshold

Threshold grayscale image
imlist

Image list
imhessian

Compute image hessian.
is.pixset

Check that an object is a pixset object
pixel.grid

Return the pixel grid for an image
is.imlist

Check that an object is an imlist object
imsharpen

Sharpen image.
imshift

Shift image content.
iminfo

Return information on image file
interp

Interpolate image values
pixset

Pixel sets (pixsets)
load.example

Load example image
is.cimg

Checks that an object is a cimg object
load.image

Load image from file or URL
where

Return locations in pixel set
px.flood

Select a region of homogeneous colour
plot.imlist

Plot an image list
watershed

Compute watershed transform.
resize_doubleXY

Resize image uniformly
nfline

Plot a line, Hesse normal form parameterisation
mutate_plyr

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

Remove alpha channel and store as attribute
imeval

Evaluation in an image context
imdraw

Draw image on another image
imrotate

Rotate an image along the XY plane.
imrep

Replicate images
load.video

Load a video using ffmpeg
isoblur

Blur image isotropically.
label

Label connected components.
warp

Warp image
vanvliet

Young-Van Vliet recursive Gaussian filter.
magick

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

Permute image axes
split_connected

Split pixset into connected components
squeeze

Remove empty dimensions from an array
%>%

Pipe operator