New geomorph function to digitize multiple 2d images

(This article was first published on geomorph, and kindly contributed to R-bloggers)

Hi Morphometricians!

We've enhanced geomorph's ability to continuously digitize multiple specimens' images in 2d, if these are within the same directory. This new function allows one to digitize 2d images without interruption. Thanks to Samuel Brown and Karl Fetter for suggesting the improvement.

We will incorporate this function in our next package update. I'm including demonstration code and a link to archaeological lithic specimens below. To replicate the excercise, first download zipped folder containing the images of 3 specimens from this link .

These images are of Middle and Upper Paleolithic tools from excavations at Tor Sadaf, Jordan, conducted by Dr. Nancy Coinman

Cheers,

Erik

DIgitizing instructions can be found in the geomorph package manual (pp. 11-12)


# create a folder named "2d_midpaleolithic_specs" and unzip images there
# dir.create("C:/2d_midpaleolithic_specs/")

# then set the directory to where the images are located
> setwd("C:/2d_midpaleolithic_specs/")

> # create the file name character vector named "specs"
> # ensure that only ".jpg" files are called (for future reference)
> specs<-list.files()[grep(".JPG",list.files())]
> specs
[1] "spec100.JPG" "spec143.JPG" "spec164.JPG"

> # source the function "digitize2d.multi()"
> source(url("http://www.people.fas.harvard.edu/~eotarolacastillo/software/digitze2dmulti.R"))

> # To begin digitizing images call the function with with:
> diged.imgs <- lapply(specs, digitize2d.multi, nlandmarks=3, scale=1)
Loading required package: jpeg
set scale = 1

# to set the scale, use the mouse to digitize the length of the scale in the image


select landmarks 1:3

# to select landmarks, "point-and-click" at the locations of the landmarks of interest. in this case, the ends of a preparation platform and the tip were selected.


set scale = 1
select landmarks 1:3

(figure not shown)
set scale = 1
select landmarks 1:3

# here is another example using an upper-paleolithic blade.


To leave a comment for the author, please follow the link and comment on his blog: geomorph.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.