OpenNI2 icon indicating copy to clipboard operation
OpenNI2 copied to clipboard

Vertical stripes in the depth image and GMCMode

Open nh2 opened this issue 10 years ago • 2 comments

NiViewer shows some artifacts in the depth image, usually 2 to 8 vertical bars (and sometimes more).

It is especially visible when you turn NiViewer into Psychedelic Depth mode (press 2) and point the camera at a wall.

Image showing the artifact

The bars are always vertical, no matter how you turn the camera!

This has been reported in various places for all devices that use Primesense chips (Kinect, Asus Xtion, Asus Xtion Pro, and the Primesense camera):

  • https://code.google.com/p/simple-openni/issues/detail?id=2
  • http://social.msdn.microsoft.com/Forums/en-US/40d55ac6-19b7-4331-aca4-7f8cd271b78b/vertical-banding-in-kinect-depth-images?forum=kinectsdk
  • https://groups.google.com/forum/#!topic/openni-dev/ZeMIU68NlGE
  • https://groups.google.com/forum/#!topic/openkinect/hb8kL4URISg

This problem is fixed by setting GMCMode=0 in the OpenNI .ini file for your camera (for me that's PS1080.ini, and it works great for both cameras I have, Asus Xtion Pro and the Primesense one).

@shenberg I saw you commented on this at https://groups.google.com/forum/#!topic/openni-dev/N3jYzxqcDLo, suggesting this setting.

What does the GMCMode setting do?

Might I get drawbacks from turning it off?

nh2 avatar May 21 '14 17:05 nh2

In total depth is more accurate with GMCMode enabled (it fixes some small systemic-yet-not-constant depth error), but the artifacts might not be worth the slight improvement in depth accuracy. I don't know the specifics of how exactly the mechanism works though.

On Wed, May 21, 2014 at 8:11 PM, Niklas Hambüchen [email protected]:

NiViewer shows some artifacts in the depth image, usually 2 to 8 vertical bars (and sometimes more).

It is especially visible when you turn NiViewer into Psychedelic Depthmode (press 2) and point the camera at a wall.

Image showing the artifacthttps://simple-openni.googlecode.com/issues/attachment?aid=-8669968271920100909&name=screenshot.png&token=ABZ6GAdXYy4MAZ9FFYXplcM2nDs_V_5KUg%3A1400691935537&inline=1

The bars are always vertical, no matter how you turn the camera!

This has been reported in various places for all devices that use Primesense chips (Kinect, Asus Xtion, Asus Xtion Pro, and the Primesense camera):

  • https://code.google.com/p/simple-openni/issues/detail?id=2

    http://social.msdn.microsoft.com/Forums/en-US/40d55ac6-19b7-4331-aca4-7f8cd271b78b/vertical-banding-in-kinect-depth-images?forum=kinectsdk
  • https://groups.google.com/forum/#!topic/openni-dev/ZeMIU68NlGE
  • https://groups.google.com/forum/#!topic/openkinect/hb8kL4URISg

This problem is fixed by setting GMCMode=0 in the OpenNI .ini file for your camera (for me that's PS1080.ini, and it works great for both cameras I have, Asus Xtion Pro and the Primesense one).

@shenberg https://github.com/shenberg I saw you commented on this at https://groups.google.com/forum/#!topic/openni-dev/N3jYzxqcDLo, suggesting this setting.

What does the GMCMode setting do?

Might I get drawbacks from turning it off?

— Reply to this email directly or view it on GitHubhttps://github.com/OpenNI/OpenNI2/issues/81 .

shenberg avatar May 22 '14 13:05 shenberg

Upon further investigation GMC most likely stands for Global Motion Compensation and is part of the compression performed by the firmware of the sensor. What's interesting is that the usual GMC algorithm shouldn't partition the screen into the vertical sections that are being seen (Hence 'Global') but other similar motion compensation algorithms such as Block Motion Compensation do just this and create a very similar artifact.

The main disadvantage of block motion compensation is that it introduces discontinuities at the block borders (blocking artifacts). These artifacts appear in the form of sharp horizontal and vertical edges which are easily spotted by the human eye and produce false edges and ringing effects (large coefficients in high frequency sub-bands) due to quantization of coefficients of the Fourier-related transform used for transform coding of the residual frames.

This seems like a very likely culprit for the vertical banding being seen in the Primesense devices.

adamjdorwart avatar Jun 27 '15 00:06 adamjdorwart