Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/281.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 为什么kinect v1保存的深度图像太黑_Python_Opencv_Image Processing_Kinect_Grayscale - Fatal编程技术网

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

Python 为什么kinect v1保存的深度图像太黑,python,opencv,image-processing,kinect,grayscale,Python,Opencv,Image Processing,Kinect,Grayscale,我认为这是一个关于深度图像的简单问题。但我已经困惑了一段时间 所以我在Python中使用cv2保存Kinect v1传感器的原始深度图像。然而,它几乎是纯黑色的 然而,我注意到,当我旋转图像时,它不是纯黑色的,我可以识别图像中的形状。我还检查像素值,其中大多数值大于255 因为我下载了一个带有深度图像的数据集进行比较,所以我很困惑为什么会出现这样的黑色。更合理的是: 但是,我也检查了它的像素值。它们中的大多数也大于255。我对自己的深度图像做了什么错事吗 任何评论都将不胜感激 您的图像为16

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

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

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

因为我下载了一个带有深度图像的数据集进行比较,所以我很困惑为什么会出现这样的黑色。更合理的是:

但是,我也检查了它的像素值。它们中的大多数也大于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

convert YourImage.png -normalize result.png