Can anyone help with the code for this? I want to reduce my image size by using stochastic sampling but cannot work out how to set the limits of my input patch.