the ```border``` can be empty and ```roi_size``` too. I believe you need to generate ```roi_size``` and then ```border```, but not in the reverse order.