The Code
The code is divided roughly into two sections: the image analysis, and the interface.
![](static/code_layout.png)
The frames from the video cameras are analyzed by CMCMarkerTrackingEx, which located the points in each frame, orders them appropriately, then calls CMCMath to determine the real-world locations of the tracked points. CMCMath uses camera rotation matrices and translation vectors calculated by the Mathematica NewCoords notebook. CMCMarkerTrackingEx then either saves the tracked points, frame by frame, to an out.text file, or passes the points immediately to CMCAnimationPanel.
CMCAnimatonPanel takes a list of tracked points and the corresponding images, and constructs CMCThreadInfo, which holds information needed by both CMCAnimationThread3D and CMCVideoThread.
CMCAnimationThread3D and CMCVideoThread run in sync, and show the 3D animation of the model and the video of the model, respectively. At 30 frames per second, CMCAnimationThread3D updates the model animation, and can show the model from any angle depending on the user's preference through CMCGui.
CMCGui is the user interface to the program, and handles the menus, buttons, slider, and, in conjunction with CMCAnimationPanel, the animation and video panels.