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
{{ message }}
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.
I have been using the image_slicer.slice() for some time now. Recently the input image dimensions changed and thus the new shape of input images have become rectangular now.
Current dimensions of new input images = 8235 * 10065 pixel (earlier the input images were square shaped with dimension in multiple of 183)
Expected output tile dimension = 183 * 183
So the number of tiles expected = 55 rows * 45 columns
I gave n=2475 (55 * 45) but the function sliced 2500 tiles of dimension 164*201 pixel, which is not the desired result in this case.
Can this (slicing the input images to a given number of tiles as rows and columns) be achieved using the slice function() ?
please suggest if its possible.
Best,
Akhil
The text was updated successfully, but these errors were encountered:
I did some digging of the lib code and came across the slice() function definition. def slice(filename, number_tiles=None, col=None, row=None, save=True):
which gave the answer to my query. I was not able to find anything related to this provision in the documents. May be the docs could be updated.
However, in the else block, the calculation of variable extra was throwing an error: unsupported operand type(s) for -: 'int' and 'NoneType' for obvious reason. extras = (columns * rows) - number_tiles where number_tiles is None
I could get it working using a ternary operator as below extras = (columns * rows) - 0 if number_tiles is None else number_tiles
I would keep this issue open with updated title instead of closing it and creating a new one.
Best,
Akhil
AkhilJPatil
changed the title
slice function not compatible with rectangular images
slice function: None type not handled for rectangular images
Dec 25, 2019
I just hit the same error (line 161 main.py)
You can delete the '-number_tiles ' bit, that code is only called if number_tiles is not defined with a value.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello Sam,
I have been using the image_slicer.slice() for some time now. Recently the input image dimensions changed and thus the new shape of input images have become rectangular now.
Current dimensions of new input images = 8235 * 10065 pixel (earlier the input images were square shaped with dimension in multiple of 183)
Expected output tile dimension = 183 * 183
So the number of tiles expected = 55 rows * 45 columns
I gave n=2475 (55 * 45) but the function sliced 2500 tiles of dimension 164*201 pixel, which is not the desired result in this case.
Can this (slicing the input images to a given number of tiles as rows and columns) be achieved using the slice function() ?
please suggest if its possible.
Best,
Akhil
The text was updated successfully, but these errors were encountered: