Skip to content

Commit

Permalink
Clean up user supplied key points
Browse files Browse the repository at this point in the history
  • Loading branch information
miketaormina committed May 24, 2021
1 parent f838491 commit fb6e7ef
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion bigstream/affine.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ def ransac_affine(
if verbose:
ns = fix_spots.shape[0]
print(f'FIXED image: found {ns} key points')
else:
# Not sure what the convention should be for pixel vs. physical coordinates.
# This is assuming pixels at the same resolution as `fix` and `mov`.
fix_spots = features.cull_boundary_points(fix_spots, cc_radius, fix.shape)
if fix_spots.shape[1]==3:
fix_spots = np.hstack([fix_spots, np.ones((fix_spots.shape[0],1))])

if mov_spots is None:
mov_spots = features.blob_detection(
Expand All @@ -52,7 +58,11 @@ def ransac_affine(
if verbose:
ns = mov_spots.shape[0]
print(f'MOVING image: found {ns} key points')

else:
mov_spots = features.cull_boundary_points(mov_spots, cc_radius, mov.shape)
if mov_spots.shape[1]==3:
mov_spots = np.hstack([mov_spots, np.ones((mov_spots.shape[0], 1))])

# sort
sort_idx = np.argsort(fix_spots[:, 3])[::-1]
fix_spots = fix_spots[sort_idx, :3][:nspots]
Expand Down

0 comments on commit fb6e7ef

Please sign in to comment.