python - 如何计算对比度改善指数 (CII)
问题描述
嗨,我想知道如何计算 CII。据我所知获得它:
在哪里:
因为a是前景的平均灰度,b是背景的平均灰度。
我对如何分离图像的前景和背景部分感到困惑。
有人对我有任何解决方案/启示吗?
谢谢你。
解决方案
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.
推荐阅读
- ios - 如何从通知服务扩展访问应用程序的徽章计数
- sql - 为什么查询优化器在合并连接后使用排序?
- ruby - 使用带有 SAN 的 Ruby OpenSSL 解码 CSR
- dns - Kubernetes:Kube-DNS 与 CoreDNS
- java - Java - 对象映射器 - 要列出的数字的 JSON 数组
- sql - spark sql数据帧中的迭代,在第一次迭代中获取第一行值,在下一次迭代中获取第二行值,依此类推
- react-native - 如何更改 React Native 底部标签栏图标 onTabPress 的图像?
- excel - VBA 动态搜索模式与动态
- bash - bash 以捕获特定的模式实例并排除其他模式
- mysql - SQL Select Books 基于存储在序列化数组中的类型