ms_camera_model package

Submodules

ms_camera_model.data_comparison module

Multispectral Camera Model - Data Comparison

  • Description: Classes and their methods used for comparing real MS data with modeled data

  • Author: Tomas Vacek

  • Year: 2026

  • License: MIT License

ms_camera_model.data_comparison.calculate_michelson_contrast(image_data, band)[source]

Calculate Michelson contrast for a single band

Parameters:
Returns:

Michelson contrast as a float

Return type:

float

ms_camera_model.data_comparison.calculate_ndi(image_data, band_1, band_2)[source]

Calculate Normalised Difference Index (NDI) for selected areas

Parameters:
  • image_data (ModeledMultispectralImageData) – ModeledMultispectralImageData class instance

  • band_1 (int) – band number as an integer

  • band_2 (int) – band number as an integer

Returns:

ndi representation of the scene as ndarray

Return type:

ndarray

ms_camera_model.data_comparison.calculate_spectral_angle_mapper(real_ms_ratios, modeled_ms_ratios)[source]

Calculate the spectral angle mapper (shape similarity) between real and modeled data

Parameters:
  • real_ms_ratios (ndarray) – real MS band ratios

  • modeled_ms_ratios (ndarray) – modeled MS band ratios

Returns:

angle in rad describing the similarity independent of brightness

Raises:

ValueError – if the calculation would cause division by 0

Return type:

float

ms_camera_model.data_comparison.calculate_weber_contrast(image_data, band, area_of_interest, background_area)[source]

Calculate Weber contrast for a single band and defined area

Parameters:
  • image_data (ModeledMultispectralImageData) – ModeledMultispectralImageData class instance

  • band (int) – band number as an integer

  • area_of_interest (AreaLocation) – AreaLocation instance with coordinates of the area of interest

  • background_area (AreaLocation) – AreaLocation instance with coordinates of the background area

Returns:

Weber contrast as a float

Return type:

float

ms_camera_model.data_comparison.compare_band_ratios(real_ms_image_data, modeled_ms_image_data, real_ms_area_location, modeled_ms_area_location)[source]

Compare band ratios of real MS image data with modeled MS image data, area defined globally

Parameters:
Returns:

tuple(real_ms_ratios, modeled_ms_ratios)

Raises:
  • ValueError – if sum of means of selected area is less than 1e-10

  • InvalidProvidedArea – if provided area locations are lists

Return type:

tuple[ndarray, ndarray]

ms_camera_model.data_comparison.compare_band_ratios_per_band(real_ms_image_data, modeled_ms_image_data, real_ms_area_location, modeled_ms_area_location)[source]

Compare band ratios of real MS image data with modeled MS image data, area defined per band

Parameters:
  • real_ms_image_data (MultispectralImageData) – MS image data from a real camera

  • modeled_ms_image_data (ModeledMultispectralImageData) – modeled MS image data

  • real_ms_area_location (list[AreaLocation]) – list[AreaLocation] objects describing the area that will be compared

  • modeled_ms_area_location (list[AreaLocation]) – list[AreaLocation] object describing the area that will be compared

Returns:

tuple(real_ms_ratios, modeled_ms_ratios)

Raises:
  • ValueError – if sum of means of selected area is less than 1e-10

  • InvalidProvidedArea – if provided area locations are not lists

  • InvalidProvidedArea – if provided area locations are not of necessary length

Return type:

tuple[ndarray, ndarray]

ms_camera_model.errors module

Multispectral Camera Model - Custom Errors

  • Description: Custom error definitions to improve readability and make debugging easier

  • Author: Tomas Vacek

  • Year: 2026

  • License: MIT License

exception ms_camera_model.errors.AreaOutsideOfBounds[source]

Bases: Exception

The provided area is outside of bounds of the image

exception ms_camera_model.errors.ImageDataIncompatible[source]

Bases: Exception

Image Data is incompatible

exception ms_camera_model.errors.ImageImportFailed[source]

Bases: Exception

Image import failed

exception ms_camera_model.errors.ImageRegistrationFailed[source]

Bases: Exception

Image registration is not possible for the provided ImageData class instances

