how to Save RGBD video from Kinect using OpenCV
Hello Everyone,
I tried saving the depth video from the below code but I am not able to , could anyone help me as how can I save the Depth frames/video.
import freenect
import cv2
import numpy as np
def get_video():
array,_ = freenect.sync_get_video()
array = cv2.cvtColor(array,cv2.COLOR_RGB2BGR)
return array
def get_depth():
array,_ = freenect.sync_get_depth()
array = array.astype(np.uint8)
return array
if __name__ == "__main__":
while 1:
#get a frame from RGB camera
frame = get_video()
#get a frame from depth sensor
depth = get_depth()
#display RGB image
cv2.imshow('RGB image',frame)
#display depth image
cv2.imshow('Depth image',depth)
# quit program when 'esc' key is pressed
k = cv2.waitKey(5) & 0xFF
if k == 27:
break
cv2.destroyAllWindows()
and the problem is ?
Must you use Python, or is C++ good? Also, which version of the Kinect are you using... Xbox 360 or Xbox One?
its XBOX 360.....and Python
You can try
OpenEXR
image file format.I usually use this format when saving the depth map from Blender and when I want to read it with OpenCV.
Other file formats that allow saving 16 bits or more are good also.