Learn R Programming

Rvision (version 0.6.0)

readFrame: Read Specific Video Frame

Description

Read a specific frame of a Video object and returns it as an Image object.

Usage

readFrame(x, pos, target = "new")

Arguments

x

A Video object.

pos

An integer corresponding to the position of the frame to read in the video.

target

The location where the results should be stored. It can take 2 values:

  • "new":a new Image object is created and the results are stored inside (the default).

  • An Image object:the results are stored in another existing Image object. This will replace the content of target. Note that target must have the same dimensions as x.

Value

If target="new", the function returns an Image object. If target is an Image object, the function returns nothing and modifies that Image object in place.

See Also

Video, Image, readNext

Examples

Run this code
# NOT RUN {
balloon <- video(system.file("sample_vid/Balloon.mp4", package = "Rvision"))
frame10 <- readFrame(balloon, 10)

# }

Run the code above in your browser using DataLab