Learn R Programming

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

imager (version 0.42.13)

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

License

LGPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Shota Ochi

Last Published

March 7th, 2022

Functions in imager (0.42.13)

as.data.frame.pixset

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

Convert a pixel image to a data.frame
diffusion_tensors

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

Estimate displacement field between two images.
extract_patches

Extract image patches and return a list
highlight

Highlight pixel set on image
flatten.alpha

Flatten alpha channel
haar

Compute Haar multiscale wavelet transform.
imchange

Modify parts of an image
imappend

Combine a list of images into a single image
imsharpen

Sharpen image.
FFT

Compute the Discrete Fourier Transform of an image
RasterPackage

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

Form an adjacency graph from a pixset
bbox

Compute the bounding box of a pixset
blur_anisotropic

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

Convert image list to data.frame
imager.replace

Replace part of an image with another
cimg2im

Convert cimg to spatstat im object
capture.plot

Capture the current R plot device as a cimg image
as.imlist.list

Convert various objects to image lists
center.stencil

Center stencil at a location
circles

Add circles to plot
imager.subset

Array subset operator for cimg objects
imcoord

Coordinates as images
add.colour

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

Convert to cimg object
bucketfill

Bucket fill
imlap

Compute image Laplacian
imwarp

Image warping
imdirac

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

Image list
index.coord

Linear index in internal vector from pixel coordinates
cannyEdges

Canny edge detector
as.cimg.data.frame

Create an image from a data.frame
as.cimg.array

Turn an numeric array into a cimg object
boats

Photograph of sailing boats from Kodak set
imshift

Shift image content.
at

Return or set pixel value at coordinates
ci

Concatenation for image lists
common_pixsets

Various useful pixsets
autocrop

Autocrop image region
channels

Split a colour image into a list of separate channels
inpaint

Fill-in NA values in an image
interact

Build simple interactive interfaces using imager
cimg.extract

Various shortcuts for extracting colour channels, frames, etc
as.cimg.function

Create an image by sampling a function
load.video

Load a video using ffmpeg
cimg.use.openmp

Control CImg's parallelisation
display

Display object using CImg library
boundary

Find the boundary of a shape in a pixel set
erode

Erode/dilate image by a structuring element.
coord.index

Coordinates from pixel index
correlate

Correlation/convolution of image by filter
draw_text

Draw text on an image
%inr%

Check that value is in a range
grayscale

Convert an RGB image to grayscale
as.cimg.raster

Convert a raster object to a cimg object
display.cimg

Display image using CImg library
get.locations

Return coordinates of subset of pixels
frames

Split a video into separate frames
load.example

Load example image
magick

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

Pixel sets (pixsets)
pixel.grid

Return the pixel grid for an image
imgradient

Compute image gradient
imfill

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

Generate (Gaussian) white-noise image
imager

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

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

Plot objects on image using base graphics
interp

Interpolate image values
is.cimg

Checks that an object is a cimg object
load.dir

Load all images in a directory
liply

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

Return contours of image/pixset
hough_line

Hough transform for lines
im2cimg

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

Circle detection using Hough transform
ilply

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

Compute Euclidean distance function to a specified value.
display.list

Display image list using CImg library
get_gradient

Compute image gradient.
get.stencil

Return pixel values in a neighbourhood defined by a stencil
gsdim

Grayscale dimensions of image
grow

Grow/shrink a pixel set
imdraw

Draw image on another image
as.raster.cimg

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

Methods to convert various objects to pixsets
boxblur

Blur image with a box filter (square window)
permute_axes

Permute image axes
imrep

Replicate images
isoblur

Blur image isotropically.
imrotate

Rotate an image along the XY plane.
label

Label connected components.
imeval

Evaluation in an image context
boxblur_xy

Blur image with a box filter.
%>%

Pipe operator
clean

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

Fill in a colour in an area given by a pixset
load.image

Load image from file or URL
crop.borders

Crop the outer margins of an image
make.video

Make/save a video using ffmpeg
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
resize_doubleXY

Resize image uniformly
rm.alpha

Remove alpha channel and store as attribute
px.flood

Select a region of homogeneous colour
map_il

Type-stable map for use with the purrr package
plot.imlist

Plot an image list
squeeze

Remove empty dimensions from an array
split_connected

Split pixset into connected components
threshold

Threshold grayscale image
stencil.cross

A cross-shaped stencil
resize

Resize image
vanvliet

Young-Van Vliet recursive Gaussian filter.
renorm

Renormalise image
deriche

Apply recursive Deriche filter.
draw_rect

Draw rectangle on image
draw_circle

Draw circle on image
RGBtoHSL

Colour space conversions in imager
imager.combine

Combining images
get_hessian

Return image hessian.
idply

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

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

Select image regions interactively
imsub

Select part of an image
imsplit

Split an image along a certain axis (producing a list)
is.pixset

Check that an object is a pixset object
is.imlist

Check that an object is an imlist object
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.
warp

Warp image
iminfo

Return information on image file
imhessian

Compute image hessian.
patchstat

Return image patch summary
mutate_plyr

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

Plot a line, Hesse normal form parameterisation
mirror

Mirror image content along specified axis
plot.cimg

Display an image using base graphics
watershed

Compute watershed transform.
play

Play a video
periodic.part

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

A pixset for NA values
where

Return locations in pixel set
px.remove_outer

Remove all connected regions that touch image boundaries
save.image

Save image
rotate_xy

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

Create a cimg object
cimg.dimensions

Image dimensions
as.igraph.cimg

Form a graph from an image