Hello bec1010,
Some variations of the script are also writing intermediate points by the image border. If oyu need only four corners you need to create steps as a list of four elements.
steps = [(0, 0), (sensor.width-1, 0), (sensor.width-1, sensor.height-1), (0, sensor.height-1)]
this should go instead of five lines of steps definition via list(zip(...)).