Kinect raw depth to distance in meters

The correct answer is actually a comment on your question. The number given is actually a distance in millimetres. To get this number, you either need to use a skeleton joint and call DepthImageFrame’s MapFromSkeletonPoint or shift the raw short value right by DepthImageFrame.PlayerIndexBitmaskWidth. E.g. Skeleton using (var skeletonFrame= e.OpenSkeletonFrame()) using (var depthFrame = e.OpenDepthImageFrame()) … Read more

OpenCV: How to visualize a depth image

According to the documentation, the function imshow can be used with a variety of image types. It support 16-bit unsigned images, so you can display your image using cv::Mat map = cv::imread(“image”, CV_LOAD_IMAGE_ANYCOLOR | CV_LOAD_IMAGE_ANYDEPTH); cv::imshow(“window”, map); In this case, the image value range is mapped from the range [0, 255*256] to the range [0, … Read more

Hitting Maximum Recursion Depth Using Pickle / cPickle

From the docs: Trying to pickle a highly recursive data structure may exceed the maximum recursion depth, a RuntimeError will be raised in this case. You can carefully raise this limit with sys.setrecursionlimit(). Although your trie implementation may be simple, it uses recursion and can lead to issues when converting to a persistent data structure. … Read more

How to render depth linearly in modern OpenGL with gl_FragCoord.z in fragment shader?

but I still don’t know whether or not the gl_FragCoord.z is linear. Whether gl_FragCoord.z is linear or not depends on, the projection matrix. While for Orthographic Projection gl_FragCoord.z is linear, for Perspective Projection it is not linear. In general, the depth (gl_FragCoord.z and gl_FragDepth) is calculated as follows (see GLSL gl_FragCoord.z Calculation and Setting gl_FragDepth): … Read more

Unexpected ConvertTo-Json results? Answer: it has a default -Depth of 2

Answer ConvertTo-Json has a -Depth parameter: Specifies how many levels of contained objects are included in the JSON representation. The default value is 2. Example To do a full round-trip with a JSON file you need to increase the -Depth for the ConvertTo-Json cmdlet: $Json | ConvertFrom-Json | ConvertTo-Json -Depth 9 TL;DR Probably because ConvertTo-Json … Read more