X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 25 Feb 2022 10:48 AM by  Federico Carotenuto
ROI with masked pixels but no existing mask
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

Federico Carotenuto



New Member


Posts:3
New Member


--
30 Sep 2021 10:07 AM
    I would like to understand better the "Mask Count" variables under the ROI Statistics tool.

    I am working with hyperspectral satellite images to which I didn't personally apply any mask. Nevertheless, when I design some ROI and ask ENVI 5.6 (or IDL 8.8 for what matters) to compute the ROI statistics, those are computed only on a subset of the ROI pixels.

    For example I have a ROI with 11 pixels of which only 1 is used to compute the statistics (and, therefore, no standard deviation) and 10 are masked. The ROI Statistics panel, under "ROI Summary" reads "Pixel Count = 1" and "Mask Count = 10".

    This behaviour disappears if I open the images with QGIS, save them back to ENVI format, and open them in ENVI/IDL again. In that case the ROI statistics are computed on the full amount of pixels in the ROI (i.e.: the ROI Summary reads "Pixel Count = 11" and there's no "Mask Count" variable anymore).

    My guess was that some sort of bad pixels mask embedded in the image metadata and, if a given pixels is marked as bad in one of the bands, ENVI masks it. By manipulating the image through QGIS this metadata were purged and the masking disappeared alongside it. Nevertheless, if I use the Spectral Profile tool and move it around on all the pixels of the ROI, the spectrum always seems complete with no clear gaps in the plot.

    Can somebody help me with this and explain such behaviour to me (or at least give me some hints on what to check to diagnose a potential problem)?

    Thank you!

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    01 Oct 2021 09:53 AM
    This can happen if you have the Data ignore value set in the header. The masked pixels are discussed here:
    https://www.l3harrisgeospatial.com/docs/Statistics.html#ROIStats

    Federico Carotenuto



    New Member


    Posts:3
    New Member


    --
    25 Feb 2022 10:48 AM
    So, following your suggestions I finally understood what happened. The pixels in the ROI had some bad bands (i.e.: bands where the reflectance value was equal to the data ignore value) and when calculating statistics ENVI masks out any pixel that has even a single bad band. This resulted in all zeroes in the statistics given that every pixels had at least one band with a bad value.
    Removing the "Data Ignore Value" in the header solved the problem.
    Given that the Data Ignore Value is quite useful in many other situations, having to remove it from the header altogether to obtain basic statistics does seem inconvenient to me. I would rather preferred to still obtain the statistics with the bad bands defaulted to the Data Ignore Value, but maybe there's some hard constraints in ENVI architecture that I do not know about.
    You are not authorized to post a reply.