def test_basic(): x = np.random.random((100, 100)) * 255 y = x / 1.8 a, b = photometric_adjust(y, x) assert_almost_equal(a, 1.8) assert_almost_equal(b, 0)
parser.print_help() sys.exit(0) ic = load_vgg(vgg_dir) # Perform crude photometric registration ref = ic[0].copy() images = [] scale_offset = [] for i in range(len(ic)): scale = 1 offset = 0 if options.photo_adjust: img_warp = homography(ic[i], ic[i].info['H']) scale, offset = photometric_adjust(img_warp, ref) scale_offset.append((scale, offset)) images.append(ic[i] * scale + offset) print "Images adjusted by: %s" % str(['%.2f, %.2f' % (a,b) for (a,b) in scale_offset]) images = [img for i,img in enumerate(images) if not i in options.ignore] HH = [i.info['H'] for i in images] oshape = np.floor(np.array(images[0].shape) * options.scale) avg = initial_guess_avg(images, HH, options.scale, oshape) # # Update solution one frame at a time
parser.print_help() sys.exit(0) ic = load_vgg(vgg_dir) # Perform crude photometric registration ref = ic[0].copy() images = [] scale_offset = [] for i in range(len(ic)): scale = 1 offset = 0 if options.photo_adjust: img_warp = homography(ic[i], ic[i].info['H']) scale, offset = photometric_adjust(img_warp, ref) scale_offset.append((scale, offset)) images.append(ic[i] * scale + offset) print "Images adjusted by: %s" % str( ['%.2f, %.2f' % (a, b) for (a, b) in scale_offset]) images = [img for i, img in enumerate(images) if not i in options.ignore] HH = [i.info['H'] for i in images] oshape = np.floor(np.array(images[0].shape) * options.scale) avg = initial_guess_avg(images, HH, options.scale, oshape) # # Update solution one frame at a time