spectralpython / spectral

Python module for hyperspectral image processing
MIT License
571 stars 139 forks source link

Error while performing supervised classification #81

Closed BlcaKHat closed 6 years ago

BlcaKHat commented 6 years ago

I am performing supervised classification . In Gaussian Maximum Likelihood Classification , I am getting error in this step " clmap = gmlc.classify_image(img)" classifiction

tboggs commented 6 years ago

How many bands are in your image? It appears that you are undersampled, which is causing a singular covariance matrix. You need at least as many samples per class as there are bands in your image data.

BlcaKHat commented 6 years ago

I have 150 bands in my image. how can i fix it ?

tboggs commented 6 years ago

To perform GMLC you must have as many samples per class as you have bands in the data; otherwise, the covariance matrix is singular. To get around that you need to increase the number of samples per class or reduce the dimensionality of the data (select fewer bands, select Principal Components, covariance regularization, etc.)

BlcaKHat commented 6 years ago

I reduced the spectral subset to 13 bands and I also reduced the spatial subset., still i am getting the same error. Is there a way to perform SAM classification with the help of saved roi or spectral library.

BlcaKHat commented 6 years ago

https://drive.google.com/open?id=1H28nGBOq-ywoh8x5DGqwSLZZxCIYDmC1 this is the sample data .It would be great if you give a hit.

tboggs commented 6 years ago

I don't know what you would expect me to do with those files. There is no ground truth mask to define training data labels.

The use of SAM and MSAM is described on the web site.