Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 1
    For my case the easiest solution, also isn't calculation expensive Commented Nov 14, 2018 at 12:44
  • @DeepPatel you are wrong. The resulting tiles do not overshoot the image size for any values of N and M, since slicing the image beyond its borders ignores the redundant parts. The following statement is correct for any 0<=x<=im.shape[0]: assert im[im.shape[0]-x:im.shape[0]+x:,:].shape[0] == x Commented Feb 8, 2022 at 18:22
  • 1
    My bad, I was using this for something else and may have made some mistake when modifying it. You are right. Commented Feb 9, 2022 at 19:49
  • 1
    Any one try putting these back together after splitting? Commented Jul 22, 2022 at 8:45
  • 1
    @Thomas this is late, but for posterity, the sequence of tiles given by the code goes row by row. So, if you have six tiles with 2 rows and 3 columns, then to put it back together, you do row0=[tiles[0],tiles[1],tiles[2]] and row1=[tiles[3],tiles[4],tiles[5]] Commented Oct 17, 2023 at 12:16