Skip to content

Minor bugs - #233

Open
CKChang-tw wants to merge 3 commits into
perfanalytics:mainfrom
CKChang-tw:minor_bugs
Open

Minor bugs#233
CKChang-tw wants to merge 3 commits into
perfanalytics:mainfrom
CKChang-tw:minor_bugs

Conversation

@CKChang-tw

Copy link
Copy Markdown

I found some bugs when trying to run my own projects. All minor and further explained in each commits:

  • Fix video-based intrinsics calibration (frame extraction and cached corner points)
  • Fix synchronization using same video for all cameras when there is underscore _ in the camera name
  • Fix IndexError in markerAugmentation and validate participant_height/mass against trc file count

…orner points)

- extract_frames(): fix frame-extracted check calling .stem on a bool
  (always raised, silently caught, so video frames were never extracted)
- extract_frames(): write extracted frames next to the source video,
  not the current working directory
- calibrate_intrinsics(): don't let a cache miss in Image_points.json
  overwrite the real objp checkerboard grid with [], which broke
  findCorners()'s return value and crashed the caller's unpacking
cam_names was derived with `Path(j_dir).name.split('_')[0]`, which
assumes camera names never contain underscores. Video files named
like "cam_1.mp4" or "cam_2.mp4" produce pose directories
"cam_1_json", "cam_2_json", etc., all truncated to the
same "cam" name. This collapsed the per-camera video lookup dict
to a single entry, so every camera reused one video during person/
frame selection, and offset logs printed "Camera cam and cam".

Strip only the trailing "_json" suffix instead, preserving the
full camera name regardless of underscores.
…mass against trc file count

The augmentation loop iterated `range(len(subject_mass))` instead of
`range(len(trc_files))`, so a longer participant_mass/participant_height
list in Config.toml (e.g. a multi-person value left over when multi_person
is false) caused `trc_files[p]` to raise IndexError once p exceeded the
actual number of trc files.

- When multi_person is false, participant_height/participant_mass must now  resolve to exactly one value matching the one expected trc file; a mismatch raises a clear ValueError instead of silently padding/trimming into a later crash.
- When multi_person is true, mismatched list lengths still only warn and pad/trim, since a valid person can be dropped from pose-3d during triangulation.
- If multiple trc files are found while multi_person is false (e.g. after rerunning filtering() with a different filter type), fall back to the most recently modified one with a warning, since pose-3d is never cleaned between runs and this is a normal workflow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant