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.
|