dirac-institute / kbmod

KBMOD (Kernel-Based Moving Object Detection)
BSD 2-Clause "Simplified" License
46 stars 14 forks source link

Fix edge case in stamp creation #701

Closed jeremykubica closed 2 months ago

jeremykubica commented 2 months ago

In a very rare case where the edge off the stamp just intersects the edge of the image (1 pixel total overlap), the differences between to_index() and (int) can cause different rounding where the to_index() mapping is inside the image, but the (int) one is not. In this case the code crashes because we are bounds checking on the to_index()values, but building the anchored block from the (int) values.