diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-05-15 05:22:16 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-05-15 05:22:16 +0200 |
| commit | 618acea600bc3474daa2995d2def64d8feaa3981 (patch) | |
| tree | b6dad2c4d8b3476f3c858fb23d901c4d3902f7f4 /test-mogrify.py | |
| parent | ab6ecf09b4b0ca0e22a524402ffb596091fee2a1 (diff) | |
testy
Diffstat (limited to 'test-mogrify.py')
| -rw-r--r-- | test-mogrify.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/test-mogrify.py b/test-mogrify.py index 594a773..700f60f 100644 --- a/test-mogrify.py +++ b/test-mogrify.py @@ -144,8 +144,8 @@ if __name__ == '__main__': frac_b = data_opt.sequence_frac frac_c = 1.0 - frac_a - frac_b print("rec: {}, seq: {}, pix: {}".format(frac_a, frac_b, frac_c)) - frac_a = data_opt.recursive_frac else: + frac_a = data_opt.recursive_frac frac_b = 1.0 - frac_a print("rec: {}, pix: {}".format(frac_a, frac_b)) @@ -204,30 +204,32 @@ if __name__ == '__main__': array_c = np.multiply(im.astype('float64'), frac_c) comb_ab = np.add(array_a, array_b) comb_abc = np.add(array_ab, array_c) - im = comb_abc.astype('uint8') + next_im = comb_abc.astype('uint8') + print("rec: {}, seq: {}, pix: {}".format(frac_a, frac_b, frac_c)) else: frac_a = data_opt.recursive_frac frac_b = 1.0 - frac_a array_a = np.multiply(last_im.astype('float64'), frac_a) array_b = np.multiply(im.astype('float64'), frac_b) - im = np.add(array_a, array_b).astype('uint8') + next_im = np.add(array_a, array_b).astype('uint8') - if data_opt.recurse_roll != 0: - last_im = np.roll(tmp_im, data_opt.recurse_roll, axis=data_opt.recurse_roll_axis) - else: - last_im = im.copy().astype('uint8') + # if data_opt.recurse_roll != 0: + # last_im = np.roll(tmp_im, data_opt.recurse_roll, axis=data_opt.recurse_roll_axis) + # else: + last_im = next_im.copy().astype('uint8') else: last_im = im.copy().astype('uint8') tmp_im = im.copy().astype('uint8') + next_im = im #print(im.shape, im.dtype) # image_pil = Image.fromarray(im, mode='RGB') # im = np.asarray(image_pil).astype('uint8') #print(im.shape, im.dtype) - img = process_image(im) + img = process_image(next_im) cv2.imwrite(tmp_path, img) os.rename(tmp_path, edges_path) |
