Closed Pruthvi3796 closed 7 years ago
I don't know what you mean by "unclassified region". You appear to be classifying every pixel so there is no unclassified region.
If you want to set the class of pixels above some threshold to zero, you could do that like this:
clmap = clmap + 1
threshold = 0.1
clmap[np.min(cla, -1) > threshold] = 0
When i am classifying same image in ENVI it gives the following result. This result is also verified with grount truth point data.In this black region is unclassified region.where as in python result(show in first image) does not show unclassified region.Cyan color is classified as class:6 cotton.So what is the problem.
I still do not know what you mean by "unclassified region". Are those pixels you don't want classified or pixels whose minimum spectral angle is above some threshold?
Thanks tboggs for Reply.Now it is coming correct.Now the Question is the how to set the projection to the classified image same as the unclassfied image in save_classification?
See the documentation for save_classification
. It accepts an optional "metadata" keyword (whose value is a dict
), which can include metadata from the original image (i.e., from the metadata
attribute of the source image). So you could do
spy.envi.save_classification('results.hdr', classes, metadata=src_image.metadata)
or create a new dict with only a subset of key-value pairs from src_image.metadata
.
but it does not show unclassified region.It classified all the image(misclassification). Produce the following result.Also I don't know how to set threshold?