X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 06 Apr 2017 05:19 AM by  anon
How create a lookup array for the ENVI_DO_IT Net Neural Classification
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:24
New Member


--
06 Apr 2017 05:19 AM
    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

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    11 Apr 2017 12:19 PM
    I have sent up the color lookup table like this before: envi_restore_rois, 'bh.roi' roi_ids = envi_get_roi_ids(fid=fid, $ roi_colors=roi_colors, roi_names=class_names) class_names = ['Unclassified', class_names] num_classes = n_elements(roi_ids) lookup = bytarr(3, num_classes + 1) ; Set the unclassified class to black and use roi colors lookup = bytarr(3,num_classes+1) lookup[0,1] = roi_colors
    You are not authorized to post a reply.