简体   繁体   English

为什么kinect v1中保存的深度图像太黑

[英]Why saved depth image is too black from kinect v1

I think it is a simple question regarding to depth image. 我认为这是一个关于深度图像的简单问题。 But I have been confused for a while. 但是我已经一阵困惑了。

So I use cv2 in Python to save raw depth image from Kinect v1 sensor. 所以我在Python中使用cv2来保存Kinect v1传感器的原始深度图像。 However, it comes almost purely black. 但是,它几乎是纯黑色的。

在此处输入图片说明

However, I noticed that it is not pure black as I rotate the image I can recognize the shape in the image. 但是,我注意到它不是纯黑色,因为我旋转图像时可以识别图像中的形状。 I also check the pixel value where most of values are larger than 255. 我还会检查大多数值大于255的像素值。

I am quite confused why this comes out as such black since I downloaded an dataset with depth image for comparison. 我很困惑为什么会这么黑,因为我下载了带有深度图像的数据集进行比较。 It shows more reasonable as : 它显示为更合理: 在此处输入图片说明

However, I also checked the pixel value it has. 但是,我还检查了它的像素值。 Most of them are larger than 255, too. 它们中的大多数也大于255。 Am I doing something wrong to my own depth image? 我对自己的深度图像做错了吗?

Any comment are appreciated! 任何评论表示赞赏!

Your image is 16-bit, meaning that the range of the pixel brightnesses is 0-65535. 您的图像是16位的,这意味着像素亮度的范围是0-65535。

However, the mean value is 693 and the max is 1567, so your brightest pixel is only 1567/65535, or 2% of the way from black to white, or very dark! 但是,平均值为693,最大值为1567,因此,您最亮的像素仅为1567/65535,即从黑色到白色的2%,或者非常暗!

I checked with ImageMagick as follows: 我用ImageMagick进行了如下检查:

identify -verbose yourImage.png

Output 产量

Image: g5QB7.png
  Format: PNG (Portable Network Graphics)
  Mime type: image/png
  Class: DirectClass
  Geometry: 640x480+0+0
  Units: Undefined
  Colorspace: Gray
  Type: Grayscale
  Base type: Undefined
  Endianess: Undefined
  Depth: 16-bit
  Channel depth:
    Gray: 16-bit                                   <--- see here
  Channel statistics:
    Pixels: 307200
    Gray:
      min: 0  (0)
      max: 1567 (0.0239109)                        <--- see here
      mean: 693.437 (0.0105812)                    <--- and here
      standard deviation: 291.677 (0.00445071)
      kurtosis: 0.679889
      skewness: -0.598566
      entropy: 0.936256
  Colors: 480
  Histogram:
     26207: (    0,    0,    0) #000000000000 gray(0)
         8: (  447,  447,  447) #01BF01BF01BF gray(0.682078%)
         7: (  448,  448,  448) #01C001C001C0 gray(0.683604%)
        68: (  449,  449,  449) #01C101C101C1 gray(0.68513%)
        76: (  450,  450,  450) #01C201C201C2 gray(0.686656%)
       136: (  451,  451,  451) #01C301C301C3 gray(0.688182%)
        43: (  452,  452,  452) #01C401C401C4 gray(0.689708%)
  ...
  ...
  ...
         1: ( 1567, 1567, 1567) #061F061F061F gray(2.39109%)
  Rendering intent: Undefined
  Gamma: 0.454545
  Matte color: grey74
  Background color: white
  Border color: srgb(223,223,223)
  Transparent color: none
  Interlace: None
  Intensity: Undefined
  Compose: Over
  Page geometry: 640x480+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Zip
  Orientation: Undefined
  Properties:
    date:create: 2018-06-26T21:39:17+01:00
    date:modify: 2018-06-26T21:39:17+01:00
    png:IHDR.bit-depth-orig: 16
    png:IHDR.bit_depth: 16
    png:IHDR.color-type-orig: 0
    png:IHDR.color_type: 0 (Grayscale)
    png:IHDR.interlace_method: 0 (Not interlaced)
    png:IHDR.width,height: 640, 480
    signature: ec5dcdec9a351d5e76cc14257fa91bd22c5d496c0aa122e2d933c8521512b090
  Artifacts:
    verbose: true
  Tainted: False
  Filesize: 100051B
  Number pixels: 307200
  Pixels per second: 30.72MB
  User time: 0.000u
  Elapsed time: 0:01.009
  Version: ImageMagick 7.0.7-35 Q16 x86_64 2018-05-25 https://www.imagemagick.org

You can normalise to the full range of 0-65535 like this: 您可以像这样将整个范围归一化为0-65535:

convert YourImage.png -normalize result.png

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM