Skip to content

Commit

Permalink
Merge pull request #152 from yfukai/constrained_refinement_bugfix
Browse files Browse the repository at this point in the history
bug fixed for constrained refinement (by adding correct limit)
  • Loading branch information
yfukai authored Dec 16, 2021
2 parents 900fef1 + f12db45 commit 0afeecd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
id: metadata
uses: dependabot/[email protected]
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-patch' }}
run: gh pr merge --auto --merge "$PR_URL"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "m2stitch"
version = "0.2.1"
version = "0.2.2"
description = "M2Stitch"
authors = ["Yohsuke Fukai <[email protected]>"]
license = "MIT"
Expand Down
5 changes: 3 additions & 2 deletions src/m2stitch/_constrained_refinement.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def refine_translations(images: NumArray, grid: pd.DataFrame, r: Float) -> pd.Da
continue
image1 = images[i1]
image2 = images[i2]
W, H = image1.shape

def overlap_ncc(params):
x, y = params
Expand All @@ -102,8 +103,8 @@ def overlap_ncc(params):
int(g[f"{direction}_y_second"]),
]
limits = [
[init_values[0] - r, init_values[0] + r],
[init_values[1] - r, init_values[1] + r],
[max(-W + 1, init_values[0] - r), min(W - 1, init_values[0] + r)],
[max(-H + 1, init_values[1] - r), min(H - 1, init_values[1] + r)],
]
values, ncc_value = find_local_max_integer_constrained(
overlap_ncc, np.array(init_values), np.array(limits)
Expand Down

0 comments on commit 0afeecd

Please sign in to comment.