# =============================================================================== # action: bowhist # =============================================================================== # # extract bow histograms # if (args['action'] == 'bowhist') or (args['action'] == 'all'): print "\n=== extract BoW Histograms from directory {0} ===\n".format(args['dir']) dir = args['dir'] if len(args['featdir']) > 0: dir = args['featdir'] MatchboxLib.extractBoWHistograms(config,args['dir'], args['threads'], dir) # =============================================================================== # action: compare # =============================================================================== # # compare bow histograms and display duplicates # if (args['action'] == 'compare') or (args['action'] == 'all'): print "\n=== compare images from directory {0} ===\n".format(dir) dir = args['dir'] if len(args['featdir']) > 0: dir = args['featdir']
# =============================================================================== # action: bowhist # =============================================================================== # # extract bow histograms # if (args['action'] == 'bowhist') or (args['action'] == 'all'): print "\n=== extract BoW Histograms from directory {0} ===\n".format(args['dir']) feature_directory = args['dir'] if len(args['featdir']) > 0: feature_directory = args['featdir'] MatchboxLib.extractBoWHistograms(config, args['dir'], args['threads'], feature_directory, args['binary']) # =============================================================================== # action: compare # =============================================================================== # # compare bow histograms and display duplicates # if (args['action'] == 'compare') or (args['action'] == 'all'): print "\n=== compare images from directory {0} ===\n".format(args['dir']) feature_directory = args['dir'] if len(args['featdir']) > 0: feature_directory = args['featdir']
# extract features for collection 1 print "\n=== extracting features from directory {0} ===\n".format(args['dir1']) MatchboxLib.extractFeatures(config, args['dir1'], args['sdk'],args['threads'], args['clahe'], feat_dir1, "SIFTComparison") # extract features for collection 2 print "\n=== extracting features from directory {0} ===\n".format(args['dir2']) MatchboxLib.extractFeatures(config, args['dir2'], args['sdk'],args['threads'], args['clahe'], feat_dir2, "SIFTComparison") print "\n=== calculating Bag of Words ===\n".format(args['dir2']) if not os.path.exists("{0}/bow.xml".format(feat_dir1)): MatchboxLib.calculateBoW(config, feat_dir1, args['filter'], args['precluster']) print "\n=== Searching for referencing images in both collections ===\n" print "... extract BoW Histograms of collection2" MatchboxLib.extractBoWHistograms(config,args['dir1'], args['threads'], feat_dir1, "{0}/bow.xml".format(feat_dir1)) MatchboxLib.extractBoWHistograms(config,args['dir2'], args['threads'], feat_dir2, "{0}/bow.xml".format(feat_dir1)) # if (args['action'] == 'duplicates') or (args['action'] == 'all'): # ## print "\n=== Searching for duplicates ===\n" # # # # calculating Bag of Words # print "\n=== Bag of Words Processing ===\n" # # if not os.path.exists("{0}/col1/bow.xml".format(args['featdir'])): # MatchboxLib.calculateBoW(config, "{0}/col1".format(args['featdir']), args['filter'], args['precluster']) # # print "... extract BoW Histograms from collection 1"
args['precluster'], args['bowsize'], args['verbose'], args['binary']) # =============================================================================== # action: bowhist # =============================================================================== # # extract bow histograms # if (args['action'] == 'bowhist') or (args['action'] == 'all'): print "\n=== extract BoW Histograms from directory {0} ===\n".format( collection_directory) MatchboxLib.extractBoWHistograms(config, collection_directory, args['threads'], feature_directory, args['binary']) # =============================================================================== # action: compare # =============================================================================== # # compare bow histograms and display duplicates # if (args['action'] == 'compare') or (args['action'] == 'all'): print "\n=== compare images from directory {0} ===\n".format( args['dir']) MatchboxLib.pyFindDuplicates_SpatialVerification_fast( config, feature_directory, args['threads'], args['binary'],
# extract features for collection 2 print "\n=== extracting features from directory {0} ===\n".format(args["dir2"]) MatchboxLib.extractFeatures( config, args["dir2"], args["sdk"], args["threads"], args["clahe"], feat_dir2, "SIFTComparison" ) print "\n=== calculating Bag of Words ===\n".format(args["dir2"]) if not os.path.exists("{0}/bow.xml".format(feat_dir1)): MatchboxLib.calculateBoW(config, feat_dir1, args["filter"], args["precluster"]) print "\n=== Searching for referencing images in both collections ===\n" print "... extract BoW Histograms of collection2" MatchboxLib.extractBoWHistograms( config, args["dir1"], args["threads"], feat_dir1, "{0}/bow.xml".format(feat_dir1) ) MatchboxLib.extractBoWHistograms( config, args["dir2"], args["threads"], feat_dir2, "{0}/bow.xml".format(feat_dir1) ) # if (args['action'] == 'duplicates') or (args['action'] == 'all'): # ## print "\n=== Searching for duplicates ===\n" # # # # calculating Bag of Words # print "\n=== Bag of Words Processing ===\n" # # if not os.path.exists("{0}/col1/bow.xml".format(args['featdir'])): # MatchboxLib.calculateBoW(config, "{0}/col1".format(args['featdir']), args['filter'], args['precluster'])