Build instructions
Pull from git:
git clone https://github.com/picoexperiment/PICOJarTracker.git
Ensure cmake and opencv are both installed. On Compute Canada, use:
module load cmake
module load opencv
To build:
cd PICOJarTracker
cmake .
make
Updating Templates
The templates are images of the fiducial marks that are cropped from a reference image. These templates are numbered, with the number used as a reference in the code. The code will align the templates with the corresponding fiducial marks in images it receives from various events.
To update the templates, follow the steps below.
- Choose a reference event, where all cameras are operational.
- Copy the first frame from each camera and change the file name so future users will know from which event the image was taken.
- For each camera, make small cropped images of each of the fiducial marks to be tracked by the camera. Try to choose marks such that the cropped images will be free of patterns that could distract the image matching algorithm. Ensure that the entire mark is captured in the new template, and that a small amount of padding is present around the mark. The choice of padding is a bit of an art. The padding can be used to lead opencv away from features that can sometimes have similar shading, such as due to lighting changes. As each template is made, record the X and Y position (in pixels) of the pixel in the top left corner of the cropped area. Do not partially crop pixels, as this will make it more difficult to asign the correct X and Y poisitions. Must have at least 4 templates.
- Save the new templates in directories labelled
cam0,cam1, etc, along with the renamed image from step 2. These directories should all be contained within another directory, which will be specified at runtime. - Specify the pixel coordinates in a
templ.cfgfile in the top level directory created in step 4. Use one of the existingtempl.cfgfiles as a guide. - Make and run Optometrist on the same run that the new templates were taken from.
- Load the output file, and look at the
Key Pointsfor the event that the templates were taken from. This is where Optometrist has decided that each template was taken from in the image. - Update the
templ.cfgfile as needed to ensure that the locations of theKey Points(rounded to the nearest pixel) matches what is written in thetempl.cfgfile. Also check that the perspective transform is very close to a 3x3 identity matrix for the reference event. - Have a new optical lookup table generated using the same event as a reference.