X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 19 Jun 2008 04:36 PM by  anon
majority analysis
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
19 Jun 2008 04:36 PM
    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!

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    19 Jun 2008 04:36 PM
    I am not sure what you mean by 'the script only performs a partial majority analysis on one of the classes'. Does it fail at some point with an error? Have you tried the sample code on a classification of ENVI's sample dataset, bhtmref.img? I ran a quick isodata on this and then ran the example code using this file and it ran without error and produced reasonable results. It would be interesting to know if you can run the code on this dataset but not on another.
    You are not authorized to post a reply.