else: angle_deg = compute_angle(ned1, ned2, match[0]) * r2d if angle_deg < args.min_angle: mark_list.append([k, i]) if (k + 1) % step == 0: bar.next() bar.finish() # Pairs with very small average angles between each feature and camera # location indicate closely located camera poses and these cause # problems because very small changes in camera pose lead to very # large changes in feature location. # mark selection cull.mark_using_list(mark_list, matches) mark_sum = len(mark_list) def delete_marked_features(matches): print(" deleting marked items...") for i in reversed(range(len(matches))): match = matches[i] has_bad_elem = False for j in reversed(range(1, len(match))): p = match[j] if p == [-1, -1]: has_bad_elem = True match.pop(j) if len(match) < 3: print("deleting match that is now in less than 2 images:", match)
mark_count += 1 return mark_count # load the group connections within the image set groups = Groups.load(args.project) error_list = compute_feature_depths(proj.image_list, groups[0], matches_sba) if args.interactive: # interactively pick outliers mark_list = cull.show_outliers(error_list, matches_sba, proj.image_list) # mark both direct and/or sba match lists as requested cull.mark_using_list(mark_list, matches_direct) cull.mark_using_list(mark_list, matches_sba) mark_sum = len(mark_list) else: # trim outliers by some # of standard deviations high mark_sum = mark_outliers(error_list, args.std) # after marking the bad matches, now count how many remaining features # show up in each image for i in proj.image_list: i.feature_count = 0 for i, match in enumerate(matches_direct): for j, p in enumerate(match[1:]): if p[1] != [-1, -1]: image = proj.image_list[p[0]] image.feature_count += 1
if line[0] > mean + stddev * trim_stddev: cull.mark_feature(matches_orig, line[1], line[2], line[0]) cull.mark_feature(matches_opt, line[1], line[2], line[0]) mark_count += 1 return mark_count error_list = compute_feature_depths(proj.image_list, groups[0], matches_opt) if args.interactive: # interactively pick outliers mark_list = cull.show_outliers(error_list, matches_opt, proj.image_list) # mark both direct and optimized match lists as requested cull.mark_using_list(mark_list, matches_orig) cull.mark_using_list(mark_list, matches_opt) mark_sum = len(mark_list) else: # trim outliers by some # of standard deviations high mark_sum = mark_outliers(error_list, args.stddev) # after marking the bad matches, now count how many remaining features # show up in each image for image in proj.image_list: image.feature_count = 0 for i, match in enumerate(matches_orig): for j, p in enumerate(match[1:]): if p[1] != [-1, -1]: image = proj.image_list[p[0]] image.feature_count += 1
mark_list = [] for line in by_feature: if line[0] < 0.175: # 10 degrees mark_list.append([line[1], line[2]]) elif mode == 'by_pair': mark_list = [] for line in by_pair: # 0.087 = 5 degrees # 0.175 = 10 degrees # 0.262 = 15 degrees if line[2] < 0.087: print(line) mark_list += find_image_pairs(line[0], line[1]) # mark selection cull.mark_using_list(mark_list, matches_grouped) cull.mark_using_list(mark_list, matches_sba) mark_sum = len(mark_list) # after marking the bad matches, now count how many remaining features # show up in each image for i in proj.image_list: i.feature_count = 0 for i, match in enumerate(matches_sba): for j, p in enumerate(match[1:]): if p[1] != [-1, -1]: image = proj.image_list[p[0]] image.feature_count += 1 purge_weak_images = False if purge_weak_images: