mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-31 12:41:20 +08:00
Log warning when bitdepth > 10
This commit is contained in:
@@ -27,6 +27,9 @@ References
|
||||
|
||||
import numpy as np
|
||||
from skimage import img_as_ubyte
|
||||
from ... import get_log
|
||||
log = get_log()
|
||||
|
||||
from . import bilateral16_cy
|
||||
from .generic import find_bitdepth
|
||||
|
||||
@@ -60,6 +63,9 @@ def _apply(func8, func16, image, selem, out, mask, shift_x, shift_y, s0, s1):
|
||||
if out is None:
|
||||
out = np.zeros(image.shape, dtype=np.uint16)
|
||||
bitdepth = find_bitdepth(image)
|
||||
if bitdepth > 10:
|
||||
log.warn("Bitdepth of %d may result in bad rank filter "
|
||||
"performance." % bitdepth)
|
||||
func16(image, selem, shift_x=shift_x, shift_y=shift_y, mask=mask,
|
||||
bitdepth=bitdepth + 1, out=out, s0=s0, s1=s1)
|
||||
else:
|
||||
|
||||
@@ -17,6 +17,9 @@ References
|
||||
|
||||
import numpy as np
|
||||
from skimage import img_as_ubyte, img_as_uint
|
||||
from ... import get_log
|
||||
log = get_log()
|
||||
|
||||
from . import generic8_cy, generic16_cy
|
||||
|
||||
|
||||
@@ -60,6 +63,9 @@ def _apply(func8, func16, image, selem, out, mask, shift_x, shift_y):
|
||||
if out is None:
|
||||
out = np.zeros(image.shape, dtype=np.uint16)
|
||||
bitdepth = find_bitdepth(image)
|
||||
if bitdepth > 10:
|
||||
log.warn("Bitdepth of %d may result in bad rank filter "
|
||||
"performance." % bitdepth)
|
||||
func16(image, selem, shift_x=shift_x, shift_y=shift_y, mask=mask,
|
||||
bitdepth=bitdepth + 1, out=out)
|
||||
|
||||
|
||||
@@ -23,6 +23,9 @@ References
|
||||
|
||||
import numpy as np
|
||||
from skimage import img_as_ubyte
|
||||
from ... import get_log
|
||||
log = get_log()
|
||||
|
||||
from . import percentile8_cy, percentile16_cy
|
||||
from .generic import find_bitdepth
|
||||
|
||||
@@ -59,6 +62,9 @@ def _apply(func8, func16, image, selem, out, mask, shift_x, shift_y, p0, p1):
|
||||
if out is None:
|
||||
out = np.zeros(image.shape, dtype=np.uint16)
|
||||
bitdepth = find_bitdepth(image)
|
||||
if bitdepth > 10:
|
||||
log.warn("Bitdepth of %d may result in bad rank filter "
|
||||
"performance." % bitdepth)
|
||||
func16(image, selem, shift_x=shift_x, shift_y=shift_y, mask=mask,
|
||||
bitdepth=bitdepth + 1, out=out, p0=p0, p1=p1)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user