exception ms_camera_model.errors.IncompatibleBandChoice[source]

Bases: Exception

Chosen bands are not compatible with this method

exception ms_camera_model.errors.InvalidProvidedArea[source]

Bases: Exception

Provided area is invalid

exception ms_camera_model.errors.NoBandCenters[source]

Bases: Exception

Provided ImageData class instance doesn’t contain band_centers

exception ms_camera_model.errors.NoDarkFrame[source]

Bases: Exception

No embedded dark frame found

exception ms_camera_model.errors.NoImageData[source]

Bases: Exception

Provided ImageData instance doesn’t contain img_data

exception ms_camera_model.errors.NoProvidedArea[source]

Bases: Exception

No area was provided

exception ms_camera_model.errors.NoProvidedFilepaths[source]

Bases: Exception

No filepaths were provided

exception ms_camera_model.errors.NoProvidedFilterSensorUnits[source]

Bases: Exception

No provided FilterSensorUnit class instances

exception ms_camera_model.errors.WavelengthMismatch[source]

Bases: Exception

Provided filter wavelengths do not match with available hyperspectral image data

ms_camera_model.filter_sensor module

Multispectral Camera Model - Filters and Sensors

  • Description: Dataclasses and their methods for filters and sensors

  • Author: Tomas Vacek

  • Year: 2026

  • License: MIT License

class ms_camera_model.filter_sensor.FilterSensorUnit(filter_spec, sensor_spec)[source]

Bases: object

Combination of filter and sensor

Parameters:
Method from_excel:

alternative constructor which imports data from Excel

filter_spec: FilterSpecs
classmethod from_excel(filename_filter, filename_sensor)[source]

Load filter transmission and sensor spectral sensitivity from Excel file

Parameters:
  • filename_filter (str) – Filename or path to the filter xlsx file

  • filename_sensor (str) – Filename or path to the sensor xlsx file

Returns:

FilterSensorUnit with loaded data

Return type:

FilterSensorUnit

sensor_spec: SensorSpecs
class ms_camera_model.filter_sensor.FilterSpecs(filter_transmittance, name='Generic', supplier='Generic', band_center=0, band_width=0)[source]

Bases: object

Filter specification

Parameters:
  • filter_transmittance (ndarray)

  • name (str)

  • supplier (str)

  • band_center (float)

  • band_width (float)

band_center: float = 0
band_width: float = 0
filter_transmittance: ndarray
name: str = 'Generic'
supplier: str = 'Generic'
class ms_camera_model.filter_sensor.InterpolatedFilterSensorUnit(filter_spec, sensor_spec, combined_response=None)[source]

Bases: FilterSensorUnit

FilterSensorUnit interpolated to hyperspectral data

Parameters:
  • combined_response (ndarray | None) – combined spectral response function for the filter and sensor

  • filter_spec (FilterSpecs)

  • sensor_spec (SensorSpecs)

Method interpolate_to_hs_data:

alternative constructor, interpolates FilterSensorUnit to hyperspectral data

combined_response: ndarray | None = None
classmethod interpolate_to_hs_data(fs_unit, hs_band_centers)[source]

Interpolate the provided filter and sensor data to hyperspectral data

Parameters:
  • fs_unit (FilterSensorUnit) – FilterSensorUnit class instance

  • hs_band_centers (list[float]) – list[float] containing band centers of available hyperspectral data

Returns:

InterpolatedFilterSensorUnit

Raises:
  • ValueError – if hs_band_centers are None

  • ValueError – if the filter has no pass band

  • WavelengthMismatch – if the filter active response is outside of available hyperspectral wavelengths

Return type:

InterpolatedFilterSensorUnit

class ms_camera_model.filter_sensor.SensorSpecs(sensor_qe_curve, name='Generic', supplier='Generic', sensor_type='Generic')[source]

Bases: object

Sensor specification

Parameters:
  • sensor_qe_curve (ndarray)

  • name (str)

  • supplier (str)

  • sensor_type (str)

name: str = 'Generic'
sensor_qe_curve: ndarray
sensor_type: str = 'Generic'
supplier: str = 'Generic'

