comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Get min and max values from a multiband image according to pixel locations of classification image
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Get min and max values from a multiband image according to pixel locations of classification image [message #82055] Sat, 17 November 2012 07:53 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> class1Pixels = Where(classifiedImage EQ class1, count)
> IF count GT 0 THEN BEGIN
> class1Min = minImage[class1Pixels]
> class1Max = maxImage[class1Pixels]
> ENDIF

If your images are large, it is often MUCH faster
to use the Histogram command to locate classified
pixels. Assume, for example, that in your classified
image, the three classes are labeled with 1, 2, and 3.
Then:

h = Histogram(classifiedImage, BinSize=1B, Reverse_Indices=ri)
class1Pixels = Reverse_Indices(ri, 1, COUNT=cnt1)
class2Pixels = Reverse_Indices(ri, 2, COUNT=cnt2)

Etc.

You can find Reverse_Indices here:

http://www.idlcoyote.com/programs/reverse_indices.pro

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Previous Topic: Get min and max values from a multiband image according to pixel locations of classification image
Next Topic: Rare View of Aurora Australis

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 16:44:23 PDT 2025

Total time taken to generate the page: 1.19673 seconds