Anchor is a free command-line application and platform for image processing and computer vision.

It’s a Swiss-army-knife for loading, transforming, and extracting information from sets of images, as single-image tools are often limiting.

It quickly searches subdirectories of images on the file-system and processes!

Features

Anchor logo

  • Supports diverse image types and formats (photos, 2D / 3D / time-series microscopy).
  • Smartly names outputs by finding patterns in filenames. Preserves directory structure.
  • Reproducible pipelines defined via XML.
  • Feature-extraction libraries (sets of voxels, geometric shapes) etc.
  • Extensible via Java to call operations in ImageJ, Icy, OpenCV etc.
  • Cross-platform - Windows, Linux, Mac.
  • Deep Learning inference with the ONNX Runtime.

Project Status

Anchor’s source-code can be found on GitHub. Please report any bug / feature request as an issue.

Quick Start - Example Commands

Start a task, by opening a shell in a directory of images and typing anchor -t <someTask>.

By default, it will search recursively for all images in this directory (with standard extensions).

Command What it does?
anchor searches for images recursively in the current directory, and derives a naming pattern.
anchor -i c:\foo\bar like above, but searches in the specified directory (recursively).
anchor -i .png like above, but searches only for .png in the current directory (recursively).
anchor -h shows all available command-line options
anchor -t or anchor -st shows all available predefined tasks.
   
anchor -t summarize summarizes images into bullet points (extension, file naming patterns, size etc.).
anchor -t summarize -i d:\foo\ summarizes images recursively in a particular directory.
anchor -t summarize -i .tif -i .png summarizes only images that end with the extensions .tif or .png (recursively)
anchor -t summarize -i *match*.tif summarizes only images matching the wildcard non-recursively in the input directory.
anchor -t summarize -i "**match**.tif" summarizes only images matching the wildcard recursively (unsupported on some shells!
anchor -t list lists the paths and unique-identifier for each input.
   
anchor -t feature/metadata creates a CSV with images as rows, and image metadata as columns.
anchor -t feature/intensity creates a CSV with images as rows, and intensity statistics as columns.
anchor -t feature/hog creates a CSV with images as rows, and a HOG descriptor as columns.
anchor -t feature/hog -pg -oe featuresAggregated like above, but adds grouping with an aggregated CSV file.
   
anchor -t segment/text finds and segments regions of texts in images
anchor -t segment/coco finds and segments common categories of objects in images.
   
anchor -t convert -ip -of png converts all images to PNG format (or pick another extension!)
anchor -t convert -ip -of png -ic -oo d:\foo converts like above to a particular directory, and copies non-image files (e.g. metadata!)
anchor -t copy -ip -oo d:\foo copies all images to a particular new directory.
anchor -t copy -is -on randomizes the order of images and anonymizes the filename.
anchor -t cluster/timestamp clusters images that are adjacent in time (from EXIF, file attributes or naming)
   
anchor -t resize -ps 0.1 resizes each image to have a tenth of the width and height (try 2 to double).
anchor -t resize -ps 1024x768 resizes each image to have 1024x768 size in pixels.
anchor -t resize -ps 1024x768 -on resizes like above, but outputs as an incrementing sequence (useful for creating videos!)
anchor -t resize -ps 1024x resizes each image to have 1024 pixels width, otherwise preserving aspect-ratio.
anchor -t center -ps 1024x like above, but each output image has a identical common size, centering within it.
anchor -t resize -ps x768 resizes each image to have 768 pixels height, otherwise preserving aspect-ratio.
anchor -t center -ps x768+ like above, but each output image has a identical common size, centering within it.
anchor -t resize -ps 1024x768+ resizes each image to maximally fit inside 1024x768 size, preserving aspect-ratio.
anchor -t center -ps 1024x768+ like above, but each output image has a identical common size, centering within it.
   
anchor -t histogram creates a histogram CSV file of the pixel values of each image, and all images summed.
   
anchor -t montage creates a montage of all images (recursively).
anchor -t montage -il 20 creates a montage from the initial 20 images in order.
anchor -t montage -ir 20 creates a montage from a random sample of 20 images.
anchor -t montage -ir 0.04 creates a montage from a random sample of 4% of all images.
anchor -t montage -oe unlabelled creates an unlabelled montage (additionally).
anchor -t montage -ps 2000x creates a montage that has 2000 pixels width.
anchor -t montage -ps 0.3 creates a montage where image widths are approximately 30% of their original.
anchor -t montage/table creates a montage with a table structure.
anchor -t montage/slices creates a montage of the z-slices of a 3D image.
   
anchor -t project/mean projects the mean-intensity of all images (which must be identically sized!)
anchor -t project/meanResize like above, but first resizes all images to a common size, and then calculates.
anchor -t project/meanResize -pg 0 like above, but groups by the first element in the identifier.
anchor -t project/meanResize -pg 0:1 like above, but groups by the first two elements in the identifier.
anchor -t project/meanResize -pg -1 like above, but groups by the last element in the identifier.
anchor -t project/max projects the maximum-intensity of all images (which must be identically sized!)
anchor -t project/min projects the minimum-intensity of all images (which must be identically sized!)
anchor -t project/standardDeviation projects the standard-deviation of all images (which must be identically sized!)
   
anchor -t copy -ir 20 randomly samples 20 inputs.
anchor -t copy -ir 0.3 randomly samples 30% of all inputs.
anchor -t copy -ir 0.3 -on randomly samples and anonymizes 30% of all inputs.
anchor -t anonymize anonymizes all inputs.

Note the -i and -o command line options are can be applied to any task to select inputs and an output path. outputs = task(inputs)

Author

Owen Feehan - developed since 2010 personally and via employment in ETH Zurich, the University of Zurich and Hoffmann-La Roche. Licensed open source.