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

UserTemplate + even/square crop sizes can lead to off-by-one errors #72

Open
matbryan52 opened this issue Dec 27, 2023 · 0 comments
Open
Labels
bug Something isn't working

Comments

@matbryan52
Copy link
Member

In testing #70, I had off-by-one errors when using a 3x3 mask with a central pixel == 1.

This is due to the hardcoded crop shape of (2 * search, 2 * search), so that the small mask is inserted into the search template off-centre.

Ideally, the crop shape should follow the mask shape for odd/evenness so that everything remains centered. Similarly there is no need to force the crops to be square, if the template is rectangular we can search in a rectangular window.

As part of #70 I've started to implement a backwards-compatible mechanism for a MatchPattern to supply a Tuple[int, int] from get_crop_size() which directly specifies the crop to search in.

@matbryan52 matbryan52 added the bug Something isn't working label Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant