Re: Extract values from an AOI

171 views
Skip to first unread message

ERDAS Communities - Automated Email

unread,
Mar 10, 2010, 11:40:46 AM3/10/10
to erdas-communitie...@googlegroups.com

Re: Extract values from an AOI
By rthurau in ERDAS Software Forum

Donn,

Wondering if you or anyone might know whether it's possible to set this task up in modeler.

Here's what I have: I have a five layer image and I have AOIs from 9 different land cover classes.

Here's what I want: I'd like to generate a model that extracts the image from each AOI file and gives me pixel value statistics (mean, min, max, SD).

So, I'd have 9 sets of stats for each band. I'd love to have this in modeler (SML) so in the future I can just plug in my image, plug in my AOIs and generate these stats.

Thanks for any help you can provide.

Rich

 

----------------------------------
You were sent this email because you opted to receive email notifications when someone responded to this thread.

To unsubscribe:

  1. To unsubscribe from this item only, visit the item link and turn off notifications.
  2. To stop all notifications of any updated items from ERDAS Communities, go to Edit Profile, click on the Site Options tab, then under Email Configuration, set Send Notifications to "No".

ERDAS Communities - Automated Email

unread,
Mar 10, 2010, 3:16:35 PM3/10/10
to erdas-communitie...@googlegroups.com

By Donn Rodekohr in ERDAS Software Forum

Rich,

Perhaps I'm being extra slow today, but as I read your design specs I asked myself the question -- "Doesn't the signature editor already do this?"  

Answer -- yes.

Open the signature editor, plug in your image, plug in your AOIs, click the Sigma icon to generate stats and you have 9 sets of stats for each band.

The process you describe would be quite convoluted within Modeler.  Consolidating the information to the tables you described would also be convoluted at best, nigh on to impossible on a normal day.  Besides, a model can only handle one AOI.  If your AOI's are all separate files they would have to be consolidated to one file, which is probably a good idea anyway.

Definitely easier to use the Signature Editor.  

If Sig Ed. doesn't do the trick, Zonal Attributes under Vector analysis will.  All you have to do is convert the consolidated AOI file to a shapefile and run Zonal Attributes.  Select mean, min, max, and SD and each of those statistics will be added to the attributes of each polygon.  This may be easier than using the Sig Ed.  

At any rate, either tool is way more efficient than trying to create a model.

ERDAS Communities - Automated Email

unread,
Mar 10, 2010, 3:56:46 PM3/10/10
to erdas-communitie...@googlegroups.com

By rthurau in ERDAS Software Forum

I really appreciate your input.

I've found each of these tools and have been working with them manually. I can get my answers, sort of, but I wish there was something that could be used to combine these functions (sig. ed. stats and the zonal stats to vector).

I have an AOI layer for each land cover class to derive. I want to use a decision tree method for classification.

Using either tool has it's drawbacks. The zonal stats to vector is nice in that it preserves the information about each individual AOI within each AOI layer. So, I can look at the pixel values within each AOI polygon and I can link that specific information back to the original location. This is important, because my image is a mosaic of aerial photos, some of which were not so good. This allows me to throw out values if they come from a particularly crappy part of the image. And, I can add additional attribute information from other vector layers.

The problem with the zonal stats to vector tool is I have to run each band seperately. That means running 45 operations (one for each band for each AOI layer). Running the tool that many times: not practical. Setting up the batch to run that many times, not desirable. Getting zonal stats to vector to run in a script where I could just copy and paste and rename band numbers?- That would make it very doable.

Signature editor stats are quick and useful. The main problem is that I don't have data by AOI polygon. And, there does not appear to be any way to export the sig. ed. stats table (close is the only option). And, I have to: 1. Add AOI, 2. Select all AOIs, 3. Collect Sigs. in editor. 4. Generate summary stats, 5. Manually record stats, 6. remove aoi layer, 7. add new layer...repeat. This seems like a ridiculously time consuming task to just find summary statistics.

Another technique I've considered, is to subset the image by each AOI (I also have them as shapefiles now) to create a new raster then generate a table from Global Stats. I have a couple problems with this method too: One is, the SML book lists "Mosaicing and Subset" as tools you can run in SML, but that is the only place the word "subset" appears in the document (?!). Secondly, Global Stats only reports one statistic at a time. So, I'd have to run Global Min, G. Max, G. Mean, and G. SD and then figure out how to get them in the same table and arrange by layer.

Maybe I'm doing this all wrong or something. The AOIs are my signatures for each land cover class, so it doesn't make sense to me to combine them all to one layer.

I really, really, appreciate your thoughts. Like I said, I'm already using your suggested methods to manually generate the info I can use, but I've been usnsuccessful in getting the info I really need to do the job right. An SML code would be awesome, because in the future, I could just plug in AOI (or vector) layers representing my training samples, and the input image, and out would pop my general statistics.

Thank you, thank you.

Rich

ERDAS Communities - Automated Email

unread,
Mar 10, 2010, 4:56:57 PM3/10/10
to erdas-communitie...@googlegroups.com

By Donn Rodekohr in ERDAS Software Forum

Welcome to the real world!

The reason that they are paying you the really big bucks is to do the scut work that they don't want to do, which includes sorting through mountains of data to boil it all down to a couple of stats.  It is what geospatial analysts do best, and most of the time.

Regarding keeping your 9 land uses in separate AOI's, I would not be afraid of clustering them, especially if clustering them to a shapefile.  Add a landuse as an attribute to each polygon then do the Zonal Summary function 5 times for each band.  You can easily separate out the land uses in the .dbf file.  I know that it is not advisable but I will sometimes (often times) use Excel to open the .dbf file and IMMEDIATELY Save As.. an excel table.   Then I can sort and separate and analyze at will.  Plus with a spreadsheet you can make these wizbang graphs and summary reports to make your employer think that you have been doing more than you have.  Do the work, rewards will follow.

Back when I was working on an interface development contract the client gave us a 60 page spec sheet of what functions were supposed to happen automatically with the click of one button.  We called it the DMJ button -- Do My Job.  They were asking the impossible but we gave them a work flow process that accomplished the task with minimal human intervention.  It became a series of DTF (Do This First), followed by some NDT (Now Do This) buttons that did streamline their operation.  There was always some point where some smart human had to look at the data and decide which NDT button to press next.

I think that is where you are.

ERDAS Communities - Automated Email

unread,
Mar 10, 2010, 6:52:17 PM3/10/10
to erdas-communitie...@googlegroups.com

By rthurau in ERDAS Software Forum

Donn,

Unfortunately, I'm working for myself and want to spend the least amount of real work time as possible. My 'data sorting' came in the preprocessing and in carefully building the training signatures with AOIs. I was hoping that hard work would pay off. Hopefully it will.

The DMJ process sounds exactly like a geoprocessing script. The fundamental processing of Imagine 2010 must be based on scripting. Where is the link between the gui and guts? My guess is that it's present, but is somehow left out of the documentation. Or maybe what I want must be purchased through an additional module?

I was just about 30 minutes ahead of you in figuring out the cluster-vector-zonal stats by band method. The only problem is having to export the data before running each band, since the values are overwritten with each process. Another task, easily accomplished, sequentially in a script.

As it goes now, I'm just processing manually. If I need to re-mosaic, then I'll have to manually process again.

Or maybe there's another software package out there that does it?

You are right though, I am just an analyst. Your replys have given me some confidence in learning the new interface.

Thanks a lot for your time.

Rich

 

ERDAS Communities - Automated Email

unread,
Mar 10, 2010, 8:07:30 PM3/10/10
to erdas-communitie...@googlegroups.com

By Mark in ERDAS Software Forum

Can you believe that we are still having users ask how to do simple things like calculate stats for an AOI -- after all these years?  And even experienced users cannot get precise integer pixel values out of a 32u raster using pixeltotable (see other thread).  So many bells and whistles... but so many basic things that are not obvious or user-friendly (really, it's a bit of a bother to subset to calculate AOI stats; and using the signature editor for such a simple task seems like overkill,. It should be quick and easy: define AOI; click button; and bingo! here are your stats.).  Maybe these things are fixed in 2010; I don't know.  Is 2010 more like a MS Office GUI upgrade (form) or is it more like an engine tune-up (function)? I'm hoping it's both.

ERDAS Communities - Automated Email

unread,
Mar 10, 2010, 8:17:38 PM3/10/10
to erdas-communitie...@googlegroups.com

By Jarlath O'Neil-Dunne in ERDAS Software Forum

Hi Mark,

IMAGINE 2010 focuses has major performance improvements though parallel processing (just computed stats and built pyramids for 2000+ images in less than an hour using all 16 cores on my workstation) and the GUI (no more annoying windows littering the screen).  The viewer is A LOT faster when panning and roaming, blowing ArcGIS out of the water, but it also crashes more.  For the most part the other functionality remains the same from what I have seen.  I don't think the issues you raised are addressed, but I still highly recommend the upgrade, especially if you have a computer that was purchased in the last 3 years.  It's nice to finally harness multicore processing power.  Hope this helps.

ERDAS Communities - Automated Email

unread,
Mar 10, 2010, 8:47:50 PM3/10/10
to erdas-communitie...@googlegroups.com

By Mark in ERDAS Software Forum

Thanks Jarlath, Wow, 2010 sounds fantastically fast -- the Viewer was already pretty spectacular imho -- I'll upgrade when I get the chance. From what you wrote it seems as if Imagine is becoming more and more adapted to processing high resolution imagery. This is great for those financially muscular entities that can afford 2000+ QuickBird images. What about the rest of us?  I'm still frequently frustrated by little things that ought to be easy -- like extracting pixel values and statistics for defined points/polygons -- and yet are not.  p.s. my windows do not litter my screen! 

ERDAS Communities - Automated Email

unread,
Mar 10, 2010, 9:32:59 PM3/10/10
to erdas-communitie...@googlegroups.com

By Jarlath O'Neil-Dunne in ERDAS Software Forum

Well, I always say that person who wrote the book "Don't Sweat the Small Stuff" was an idiot.   I am rather amazed that some of the straightforward operations that you point out are easier to do in ArcGIS.  ArcGIS is not particularly well suited to raster analysis, especially multiband rasters, when compared to IMAGINE, but they do make certain operations easier for beginners (and even experts sometimes).  I've been using object-based image analysis (OBIA) routines to do the stuff you mentioned.  Image objects are much better suited for many of these raster/vector operations.  In one case I needed to summarize billions of pixels of data into 1/2 million polygons.  Took forever in ERDAS IMAGINE, ArcGIS crashed after 36 hours, and the OBIA routine had it done in 8 minutes.

Back to IMAGINE 2010...  From a data prep standpoint the gains to be had from parallel processing reproject and compression commands are really great.  MosaicPro also got a big performance boost.  I'm very happy for that.  The folks at ERDAS really thought this one through and I think the parallel processing functionality will put some heat on the other vendors that have not moved in that direction.  On one of the webinars Paul Beaty mentioned some advancements in 64-bit support down the road.  This would also be welcome given the advances in OS and drop in price of memory.  I also wonder if some processing can be moved over to the GPU?  Of course this all sounds good, but I don't have to write the code.  I hear 64-bit migration can be quite a hassle.

And no trust fund here.  The 2049 images were freely available orthophotos. Life in VT is good, not quite 2049 Quickbird images good.

ERDAS Communities - Automated Email

unread,
Mar 10, 2010, 9:53:07 PM3/10/10
to erdas-communitie...@googlegroups.com

By Mark in ERDAS Software Forum

Thanks, I hear that!  I really ought to get ArcGIS on my MBP but had hoped to do it all with one package. Which OBIA package are you using (eCognition?).

ERDAS Communities - Automated Email

unread,
Mar 11, 2010, 9:41:20 AM3/11/10
to erdas-communitie...@googlegroups.com

By rthurau in ERDAS Software Forum

Yes, please share the info on the OBIA package.

I'll also chime in on the Imagine 2010 vs. ArcGIS 9.3. Imagine's image redraw speeds make a person wonder what the hell ArcGIS is doing half the time. The 2010 interface seems pretty sleek, but it seems a lot of the little things are hard to find. That is a given with a new interface, what seems negligent to me is the number of times common tools and functions get zero hits in the help searches.

But, visual tools are only 50% of the function of both Imagine and ArcGIS. The power is in the processing and data management. Here's where ArcGIS blows Imagine away. Where's the SML support for table manipulation? Jarlath's point about ArcGIS's inadequacy in dealling with multi-band imagery is the main reason I'm in this community. SML seems like it's a cleaner and clearer script than Python or VBA, but the functionality, or at least the documentation seems to be short.

Do either of you work much with SML? Is this a language still in development? Or, should I give up now, use Imagine to unstack my layers, and run everything in Modelbuilder?

Thanks for your insight.

Rich

ERDAS Communities - Automated Email

unread,
Mar 12, 2010, 8:38:15 AM3/12/10
to erdas-communitie...@googlegroups.com

By Jarlath O'Neil-Dunne in ERDAS Software Forum

Hi Rich,

First, with respect to SML I agree that it has fallen behind a bit, especially compared to Model Builder.   While Model Builder has its share of issues it supports a wider range of geoprocessing functions and has much better support for vector datasets.  ERDAS has been talking SML up lately, especially in terms of publishing spatial models to Apollo, so hopefully this will bring some new life into it.  SML still has more advanced raster processing capabilities, plus it's faster.  I think ESRI was wise to select Python as it leverages a much larger developer community.  SML and the old AML are both very clean, but one does find they have their limits.

Overall, I am excited that ESRI and ERDAS parted ways as I believe it will bring some much needed competition to the geoprocessing arena, particularly as we seek to find ways to expose our geoprocessing workflows to end users via the web and leverage enterprise computing architecture.

For the OBIA methods I have been using eCognition to do a lot of zonal processes that Mark mentioned as it is exponentially faster.  Not a cheap software package, but they offered parallel processing many years ago.  I believe image objects are really the future.  One can do things with image objects to resolve "sliver" issues that make clump, sieve, and aggregate routines look downright archaic.  You might be able to do the same things in IMAGINE Objective, but I don't think it supports parallel processing.  SPRING and Orfeo Toolbox are open source options worth having a look at.  Interestingly both support 64-bit architecture, something no commercial OBIA package does.

Reply all
Reply to author
Forward
0 new messages