I am working with Tandem-x image . I applied GLCM and then PCA on original image and my image (pc0) is like this;
But I do not know why NaN area around of my original image, now it is replaced by ‘2338973’ (as you can see in below image) and when I am using this PCA image (pc0) in SNAP for doing classification then it gives a class to around of image (I mean 2338973, look at below image).
I think (I am not quite sure) it will be solvable by replacing ‘NaN ’ value instead of 2338973 value in PCA result (pc0) but I do not know how should I do in bandmath?
Anyway as whole 2338971 values are ‘0’ value now so, classification should work well but I do not know why again it is mixed by this time by another class!!!
If I understand your problem correctly, it has to do with NaN values that assigned a class when you do the classification.
In order to avoid this, you can create training data for your NaN values (draw one polygon in black area) and give it a name (lets say NaN) and perform the classification as normal. When the classification is complete, you will see that you have a class called NaN.
Then, go to this class name (NaN) and make it transparent. This class will disappear and you will have only your classified image.
Once you have your classification results, go to table on the bottom right window (where you have all of your classes with different colors), click on the NaN class and press none. This will make the NaN class transparent.
Thank you. yes they are transparetned but still they are labaled as class 2. Is it possible to completely remove them here in SNAP or not? Any way in bandmath?
One more question;
I do not know why I have some NaN values after classification in my classified image like salt and paper noise ! Any idea for removing them?