Code developed for using OAK-D camera
Make sure to have DepthAI API installed, or install it like this
git clone https://github.com/luxonis/depthai.git
cd depthai
python3 install_requirements.py
python3 depthai_demo.py
import depthai as dai
pipeline = dai.Pipeline()
mono = pipeline.createMonoCamera() # create camera node
mono.setBoardSocket(dai.CameraBoardSocket.LEFT) # select a camera
xout = pipeline.createXLinkOut()
xout.setStreamName("left")
mono.out.link(xout.input)
with dai.Device(pipeline) as device:
queue = device.getOutputQueue(name="left")
frame = queue.get()
imOut = frame.getCvFrame()