image_measure: Measure pixels in a set of images

View source: R/img_measure.R

image_measureR Documentation

Measure pixels in a set of images

Description

This function launches a Shiny app that allows you to quickly measure the pixel location of the waterline of a whale/boat and the horizon/shoreline directly behind it in a set of images.

Usage

image_measure(
  img_path = "images/",
  log_path = "measures.csv",
  scroll_width = 1700,
  scroll_height = 400
)

Arguments

img_path

Path to the folder of images. The default assumption is that there is a folder named "images" within your working directory.

log_path

Path to the csv file in which to keep pixel measurements. The default assumption is a file, measures.csv, within your working directoy. If this file does not exist in the specified path, the function will create it.

scroll_width

Width, in pixels, of image scrolling portion of the app, to customize the app for your specific screen.

scroll_height

Height, in pixels, of image scrolling portion of the app, to customize the app for your specific screen.

Details

This function uses EBImage to read and display images. It uses exifr and exiftoolr to read image metadata.

Workflow notes:

  • If your photos are large, you can adjust the zoom options and scroll around the image using your mousepad.

  • Double-click on the whale/boat waterline to grab its pixel location.

  • Single-click on the horizon/shore line to grab its pixel location.

  • To save these measurements, click the "Save" button that appears.

  • The app will automatically advance to the next image.

  • If you can't take both of those measurements for an image, click the "Can't" button to mark that image as processed as advance to the next image.

  • Advance to the next image without saving measurements by clicking the "Skip" button.

  • Note that by default, the app will only show images that do not yet have measurements within the log_path file.

  • Close the app by exiting the app window; you may also have to click the 'Stop sign' in R or RStudio to end the command completely.

Value

This function will launch a Shiny app. As you store measurements, the log_path file will be updated with those new measurements. Each row of measurements follows this comma-separated format:

  1. Image filename,

  2. Y pixel of horizon/shore

  3. Y pixel of whale/boat waterline

  4. X pixel of whale/boat (can be useful for refining bearing)

  5. System time of when measurement was made


ericmkeen/suRvey documentation built on Feb. 5, 2025, 7:44 a.m.