make decorrelation stretch algorithm a renderer
As discussed in #450.
Comments (12)
-
reporter -
reporter - changed status to resolved
resolved by 7993976
-
reporter - removed version
Removing version: 3.10 (automated comment)
-
Firstly, THANK YOU for developing this!
Is this not working with QGIS Master?
Your Example data works via “Visualization → Decorr Stretch” but not through the renderer. I get:
“TypeError: __init__() got an unexpected keyword argument 'clip'
Traceback (most recent call last): File "/home/royden/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapboxprocessing/renderer/decorrelationstretchrenderer.py", line 217, in onApplyClicked self.layer.setRenderer(self.currentRenderer()) File "/home/royden/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/site-packages/typeguard/__init__.py", line 903, in wrapper retval = func(*args, **kwargs) File "/home/royden/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapboxprocessing/renderer/decorrelationstretchrenderer.py", line 197, in currentRenderer scaler2 = MinMaxScaler(feature_range=[0, 255], clip=True) File "/usr/lib/python3/dist-packages/sklearn/utils/validation.py", line 72, in inner_f return f(**kwargs) TypeError: __init__() got an unexpected keyword argument 'clip'
Python version: 3.9.5 (default, May 11 2021, 08:20:37) [GCC 10.3.0]
QGIS version: 3.23.0-Master Master, 8e46f2ca6a
-
reporter Your Scikit-Learn is outdated I would guess. Please check in the console:
import sklearn sklearn.__version__ '0.24.2'
You need 0.24 or higher.
-
reporter If you are not sure how to update a package, read the docs: https://enmap-box.readthedocs.io/en/latest/usr_section/usr_installation.html#install-required-python-packages
-
Your diagnosis was spot on Dr!
Was installed by my Dist packager, so ….
BTW, there is a variant of DCS, called R(unning)DCS which might be useful, perhaps as an algo version if that stays:
http://davinci.asu.edu/index.php?title=rdcs
tnx again
-
reporter Regarding the running DCS: instead of doing it blockwise and blend the blocks together. You can already maximize the local variation by zooming to a location and use the “Current canvas” option:
-
Found that - very useful.
So the Visualisation algo route is the only way to get the decorr stretch into QGIS? “Save as” for the rendered decorr just saves the pre-rendered image.
-
reporter I think you are right. Unfortunately, QGIS doesn’t support custom raster renderer to be registered to QGIS. Because of this we loose the renderer when moving (i.e. cloning) the layer from the EnMAP-Box to QGIS.
-
reporter Or maybe not, just tested to move a raster layer with a standard renderer from EnMAP-Box to QGIS via drag&drop. Here I also loose the current renderer. I’ll create a new issue for that.
-
reporter Here is the follow-up issue:
#861 - Log in to comment
@Agustin Lobo FYI - implemented it as a renderer. I guess we can remove the algo version, right?