mark_count = 0 for line in error_list: # print "line:", line 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:]):
matches.pop(i) elif len(match) < 3: print("deleting match that is now in less than 2 images:", match) matches.pop(i) by_feature, by_pair = compute_shakers(matches_sba) for line in by_pair: print(line[0], line[1], 'avg:', line[2], 'std:', line[3], 'min:', line[4]) #mode = 'by_feature' mode = 'by_pair' if args.interactive: mark_list = cull.show_outliers(by_feature, matches_sba, proj.image_list) elif mode == 'by_feature': # trim outliers by some number of standard deviations high # (for movers) mark_sum = mark_outliers(error_list, args.stddev) # construct a 'mark list' from the most colocated image pairs (note, # 3+ way matches are less likely to show up on this bad list.) 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