#don't throw anything out, just have dataframes and masks
#TODO: decide on a consistent mask format to output. Do we want to also accept existing masks and just mask more things?
#TODO: decide on a consistent mask format to output.
#Do we want to also accept existing masks and just mask more things?
#consider passing in the matches and source_node to __init__
classMatchOutlierDetector(object):
"""
Documentation
"""
def__init__(self,ratio=0.8):
def__init__(self,matches,ratio=0.8):
#0.8 is Lowe's paper value -- can be changed.
self.distance_ratio=ratio
self.matches=matches
self.mask=None#start with empty mask? I guess we could accept an input mask.
# return mask with self-neighbors set to zero. (query only takes care of literal self-matches on a keypoint basis, not self-matches for the whole image)
#TODO: turn this into a mask-style thing. just returns a mask of bad values
deffind_self_neighbors(self,source_node,matches):
defself_neighbors(self,source_node):
"""
Returns a df containing self-neighbors that must be removed.
(temporary return val?)
@@ -122,10 +124,14 @@ class MatchOutlierDetector(object):