为什么将l*a*b的ab除以110以在-1和1之间标准化它?

发布于 2025-02-06 15:39:20 字数 422 浏览 1 评论 0原文

A>试图解释Pix2Pix研究的图像着色策略。 这个问题仅参考本文。

在数据集“制作数据集和数据加载器”部分中,在__getItem__方法内,将图像转换为l*a*b后,它们将张量的一部分划分为50并减去1。 1作为l的范围从0到100。

但是AB值除以110,这很奇怪,因为AB值在-128到128范围内。据我所知,AB应除以128,以将其值带到-1和1之间。 1。

如果有人了解这背后的逻辑,请花点时间告诉我。

This article tries to explain image colorizing strategy of pix2pix research.
This question references this article only.

In the dataset 'Making Dataset and DataLoaders' section, inside __getitem__ method, after converting the image to L*a*b, they divide L part of the tensor by 50 and subtract 1. This will surely bring the L values between -1 and 1 as L ranges from 0 to 100.

But ab values are divided by 110, which is strange, as ab values range from -128 to 128. As of my understanding, ab should be divided by 128 to bring its values between -1 and 1.

If anyone understands the logic behind this, please take the time to tell me.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月下伊人醉 2025-02-13 15:39:20

理论上A和B没有有限,但由于实际原因通常被夹住。

wikipedia

a*和b*轴是无限的,取决于参考白色
它们很容易超过±150,以覆盖人类的范围。尽管如此,
软件实施通常会限制这些值以实用
原因。例如,如果使用整数数学,则很常见
在-128至127的范围内夹紧A*和B*。

我认为110的来源是 MATLAB实现,

但是,我认为这不适合跳过。彩色的震动,因此这可能是一个错误。

2 http://ai.stanford.edu/~ruzon/~ruzon/software/rgblab.html scikit。

Theoriticaly a and b are not bounded but often clamped for practical reason.

from wikipedia

The a* and b* axes are unbounded, and depending on the reference white
they can easily exceed ±150 to cover the human gamut. Nevertheless,
software implementations often clamp these values for practical
reasons. For instance, if integer math is being used it is common to
clamp a* and b* in the range of −128 to 127.

I think that the source of the 110 is this Matlab implementation

However, I assume that this DOESN'T hold for the skimage.color implemneation so it may be a mistake.

2: http://ai.stanford.edu/~ruzon/software/rgblab.html scikit.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文