ms_camera_model.image_data module

Multispectral Camera Model - Image Data

  • Description: Dataclasses and their methods for image data

  • Author: Tomas Vacek

  • Year: 2026

  • License: MIT License

class ms_camera_model.image_data.AreaLocation(ulx, uly, lrx, lry)[source]

Bases: object

Area location value object with checks

Parameters:
  • ulx (int)

  • uly (int)

  • lrx (int)

  • lry (int)

as_tuple()[source]

Return in openCV compatible format

Return type:

tuple[int, int, int, int]

lrx: int
lry: int
ulx: int
uly: int
class ms_camera_model.image_data.HyperspectralImageData(img_data, band_centers, nbands)[source]

Bases: ImageData

Hyperspectral Image Data - imported from hyperspectral data file

Method import_calibrated_hs_img:

Import hyperspectral cube with metadata and perform radiometric calibration

Method import_hs_img:

Import hyperspectral cube into img_data, band_centers and nbands

Parameters:
  • img_data (ndarray)

  • band_centers (list[float])

  • nbands (int)

classmethod import_calibrated_hs_img(img_filepath, panel_data_filepath, panel_location)[source]

Import hyperspectral cube as ImageData class instance

Parameters:
  • img_filepath (str) – path to the hyperspectral image file

  • panel_data_filepath (str) – path to the csv panel albedo file

  • panel_location (AreaLocation) – AreaLocation object

Returns:

HyperspectralImageData

Raises:
Return type:

HyperspectralImageData

classmethod import_hs_img(img_filepath)[source]

Import hyperspectral cube as ImageData class instance

Parameters:

img_filepath (str) – path to the hyperspectral image file

Raises:
Returns:

HyperspectralImageData

Return type:

HyperspectralImageData

class ms_camera_model.image_data.ImageData(img_data, band_centers, nbands)[source]

Bases: ABC

Image Data class

Parameters:
  • img_data (ndarray) – np.ndarray of image data with shape (rows, cols, bands)

  • band_centers (list[float]) – list of floats storing the center of each band in the img_data array

  • nbands (int) – number of bands in the img_data array

Method __add__:

add two ImageData classes

Method mean_spectrum_area:

calculate mean spectrum for a select area

band_centers: list[float]
img_data: ndarray
static mean_spectrum_area(img, corner_coords)[source]

Calculate mean over spectral bands for select area

Parameters:
  • img (ndarray) – image data

  • corner_coords (tuple[int, int, int, int]) – coordinates of corners of the area in format [ulx, uly, lrx, lry]

Returns:

np.ndarray of mean spectrum for selected area

Raises:

AreaOutsideOfBounds – when provided area coordinates are outside of the available image data

Return type:

ndarray

nbands: int
class ms_camera_model.image_data.ModeledMultispectralImageData(img_data, band_centers, nbands, band_names)[source]

Bases: ImageData

Modeled Multispectral Image Data - modeled from HS data

Method perform_radiometric_calibration:

method for performing radiometric calibration against known panel

Parameters:
  • img_data (ndarray)

  • band_centers (list[float])

  • nbands (int)

  • band_names (list[str])

band_names: list[str]
perform_radiometric_calibration(panel_calibration, panel_locations)[source]

Perform radiometric calibration on the modeled multispectral image data

Parameters:
  • panel_calibration (dict[str, float]) – panel_calibration data of used MicaSense CRP

  • panel_locations (list[AreaLocation]) – list of AreaLocation objects

Returns:

ModeledMultispectralImageData

Return type:

ModeledMultispectralImageData

class ms_camera_model.image_data.MultispectralImageData(img_data, band_centers, nbands)[source]

Bases: ImageData

Multispectral Image Data - loaded from real MS camera

Method import_altum_pt_ms_imgs:

method for import of images from MicaSense Altum-PT camera

Method import_ms_imgs:

method for import of generic multispectral images

Method check_filepaths:

method which checks that filepaths are a non-empty list and are strings

Parameters:
  • img_data (ndarray)

  • band_centers (list[float])

  • nbands (int)

static check_filepaths(filepaths)[source]

