Skip to content
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

Annotation positions not accurate in sub-pixel level #223

Closed
nlw0 opened this issue Aug 20, 2020 · 0 comments · Fixed by #305
Closed

Annotation positions not accurate in sub-pixel level #223

nlw0 opened this issue Aug 20, 2020 · 0 comments · Fixed by #305
Labels

Comments

@nlw0
Copy link

nlw0 commented Aug 20, 2020

There seems to be some detail missing in the calculation of annotation positions to put them in the right place when the image is zoomed it. This is a sample program, and some screenshots of the result moving around over the image. Seems like some kind of off-by-one error when calculating the transformed coordinates.

using ImageView
using TestImages

guidict = imshow(testimage("cameraman"))
annotate!(guidict, AnnotationPoint(255.01, 255.01, shape='.', size=4, color=RGB(1,0,0)))
annotate!(guidict, AnnotationPoint(255.99, 255.01, shape='.', size=4, color=RGB(1,0,0)))
annotate!(guidict, AnnotationPoint(255.01, 255.99, shape='.', size=4, color=RGB(1,0,0)))
annotate!(guidict, AnnotationPoint(255.99, 255.99, shape='.', size=4, color=RGB(1,0,0)))

image
image
image
image

@timholy timholy added the bug label Apr 24, 2022
jwahlstrand added a commit that referenced this issue May 26, 2024
…#305)

When drawing anchored annotations, widen the user bounding box since the pixels are centered on the integers of the user coordinates.

Fixes #223.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants