-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve draw algorithm to handle tile edges in a good way #79
Comments
I'm moving this to the 0.2 milestone. I didn't have time to implement this before going on vacation and want to release v0.1 now. |
Coming back to this question how to draw tiles. The core of the current implementation is here: Lines 199 to 203 in 8d6078f
So the algorithm is to project each tile into a full sky image, and to sum up those projected sky images. I think a much better algorithm would be to first compute a "plan" for a given sky image, where for every pixel in the sky image a decision is made which tile to use to compute it's value. This will give you a label image which you can integer-encode e.g. like this:
where Then do something like this:
This should be much faster, memory efficient, and I think avoid the bright edge issue. |
@cdeil - I'm trying to get back to this issue, and would like to work on it during the weekend. Regarding the computation of tile plan:
So, currently we apply projective transformation to project the tile corners to the sky image. In this case, do we just add a preprocessing step which creates the label image? Could you please elaborate how the label image should be constructed? Do we find the area spanned by a particular tile (using tile corners) and assign a unique label to that part of the image? |
It's been a long time, but this is still an open issue - anyone considering tackling it? |
Hi @keflavich, I'm afraid none of the original developers are actively maintaining this project any longer. If you want send us an PR, we will be happy to review it (or add you to the list of maintainers). |
As discussed previously, our current method of combining projected tiles isn't good. We simply make full sky images for each projected tile and sum them up. This often leads to "bright lines" at tile edges, because pixels there are drawn and summed twice, i.e. the intensity is a factor 2 too high.
Example: https://gist.github.com/cdeil/796875efe4a3620987b9f62eb278cfbc
Output:
Using the RGB example from the high-level docs, one can see that it can also happen that we get "dark lines" or holes between tiles when drawing with the current method:
And the current
SimpleTilePainter
is super slow, presumably because it applies the projective transform for every tile for the whole sky image (even though the tile only contributes to a small subset of pixels in the output image).So we need to implement a better method in the
SimpleTilePainter
, to avoid these artifacts and get reasonable performance. I have some ideas, @adl1995 - we can discuss in the call this afternoon.The text was updated successfully, but these errors were encountered: