opencv - Simultneous depth and video from kinect -
i want both depth , video streams kinect opencv code. working in linux. have installed libfreenect module depth. however, there 1 device listed in /dev/. now, when connect kinect pc , run
camorama -d /dev/video0
i depth map. then, access device using videocapture in opencv , rgb video. now, if again run camorama command, rgb video time. can't figure out what's happening. want both stream in opencv code. please help.
run python script:
import freenect import cv2 import numpy np functions import * def nothing(x): pass kernel = np.ones((5, 5), np.uint8) def pretty_depth(depth): np.clip(depth, 0, 2**10 - 1, depth) depth >>= 2 depth = depth.astype(np.uint8) return depth while 1: orig = freenect.sync_get_video()[0] orig = cv2.cvtcolor(orig,cv2.color_bgr2rgb) dst = pretty_depth(freenect.sync_get_depth()[0])#input kinect cv2.imshow('disparity', dst) cv2.imshow('rgb',orig) if cv2.waitkey(1) & 0xff == ord('b'): break
Comments
Post a Comment