负差异值?

发布于 2024-10-23 14:22:24 字数 207 浏览 1 评论 0原文

当将负视差值映射到灰度时,如何处理负视差值?我尝试将左图像对与右图像对进行匹配,很多时候会出现负值。目前我将它们标准化为 0-255(8位图)!

在此处输入图像描述 在此输入图像描述

How does one deal with negative disparity values when they are to be mapped onto gray scale?I try to match the left image pair with the right one and lot of the times negative values show up.Currently I normalize them to 0-255(8 bit image)!

enter image description here enter image description here

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

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

发布评论

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

评论(2

晒暮凉 2024-10-30 14:22:24

标准化为灰度并不是一种可怕的方法。

另一种方法可能是使 -ve 数字随着幅度变大而从黑色变为红色,而 +ve 数字则从黑色变为绿色(例如),但这意味着小的差异将非常不可见。

我发现的最好方法是将您的差异映射到从绿色到黄色到红色的颜色(或 色轮)。我发现做到这一点的最简单方法是使用 colourspace 像 HSL - 将 L 设置为一半(最大颜色),S 到最大 - “全彩色”,并根据视差数改变 H 值。然后,您通常必须通过标准方程将HSL值转换为RGB值

Normalising to a greyscale isn't a dreadful way of doing it.

Another way might be to make -ve numbers shade from black to red as they get larger in magnitude and +ve numbers shade from black to green (for example) Although this means that small disparities will be pretty invisible.

The best way I've found is to map your disparities to a colour from green through yellow through red (or some other continuous section of the colour wheel). The easiest way I've found to do this is to use a colourspace like HSL - set L to halfway (maximum colour), S to maximum - "fully coloured" and vary the H value with your disparity numbers. Then you usually have to convert the HSL values to RGB values via the standard equations.

梦醒时光 2024-10-30 14:22:24

你翻译它们。您可以将视差范围:[-127,128] 编码为 [0,255],方法是向视差添加 127 进行编码,然后从像素值中减去 127,将像素值解码为视差。

现在看来,如果您需要的范围大于 0 到 255 之间,则必须使用一些可视化软件来显示视差图,例如考虑 MATLAB。灰度图像为您提供的唯一好处是您拥有非常自然的可视化,如果这还不够,因为您有超过 256 个离散标签,您需要转向另一种类型的可视化机制。

You translate them. You can encode the disparity range: [-127,128] into [0,255] by adding 127 to the disparity to encode it, and substract 127 from the pixel value to decode the pixel value in to a disparity.

As it now seems to be the case, if you need more range than between 0 and 255, you're going to have to use some visualization software for your disparity maps, consider for example MATLAB. The only thing a grayscale image gives you is that you have very natural visualization, if that is not enough because you have more than 256 discrete labels you need to move on to another type of visualization mechanism.

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