Hi, I am working on a script that automatically classifies an image. The final stage of the classification is a majority analysis, but somehow this does not work. The script only performs a partial majority analysis on one of the classes. I use the example script as provided in the ENVI help. Part of this code is shown below:
envi_file_query, fid, dims=dims, ns=ns, nl=nl, nb=nb, num_classes=num_classes
pos = [0]
out_name = 'testimg'
method = 0
kernel_size = [5,5]
class_ptr = lonarr(num_classes) + 1
; Call doit
envi_doit, 'class_majority_doit', fid=fid, pos=pos, dims=dims, method=method, $
kernel_size=kernel_size, out_name=out_name, class_ptr=class_ptr
Manually performing a majority analysis on the same classification file from the ENVI menu bar works fine. I tested it both for ENVI 4.3. and ENVI 4.4. Does anybody have any idea what the problem can be? I tried all combinations for the class_ptr, as this seems the most logical error source, but the results remain the same. I am sure the input file is an ENVI-Classification file.
Thanks for your help!
|