fix the "bounding box glitch" problem

idgun.py had a well-known problem in bounding box detection called the "bounding box glitch". When there is a spark that occupies the output glider lane, idgun.py underestimates the bounding box by not taking that spark into account.

This commit solves this glitch by using a different algorithm that captures the bounding box of each phase.

A naive benchmark of running the script for every gun in catagolue's "gun" dataset shows that this approach is roughly 8 times slower.

Technically two different algorithms are used. See more in the source code comments.

Merge request reports

Loading