Dears,
I am trying to perform an ISODATA classification on a masked Landsat image with ENVITask.
With the following I mask the image:
mask = e.OpenRaster(in_dir + '\' + fn_classification_mask)
data = BYTE(mask.GetData())
data[ind_dist_exclude]=0
mask2 = ENVIRaster(data, URI=out_dir + '\' + fn_base + '_mask_ISO_project_' + STRTRIM(project_ids[p],2), INHERITS_FROM=mask)
mask2.Save
Then I apply the mask to the Landsat image:
SubsetWithMask = ENVIMaskRaster(Subset, mask2)
Finally I run the isodata classification on it
SubsetWithMask = ENVIMaskRaster(Subset, mask2) ;be care here use the appropriate mask to be build with SLC and dist and omit
Task = ENVITask('ISODATAClassification')
Task.Input_Raster = SubsetWithMask
Task.ITERATIONS = 3
Task.NUMBER_OF_CLASSES=5
Task.OUTPUT_RASTER_URI = out_dir + '\' + fn_base + '_ISO_project_' + STRTRIM(project_ids[p],2);+'v2'
Task.Execute
But the mask is ignored and the classification is performed over the whole image.
Help is appreciated!
Thanks in advance,
Michele
|