Question

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

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top