X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 02 Jun 2009 09:37 PM by  anon
ROI Summary by Polygon
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
02 Jun 2009 09:37 PM
    This is the first step in a two-step process that I want to complete. In this step, I want to be able to summarize the ROI data not by pixel, but by polygon. I have many ROIs for a collection of images. All of the entities in each ROI are polygons, exclusively. I know that ENVI still "knows" about the polygons, because the ENVI ROI tool still shows how many polygons in each of my ROI regions. If you are familiar with ASCII file output of ROI data, you have each row representing a pixel, with the following information on each pixel: Pixel ID, Pixel X, Pixel Y, Map X, Map Y, Lat, Lon, Band Info. This is a huge table, especially if the ROI contains 157,000+ points. I would like to be able to reduce this pixel table to a polygon table, containing summary information for each polygon, ie: Polygon ID, #pixels, area, Mean Pixel X, Mean Pixel Y, Mean Map X, Mean Map Y, Mean Lat, Mean Lon, Mean Band, Std Band. So, instead of a 157,000-line table, I get an 80-line table, for instance. I've seen all kinds of examples in the User Community files where one wants to take EVF or Shapefile data into ROIs. I want to do EXACTLY the opposite - take ROIs to Shapefiles. Anybody ever done this before? Got any ideas? I'm looking at an algorithm to "find" the polygons in the pixel data, but that's a real chore. I'm hoping for a better idea.

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    03 Jun 2009 01:13 PM
    It seems to me you would need to write a routine that would read the records from your EVF and extract the coordinates from each record (polygon in your case).  Then to get the mean of the pixels inside the polygon, you might convert back to ROI and get statistics using the ROI as your subset.  I am not sure what it means to have a 'mean latitude' or 'mean longitude' or how this might be used but once you have your data out of your EVF, you can do pretty much what you want with it.  Example code on how to read the records from an EVF file can be found in the ENVI Help under ENVI_EVF_CLOSE.
    You are not authorized to post a reply.