X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 15 Mar 2017 04:52 AM by  anon
majority/mode from bands
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
15 Mar 2017 04:52 AM
    Is there any tool, or band math function, that can compute the majority or mode from bands of the image? I mean that I want to know for each pixel, the value that is most frequent through all the bands of the image. For example: Image with 3 bands, for pixel(i,j) values are: b1=2, b2=3, b3=3 the result should be: majority=3 Actually I need this to combine different classification results and for each pixel select the most frequent class.

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    15 Mar 2017 08:30 AM
    There is no function in ENVI or IDL that calculates the statistical mode of an array but there is an example of how it could be done here: http://www.idlcoyote.com/code_tips/mo...

    Deleted User



    New Member


    Posts:
    New Member


    --
    16 Mar 2017 06:46 AM
    Thanks, I tried to use the function from the link, but as a result I got 0 value in each pixel. As the argument for the function should be an array, I typed in the band math such expression: mode([b1, b2, b3]) I still look for the solution....
    You are not authorized to post a reply.