-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Canwe use mapper functions on already acquired images #2
Comments
Most of the library's functions require the actual depth values from Kinect, meaning the distance of the object from the camera. However, a saved Depth Frame or Color Frame does not contain any information about the depth, they only represent pixel values. I don't think that you can map color to depth without using a Kinect device because you need acquire the depth values in meters from the Kinect. |
This is the code to Map Color to Depth, however without the Kinect running i don't think that it will produce any result. Most likely a black image. import numpy as np kinect = PyKinectRuntime.PyKinectRuntime(PyKinectV2.FrameSourceTypes_Depth | PyKinectV2.FrameSourceTypes_Color) """ import your images here """ color2depth_points_type = _DepthSpacePoint * np.int(1920 * 1080) Also if you want to Map Depth Frames to Color Space you should use the color_2_depth function. Or the code below: import numpy as np kinect = PyKinectRuntime.PyKinectRuntime(PyKinectV2.FrameSourceTypes_Depth | PyKinectV2.FrameSourceTypes_Color) """ import your images here """ depth2color_points_type = _ColorSpacePoint * np.int(512 * 424) But again I don't think it would produce something useful. |
Hey thanks for the quick reply, The Kinect depth image i have raw depth value (with values up to 7905). Also, in the line: kinect._depth_frame_data- shouldn't this be replace with original depth frame, that we read? |
In reality, the array that the Kinect returns when you call the function kinect.get_last_depth_frame() is a (424*512) array that is made from the kinect._depth_frame_data using the next command: depth_frame = np.copy(np.ctypeslib.as_array(kinect._depth_frame_data, shape=(kinect._depth_frame_data_capacity.value,))) So there is a correlation between the depth_frame_data and the depth_frame. If you have stored the depth frame that the function kinect.get_last_frame() returns then you have to transformed it to the depth_frame_data type using the above type. depth_frame_data = ctypes.POINTER(ctypes.c_ushort) |
I have already acquired rgb-d dataset from kinect2. Can this library be used for already acquired images?
The text was updated successfully, but these errors were encountered: