Use img.binary():
https://docs.openmv.io/library/omv.image.html?highlight=binary#image.image.Image.image.binary