Learn R Programming

imager (version 0.45.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

9,194

Version

0.45.8

License

LGPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

February 20th, 2024

Functions in imager (0.45.8)

autocrop

Autocrop image region
bbox

Compute the bounding box of a pixset
as.raster.cimg

Convert a cimg object to a raster object for plotting
blur_anisotropic

Blur image anisotropically, in an edge-preserving way.
center.stencil

Center stencil at a location
capture.plot

Capture the current R plot device as a cimg image
cannyEdges

Canny edge detector
boats

Photograph of sailing boats from Kodak set
boxblur

Blur image with a box filter (square window)
boundary

Find the boundary of a shape in a pixel set
clean

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

Add circles to plot
cimg.openmp

Control CImg's parallelisation
channels

Split a colour image into a list of separate channels
cimg2im

Convert cimg to spatstat im object
cimg.dimensions

Image dimensions
contours

Return contours of image/pixset
cimg.extract

Various shortcuts for extracting colour channels, frames, etc
as.pixset

Methods to convert various objects to pixsets
display.cimg

Display image using CImg library
display

Display object using CImg library
display.list

Display image list using CImg library
displacement

Estimate displacement field between two images.
distance_transform

Compute Euclidean distance function to a specified value.
draw_circle

Draw circle on image
get.locations

Return coordinates of subset of pixels
flatten.alpha

Flatten alpha channel
bucketfill

Bucket fill
colorise

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

Blur image with a box filter.
common_pixsets

Various useful pixsets
crop.borders

Crop the outer margins of an image
grow

Grow/shrink a pixel set
correlate

Correlation/convolution of image by filter
cimg

Create a cimg object
ci

Concatenation for image lists
deriche

Apply recursive Deriche filter.
grab

Select image regions interactively
%inr%

Check that value is in a range
grayscale

Convert an RGB image to grayscale
highlight

Highlight pixel set on image
iiply

Split an image, apply function, recombine the results as an image
get.stencil

Return pixel values in a neighbourhood defined by a stencil
ilply

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

Circle detection using Hough transform
imager.replace

Replace part of an image with another
imager.subset

Array subset operator for cimg objects
frames

Split a video into separate frames
imeval

Evaluation in an image context
im_split

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

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

Draw image on another image
gsdim

Grayscale dimensions of image
coord.index

Coordinates from pixel index
draw_rect

Draw rectangle on image
draw_text

Draw text on an image
imsplit

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

Coordinates as images
haar

Compute Haar multiscale wavelet transform.
imdirac

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

Select part of an image
imrep

Replicate images
imrotate

Rotate an image along the XY plane.
imgradient

Compute image gradient
imager.combine

Combining images
get_hessian

Return image hessian.
erode

Erode/dilate image by a structuring element.
RGBtoHSL

Colour space conversions in imager
diffusion_tensors

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

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

Combine a list of images into a single image
imhessian

Compute image hessian.
interp

Interpolate image values
is.imlist

Check that an object is an imlist object
load.dir

Load all images in a directory
iminfo

Return information on image file
is.cimg

Checks that an object is a cimg object
map_il

Type-stable map for use with the purrr package
imsharpen

Sharpen image.
imshift

Shift image content.
nfline

Plot a line, Hesse normal form parameterisation
liply

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

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

Mirror image content along specified axis
is.pixset

Check that an object is a pixset 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.
make.video

Make/save a video using ffmpeg
resize_doubleXY

Resize image uniformly
pixset

Pixel sets (pixsets)
pixel.grid

Return the pixel grid for an image
extract_patches

Extract image patches and return a list
get_gradient

Compute image gradient.
imlist

Image list
hough_line

Hough transform for lines
rm.alpha

Remove alpha channel and store as attribute
load.example

Load example image
imlap

Compute image Laplacian
renorm

Renormalise image
idply

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

Fill-in NA values in an image
load.image

Load image from file or URL
interact

Build simple interactive interfaces using imager
patchstat

Return image patch summary
permute_axes

Permute image axes
%>%

Pipe operator
periodic.part

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

Display an image using base graphics
imnoise

Generate (Gaussian) white-noise image
implot

Plot objects on image using base graphics
imchange

Modify parts of an image
threshold

Threshold grayscale image
play

Play a video
px.flood

Select a region of homogeneous colour
stencil.cross

A cross-shaped stencil
plot.imlist

Plot an image list
pad

Pad image with n pixels along specified axis
label

Label connected components.
rotate_xy

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

Resize image
patch_summary_cimg

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

Blur image isotropically.
vanvliet

Young-Van Vliet recursive Gaussian filter.
save.image

Save image
watershed

Compute watershed transform.
where

Return locations in pixel set
imwarp

Image warping
index.coord

Linear index in internal vector from pixel coordinates
load.video

Load a video using ffmpeg
warp

Warp image
px.remove_outer

Remove all connected regions that touch image boundaries
px.na

A pixset for NA values
squeeze

Remove empty dimensions from an array
magick

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

Split pixset into connected components
as.cimg.raster

Convert a raster object to a cimg object
RasterPackage

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

Convert to cimg object
as.cimg.im

Convert an image in spatstat format to an image in cimg format
as.cimg.data.frame

Create an image from a data.frame
FFT

Compute the Discrete Fourier Transform of an image
as.cimg.function

Create an image by sampling a function
add.colour

Add colour channels to a grayscale image or pixel set
as.data.frame.imlist

Convert image list to data.frame
as.igraph.pixset

Form an adjacency graph from a pixset
as.data.frame.cimg

Convert a pixel image to a data.frame
as.data.frame.pixset

Methods to convert pixsets to various objects
as.imlist.list

Convert various objects to image lists
as.cimg.array

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

Form a graph from an image
at

Return or set pixel value at coordinates