NIIRSImageMetric
- class nrtk.impls.image_metric.niirs_image_metric.NIIRSImageMetric(sensor: PybsmSensor, scenario: PybsmScenario)
Implementation of the ImageMetric interface to calculate the NIIRS metric.
The NIIRS metric, or National Imagery Interpretability Rating Scale, is used to rate the quality of images based on interpretability. This class requires a PybsmSensor and PybsmScenario to be initialized, as it uses these components to perform the metric calculation.
- Attributes:
sensor (PybsmSensor): The sensor configuration for the metric computation. scenario (PybsmScenario): The scenario configuration used in metric calculation.
Methods
Given the pyBSMSensor and the pyBSMScenario, compute the NIIRS metric.
from_configInstantiate a new instance of this class given the configuration JSON-compliant dictionary encapsulating initialization arguments.
Generates a configuration dictionary for the NIIRSImageMetric instance.
get_default_configGenerate and return a default configuration dictionary for this class.
get_implsDiscover and return a set of classes that implement the calling class.
Checks if the required pybsm module is available.
- __call__(img_1: ndarray[Any, Any] | None = None, img_2: ndarray[Any, Any] | None = None, additional_params: dict[str, Any] | None = None) float
Given the pyBSMSensor and the pyBSMScenario, compute the NIIRS metric.
While this implementation of compute() takes the expected input paramerters, none of the values are used during calculation. pyBSM’s NIIRS calculation only uses the Sensor and Scenario objects to calculate NIIRS and is image independent.
In order to inherit and function as an ImageMetric implementation, the arguements for compute stay consistent with other implementaiotns and are not used.
- Returns:
The NIIRS metric for the given pyBSMSensor and pyBSMScenario.
- __init__(sensor: PybsmSensor, scenario: PybsmScenario) None
Initializes the NIIRSImageMetric.
- Args:
sensor (PybsmSensor): A pyBSM sensor object representing sensor characteristics. scenario (PybsmScenario): A pyBSM scenario object for environmental and context settings.
- Raises:
ImportError: If the pyBSM library is not available. installed via ‘nrtk[pybsm]’.
- compute(img_1: ndarray[Any, Any] | None = None, img_2: ndarray[Any, Any] | None = None, additional_params: dict[str, Any] | None = None) float
Given the pyBSMSensor and the pyBSMScenario, compute the NIIRS metric.
While this implementation of compute() takes the expected input paramerters, none of the values are used during calculation. pyBSM’s NIIRS calculation only uses the Sensor and Scenario objects to calculate NIIRS and is image independent.
In order to inherit and function as an ImageMetric implementation, the arguements for compute stay consistent with other implementaiotns and are not used.
- Returns:
The NIIRS metric for the given pyBSMSensor and pyBSMScenario.
- get_config() dict[str, Any]
Generates a configuration dictionary for the NIIRSImageMetric instance.
- Returns:
dict[str, Any]: Configuration data representing the sensor and scenario.
- classmethod is_usable() bool
Checks if the required pybsm module is available.
- Returns:
bool: True if pybsm is installed; False otherwise.