HSImage
Hyperspectral Image Interface Library for ENVI-BIL image files
|
This class provides an interface for labeled and classified ENVI-BIL hyperspectral images. More...
Public Member Functions | |
def | __init__ |
Constructor Default constructor to create empty classified_hsimage instance. | |
def | __init__ |
Constructor. More... | |
def | __init__ |
Constructor (Recommended) More... | |
def | getClassSpectra |
def | getClassTF |
getClassTF More... | |
def | getAvgClassTF |
getAvgClassTF More... | |
def | getPixelClass |
getPixelClass More... | |
def | setSpectraClass |
setSpectraClass More... | |
def | setSpectraClass |
setSpectraClass More... | |
def | setImageClass |
setImageClass More... | |
def | getImageClass |
setImageClass More... | |
Static Public Attributes | |
tuple | hsimage = hsimage() |
getClassSpectra More... | |
This class provides an interface for labeled and classified ENVI-BIL hyperspectral images.
It requires either a loaded hsimage instance, an OpenCV image and a list of ("name", [color]) tuples or a full set of hyperspectral image files: header (.hdr), image (.raw) and a label (.lif) file. Using the method with the .lif files is recommended. This method assumes that the spectrometer files have been previously loaded with the hsimage instance and have been saved to the (.hdr) file. This happens automatically if the spectrometer files are loaded with the hsimage instance.
def HSI.classified_hsimage.__init__ | ( | img, | |
label_img, | |||
label_colors | |||
) |
Constructor.
Constructor for loading with hsimage instance, OpenCV Label image and vector of class name and color tuples
img | hsimage instance |
label_img | numpy array compatible with OpenCV containing 3-channel colors for the different classes present in the image |
label_colors | list of ("name",[blue,green,red]) tuples associating the class names to the appropriate color in the label_img |
def HSI.classified_hsimage.__init__ | ( | image_file, | |
header_file, | |||
label_file | |||
) |
Constructor (Recommended)
Constructor for loading from file system using the image (.raw), header (.hdr) and label (.lif) files. This method assumes that at some previous time the spectrometer files have been loaded in the image and stored in the image .hdr file. If you are unsure that this has happened, load the underlying hsimage into memory and specify the spectrometer file locations. You can can also check to see if the end of the header file has the spectrometer file locations stored at the end of the file.
image_file | Image (.raw) file |
header_file | Header (.hdr) file |
label_file | Label (.lif) file |
def HSI.classified_hsimage.getAvgClassTF | ( | class_name | ) |
def HSI.classified_hsimage.getClassTF | ( | class_name, | |
num_spectra | |||
) |
getClassTF
Gets the reflectance (transfer function) spectra from a specific class by name
class_name | Name of class to retrieve |
num_spectra | Number of spectra to return. -1 to return all class reflectance spectra |
def HSI.classified_hsimage.getImageClass | ( | ) |
def HSI.classified_hsimage.getPixelClass | ( | row, | |
col | |||
) |
def HSI.classified_hsimage.setImageClass | ( | class_labels, | |
class_list | |||
) |
setImageClass
Sets the class(es) of the whole image to a new set based on the class_labels input which is an image colored with the class information
class_labels | OpenCV compatible numpy array where each point is colored with the corresponding class color |
class_list | List of tuples of class name and corresponding color |
def HSI.classified_hsimage.setSpectraClass | ( | row, | |
col, | |||
class_name | |||
) |
def HSI.classified_hsimage.setSpectraClass | ( | pixel_locs, | |
class_name | |||
) |
|
static |
getClassSpectra
Gets a number of wavelength spectra from a specific class by name
class_name | Name of class to retrieve |
num_spectra | Number of spectra to return. -1 to return all class spectra |
Underlying hsimage object that contains the image data that classified_hsimage is built around. Accessible and enables the entire API of hsimage.