负差异值?
当将负视差值映射到灰度时,如何处理负视差值?我尝试将左图像对与右图像对进行匹配,很多时候会出现负值。目前我将它们标准化为 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)!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
标准化为灰度并不是一种可怕的方法。
另一种方法可能是使 -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.
你翻译它们。您可以将视差范围:[-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.