Bitwise_and fails on smaller starting Mats

not necessarily. that could just be uninitialized memory (you did not initialize it to a specific value), and those pixels aren’t touched by the API call because you specify a mask argument.