首页 > 解决方案 > 如何计算对比度改善指数 (CII)

问题描述

嗨,我想知道如何计算 CII。据我所知获得它:

在哪里:

因为a前景的平均灰度,b背景的平均灰度。
我对如何分离图像的前景和背景部分感到困惑。
有人对我有任何解决方案/启示吗?
谢谢你。

标签: pythonimageimage-processingcontrast

解决方案


Contrast is usually calculated from minimum and maximum brightness values. Not from foreground or background.

Modulation (or Michelson Contrast) is defined as

M = (L_max - L_min) / (L_max + L_min)

If you want to calculate that from foreground and background you'll have to distinguish between both. This is referred to as image segmentation.

You'll find plenty of resources for that keyword and there are countless ways to achieve that.


推荐阅读