Compare segments/laps

Issue #30 new
Daniel Besse created an issue

Compare segments two segment (from same or different activity)

Comments (8)

  1. Daniel Besse reporter

    Some pseudo-algorithm ideas:

    • compute and store for each activity a bounding box
    • search activities with overlapping bounding box

    Espace

    • eqspaced streams in dist for both activities

    Resample

    for a_idx = [a_act points]:
      a_pos_round[a_idx] = round_to_grid(a_pos[a_idx])
      a_resample = a such that no two consecutive idxs are in the same grid bin
    
    for b_idx = [b_act points]:
      b_pos_round[b_idx] = round_to_grid(b_pos[b_idx])
      b_resample = b such that no two consecutive idxs are in the same grid bin
    

    Categorize

    for a_idx = [a_act_resample points]:
      for all 9 neighbors of a_pos_round[a_idx]:
        a_idxs_at[neighbor][] = a_idx
    

    Match

    for b_idx = [b_act_resample points]:
      for a_match_idx = a_idxs_at[b_pos_round[b_idx]]:
        cur_seq_len = 0
        while true:
          if isset(seq_len[b_idx][a_match_idx]) :cur_seq_len += seq_len[b_idx][a_match_idx]:
            break
          cur_seq_len += 1
          if end(A) or end(B):
            break
          if !(a_match_idx+cur_seq_len in a_idxs_at[b_pos_round[b_idx+cur_seq_len]])
            break (or allow some short exceptions...)
        seq_len[b_idx][a_match_idx] = cur_seq_len
    

    Filter

    for seq = [seq_len]:
      filter according to criteria
      display proposition [start_dist, end_dist]
    

    Segment comparison

    [start_dist, end_dist]:

    • x axis = distance
      plot: time difference, speed, power, CdA, etc
    • x axis = time
      map: position
  2. Daniel Besse reporter

    initial code for segment matching (see #30)

    • displays common segments in one activity (with loops for instance)
    • currently only perfect match. Allowing for small discrepancies is TBD (resample may have to be dropped and seq_len directly computed differently for A and B)

    → <<cset 23dac3249979>>

  3. Log in to comment