diff options
author | Alexandre Marie <alexandre.marie@synchrotron-soleil.fr> | 2018-12-17 12:28:24 +0100 |
---|---|---|
committer | Alexandre Marie <alexandre.marie@synchrotron-soleil.fr> | 2018-12-17 12:28:24 +0100 |
commit | cebdc9244c019224846cb8d2668080fe386a6adc (patch) | |
tree | aedec55da0f9dd4fc4d6c7eb0f58489a956e2e8c /silx/image/medianfilter.py | |
parent | 159ef14fb9e198bb0066ea14e6b980f065de63dd (diff) |
New upstream version 0.9.0+dfsg
Diffstat (limited to 'silx/image/medianfilter.py')
-rw-r--r-- | silx/image/medianfilter.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/silx/image/medianfilter.py b/silx/image/medianfilter.py index a986b4d..5d98b48 100644 --- a/silx/image/medianfilter.py +++ b/silx/image/medianfilter.py @@ -1,6 +1,6 @@ # coding: utf-8 # /*########################################################################## -# Copyright (C) 2017 European Synchrotron Radiation Facility +# Copyright (C) 2017-2018 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -31,12 +31,15 @@ __authors__ = ["H. Payno"] __license__ = "MIT" __date__ = "04/05/2017" + +import logging + from silx.math import medianfilter as medianfilter_cpp -try: +from silx.opencl import ocl as _ocl +if _ocl is not None: from silx.opencl import medfilt as medfilt_opencl -except ImportError: +else: # No OpenCL device or pyopencl not installed medfilt_opencl = None -import logging _logger = logging.getLogger(__name__) @@ -84,7 +87,7 @@ def medfilt2d(image, kernel_size=3, engine='cpp'): conditional=False) elif engine == 'opencl': if medfilt_opencl is None: - wrn = 'opencl median filter module import failed' + wrn = 'opencl median filter not available. ' wrn += 'Launching cpp implementation.' _logger.warning(wrn) # instead call the cpp implementation |