Beispiel #1
0
parser = argparse.ArgumentParser(description='Keypoint projection.')
parser.add_argument('--project', required=True, help='project directory')
args = parser.parse_args()

proj = ProjectMgr.ProjectMgr(args.project)
proj.load_images_info()

source = 'matches_grouped'
print("Loading source matches:", source)
matches = pickle.load(open(os.path.join(proj.analysis_dir, source), 'rb'))

print("features:", len(matches))

# compute the group connections within the image set.
groups = Groups.compute(proj.image_list, matches)
Groups.save(proj.analysis_dir, groups)

print('Total images:', len(proj.image_list))
print('Group sizes:', end=" ")
for g in groups:
    print(len(g), end=" ")
print()

# debug
print("Counting allocated features...")
count = 0
for i, match in enumerate(matches):
    if match[1] >= 0:
        count += 1

print("Writing:", source, "...")
Beispiel #2
0
area_dir = os.path.join(args.project, args.area)
source = 'matches_grouped'
print("Loading source matches:", source)
matches = pickle.load( open( os.path.join(area_dir, source), 'rb' ) )

print("features:", len(matches))

# compute the group connections within the image set.

groups = Groups.groupByFeatureConnections(proj.image_list, matches)
# groups = Groups.groupByConnectedArea(proj.image_list, matches)
# groups = Groups.groupByImageConnections(proj)

groups.sort(key=len, reverse=True)
Groups.save(area_dir, groups)

print('Total images:', len(proj.image_list))
print('Group sizes:', end=" ")
for g in groups:
    print(len(g), end=" ")
print()

# debug
print("Counting allocated features...")
count = 0
for i, match in enumerate(matches):
    if match[1] >= 0:
        count += 1

print("Writing:", source, "...")