Mercurial > repos > imgteam > 2d_local_threshold
comparison auto_local_threshold.py @ 2:d070576c6286 draft
"planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/2d_auto_local_threshold/ commit 3d389fdec0db29cf6fbd783c0501455bf624fa90"
author | imgteam |
---|---|
date | Wed, 18 Dec 2019 09:55:10 +0000 |
parents | f03398bea281 |
children | 0bbcb6a31a20 |
comparison
equal
deleted
inserted
replaced
1:f03398bea281 | 2:d070576c6286 |
---|---|
22 | 22 |
23 img_in = skimage.io.imread(args.input_file.name) | 23 img_in = skimage.io.imread(args.input_file.name) |
24 img_in = np.reshape(img_in, [img_in.shape[0], img_in.shape[1]]) | 24 img_in = np.reshape(img_in, [img_in.shape[0], img_in.shape[1]]) |
25 thresh = threshOptions[args.thresh_type](img_in, args.block_size) | 25 thresh = threshOptions[args.thresh_type](img_in, args.block_size) |
26 | 26 |
27 if args.dark_background: | 27 if args.dark_background: |
28 res = img_in > thresh | 28 res = img_in > thresh |
29 else: | 29 else: |
30 res = img_in <= thresh | 30 res = img_in <= thresh |
31 | 31 |
32 res = skimage.util.img_as_uint(res) | 32 res = skimage.util.img_as_uint(res) |