Check that provided list of filepaths is usable

Parameters:

filepaths (list[str]) – list of filepaths

Raises:
  • TypeError – when provided paths aren’t in list

  • TypeError – when provided paths aren’t strings

  • NoProvidedFilepaths – when there are no provided filepaths

Return type:

None

classmethod import_altum_pt_ms_imgs(filepaths, panel_calibration, panel_locations)[source]

Import and pre-process Altum PT images

Parameters:
  • filepaths (list[str]) – list of filepaths to the multispectral images, their order determines order in the final array

  • panel_calibration (dict[str, float]) – panel_calibration data of used MicaSense CRP

  • panel_locations (list[AreaLocation]) – list of AreaLocation objects

Returns:

MultispectralImageData

Raises:
  • ImageDataIncompatible – when the number of image filepaths doesn’t match number of calibration panel coordinates

  • ImageImportFailed – when image import fails

  • NoImageData – when image import results in an empty array

  • NoProvidedArea – when the provided area of the CRP is None or empty

  • TypeError – when provided paths aren’t in list

  • TypeError – when provided paths aren’t strings

  • NoProvidedFilepaths – when there are no provided filepaths

Return type:

MultispectralImageData

classmethod import_ms_imgs(filepaths)[source]

Import multispectral images as a np.ndarray

Parameters:

filepaths (list[str]) – list of filepaths to the multispectral images, their order determines order in the final array

Returns:

MultispectralImageData

Raises:
  • ImageImportFailed – when image import fails

  • NoImageData – when image import results in an empty array

  • TypeError – when provided paths aren’t in list

  • TypeError – when provided paths aren’t strings

  • NoProvidedFilepaths – when there are no provided filepaths

Return type:

MultispectralImageData

ms_camera_model.image_registrator module

Multispectral Camera Model - Image Registration

  • Description: Classes and functions for image registration

  • Author: Tomas Vacek

  • Year: 2026

  • License: MIT License

class ms_camera_model.image_registrator.AkazeAlgorithm[source]

Bases: RegistrationAlgorithm

AKAZE algorithm

find_keypoints(img, mask)[source]

Find keypoint using AKAZE method

Parameters:
  • img (ndarray) – image data array

  • mask (ndarray | None) – mask array

Returns:

keypoints and their descriptors

Return type:

tuple[ndarray, ndarray]

find_matches(des_ref, des_src)[source]

Find matches using compatible matcher

Parameters:
  • des_ref (ndarray) – descriptors for reference image

  • des_src (ndarray) – descriptors for source image

Returns:

matches

Return type:

Sequence[Sequence[DMatch]]

class ms_camera_model.image_registrator.OrbAlgorithm[source]

Bases: RegistrationAlgorithm

ORB algorithm

find_keypoints(img, mask)[source]

Find keypoint using ORB method

Parameters:
  • img (ndarray) – image data array

  • mask (ndarray | None) – mask array

Returns:

keypoints and their descriptors

Return type:

tuple[ndarray, ndarray]

find_matches(des_ref, des_src)[source]

Find matches using compatible matcher

Parameters:
  • des_ref (ndarray) – descriptors for reference image

  • des_src (ndarray) – descriptors for source image

Returns:

matches

Return type:

Sequence[Sequence[DMatch]]

class ms_camera_model.image_registrator.RegistrationAlgorithm[source]

Bases: ABC

Define keypoint finding and matching strategy

abstractmethod find_keypoints(img, mask)[source]

Find keypoint using defined method

Parameters:
  • img (ndarray) – image data array

  • mask (ndarray | None) – mask array

Returns:

keypoints and their descriptors

Return type:

tuple[ndarray, ndarray]

abstractmethod find_matches(des_ref, des_src)[source]

Find matches using compatible matcher

Parameters:
  • des_ref (ndarray) – descriptors for reference image

  • des_src (ndarray) – descriptors for source image

Returns:

matches

Return type:

Sequence[Sequence[DMatch]]

class ms_camera_model.image_registrator.SiftAlgorithm[source]

Bases: RegistrationAlgorithm

SIFT algorithm

find_keypoints(img, mask)[source]

