You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Result of cropping never contains last column and last row of image pixels.
Method np.random.randint(low, high) returns value from low (inclusive) and to high(exclusive) (See documentation)
Therefore variable top takes value from 0 to h - new_h - 1 inclusive.
Maximal bottom equals (h - new_h - 1) + new_h - 1 = h - 2 but not h - 1.
Row indexed h - 1 never gets into result.
Similarly, column indexed w - 1.