UserTemplate
+ even/square crop sizes can lead to off-by-one errors
#72
Labels
bug
Something isn't working
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 aTuple[int, int]
fromget_crop_size()
which directly specifies the crop to search in.The text was updated successfully, but these errors were encountered: