Re: Raster to Vector outlines- Classification Image [message #69529] |
Sat, 23 January 2010 11:05 |
Mort Canty
Messages: 134 Registered: March 2003
|
Senior Member |
|
|
Am 23.01.2010 15:50, schrieb Robin Wilson:
> Hi,
>
> I've got a classification image consisting of various polygons, each of
> a different value (integers, from 1 to about 59,000!). I'd like to
> display all of the boundaries of these polygons on the image, either in
> an EVF file or just as an ROI with pixels for each of the boundaries so
> I can overlay it on the image.
>
> I've tried using RTV_DOIT, but that extracts each boundary to a separate
> EVF file. I've written a routine to stitch together all these EVF files,
> but the creation of 1000 of the EVF files using RTV_DOIT takes quite a
> while - and the 59,000 polygons I have is only for a small image!
>
> Does anyone know of any better way to do this? It can be using an ENVI
> procedure or a built-in IDL function, or a simple way to write some IDL
> code to do this.
>
> Best regards,
>
> Robin Wilson
> University of Southampton
You can try this:
boundaries = classimage*0
boundaries[where( (classimage-shift(classimage,1,0) ne 0) $
or (classimage-shift(classimage,0,1) ne 0) )] = 1
Mort
|
|
|
Re: Raster to Vector outlines- Classification Image [message #69530 is a reply to message #69529] |
Sat, 23 January 2010 07:07  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Robin Wilson writes:
> I've got a classification image consisting of various polygons, each of
> a different value (integers, from 1 to about 59,000!). I'd like to
> display all of the boundaries of these polygons on the image, either in
> an EVF file or just as an ROI with pixels for each of the boundaries so
> I can overlay it on the image.
>
> I've tried using RTV_DOIT, but that extracts each boundary to a separate
> EVF file. I've written a routine to stitch together all these EVF files,
> but the creation of 1000 of the EVF files using RTV_DOIT takes quite a
> while - and the 59,000 polygons I have is only for a small image!
>
> Does anyone know of any better way to do this? It can be using an ENVI
> procedure or a built-in IDL function, or a simple way to write some IDL
> code to do this.
I've done some "blob" analysis before and I've discovered
there are fast ways and there are slow ways. The fast ways,
naturally, involve a histogram. You may find some ideas
about how to solve your problem by reading some of these
articles. I'd probably start with this one:
http://www.dfanning.com/ip_tips/blobanalysis.html
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|