Skip to content

Commit

Permalink
ftlib: prevent get_match_coords if domain_filter returns empty
Browse files Browse the repository at this point in the history
  • Loading branch information
akorosov committed Mar 27, 2017
1 parent ee648e6 commit 5c388e3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sea_ice_drift/ftlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,11 @@ def feature_tracking(n1, n2, **kwargs):

# filter keypoints by Domain
kp1, descr1 = domain_filter(n1, kp1, descr1, n2, **kwargs)
if len(kp1) == 0:
return (np.array([]),)*4
kp2, descr2 = domain_filter(n2, kp2, descr2, n1, **kwargs)
if len(kp2) == 0:
return (np.array([]),)*4

# find coordinates of matching key points
x1, y1, x2, y2 = get_match_coords(kp1, descr1, kp2, descr2, **kwargs)
Expand Down

0 comments on commit 5c388e3

Please sign in to comment.