This python script creates multiple circles to demonstrate that line crossing can be done by masking.
Script creates one mask for the line and then creates multiple masks for each circles. In this case circles are made up to represent object center points. These points can be used to create circles just like the script does and with a given line and given consideration to the limitation occuring because of the speed of these objects.
To run the given script installing these requirements are sufficient
opencv
numpy
math
imutils