Hi eCog Community,

I'm interested in quantifying NDVI values within some classified segments of vegetated areas and producing a histogram summarizing the mean NDVI values with the segments across a region. 

Does anyone have suggestions on a workflow to aggregate NDVI pixel values within each segment into a single value (e.g. mean) , assign the statistic to the segment, and produce a histogram of the mean NDVI values for all the segments of a particular class in a region? 

3 comments

  • Matthias Staengel

    Hi Jon,

    You will find the mean value of an object as a pre-defined feature already available if you have created an NDVI layer here:

    Then you can export your statistics using "export object statistics". The object statistics (mean NDVI) can be simply exported as a CSV file. You also can set the domain to only export statistics of certain classified objects or limit it by region (subset). 

    This will create a CSV file looking like this:

    I suggest the following workflow:

    1. Compute the NDVI using the "index layer calculation" algorithm. This will create a raster based NDVI layer in your project.
    2. Create Image objects using any Segmentation algorithm
    3. Use the "export object statistics" algorithm to export the mean NDVI statistics of each object into a csv file

    You then can create a histogram based on the CSV file:

    Please also have a look at this tool in eCognition --> TOOLS --> 2D FEATURE SPACE PLOT. It allows you to plot different features of objects against each other.

    Hope this helps?

    Cheers,

    Matthias

  • Jon Detka

    Fantastic! This is very helpful and I was able to replicate within my project. 
    On a related thread. Is there a way to get the proportion of pixels below a particular threshold? 
    Ex. proportion of pixels in each patch that have NDVI <= 0.  

     

  • Matthias Staengel

    Hi Jon,

    Perfect!

    "Is there a way to get the proportion of pixels below a particular threshold? " --> YES! My approach would be establishing two Image Object Levels eg.:

    • Level 1 (your patch Level)
    • Level 0 (this one has to be below (please use the algorithm "copy image object Level" and choose as Parameter "below"! and give it another name.) and you can for example run a multi-threshold segmentation on this Image Object Level using the NDVI layer as input and setting the threshold to a value you like eg.: 0. You can put everything that falls above this threshold into Class A and everything below into Class B. This all can be defined in the "multi-threshold" segmentation algorithm in one step.

    Then you can simply use the feature "Sub-objects --> rel. area of". This feature will return the relative area of a sub-object class (you can define the distance in "how many levels below").

    This will return the relative area of sub-objects classified as X for each object of the super-level. In the GIF below you see Class A in green representing vegetation on the Sub-Level and a simple chessboard on the Super-Level. In the top-right view and in the Image Object Information Window you see the feature value of "Rel. area of sub-object Class-A".

Recent Discussions

Need more help?

Enter Knowledge Base Contact Support