def load_tables(hs, db_dir=None): # Check to make sure db_dir is specified correctly if db_dir is None: db_dir = hs.args.dbdir if db_dir is None or not exists(db_dir): raise ValueError('db_dir=%r does not exist!' % (db_dir)) hs_dirs, hs_tables, db_version = ld2.load_csv_tables(db_dir) hs.tables = hs_tables hs.dirs = hs_dirs if db_version != 'current': print('Loaded db_version=%r. Converting...' % db_version) hs.save_database() _checkargs_onload(hs)
chip_fpath = '/media/Store/data/work/zebra_with_mothers/06_410/1.JPG' if not os.path.exists(chip_fpath): print("PATH DOES NOT EXIST: "+str(chip_fpath)) sys.exit(1) # OpenCV Feature Detector Benchmarks # http://computer-vision-talks.com/2011/01/comparison-of-the-opencvs-feature-detection-algorithms-2/ # Conclusion: FAST is fast, STAR has low error # OpenCV Feature Detector Documentation # http://docs.opencv.org/modules/features2d/doc/feature_detection_and_description.html#freak-freak import load_data2 db_dir = load_data2.MOTHERS hs_tables, hs_dirs = load_data2.load_csv_tables(db_dir) exec(hs_tables.execstr('hs_tables')) print(hs_tables) chip_dir = db_dir + '.hs_internals/computed/chips/' feat_dir = db_dir + '.hs_internals/computed/feats/' kpts_type_pref = Pref('SIFT', choices=['SIFT', 'SURF', 'ORB', 'BRISK', 'BRIEF']) kpts_type = kpts_type_pref.value() __SIFT_PARAMS__ = ['contrastThreshold', 'edgeThreshold', 'nFeatures', 'nOctaveLayers', 'sigma'] __FREAK_PARAMS__ = ['nbOctave', 'orientationNormalized', 'patternScale', 'scaleNormalized'] img = read_img(chip_fpath) #in_place_black_bar(img)
chip_fpath = '/media/Store/data/work/zebra_with_mothers/06_410/1.JPG' if not os.path.exists(chip_fpath): print("PATH DOES NOT EXIST: " + str(chip_fpath)) sys.exit(1) # OpenCV Feature Detector Benchmarks # http://computer-vision-talks.com/2011/01/comparison-of-the-opencvs-feature-detection-algorithms-2/ # Conclusion: FAST is fast, STAR has low error # OpenCV Feature Detector Documentation # http://docs.opencv.org/modules/features2d/doc/feature_detection_and_description.html#freak-freak import load_data2 db_dir = load_data2.MOTHERS hs_tables, hs_dirs = load_data2.load_csv_tables(db_dir) exec(hs_tables.execstr('hs_tables')) print(hs_tables) chip_dir = db_dir + '.hs_internals/computed/chips/' feat_dir = db_dir + '.hs_internals/computed/feats/' kpts_type_pref = Pref('SIFT', choices=['SIFT', 'SURF', 'ORB', 'BRISK', 'BRIEF']) kpts_type = kpts_type_pref.value() __SIFT_PARAMS__ = [ 'contrastThreshold', 'edgeThreshold', 'nFeatures', 'nOctaveLayers', 'sigma' ] __FREAK_PARAMS__ = [ 'nbOctave', 'orientationNormalized', 'patternScale', 'scaleNormalized'