import pyk4a
from pyk4a import Config, PyK4A, ColorResolution

import cv2
import numpy as np

k4a = PyK4A(Config(color_resolution=ColorResolution.RES_720P,
                   depth_mode=pyk4a.DepthMode.NFOV_UNBINNED,
                   synchronized_images_only=True, ))
k4a.connect()

# getters and setters directly get and set on device
k4a.whitebalance = 4500
assert k4a.whitebalance == 4500
k4a.whitebalance = 4510
assert k4a.whitebalance == 4510

while 1:
    img_color = k4a.get_capture(color_only=True)
    # img_color, img_depth = k4a.get_capture()  # Would also fetch the depth image
    if np.any(img_color):
        cv2.imshow('k4a', img_color[:, :, :3])
        key = cv2.waitKey(10)
        if key != -1:
            cv2.destroyAllWindows()
            break
k4a.disconnect()

3de05ca307f358a244445adc7767284145de2784
<mask token>

<mask token>
k4a.connect()
<mask token>
assert k4a.whitebalance == 4500
<mask token>
assert k4a.whitebalance == 4510
while 1:
    img_color = k4a.get_capture(color_only=True)
    if np.any(img_color):
        cv2.imshow('k4a', img_color[:, :, :3])
        key = cv2.waitKey(10)
        if key != -1:
            cv2.destroyAllWindows()
            break
k4a.disconnect()

<mask token>
k4a = PyK4A(Config(color_resolution=ColorResolution.RES_720P, depth_mode=
    pyk4a.DepthMode.NFOV_UNBINNED, synchronized_images_only=True))
k4a.connect()
k4a.whitebalance = 4500
assert k4a.whitebalance == 4500
k4a.whitebalance = 4510
assert k4a.whitebalance == 4510
while 1:
    img_color = k4a.get_capture(color_only=True)
    if np.any(img_color):
        cv2.imshow('k4a', img_color[:, :, :3])
        key = cv2.waitKey(10)
        if key != -1:
            cv2.destroyAllWindows()
            break
k4a.disconnect()

import pyk4a
from pyk4a import Config, PyK4A, ColorResolution
import cv2
import numpy as np
k4a = PyK4A(Config(color_resolution=ColorResolution.RES_720P, depth_mode=
    pyk4a.DepthMode.NFOV_UNBINNED, synchronized_images_only=True))
k4a.connect()
k4a.whitebalance = 4500
assert k4a.whitebalance == 4500
k4a.whitebalance = 4510
assert k4a.whitebalance == 4510
while 1:
    img_color = k4a.get_capture(color_only=True)
    if np.any(img_color):
        cv2.imshow('k4a', img_color[:, :, :3])
        key = cv2.waitKey(10)
        if key != -1:
            cv2.destroyAllWindows()
            break
k4a.disconnect()

import pyk4a
from pyk4a import Config, PyK4A, ColorResolution

import cv2
import numpy as np

k4a = PyK4A(Config(color_resolution=ColorResolution.RES_720P,
                   depth_mode=pyk4a.DepthMode.NFOV_UNBINNED,
                   synchronized_images_only=True, ))
k4a.connect()

# getters and setters directly get and set on device
k4a.whitebalance = 4500
assert k4a.whitebalance == 4500
k4a.whitebalance = 4510
assert k4a.whitebalance == 4510

while 1:
    img_color = k4a.get_capture(color_only=True)
    # img_color, img_depth = k4a.get_capture()  # Would also fetch the depth image
    if np.any(img_color):
        cv2.imshow('k4a', img_color[:, :, :3])
        key = cv2.waitKey(10)
        if key != -1:
            cv2.destroyAllWindows()
            break
k4a.disconnect()
