Learn R Programming

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

imager (version 0.45.2)

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

6,643

Version

0.45.2

License

LGPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Aaron Robotham

Last Published

May 10th, 2023

Functions in imager (0.45.2)

as.igraph.pixset

Form an adjacency graph from a pixset
bbox

Compute the bounding box of a pixset
autocrop

Autocrop image region
as.data.frame.pixset

Methods to convert pixsets to various objects
as.data.frame.imlist

Convert image list to data.frame
as.raster.cimg

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

Form a graph from an image
at

Return or set pixel value at coordinates
as.imlist.list

Convert various objects to image lists
channels

Split a colour image into a list of separate channels
center.stencil

Center stencil at a location
boats

Photograph of sailing boats from Kodak set
blur_anisotropic

Blur image anisotropically, in an edge-preserving way.
boundary

Find the boundary of a shape in a pixel set
boxblur

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

Control CImg's parallelisation
common_pixsets

Various useful pixsets
colorise

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

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

Add circles to plot
bucketfill

Bucket fill
boxblur_xy

Blur image with a box filter.
ci

Concatenation for image lists
displacement

Estimate displacement field between two images.
display

Display object using CImg library
cimg

Create a cimg object
cimg2im

Convert cimg to spatstat im object
as.pixset

Methods to convert various objects to pixsets
correlate

Correlation/convolution of image by filter
crop.borders

Crop the outer margins of an image
distance_transform

Compute Euclidean distance function to a specified value.
frames

Split a video into separate frames
flatten.alpha

Flatten alpha channel
cannyEdges

Canny edge detector
draw_rect

Draw rectangle on image
display.cimg

Display image using CImg library
cimg.dimensions

Image dimensions
cimg.extract

Various shortcuts for extracting colour channels, frames, etc
display.list

Display image list using CImg library
highlight

Highlight pixel set on image
hough_circle

Circle detection using Hough transform
draw_text

Draw text on an image
imager.subset

Array subset operator for cimg objects
imager.replace

Replace part of an image with another
contours

Return contours of image/pixset
capture.plot

Capture the current R plot device as a cimg image
imappend

Combine a list of images into a single image
imchange

Modify parts of an image
RGBtoHSL

Colour space conversions in imager
imager.combine

Combining images
extract_patches

Extract image patches and return a list
diffusion_tensors

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

Apply recursive Deriche filter.
%inr%

Check that value is in a range
imcoord

Coordinates as images
imshift

Shift image content.
grayscale

Convert an RGB image to grayscale
grow

Grow/shrink a pixel set
erode

Erode/dilate image by a structuring element.
inpaint

Fill-in NA values in an image
grab

Select image regions interactively
draw_circle

Draw circle on image
imsharpen

Sharpen image.
imdirac

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

Coordinates from pixel index
iiply

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

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

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

Compute image Laplacian
load.video

Load a video using ffmpeg
interact

Build simple interactive interfaces using imager
imlist

Image list
imhessian

Compute image hessian.
get.stencil

Return pixel values in a neighbourhood defined by a stencil
iminfo

Return information on image file
imnoise

Generate (Gaussian) white-noise image
get_gradient

Compute image gradient.
get.locations

Return coordinates of subset of pixels
get_hessian

Return image hessian.
hough_line

Hough transform for lines
isoblur

Blur image isotropically.
haar

Compute Haar multiscale wavelet transform.
im_split

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

Grayscale dimensions of image
imager

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

Draw image on another image
label

Label connected components.
pad

Pad image with n pixels along specified axis
map_il

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

Make/save a video using ffmpeg
imeval

Evaluation in an image context
implot

Plot objects on image using base graphics
px.remove_outer

Remove all connected regions that touch image boundaries
watershed

Compute watershed transform.
patch_summary_cimg

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

A pixset for NA values
where

Return locations in pixel set
idply

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

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

Compute image gradient
interp

Interpolate image values
magick

Convert a magick image to a cimg image or image list and vice versa
px.flood

Select a region of homogeneous colour
plot.imlist

Plot an image list
imsub

Select part of an image
warp

Warp image
vanvliet

Young-Van Vliet recursive Gaussian filter.
imrep

Replicate images
mirror

Mirror image content along specified axis
patchstat

Return image patch summary
is.cimg

Checks that an object is a cimg object
periodic.part

Compute the periodic part of an image, using the periodic/smooth decomposition of Moisan (2011)
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.
imwarp

Image warping
load.dir

Load all images in a directory
imrotate

Rotate an image along the XY plane.
index.coord

Linear index in internal vector from pixel coordinates
liply

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

Plot a line, Hesse normal form parameterisation
is.imlist

Check that an object is an imlist object
resize_doubleXY

Resize image uniformly
is.pixset

Check that an object is a pixset object
mutate_plyr

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

Permute image axes
load.image

Load image from file or URL
pixset

Pixel sets (pixsets)
pixel.grid

Return the pixel grid for an image
load.example

Load example image
%>%

Pipe operator
play

Play a video
threshold

Threshold grayscale image
stencil.cross

A cross-shaped stencil
plot.cimg

Display an image using base graphics
renorm

Renormalise image
split_connected

Split pixset into connected components
resize

Resize image
squeeze

Remove empty dimensions from an array
rotate_xy

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

Remove alpha channel and store as attribute
save.image

Save image
as.data.frame.cimg

Convert a pixel image to a data.frame
RasterPackage

Convert a RasterLayer/RasterBrick to a cimg image/image list
as.cimg

Convert to cimg object
as.cimg.raster

Convert a raster object to a cimg object
as.cimg.function

Create an image by sampling a function
as.cimg.array

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

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

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

Create an image from a data.frame
add.colour

Add colour channels to a grayscale image or pixel set