Shape matching with ordered boundary point shape contexts using a least cost diagonal method