Your code snippet won’t crop the images, as

you have an assert statement, which checks both image shapes are equal
you calling get_params with the same input and output size, thus it will be static and return the parameters to use the complete image (line of code 11)