Find keypoint using SIFT method

Parameters:
  • img (ndarray) – image data array

  • mask (ndarray | None) – mask array

Returns:

keypoints and their descriptors

Return type:

tuple[ndarray, ndarray]

find_matches(des_ref, des_src)[source]

Find matches using compatible matcher

Parameters:
  • des_ref (ndarray) – descriptors for reference image

  • des_src (ndarray) – descriptors for source image

Returns:

matches

Return type:

Sequence[Sequence[DMatch]]

ms_camera_model.image_registrator.register_bands(reference_img, source_img, registration_strategy, band_mask_paths_ref=None, band_mask_paths_src=None)[source]

Register img_data of one ImageData class instance against another

Parameters:
  • reference_img (ImageData) – ImageData class instance that is being registered onto

  • source_img (ImageData) – ImageData class instance that is being registered against the reference

  • registration_strategy (RegistrationAlgorithm) – image registration strategy

  • band_mask_paths_ref (list[str | None] | None) – list of mask file paths for reference images

  • band_mask_paths_src (list[str | None] | None) – list of mask file paths for source images

Returns:

ImageData instance class (same as of reference_img)

Raises:
Return type:

ImageData

ms_camera_model.image_visualiser module

Multispectral Camera Model - Image Visualisation

  • Description: Functions for image visualisation

  • Author: Tomas Vacek

  • Year: 2026

  • License: MIT License

ms_camera_model.image_visualiser.imshow(image_data, bands=None)[source]

View image as an RGB interpretation of selected bands or as a brightness plot

Parameters:
  • image_data (ImageData) – ImageData instance

  • bands (list[int] | None) – list of band numbers, if the list is not provided, brightness plot will be used instead

Raises:
  • TypeError – if provided bands are not a list or None

  • IncompatibleBandChoice – if ‘bands’ is not [], len(bands) != 3 or the number is out-of-bounds

Return type:

None

ms_camera_model.image_visualiser.plot_area_spectrum(image_data, coordinates)[source]

Plot spectrum of pixels

Parameters:
Raises:

NoBandCenters – if provided ImageData contains no band_centers

Return type:

None

ms_camera_model.model module

Multispectral Camera Model - Simulation Model

  • Description: Simulated model of a multispectral camera. Takes in hyperspectral data and colour filter specs.

Outputs multispectral data * Author: Tomas Vacek * Year: 2026 * License: MIT License

class ms_camera_model.model.MultispectralCameraModel(hs_data, filter_sensor_units, band_names)[source]

Bases: object

Multispectral camera model

Parameters:
  • hs_data (HyperspectralImageData) – HyperspectralImageData class instance

  • filter_sensor_units (list[InterpolatedFilterSensorUnit]) – list of InterpolatedFilterSensorUnit class instances

  • band_names (list[str]) – list of names for spectral bands

  • out_data – simulated multispectral image data as ImageData class instance

Method create_model:

alternative constructor ensuring FilterSensorUnit interpolation takes place

Method run_simulation:

run simulation of the multispectral camera

band_names: list[str]
classmethod create_model(hs_data, fs_units, band_names)[source]

Interpolate FilterSensorUnits to hyperspectral image data and create model with corrected units

Parameters:
  • hs_data (HyperspectralImageData) – HyperspectralImageData class instance

  • fs_units (list[FilterSensorUnit]) – list of FilterSensorUnit class instances

  • band_names (list[str]) – list of names for spectral bands

Returns:

MultispectralCameraModel

Raises:
  • TypeError – if fs_units are not a list

  • TypeError – if hs_data is not an instance of HyperspectralImageData

  • TypeError – if band_names are not a list

  • NoProvidedFilterSensorUnits – if no FilterSensorUnits are provided

Return type:

MultispectralCameraModel

filter_sensor_units: list[InterpolatedFilterSensorUnit]
hs_data: HyperspectralImageData
out_data: ModeledMultispectralImageData
run_simulation()[source]

Match filter_sensor_units specs with hs_data band_centers and calculate out_data

Returns:

Returns resulting simulated ImageData

Return type:

ImageData

Module contents

