Getting Started#
This page goes through an exemplary project. You can download this example project here (~200MB).
Experimental Setup#
Before PeTrack is used, experiments need to be planned (see Planning of Experiments), executed and of course recorded. Part of this process is the calibration (see Performing the Intrinsic and Extrinsic Calibration). At first the intrinsic calibration has to be performed, which corrects for the lens distortion of the camera. Second, the extrinsic calibration is performed, which creates known points in 3D space. Therefore we record images of a chessboard for intrinsic calibration and images of measured points for extrinsic calibration.
Using PeTrack#
The usage and some settings will be explained with the provided demo project (‘demo’ folder), the folder contains all necessary files to set up a PeTrack project.
Calibration#
The first step to setup a PeTrack project is the calibration of the camera, which mainly consists of two parts intrinsic and extrinsic calibration. Additionally some color correction and the addition of borders can be set up here.
Intrinsic calibration#
Open PeTrack. The program should automatically open in the calibration tab.
Click on “files” and browse to the snapshots out of the video for intrinsic calibration (chessboard), select ALL of those snapshots (for multi-selection hold
⌃ Ctrl/⌘ Cmdand sequentially click on the files). The snapshots for the demo are located in:demo/00_files/calibration/intrinsic.Click on “auto” to start intrinsic calibration
See how the parameters in the “intrinsic calibration” section have changed
Check “apply” and save the project to save your progress so far
demo/01_calibration/01_intrinsic.pet is the resulting PeTrack project file after these steps.
Extrinsic Calibration#
For the extrinsic calibration, we need to create a .3dc file based on the points from our sketch of the experimental setup (see Extrinsic Calibration for more detail). Create the file in the following format:
The first line is the total number of points. Starting from the second line, all coordinates should be listed in centimeter according to their X, Y and Z coordinates. An example of the .3dc file can be found as demo/01_calibration/before.3dc.
Continue with PeTrack after the intrinsic calibration. Load your combined extrinsic calibration image.
Open the image and mark the points from your
.3dcfile in the order, they appear in the file. Markers can be set with⌃ Ctrl/⌘ Cmd + double left clickand deleted with⌃ Ctrl/⌘ Cmd + double right click.Load the points from the
.3dcfile by pressing load and browsing to the file.Click “fetch”. This will use your selected image points and the points from the
.3dcto calibrate.You can check the result with the buttons “show” and “error”. Additionally, you can have PeTrack draw the virtual world coordinate system by clicking on the “show” checkbox in the “coordinate system” section.
Click “save” to make PeTrack add the pixel coordinates to the
.3dcfile.
demo/01_calibration/02_extrinsic.pet is the resulting PeTrack project file after these steps.
Recognition#
After the calibration is done, load the video file via File/Open Sequence. The next step is to set up the recognition. Switch to the tab “Recognition” and check “show”. Press (⌃ Ctrl/⌘ Cmd + 1) to adjust view. (Alternatively, you can use the menu-bar, View > Fit in region of interest)
Load the video file via
File/Open Sequenceand switch to the tab “Recognition”In the section “region of interest” check “show”. Mouse over any image-edge (top, bottom, left, right) and click and drag the green line. In the region between the green lines recognition is performed. Only if the
fixbox is unchecked, it is possible to adjust the borders of this region.Select the marker you used in the experiment. The demo experiment uses the multicolor marker with an additional code.
After selecting the marker type, click on “parameter” to set up the marker.
“open radius” and “close radius” should be deactivated when selecting colors, as the image mask does not accurately depict the selected color. To see which color range currently is detected, select “mask” and set “opacity” to 50. Then close the parameter window.
In the “map” section color and corresponding height of the marker can be defined:
Clicking on “color range” opens a dialog where you can choose the range of colors for the currently selected group.
Check “perform” to see the areas, which are included in the color range.
The “height” in the “map” section represents the height that is assumed for all participants with hats in the selected color region. See here for more info on different options to get the pedestrian height.
Go back to the “parameter”-window. Now adjust the “open radius” and “close radius” as well as other parameters to your needs. For details, see Multicolor Marker.
In our case, since we are using the additional code marker, check “use code marker” and open the “parameter” box via the button to its right. Select the correct dictionary (in our demo case “DICT_6X6_1000”) and adjust the parameter to your needs. For details, see Code Marker.
Close the parameter window of the code marker. Then deselect the mask and close the parameter window of the multicolor marker as well. Make sure to save your progress by saving the project.
demo/02_recognition/04_recognition.pet is the resulting PeTrack project files after these steps.
Tracking#
After recognition is done, go to the “tracking” tab in PeTrack.
In the section “region of interest” check “show”. You can automatically adjust the tracking region of interest (blue line) by clicking “adjust automatically” or manually adjust the lines via click and drag. If you manually adjust make sure that the tracking ROI is larger than the recognition ROI.
In the section “search region” adjust the parameters to your needs. For more details, see Set Up Tracking.
Now start the tracking by either clicking
calculate allwhich runs the tracking forward and backwards over the complete video. Or by checkingonline calculationand pressing play.After the tracking is complete, make sure to save your progress in a new project file
.petand also save your tracked trajectories in a.trcfile.
Corrections#
After the tracking is complete you should manually check and correct the resulting trajectories.
Make sure to uncheck “perform” (recognition) and “online calculation” (tracking) to not overwrite manual changes.
Adjust the visualization of trajectories by the different settings in the “path” section. For a detailed description of the options, see Visualization of Points and Trajectories.
There are different ways for correcting trajectories, see here for a detailed description.
To save your progress during correction, export the trajectories as
.trcfile (the internal file format of PeTrack). Once you are finished with the correction, additionally export a.txtfile.