Hi all,
i need to perform a Net Neural Classification using EVI:NEURAL_NET_DOIT api function.
My input raster is a 7 bands ENVI file (.dat extension) and my training ROI file has 5 class (vegetation, water, sand, groung, build).
Full code follows:
COMPILE_OPT IDL2
envi ;, /restore_base_save_files
ENVI_BATCH_INIT
output_nn = classfication_output
output_nnrule = rulke_classification_output
; variabili globali
inputsms = myraster
; aggiungere apertura file raster con estrazione FID e DIMS
envi_open_file, inputsms, R_FID=foo, /INVISIBLE, /NO_REALIZE
ENVI_FILE_QUERY, foo, DIMS=dims
; aggiungere apertura file ROI
roiname= my_roifile.roi
envi_restore_rois, roiname
roi_ids = envi_get_roi_ids(FID=foo, roi_colors=lookup, roi_names=class_names)
num_classes = n_elements(roi_ids)
class_names = ['Unclassified', class_names]
lookup = reform([0,0,0,0,0,0,0, reform(lookup, 3*num_classes)],3,num_classes+1)
; execute envi svm classification
ENVI_DOIT, "ENVI_NEURAL_NET_DOIT", FID = foo, POS=[0,1,2,3,4,5,6], DIMS = dims, $
OUT_NAME = output_nn, RULE_OUT_NAME = output_nnrule, $
THETA = 0.9, ETA = 0.2, ALPHA = 0.9, $
NUM_CLASSES = num_classes, NUM_SWEEPS = 10000, $
NUM_LAYERS = 7, ACT_TYPE= 0, $
RMS_CRIT = 0.1, ROI_IDS = roi_ids, /train, $
CLASS_NAMES = class_names, LOOKUP = lookup, THRESH = 0.7
Here the Error message:
% REFORM: New subscripts must not change the number elements in .
I don't undestrand how the lookup vector must be created and i didn't find any example.
Can you help/correct me?
Thank you
|