gen.eg.img.list: Generate Example Image List Data

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/gen.eg.img.list.r

Description

Generates synthetic video data comprising noise around each frame's peripheral and a boxed region whose pixel values oscillate according to the input parameters.

Usage

1
gen.eg.img.list(dim.x, dim.y, fps, n.secs, sig.f, sig.peak, box.width, box.height)

Arguments

dim.x

x dimension of the video frames. Defaults to 64 pixels.

dim.y

y dimension of the video frames. Defaults to 64 pixels.

fps

Sampling rate of the synthetic video in frames per second. Defaults to 30 frames per second.

n.secs

Number of seconds in the synthetic video. Defaults to 3 s.

sig.f

Frequency at which the boxed region's pixel values oscillate. Defaults to 2 Hz.

sig.peak

Peak of signal. Defaults to 0.2.

box.width

Width of box region. Defaults to 10 pixels.

box.height

Height of box region. Defaults to 10 pixels.

Details

Use this function to create synthetic video data in the list structure required for functions like amp.sig and sig.extract.

Note that noise in the frames fluctuates between -1 and 1. Therefore, if you choose sig.peak<1 in each frame the boxed region's pixel values will be below the signal to noise ratio. If you were to 'play' this video (i.e. cycle through the list elements) the boxed region would be difficult or impossible to distinguish without first amplifying the signal using amp.sig.

Value

List whose elements correspond to individual video frames, each of which are separated by 1/fps.

Author(s)

Alex J.C. Witsil

See Also

amp.sig and sig.extract

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
###############
### INPUTS ####
###############

## x and y dimension of the frame
dim.x = 64
dim.y = 64

## sample rate in frames per second
fps = 30

## how many seconds does the video last
n.secs =3 

## what is the frequency at which the boxed region oscillates
sig.f = 2 

## what is the peak amplitude of the signal
sig.peak = 0.2 

## size of the boxed region
box.width = 10
box.height = 10

################################  
### GENERATE SYNTHETIC VIDEO ###
################################

## use the inputs to generate an image list (i.e. video)
img.list <- gen.eg.img.list(dim.x, dim.y, fps, n.secs, sig.f, sig.peak, box.width, box.height)

## or use the defaults in the function
img.list <- gen.eg.img.list()

imagefx documentation built on Feb. 14, 2020, 1:07 a.m.