Multispectral Camera Model - Simulation Model

  • Description: Simulated model of a multispectral camera. Takes in hyperspectral data and colour filter specs.

Outputs multispectral data * Author: Tomas Vacek * Year: 2026 * License: MIT License

class ms_camera_model.AreaLocation(ulx, uly, lrx, lry)[source]

Bases: object

Area location value object with checks

Parameters:
  • ulx (int)

  • uly (int)

  • lrx (int)

  • lry (int)

as_tuple()[source]

Return in openCV compatible format

Return type:

tuple[int, int, int, int]

lrx: int
lry: int
ulx: int
uly: int
class ms_camera_model.FilterSensorUnit(filter_spec, sensor_spec)[source]

Bases: object

Combination of filter and sensor

Parameters:
Method from_excel:

alternative constructor which imports data from Excel

filter_spec: FilterSpecs
classmethod from_excel(filename_filter, filename_sensor)[source]

Load filter transmission and sensor spectral sensitivity from Excel file

Parameters:
  • filename_filter (str) – Filename or path to the filter xlsx file

  • filename_sensor (str) – Filename or path to the sensor xlsx file

Returns:

FilterSensorUnit with loaded data

Return type:

FilterSensorUnit

sensor_spec: SensorSpecs
class ms_camera_model.FilterSpecs(filter_transmittance, name='Generic', supplier='Generic', band_center=0, band_width=0)[source]

Bases: object

Filter specification

Parameters:
  • filter_transmittance (ndarray)

  • name (str)

  • supplier (str)

  • band_center (float)

  • band_width (float)

band_center: float = 0
band_width: float = 0
filter_transmittance: ndarray
name: str = 'Generic'
supplier: str = 'Generic'
class ms_camera_model.HyperspectralImageData(img_data, band_centers, nbands)[source]

Bases: ImageData

Hyperspectral Image Data - imported from hyperspectral data file

Method import_calibrated_hs_img:

Import hyperspectral cube with metadata and perform radiometric calibration

Method import_hs_img:

Import hyperspectral cube into img_data, band_centers and nbands

Parameters:
  • img_data (ndarray)

  • band_centers (list[float])

  • nbands (int)

classmethod import_calibrated_hs_img(img_filepath, panel_data_filepath, panel_location)[source]

Import hyperspectral cube as ImageData class instance

Parameters:
  • img_filepath (str) – path to the hyperspectral image file

  • panel_data_filepath (str) – path to the csv panel albedo file

  • panel_location (AreaLocation) – AreaLocation object

Returns:

HyperspectralImageData

Raises:
Return type:

HyperspectralImageData

classmethod import_hs_img(img_filepath)[source]

Import hyperspectral cube as ImageData class instance

Parameters:

img_filepath (str) – path to the hyperspectral image file

Raises:
Returns:

HyperspectralImageData

Return type:

HyperspectralImageData

class ms_camera_model.ImageData(img_data, band_centers, nbands)[source]

Bases: ABC

Image Data class

Parameters:
  • img_data (ndarray) – np.ndarray of image data with shape (rows, cols, bands)

  • band_centers (list[float]) – list of floats storing the center of each band in the img_data array

  • nbands (int) – number of bands in the img_data array

Method __add__:

add two ImageData classes

Method mean_spectrum_area:

calculate mean spectrum for a select area

band_centers: list[float]
img_data: ndarray
static mean_spectrum_area(img, corner_coords)[source]

Calculate mean over spectral bands for select area

Parameters:
  • img (ndarray) – image data

  • corner_coords (tuple[int, int, int, int]) – coordinates of corners of the area in format [ulx, uly, lrx, lry]

Returns:

np.ndarray of mean spectrum for selected area

Raises:

AreaOutsideOfBounds – when provided area coordinates are outside of the available image data

Return type:

ndarray

nbands: int
class ms_camera_model.MultispectralCameraModel(hs_data, filter_sensor_units, band_names)[source]

Bases: object

Multispectral camera model

