Given a tile row and column numbers returns the range of pixels affected by that tiles in the overall image Returns a tuple with: - Starting coordinates of rows in pixel space - Ending coordinates of rows in pixel space - Starting coordinates of columns in pixel space
(tile_row, tile_col, tile_width, tile_height, tile_row_overlap, tile_col_overlap)
| 49 | |
| 50 | |
| 51 | def _tile2pixel_indices(tile_row, tile_col, tile_width, tile_height, tile_row_overlap, tile_col_overlap): |
| 52 | """Given a tile row and column numbers returns the range of pixels affected by that tiles in the overall image |
| 53 | |
| 54 | Returns a tuple with: |
| 55 | - Starting coordinates of rows in pixel space |
| 56 | - Ending coordinates of rows in pixel space |
| 57 | - Starting coordinates of columns in pixel space |
| 58 | - Ending coordinates of columns in pixel space |
| 59 | """ |
| 60 | px_row_init = 0 if tile_row == 0 else tile_row * (tile_height - tile_row_overlap) |
| 61 | px_row_end = px_row_init + tile_height |
| 62 | px_col_init = 0 if tile_col == 0 else tile_col * (tile_width - tile_col_overlap) |
| 63 | px_col_end = px_col_init + tile_width |
| 64 | return px_row_init, px_row_end, px_col_init, px_col_end |
| 65 | |
| 66 | |
| 67 | def _pixel2latent_indices(px_row_init, px_row_end, px_col_init, px_col_end): |
no outgoing calls
no test coverage detected