ee_extra.QA.metrics.CMC#

class ee_extra.QA.metrics.CMC(original: Image, modified: Image, reproject: bool = True, **kwargs: Any)[source]#

Calculate band-wise change in mean contrast (CMC) between an original and modified image with the same bands. A value of 1 represents no change in contrast.

Parameters:
  • original – The original image to use as a reference.

  • modified – The modified image to compare to the original.

  • reproject – If true, the original image will be reprojected to the modified image scale before calculation.

  • kwargs – Additional keyword arguments passed to ee.Image.reduceRegion.

Returns:

A dictionary with band names as keys and CMC values as values.

References

Wang, Z., & Bovik, A. C. (2002). A universal image quality index. IEEE

Signal Processing Letters, 9(3), 81–84. https://doi.org/10.1109/97.995823

Examples

>>> from ee_extra.QA import metrics
>>> bands = ["B4", "B3", "B2"]
>>> img1 = ee.Image("COPERNICUS/S2_SR/20210703T170849_20210703T171938_T14SPG").select(bands)
>>> img2 = ee.Image("COPERNICUS/S2_SR/20210708T170851_20210708T171925_T14SPG").select(bands)
>>> metrics.CMC(img1, img2, bestEffort=True).getInfo()
{'B2': 0.9985072836552178, 'B3': 0.9996642040598637, 'B4': 0.9993236505770505}
__init__()#

Methods

__init__()