forked from scikit-image/scikit-image
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added tv_denoise.py viewer example using the CheckBox
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from skimage import data | ||
from skimage.restoration import denoise_tv_chambolle | ||
from numpy import random, clip, uint8 | ||
|
||
from skimage.viewer import ImageViewer | ||
from skimage.viewer.widgets import Slider, CheckBox, OKCancelButtons, SaveButtons | ||
from skimage.viewer.plugins.base import Plugin | ||
|
||
|
||
image = data.chelsea() | ||
sigma = 30 | ||
|
||
image = image + random.normal(loc=0, scale=sigma, size=image.shape) | ||
image = clip(image,0,255).astype(uint8) | ||
viewer = ImageViewer(image) | ||
|
||
plugin = Plugin(image_filter=denoise_tv_chambolle) | ||
plugin += Slider('weight', 0, 5, value=0.3, value_type='float') | ||
plugin += Slider('n_iter_max', 1, 1000, value=100, value_type='int') | ||
plugin += CheckBox('multichannel',value=True) | ||
plugin += SaveButtons() | ||
plugin += OKCancelButtons() | ||
|
||
viewer += plugin | ||
viewer.show() |