The method just makes sure that only a valid box from an integral image is accessed. And I am not sure if wrapping around an integral image would be correct.