This is the code i have and the preview is not working from Jetson Nano B01 to Oak D Lite
##INITIAL PIPELINE
import depthai as dai
# Create a pipeline
pipeline = dai.Pipeline()
# Define the camera source
cam = pipeline.createColorCamera()
cam.setBoardSocket(dai.CameraBoardSocket.RGB)
cam.setResolution(dai.ColorCameraProperties.SensorResolution.THE_1080_P)
# Create an XLinkOut to output the video
xout = pipeline.createXLinkOut()
xout.setStreamName("video")
# Link the camera output to the XLinkOut
cam.video.link(xout.input)
# Connect to the device
with dai.Device(pipeline) as device:
# Pipeline is created and the device is connected
print("Successfully connected to the device!")
### LEFT RIGHT CONFIGG
from depthai_sdk.managers import PipelineManager
# declaring the pipeline
pm = PipelineManager()
# after the declaration, we define its sources
# color camera
pm.createColorCam(xout=True)
# left camera
pm.createLeftCam(xout=True)
# right camera
pm.createRightCam(xout=True)
# depth
pm.createDepth(useDepth=True)
# connecting to device
with dai.Device(pm.pipeline) as device:
# pipeline is created and the device is connected
print("Successfully configured the sources!")
### FPS AND SIZE
# declaring the pipeline
pipeline = dai.Pipeline()
# color camera
cam_rgb = pipeline.createColorCamera()
cam_rgb.setPreviewSize(300, 300)
cam_rgb.setInterleaved(False)
cam_rgb.setFps(40)
# connecting to device
with dai.Device(pipeline) as device:
# pipeline is created and the device is connected
print("Successfully connected to the device!")
### PREVIEW MANAGER
from depthai_sdk import Previews
from depthai_sdk.managers import PipelineManager, PreviewManager
import depthai as dai
# create pipeline
pm = PipelineManager()
# creating color source
pm.createColorCam(xout=True)
# connecting to the device
with dai.Device(pm.pipeline) as device:
# define configs for above sources
pv = PreviewManager(display=[Previews.color.name])
# create stream queues
pv.createQueues(device)
while True:
# prepare and show streams
pv.prepareFrames()
pv.showFrames()
### CV2 PREVIEW
import cv2
# define sources (color, left, right, depth)
# creating color source
pm.createColorCam(xout=True)
pm.createLeftCam(xout=True)
pm.createRightCam(xout=True)
pm.createDepth(useDepth=True)
with dai.Device(pm.pipeline) as device:
# define configs for above sources
pv = PreviewManager(display=[Previews.color.name, Previews.left.name, Previews.right.name, Previews.depth.name])
create stream queues
pv.createQueues(device)
while True:
# prepare and show streams
pv.prepareFrames()
pv.showFrames()
# end program with 'q'
if cv2.waitKey(1) == ord('q'):
break