gm_phd_tracker: Wrapper function to the Gaussian Mixture PHD tracker

Description Usage Arguments Details Value References Examples

View source: R/phd.R

Description

Wrapper function to the Gaussian Mixture PHD tracker

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
gm_phd_tracker(
  x,
  varnames,
  type = "constant-velocity-model",
  init_field = NULL,
  birth_field = NULL,
  mergingOption = "Panta2009",
  associationOption = "Panta2009",
  position_only = FALSE,
  T_s,
  sigma2_process,
  sigma2_measure,
  P_S,
  Jmax = 20,
  kappa,
  P_D,
  tau,
  U,
  wt,
  w,
  P_Sp,
  P_B,
  return.intensity = FALSE
)

Arguments

x

data.frame: requires time, utm position north and east (m), utm speed north and east (m/s).

varnames

vector: vector of names. Default to "north", "east", "v_north", "v_east".

type

string: random-walk, constant-velocity-model or coordinated-turn-model (Type of kinematic)

init_field

list: List of starting parameters

birth_field

list: List of birth parameters

mergingOption

string: How to merge the measures and create (or continue) the labeled tracks

associationOption

string: How to associate the new measures with the old tracks

position_only

logical: Position only observed (TRUE or FALSE)

T_s

scalar: Time interval to start the filter

sigma2_process

scalar, vector or matrix: Process variance of the kinematic movement

sigma2_measure

scalar, vector or matrix: Measurement variance

P_S

scalar: Probability of survival

Jmax

numeric: Maximum number of Gaussian mixtures carried over to the following time step

kappa

scalar: Intensity of clutter

P_D

scalar: Probability of detection

tau

scalar: Pruning threshold

U

scalar: Merging threshold

wt

scalar: Track confirmation threshold

w

scalar:

P_Sp

scalar: Probability of spawning

P_B

scalar: Probabilty of birth

return.intensity

logical: Returns all the parameters required to calculate the PHD (TRUE or FALSE)

Details

The GM PHD tracker that is implemented here proposes multiple options to choose from in terms of kinematic type (linear vs non-linear), data association options (through merging option and association optiob, defaulted both to Panta2009), and radar precision (position only vs position and velocity).

Value

data.frame with an additional column indication the target id, unique for the entire tracking history, and a few additional kinematic columns

References

\insertRef

Panta2009vesselett

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
34
35
36
37
38
39
40
41
42
43
44
## Not run: 
library(tidyverse)
library(ggrepel)
data(maritime2)
obs_x <- mutate(maritime2, time = time / 60, radar_north = (radar_north - min(north))/1000,
radar_east = (radar_east - min(east))/1000, radar_range = radar_range/1000,
north = (north - min(north))/1000, east = (east-min(east))/1000,
) %>% filter(between(time, 150,250))
plot_obs(obs_x, varnames = c("north", "east"))
mI = unlist(obs_x[obs_x$time == min(obs_x$time),c("north", "east", "v_north", "v_east")])
init_field = list(list(m = mI, P = diag(1, nrow = 4), w = 1, l = "1"))
res = gm_phd_tracker(obs_x, wt = 5e-1, sigma2_measure = 1e-2,
sigma2_process = 1e-1, kappa = 1e-10, tau = 1e-2, T_s = 1, check = FALSE,
init_field = init_field, P_B = 0.1, P_D = 0.9, P_S = 0.9)
Tracks = res$Tracks
Tracks <- left_join(Tracks,
unique(obs_x %>% select(time, radar_east, radar_north, radar_range)),
 by = "time") %>% arrange(time)
tracksP = Tracks %>%
select(north, east, time, target_id, radar_north, radar_east, radar_range) %>%
pivot_longer(c(north, east))
ggplot() +
    geom_point(data = tracksP ,
     aes(x = time, y = value, col = as.factor(target_id)), size = 1, shape = 3)+
    geom_line(data = tracksP ,
    aes(x = time, y = value, group = target_id),col = "black", size = 0.5) +
    facet_wrap( ~ name, ncol = 1, strip.position="left", scales = "free") +
    theme(panel.border = element_blank(),
    panel.grid.major = element_blank(),panel.grid.minor = element_blank(),
    panel.background = element_rect(fill = "white", colour = NA),
    legend.position = 'none',
    axis.line = element_line(size = 0.5, linetype = "solid", colour = "black"))

ggplot() + geom_point(data = obs_x %>% group_by(time, target_id) %>%
summarize(n = n()) %>%
ungroup() %>% group_by(time) %>% summarise(n =n()), aes(x = time, y = n)) +
geom_path(data = Tracks %>% group_by(time) %>%
summarize(n = n()), aes(x = time, y = n), col  ="red", size = 0.5) +
geom_path(data = Tracks %>% group_by(time) %>%
 summarize(n = round(sum(weight, na.rm=TRUE))), aes(x = time, y = n), col  ="blue", size = 0.5)+
geom_point(data = Tracks %>% group_by(time) %>%
 summarize(n = round(sum(weight, na.rm=TRUE))), aes(x = time, y = n), col  ="blue", size=1)

## End(Not run)

ick003/vesselett documentation built on July 20, 2020, 9:08 p.m.