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

标签 python opencv image-processing kinect grayscale

我认为这是一个关于深度图像的简单问题。但我有一段时间很困惑。

所以我在 Python 中使用 cv2 来保存来自 Kinect v1 传感器的原始深度图像。然而,它几乎是纯黑色的。

enter image description here

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

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

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

欢迎任何评论!

最佳答案

您的图像是 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

关于python - 为什么 kinect v1 保存的深度图像太黑,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51050784/

相关文章:

python - 基于多个键之一对 Pandas 中的一系列值求和?

python - 从 python wx.lib.calendar 获取选定的日期

c - 如何在 OpenCV 中显示流图像?

python - 有没有办法可视化 haar 级联文件?

python - 如何使用 OpenCV 在图像上标记数字并绘制圆圈

c++ - 抗锯齿 PPM 文件

python - 在opencv python中获取图像的亮度和对比度

python - 网络摄像头在 opencv-python 和 opencv-contrib-python 的 pip 版本中不起作用

python - Django - 在基于类的 View 上使用 reverse()

c++ - OpenCV:忽略类似文本的轮廓