Parameters:
  • hs_data (HyperspectralImageData) – HyperspectralImageData class instance

  • filter_sensor_units (list[InterpolatedFilterSensorUnit]) – list of InterpolatedFilterSensorUnit class instances

  • band_names (list[str]) – list of names for spectral bands

  • out_data – simulated multispectral image data as ImageData class instance

Method create_model:

alternative constructor ensuring FilterSensorUnit interpolation takes place

Method run_simulation:

run simulation of the multispectral camera

band_names: list[str]
classmethod create_model(hs_data, fs_units, band_names)[source]

Interpolate FilterSensorUnits to hyperspectral image data and create model with corrected units

Parameters:
  • hs_data (HyperspectralImageData) – HyperspectralImageData class instance

  • fs_units (list[FilterSensorUnit]) – list of FilterSensorUnit class instances

  • band_names (list[str]) – list of names for spectral bands

Returns:

MultispectralCameraModel

Raises:
  • TypeError – if fs_units are not a list

  • TypeError – if hs_data is not an instance of HyperspectralImageData

  • TypeError – if band_names are not a list

  • NoProvidedFilterSensorUnits – if no FilterSensorUnits are provided

Return type:

MultispectralCameraModel

filter_sensor_units: list[InterpolatedFilterSensorUnit]
hs_data: HyperspectralImageData
out_data: ModeledMultispectralImageData
run_simulation()[source]

Match filter_sensor_units specs with hs_data band_centers and calculate out_data

Returns:

Returns resulting simulated ImageData

Return type:

ImageData

class ms_camera_model.MultispectralImageData(img_data, band_centers, nbands)[source]

Bases: ImageData

Multispectral Image Data - loaded from real MS camera

Method import_altum_pt_ms_imgs:

method for import of images from MicaSense Altum-PT camera

Method import_ms_imgs:

method for import of generic multispectral images

Method check_filepaths:

method which checks that filepaths are a non-empty list and are strings

Parameters:
  • img_data (ndarray)

  • band_centers (list[float])

  • nbands (int)

static check_filepaths(filepaths)[source]

Check that provided list of filepaths is usable

Parameters:

filepaths (list[str]) – list of filepaths

Raises:
  • TypeError – when provided paths aren’t in list

  • TypeError – when provided paths aren’t strings

  • NoProvidedFilepaths – when there are no provided filepaths

Return type:

None

classmethod import_altum_pt_ms_imgs(filepaths, panel_calibration, panel_locations)[source]

Import and pre-process Altum PT images

Parameters:
  • filepaths (list[str]) – list of filepaths to the multispectral images, their order determines order in the final array

  • panel_calibration (dict[str, float]) – panel_calibration data of used MicaSense CRP

  • panel_locations (list[AreaLocation]) – list of AreaLocation objects

Returns:

MultispectralImageData

Raises:
  • ImageDataIncompatible – when the number of image filepaths doesn’t match number of calibration panel coordinates

  • ImageImportFailed – when image import fails

  • NoImageData – when image import results in an empty array

  • NoProvidedArea – when the provided area of the CRP is None or empty

  • TypeError – when provided paths aren’t in list

  • TypeError – when provided paths aren’t strings

  • NoProvidedFilepaths – when there are no provided filepaths

Return type:

MultispectralImageData

classmethod import_ms_imgs(filepaths)[source]

Import multispectral images as a np.ndarray

Parameters:

filepaths (list[str]) – list of filepaths to the multispectral images, their order determines order in the final array

Returns:

MultispectralImageData

Raises:
  • ImageImportFailed – when image import fails

  • NoImageData – when image import results in an empty array

  • TypeError – when provided paths aren’t in list

  • TypeError – when provided paths aren’t strings

  • NoProvidedFilepaths – when there are no provided filepaths

Return type:

MultispectralImageData

class ms_camera_model.SensorSpecs(sensor_qe_curve, name='Generic', supplier='Generic', sensor_type='Generic')[source]

Bases: object

Sensor specification

Parameters:
  • sensor_qe_curve (ndarray)

  • name (str)

  • supplier (str)

  • sensor_type (str)

name: str = 'Generic'
sensor_qe_curve: ndarray
sensor_type: str = 'Generic'
supplier: str = 'Generic'