semiautomaticgit / SemiAutomaticClassificationPlugin

https://fromgistors.blogspot.com/p/semi-automatic-classification-plugin.html
Other
137 stars 50 forks source link

Spectral distance algorithm #30

Closed merkato closed 6 years ago

merkato commented 6 years ago

Hi Luca,

I've crashed it again. This time on trying Spectral distance for two bandsets. Standard settings. Same datasets as earlier. Maybe that's some outdated library?

Python error tab:

2018-02-03T05:32:54 WARNING Traceback (most recent call last):
              File "/home/mechanik/.local/share/QGIS/QGIS3/profiles/default/python/plugins/SemiAutomaticClassificationPlugin/maininterface/spectraldistancebandsets.py", line 46, in calculateDistanceAction
                self.spectralDistBandSets()
              File "/home/mechanik/.local/share/QGIS/QGIS3/profiles/default/python/plugins/SemiAutomaticClassificationPlugin/maininterface/spectraldistancebandsets.py", line 221, in spectralDistBandSets
                check = cfg.utls.processRaster(rD, bL, None, "No", cfg.utls.spectralDistanceProcess, None, oMR, None, None, 0, None, nD, "No", NoDataVal, [alg, thresh], "Spectral distance ", "Yes")
              File "/home/mechanik/.local/share/QGIS/QGIS3/profiles/default/python/plugins/SemiAutomaticClassificationPlugin/core/utils.py", line 3949, in processRaster
                o = functionRaster(gdalBandList, c, bSX, bSY, x, y, outputRasterList, functionBandArgument, functionVariable)
              File "/home/mechanik/.local/share/QGIS/QGIS3/profiles/default/python/plugins/SemiAutomaticClassificationPlugin/core/utils.py", line 4552, in spectralDistanceProcess
                firstArray = rasterArray[::, ::, :rasterArray.shape[2]/2]
            TypeError: slice indices must be integers or None or have an __index__ method

spectral_angle_mapping_scp.log

semiautomaticgit commented 6 years ago

Thank you. It is possible that it is related to the input data. Could you please share your dataset?

merkato commented 6 years ago

It's Sentinel-2 processed with SCP, and cropped with QGIS Processing.

https://drive.google.com/file/d/1xu70SDz-GxEnFGbNLGoVopwnqS4FMIO8/view?usp=sharing

semiautomaticgit commented 6 years ago

Thank you. Unfortunately I couldn't reproduce the issue. Could you please send also the training input with the ROIs causing this issue?

merkato commented 6 years ago

Two Sentinel-2A scenes: https://drive.google.com/open?id=1VC4oyIUSGP03TFEZsgGwReqfFWPF7uc7 Signatures file: https://drive.google.com/open?id=1o11b1yA9L97Hh2aBWpVzLh1cAUkGMpUt

I probably misunderstand Spectral Distance of band sets algorithm on this tab:

semi-automatic classification plugin_070

I need to load two datasets, create ROIs for one of them, and next calculate spectral distance with this tool? Or like I was thinking earlier, only load and set two band sets in Band set tab?

semiautomaticgit commented 6 years ago

Thank you. I have updated the user manual. You can find the description of this tool in http://semiautomaticclassificationmanual.readthedocs.io/en/latest/main_interface_window.html#spectral-distance