Tag Archives: Depth Image

Depth Colouring

As it’s exam season I have not been able to get as much project work done as I would like recently, however in a brief break between revision sessions yesterday I made a quick change to the way I draw the depth images (and video).

It has been bugging me for a while that the depth images come in with values in the rough range 0-6000, however my screen display program was converting them to a number in the range 0-255, thereby losing a vast amount of the potential detail. Increasing the colour depth of the grayscale image wouldn’t help overly either as it would make it no easier to visually discern the difference between values. I therefore fixed the problem by mapping it to a colour spectrum (inspired by the Hue wheel on colour pickers) rather than a grayscale one. This increases the range of values which I can display from 0-255 to 0-1530 – a six times improvement! I chose to continue mapping errors to black.

A comparison between the old, grayscale depth display (left) and the new, colour spectrum depth display (right).

A comparison between the old, grayscale depth display (left) and the new, colour spectrum depth display (right). Click for full size image.

Personally I don’t think the human eye can necessarily pick up enough information to be able to exploit the full six-times increase in the range of displayable values, however it is definitely an improvement. For example the folds in my clothing (particularly my jumper) are far more noticeable in the right hand image and it’s more obvious my arm is held in front of my body rather than parallel to it. Likewise the corner of the room is more pronounced where before it was just a light grey haze. While not a critical item for my project, it is a nice visual improvement that will make it both easier to track down bugs and more appealing to people I show it to.

When I next get an hour free the next small change I plan to make is adding compression to the video stream. Currently it streams at 12 MB/s and in the 10 minutes I was testing the coloured video, a total of 7 GB of images were streamed. This is not really practical, especially if I plan to use it over the University’s WiFi network. If I find the job too difficult to do in an hour I will give up as, once again, it is not a critical requirement.