How rjdmoore/fictrac works
FicTrac reconstructs an animal’s fictive path by tracking a patterned sphere in live camera frames or recorded video. The principal runtime is fictrac: it obtains frames, maps camera imagery into a tracking region, estimates sphere rotation, transforms motion into animal coordinates, and integrates position and heading. Configuration, camera calibration/remapping, visualization, and multiple output transports are supporting capabilities. Relationships are based on the README and SOURCE INDEX references; unsampled implementations limit certainty about some dispatch and output details.
Main entry points: Trackball.cpp Sphere tracking · Recorder.cpp Output recorder · FrameGrabber.cpp Frame acquisition · fictrac.cpp Runtime entry
Components 21
Tracking runtime
- Runtime entry
exec/fictrac.cpp - Sphere tracking
src/Trackball.cpp - Rotation optimiser
src/Localiser.cpp - Motion geometry
src/geometry.cpp - Logging
src/Logger.cpp
Camera and vision
- Frame acquisition
src/FrameGrabber.cpp - Frame source API
include/FrameSource.h - Camera drivers
src/CVSource.cpp - Camera models
src/CameraModel.cpp - Image remapping
src/Remapper.cpp - Camera remapping
src/CameraRemap.cpp
Configuration
- Configuration GUI
src/ConfigGUI.cpp - Config parser
src/ConfigParser.cpp - Camera calibration
src/SquareRT.cpp
Data output
- Output recorder
src/Recorder.cpp - File output
src/FileRecorder.cpp - Serial output
src/SerialRecorder.cpp - Socket output
src/SocketRecorder.cpp - Terminal output
src/TermRecorder.cpp
Other components
- Experiment operator
- Camera or video
Connections 22
- Experiment operator → Runtime entry: starts
- Camera or video → Frame acquisition: supplies frames
- Runtime entry → Sphere tracking: runs
exec/fictrac.cpp - Sphere tracking → Frame acquisition: grabs frames
src/Trackball.cpp - Frame acquisition → Frame source API: uses API
- Frame acquisition → Camera drivers: dispatches to
- Sphere tracking → Rotation optimiser: optimises rotation
- Sphere tracking → Camera models: models camera
src/Trackball.cpp - Sphere tracking → Camera remapping: remaps frames
src/Trackball.cpp - Camera remapping → Image remapping: extends
- Camera remapping → Camera models: maps coordinates
- Sphere tracking → Motion geometry: uses geometry
src/Trackball.cpp - Sphere tracking → Config parser: reads settings
src/Trackball.cpp - Experiment operator → Configuration GUI: configures
- Configuration GUI → Config parser: edits settings
- Configuration GUI → Camera calibration: uses geometry
- Sphere tracking → Output recorder: records results
- Output recorder → File output: writes files
- Output recorder → Serial output: sends serial
- Output recorder → Socket output: sends sockets
- Output recorder → Terminal output: prints output
- Runtime entry → Logging: logs events
exec/fictrac.cpp