'transverseMercator',
)
-WAVE_CORRECT_CHOICES = ('horiz', 'no', 'vert',)
+WAVE_CORRECT_CHOICES = OrderedDict()
+WAVE_CORRECT_CHOICES['horiz'] = cv.detail.WAVE_CORRECT_HORIZ
+WAVE_CORRECT_CHOICES['no'] = None
+WAVE_CORRECT_CHOICES['vert'] = cv.detail.WAVE_CORRECT_VERT
BLEND_CHOICES = ('multiband', 'feather', 'no',)
type=str, dest='ba_refine_mask'
)
parser.add_argument(
- '--wave_correct', action='store', default=WAVE_CORRECT_CHOICES[0],
- help="Perform wave effect correction. The default is '%s'" % WAVE_CORRECT_CHOICES[0],
- choices=WAVE_CORRECT_CHOICES,
+ '--wave_correct', action='store', default=list(WAVE_CORRECT_CHOICES.keys())[0],
+ help="Perform wave effect correction. The default is '%s'" % list(WAVE_CORRECT_CHOICES.keys())[0],
+ choices=WAVE_CORRECT_CHOICES.keys(),
type=str, dest='wave_correct'
)
parser.add_argument(
compose_megapix = args.compose_megapix
conf_thresh = args.conf_thresh
ba_refine_mask = args.ba_refine_mask
- wave_correct = args.wave_correct
- if wave_correct == 'no':
- do_wave_correct = False
- else:
- do_wave_correct = True
+ wave_correct = WAVE_CORRECT_CHOICES[args.wave_correct]
if args.save_graph is None:
save_graph = False
else:
with open(args.save_graph, 'w') as fh:
fh.write(cv.detail.matchesGraphAsString(img_names, p, conf_thresh))
- indices = cv.detail.leaveBiggestComponent(features, p, 0.3)
+ indices = cv.detail.leaveBiggestComponent(features, p, conf_thresh)
img_subset = []
img_names_subset = []
full_img_sizes_subset = []
warped_image_scale = focals[len(focals) // 2]
else:
warped_image_scale = (focals[len(focals) // 2] + focals[len(focals) // 2 - 1]) / 2
- if do_wave_correct:
+ if wave_correct is not None:
rmats = []
for cam in cameras:
rmats.append(np.copy(cam.R))
- rmats = cv.detail.waveCorrect(rmats, cv.detail.WAVE_CORRECT_HORIZ)
+ rmats = cv.detail.waveCorrect(rmats, wave_correct)
for idx, cam in enumerate(cameras):
cam.R = rmats[idx]
corners = []