Getting ROI data from an image [message #77867] |
Fri, 30 September 2011 10:50 |
Rebecca
Messages: 4 Registered: October 2011
|
Junior Member |
|
|
I need to extract hyperspectral data from an image ROI :
The project I'm working on requires me to code strictly with IDL, so I
cannot use ENVI calls in the final product. I am running unsupervised
classification (K-Means), which returns a classification image with
each pixel assigned a number from [0,..nClasses]. I want to use the
classification image to subset the image based on ROI and get the mean
spectra from each class. The functionality I need is probably the same
as ENVI_GET_ROI_DATA(). My exact question is, how can I use the one-
dimensional calls to capture ROI data from the hypersepctral data?
samples = 320
lines = 1000
bands = 300
classes = 15
result = KMEANS(img, ITERATIONS = 4, NCLASSES = classes)
FOR i = 0, nClasses-1 DO BEGIN
loc = WHERE(result EQ i, count)
IF count EQ 0 THEN CONTINUE
; ?
; ?
ENDFOR
|
|
|