Variable edge buf size. int64 coordinates.#22
Variable edge buf size. int64 coordinates.#22ausrasul wants to merge 5 commits intoImage-Py:masterfrom
Conversation
Allows large images to be marked with higher values. That fixes the bugs when "trace" can't find the end node due to integer limit of the x,y address.
|
@ausrasul Thank you for your quick fix, I was about to do something similar. About the Is the concern about memory consumption a valid one? In the PR #19 tackling the same issue @yxdragon seems to acknowledge that. I'll be testing your fork and give a feedback. |
An overflow was happening for reasonably big images (a dimension greater than 2^16). It is now `uint32`. Note that `mark_node` hasn't been touched because it's not involved in the graph generation.
|
Hi, I've added your PR and also moved buf_size to the end of the args list to prevent breaking old code that uses positional args. Regarding why int64 instead of uint64, at line sknw.py line 46 it tries to add an int from neighbors with a uint64 which result in float64 that cannot be used as an index. Your concern about memory is valid, but the problem not int or uint, but rather it being 64 instead of 16. |
The edge buffer size is too small when dealing with large images.
So I added the option to make it user defined.
Also when converting large images where the x,y coordinates are larger than the max value of int16, the coordinates become invalid/capped to the max value of int16.
It is changed to int64.