landmark.images: Read in and convert images to jpeg for digitization in...

Description Usage Arguments Details Value See Also Examples

View source: R/landmark.images.R

Description

Read in and convert images to jpeg for digitization in geomorph

Usage

1
2
3
4
5
6
7
8
9
landmark.images(
  imagedir,
  image.names,
  nlandmarks,
  scale = NULL,
  Multscale = F,
  writedir = NULL,
  tps.filename = NULL
)

Arguments

imagedir

directory of images to measure. Only images with landmarks will be processed. The landmark file names are assumed to exactly match the image names.

image.names

A vector of image names to look for in imagedir. These images should be unwarped or deformed to a common reference shape.

nlandmarks

number of landmarks to acquire per image.

scale

how long is the scale in your images?

Multscale

Logical value–should the coords be pre-multiplied by scale value?

writedir

directory to save the TPS file.

tps.filename

a name for the TPS file. If no name is provided, it will default to "/Colormesh_landmarks.TPS"

Details

This function is a wrapper around geomorph::digitize2d() that a) allows for more general image format reading and b) automatically reads in the landmarks into R after saving the TPS files. Geomorph only supports reading in jpeg files, so this function converts all images to jpeg in a temporary directory, calls digitize2d for landmarking and then removes the temporary jpegs upon completion.

Value

This function reads in several image formats and converts them to jpeg. The function returns the paths to the images that were converted, as well as the landmarks.

See Also

digitize2d (used for landmarking)

Examples

1
2
#example place 3 landmarks on one image
ex.landmark <- landmark.images(imagedir = paste0(path.package("Colormesh"),"/extdata/cropped_images/"), image.names = "GPLP_001.png", nlandmarks = 3)

J0vid/Colormesh documentation built on Feb. 4, 2022, 1:33 a.m.