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

时间:2018-06-26 20:17:41

标签: python opencv image-processing kinect grayscale

我认为这是关于深度图像的简单问题。但是我已经一阵困惑了。

因此,我在Python中使用cv2来保存Kinect v1传感器的原始深度图像。但是,它几乎是纯黑色的。

enter image description here

但是,我注意到在旋转图像时它不是纯黑色,我可以识别图像中的形状。我还会检查大多数值大于255的像素值。

我很困惑为什么会这么黑,因为我下载了带有深度图像的数据集进行比较。它显示为更合理: enter image description here

但是,我还检查了它的像素值。它们中的大多数也大于255。我对自己的深度图像做错了吗?

任何评论表示赞赏!

1 个答案:

答案 0 :(得分:5)

您的图像是16位的,这意味着像素亮度的范围是0-65535。

但是,平均值是693,最大值是1567,因此您最亮的像素只有1567/65535,或者说是从黑到白的2%,或者非常暗!!

我通过 ImageMagick 进行了如下检查:

identify -verbose yourImage.png

输出

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

您可以像这样将整个范围归一化为0-65535:

convert YourImage.png -normalize result.png

enter image description here