计算亮度时的常数k是多少
我想使用 RGB 值计算图像的亮度,但在公式中有一个常数 ki 不知道它是什么,这是文档中的公式:
“在计算亮度 (L) 时,CIE Y 乘以一个常数值“k”,其中 k 对于摄像机来说可以是常数,也可以根据场景中所选区域的测量来确定场景。
L=k*(0,2127Red+0,7151Green+0,0722*Blue) (cd/m²)
这是文档的链接:https://faculty.washington.edu/inanici/Publications/LRTPublished.pdf 强调文本
I want to calculate the luminance of image using RGB value but in the formula there is a constant k i didn't know what it is this is the formula from the document:
"In calculating luminance (L), CIE Y is multiplied by a constant value ‘k’, where k can be either aconstant for the camera or determined for a scene based on a measurement of a selected region in the scene.
L=k*(0,2127Red+0,7151Green+0,0722*Blue) (cd/m²)
this is the link to the document:https://faculty.washington.edu/inanici/Publications/LRTPublished.pdf emphasized text
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简短回答
您正在混淆仅适用于名为“Photosphere”的特定软件的内容,而数学不适用于一般亮度用途。
完整答案
你说:
什么意思?某个给定像素的亮度?或者RMS平均亮度?或者???
并且:您的图像采用什么色彩空间(配置文件)?
我假设你的图像是 sRGB,每像素 8 位。但它可能是 P3 或 Adobe98,或任何其他数量......我将向您展示的数学是针对 sRGB 的。
1) 转换为浮点
每个 8 位 0-255 sRGB 颜色通道必须转换为 0.0-1.0
2) 转换为线性
必须删除传输曲线(又名“伽玛”)。对于 sRGB,“准确”方法是:
3) 计算亮度
现在,将每个线性化通道乘以适当的系数,然后将它们相加即可得出亮度。
额外奖励:Andy 的 Down and Dirty 版本
这是一个替代方案,仍然非常准确,但更简单,性能更好。将每个通道提高到 2.2 次方,然后乘以系数并求和:
如果您还有其他问题,请告诉我...
Short Answer
You are conflating something that is only for a specific piece of software called "Photosphere" and that math is not for general luminance use.
Complete Answer
You said:
What do you mean? The luminance of some given pixel? Or the RMS average luminance? Or???
AND: What colorspace (profile) is your image in?
I am going to ASSUME your image is sRGB, and 8 bit per pixel. But it could be P3 or Adobe98, or any number of others... The math I am going to show you is for sRGB.
1) Convert to float
Each 8bit 0-255 sRGB color channel must be converted to 0.0-1.0
2) Convert to linear
The transfer curve aka "gamma" must be removed. For sRGB, the "accurate" method is:
3) Calculate Luminance
Now, multiply each linearized channel by the appropriate coefficient, and sum them to find luminance.
BONUS: Andy's Down and Dirty Version
Here's an alternate that is still usefully accurate, but simpler for better performance. Raise each channel to the power of 2.2, then multiply the coefficients, and sum:
Let me know if you have additional questions...