def test_get_color_frame_lx(): from sandbox.sensor.kinectV2 import KinectV2 kinect = KinectV2() color = kinect.get_color() print(color.shape) print(color[0]) plt.imshow(color, origin="lower") plt.show() color = kinect.get_color() plt.imshow(color, origin="lower") plt.show()
def start_mapping(kinect: KinectV2): """ Takes the kinect sensor and create the map to convert color space to depth space Args: kinect: Sensor Returns: pd.Dataframe """ set_device(kinect) df = create_CoordinateMap(kinect.get_frame()) logger.info("CoordinateMap created") return df
def test_get_IR_frame_lx(): from sandbox.sensor.kinectV2 import KinectV2 kinect = KinectV2() IR = kinect.get_ir_frame(min=0, max=6000) print(IR.shape) plt.imshow(IR, origin="lower") plt.colorbar() plt.show() IR = kinect.get_ir_frame(min=0, max=6000) print(IR.shape) plt.imshow(IR, origin="lower") plt.colorbar() plt.show()
def test_get_depth_frame_lx(): from sandbox.sensor.kinectV2 import KinectV2 kinect = KinectV2() frame = kinect.get_frame() print(frame.shape) plt.imshow(frame, origin="lower", cmap="jet") plt.colorbar() plt.show() frame = kinect.get_frame() print(frame.shape) plt.imshow(frame, origin="lower", cmap="jet") plt.colorbar() plt.show()
def start_mapping(kinect: KinectV2): """ Takes the kinect sensor and create the map to convert color space to depth space Args: kinect: Sensor Returns: pd.Dataframe """ # depth_to_color set_device(kinect) set_device_params(kinect) status = kinect._thread_status if status == "running": kinect._stop() depth, _, undistorted_depth, _, _ = registration() _ = depth_to_camera(undistorted_depth) df = create_CoordinateMap(depth.to_array()) logger.info("CoordinateMap created") if status == "running": kinect._run() return df
def test_thread(): from sandbox.sensor.kinectV2 import KinectV2 kinect = KinectV2() kinect._run() rval = True import cv2 while rval: cv2.imshow("color", kinect.get_color()) cv2.imshow("depth", kinect.get_frame()) cv2.imshow("ir", kinect.get_ir_frame()) key = cv2.waitKey(20) if key == 27: # exit on ESC break kinect._stop()
def test_thread_linux(): from sandbox.sensor.kinectV2 import KinectV2 kinect = KinectV2() kinect._run() import time time.sleep(1) print(kinect._depth) print(kinect._ir) print(kinect._color) kinect._stop() kinect._run() time.sleep(1) print(kinect._depth) print(kinect._ir) print(kinect._color) print("working", kinect.get_color())
def test_kinectv2_linux_frame(): from sandbox.sensor.kinectV2 import KinectV2 kinect = KinectV2() kinect.get_linux_frame(typ="all")
def test_init_kinectv2_linux(): from sandbox.sensor.kinectV2 import KinectV2 kinect = KinectV2()
def test_thread_linux(): from sandbox.sensor.kinectV2 import KinectV2 kinect = KinectV2() kinect._run() kinect._stop()