SNRImageMetric
- class nrtk.impls.image_metric.snr_image_metric.SNRImageMetric
Implementation of the
ComputeImageMetricsinterface to calculate the Signal to Noise Ratio.Methods
Given one image, compute the Signal to Noise ratio.
from_configInstantiate a new instance of this class given the configuration JSON-compliant dictionary encapsulating initialization arguments.
get_configReturns the config for the interface.
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.
is_usableCheck whether this class is available for use.
- compute(img_1: ndarray[Any, Any], img_2: ndarray[Any, Any] | None = None, additional_params: dict[str, Any] | None = None) float
Given one image, compute the Signal to Noise ratio.
- Parameters:
img_1 – Original input image in the shape (height, width, channels).
img_2 – (Optional) Second input image in the shape (height, width, channels). Not allowed for SNR
additional_params – (Optional) A dictionary containing implementation-specific input param-values pairs.
SNR has the following optional parameters: - axis: valid values are None, 0, 1, (0,1). Default is 0. The axis over which to calculate the standard deviation during SNR calculation. Keeping this at None will calculate over both axes and the channels. - ddof: degrees of freedom for the standard deviation calculation. Default is 0. Max value is num_elements, the number of elements used in calculation. Must be non-negative.
- Returns:
The signal to noise ratio for the input image.