home   >   tutorials   >   stereomorph user guide   >   7 digitizing application   >   7.1 digitizing video frames

7.1 Digitizing video frames

Currently, the StereoMorph digitizing application can only handle photographs. So in order to digitize videos you'll need to first extract the video frames as images and input these images to the digitizing application.

1. Load the StereoMorph library if it isn't already loaded.

# Load the StereoMorph package
library(StereoMorph)

2. Extract the frames you want to digitize using the StereoMorph function extractFrames() You'll need to make sure that your video frames are synchronized. If your videos are not synchronized but you have a clear visual signal in the view of the cameras (e.g. turning on and off a light), you can use the extractFrames() function to extract "synchronized" frames. This will ensure that corresponding frames/images between different views have the same filename.

Once you have a set of images (i.e. frames) from both views this you can follow the same instructions as for photographs in the next section. If you'd like to work through the example below with stereo video frames, you can download an example set here (17 MB). This folder contains 50 frames from left and right video footage of freely swimming Oceanic white tip sharks (video courtesy of Caine Delacy and Mark Bond) along with a few extra files needed for the digitizing application (a calibration file, a list of points to identify, and a folder where the shape data will be saved). Unzip this folder and move the folder contents to your current R working directory.

Frame from stereo video frame example set (video courtesy of Caine Delacy and Mark Bond).

3. Launch the digitizing application using the digitizeImages() function.

# Launch the digitizing application
digitizeImages(image.file='Images', shapes.file='Shapes 2D', landmarks.ref='landmarks.txt', 
	cal.file='calibration.txt')

For the remaining steps refer to the next section, starting with step 3. In the digitizing application you can skip to frame "00030.jpeg" to see some already digitized landmarks.