Skip to content

How does detection work?

Eugene Katrukha edited this page Apr 9, 2018 · 3 revisions

How does detection work?

Based on user provided parameters (rod length, thickness) macro generates a series of template images:
angles templates

For each angle orientation, macro calculates normalized cross-correlation image between template and a frame of original movie. Here is an example movie frame:

example frame

and example template orientation:

example template

It will produce following cross-correlation map, enhancing positions where template can be found:

example CC

In the next step macro looks for the pixel with maximum cross-correlation value. It should be above the threshold specified by user (x times SD of cross-correlation image intensity). Once it found it, it removes line shaped area around it (marking rod detection) and looks for the next maximum:

example CC

In addition, to prevent multiple detections, macro adds line image with unique ID to the "detection map" image:
detection map image

This image is checked on every new detection. If current pixel is occupied by previous detection, based on the maximum correlation value one of the detection is rejected and the other one is kept.

Choosing "Show rejected detections in overlay?" option shows these rejected detections in red and blue (while "true" detections are in green).

overlay