{
  "id": 1208,
  "title": "A technical question on Kinect color data",
  "url": "/competitions/GestureChallenge/discussion/1208",
  "author_name": "",
  "post_date": "2012-01-01T04:07:59.987Z",
  "votes": null,
  "comment_count": 1,
  "views": 1772,
  "content": "<p>If I take any frame of any of video, such as the first frame of devel01/K_1.avi and extract it as a bitmap I get a 320x240 B&amp;W image with 211 unique colors.</p>\r\n<p>&nbsp;</p>\r\n<p>I make a histogram of the colors. Essentially, I count the number of pixels where Red == 1, the number where Red == 2, and so on. I've excerpted the beginning part of this table below. The left-hand column is the color index, with &quot;0&quot; being &quot;black&quot;, the\r\n next column is Red, then Green, then Blue . There are a large number of counts assigned to RGB=[0,0,0], reflecting the proportionally large number of black pixels in this image.</p>\r\n<p>&nbsp;</p>\r\n<p>If you look at any individual column, you'll notice that there is a regular repeating &quot;0&quot; every seven positions. In the red column, these zeroes are at positions 5, 12, 19, 26, and so on. This pattern goes on for the entire histogram, and is fixed for all\r\n scenes in all videos I've examined so far (a very large number... it hasn't finished yet.)</p>\r\n<p>&nbsp;</p>\r\n<p>Normally I would consider this a quantization effect of the hardware. The hardware only has a resolution of 211 possible depths, and this is mapped into the 256 range of an RGB image. Zeroes are inserted, no problem, this is standard hardware behaviour.</p>\r\n<p>&nbsp;</p>\r\n<p>My question is this: If you compare the three columns, note that the Green and Blue columns also have zeroes... but these are\r\n<em>offset</em> from the zeroes in the red column. The green zeroes are two ahead of the red ones, and the blue zeroes are one behind.</p>\r\n<p>&nbsp;</p>\r\n<p>Taking a color as an example, there are 22 pixels which have Red == 6. All of these have Green == 8 and Blue == 5 in the image, indicating that the colors match the offsets in the table as well as the zeroes.</p>\r\n<p>&nbsp;</p>\r\n<p>I'm led to the hypothesis that the Kinect data has a bug in the transcription mechanism. The underlying hardware generates depth information quantized to 211 levels, but when this information is translated into RGB the color channels get &quot;out of sync&quot; with\r\n each other. The normalization algorithm is somehow skewed - averaging the R&#43;G&#43;B components is incorrect - one of the channels is correct, and the skewness of the other channels will introduce noise into the renormalization calculation.</p>\r\n<p>&nbsp;</p>\r\n<p>It would appear that the correct normalization procedure is to use one channel (probably Green) to calculate the original depth data.</p>\r\n<p>&nbsp;</p>\r\n<p>Taking Red == 1 as an example, the corresponding Green should be 3 and Blue should be -1. All pixels which have Red == 1 have Green = 3 and Blue == 0. This indicates that the offset in color intensities is clamped to the endpoints of the range.</p>\r\n<p>&nbsp;</p>\r\n<p>If this is indeed a transcription problem, correcting it would remove the clamping effect from the range endpoints, resulting in better resolution at the extreme ends of the measurement spectrum.</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp; 0:&nbsp; 1270&nbsp; 1132&nbsp; 1297<br>\r\n&nbsp; 1:&nbsp;&nbsp;&nbsp; 27&nbsp;&nbsp;&nbsp; 98&nbsp;&nbsp;&nbsp; 17<br>\r\n&nbsp; 2:&nbsp;&nbsp;&nbsp; 17&nbsp;&nbsp;&nbsp; 40&nbsp;&nbsp;&nbsp; 15<br>\r\n&nbsp; 3:&nbsp;&nbsp;&nbsp; 15&nbsp;&nbsp;&nbsp; 27&nbsp;&nbsp;&nbsp; 15<br>\r\n&nbsp; 4:&nbsp;&nbsp;&nbsp; 15&nbsp;&nbsp;&nbsp; 17&nbsp;&nbsp;&nbsp;&nbsp; 0<br>\r\n&nbsp; 5:&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp; 15&nbsp;&nbsp;&nbsp; 22<br>\r\n&nbsp; 6:&nbsp;&nbsp;&nbsp; 22&nbsp;&nbsp;&nbsp; 15&nbsp;&nbsp;&nbsp; 14<br>\r\n&nbsp; 7:&nbsp;&nbsp;&nbsp; 14&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp; 13<br>\r\n&nbsp; 8:&nbsp;&nbsp;&nbsp; 13&nbsp;&nbsp;&nbsp; 22&nbsp;&nbsp;&nbsp; 15<br>\r\n&nbsp; 9:&nbsp;&nbsp;&nbsp; 15&nbsp;&nbsp;&nbsp; 14&nbsp;&nbsp;&nb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&nbsp;&nbsp;&nbsp; 5&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp;&nbsp;&nbsp;&nbsp; 0</p>\r\n<p>&nbsp;</p>",
  "messages": [
    {
      "id": "7606",
      "postDate": "01/01/2012 04:07:59",
      "content": "<p>If I take any frame of any of video, such as the first frame of devel01/K_1.avi and extract it as a bitmap I get a 320x240 B&amp;W image with 211 unique colors.</p>\r\n<p>&nbsp;</p>\r\n<p>I make a histogram of the colors. Essentially, I count the number of pixels where Red == 1, the number where Red == 2, and so on. I've excerpted the beginning part of this table below. The left-hand column is the color index, with &quot;0&quot; being &quot;black&quot;, the\r\n next column is Red, then Green, then Blue . There are a large number of counts assigned to RGB=[0,0,0], reflecting the proportionally large number of black pixels in this image.</p>\r\n<p>&nbsp;</p>\r\n<p>If you look at any individual column, you'll notice that there is a regular repeating &quot;0&quot; every seven positions. In the red column, these zeroes are at positions 5, 12, 19, 26, and so on. This pattern goes on for the entire histogram, and is fixed for all\r\n scenes in all videos I've examined so far (a very large number... it hasn't finished yet.)</p>\r\n<p>&nbsp;</p>\r\n<p>Normally I would consider this a quantization effect of the hardware. The hardware only has a resolution of 211 possible depths, and this is mapped into the 256 range of an RGB image. Zeroes are inserted, no problem, this is standard hardware behaviour.</p>\r\n<p>&nbsp;</p>\r\n<p>My question is this: If you compare the three columns, note that the Green and Blue columns also have zeroes... but these are\r\n<em>offset</em> from the zeroes in the red column. The green zeroes are two ahead of the red ones, and the blue zeroes are one behind.</p>\r\n<p>&nbsp;</p>\r\n<p>Taking a color as an example, there are 22 pixels which have Red == 6. All of these have Green == 8 and Blue == 5 in the image, indicating that the colors match the offsets in the table as well as the zeroes.</p>\r\n<p>&nbsp;</p>\r\n<p>I'm led to the hypothesis that the Kinect data has a bug in the transcription mechanism. The underlying hardware generates depth information quantized to 211 levels, but when this information is translated into RGB the color channels get &quot;out of sync&quot; with\r\n each other. The normalization algorithm is somehow skewed - averaging the R&#43;G&#43;B components is incorrect - one of the channels is correct, and the skewness of the other channels will introduce noise into the renormalization calculation.</p>\r\n<p>&nbsp;</p>\r\n<p>It would appear that the correct normalization procedure is to use one channel (probably Green) to calculate the original depth data.</p>\r\n<p>&nbsp;</p>\r\n<p>Taking Red == 1 as an example, the corresponding Green should be 3 and Blue should be -1. All pixels which have Red == 1 have Green = 3 and Blue == 0. This indicates that the offset in color intensities is clamped to the endpoints of the range.</p>\r\n<p>&nbsp;</p>\r\n<p>If this is indeed a transcription problem, correcting it would remove the clamping effect from the range endpoints, resulting in better resolution at the extreme ends of the measurement spectrum.</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp; 0:&nbsp; 1270&nbsp; 1132&nbsp; 1297<br>\r\n&nbsp; 1:&nbsp;&nbsp;&nbsp; 27&nbsp;&nbsp;&nbsp; 98&nbsp;&nbsp;&nbsp; 17<br>\r\n&nbsp; 2:&nbsp;&nbsp;&nbsp; 17&nbsp;&nbsp;&nbsp; 40&nbsp;&nbsp;&nbsp; 15<br>\r\n&nbsp; 3:&nbsp;&nbsp;&nbsp; 15&nbsp;&nbsp;&nbsp; 27&nbsp;&nbsp;&nbsp; 15<br>\r\n&nbsp; 4:&nbsp;&nbsp;&nbsp; 15&nbsp;&nbsp;&nbsp; 17&nbsp;&nbsp;&nbsp;&nbsp; 0<br>\r\n&nbsp; 5:&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp; 15&nbsp;&nbsp;&nbsp; 22<br>\r\n&nbsp; 6:&nbsp;&nbsp;&nbsp; 22&nbsp;&nbsp;&nbsp; 15&nbsp;&nbsp;&nbsp; 14<br>\r\n&nbsp; 7:&nbsp;&nbsp;&nbsp; 14&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp; 13<br>\r\n&nbsp; 8:&nbsp;&nbsp;&nbsp; 13&nbsp;&nbsp;&nbsp; 22&nbsp;&nbsp;&nbsp; 15<br>\r\n&nbsp; 9:&nbsp;&nbsp;&nbsp; 15&nbsp;&nbsp;&nbsp; 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\n&nbsp;32:&nbsp;&nbsp;&nbsp;&nbsp; 5&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp;&nbsp;&nbsp;&nbsp; 0</p>\r\n<p>&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "7625",
      "postDate": "01/02/2012 21:10:01",
      "content": "<p>Oh, I forgot to ask my question! :-)</p>\r\n<p>&nbsp;</p>\r\n<p>The first step in signal processing is to run the data through a transform which removes sensor effects.</p>\r\n<p>&nbsp;</p>\r\n<p>For the Kinect data, that would involve skipping over the periodic zeroes to reconstruct the data as a continuous spectrum of intensities.</p>\r\n<p>&nbsp;</p>\r\n<p>My question: Is this appropriate for all Kinects? In particular, will the final evaluation data have the repeating zeroes artifact?</p>",
      "rawMarkdown": "",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 7625,
      "author_name": "rajstennajbarrabas",
      "author_url": "",
      "post_date": "01/02/2012 21:10:01",
      "content": "<p>Oh, I forgot to ask my question! :-)</p>\r\n<p>&nbsp;</p>\r\n<p>The first step in signal processing is to run the data through a transform which removes sensor effects.</p>\r\n<p>&nbsp;</p>\r\n<p>For the Kinect data, that would involve skipping over the periodic zeroes to reconstruct the data as a continuous spectrum of intensities.</p>\r\n<p>&nbsp;</p>\r\n<p>My question: Is this appropriate for all Kinects? In particular, will the final evaluation data have the repeating zeroes artifact?</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "7606": "",
    "7625": ""
  },
  "source": "meta"
}