Capturing in Wide-Angle with the OAK-D Pro camera
If you haven’t already, please complete all the prerequisites outlined in our introduction to the OAK-D Pro camera before starting this tutorial. Refer to the guide to set up the OAK Device CHOP and OAK Select TOP components.
In this tutorial, we’ll program the camera to generate a wide-angle image using its vision system. To do this, replace the script in the Text DAT with the following code:
import depthai as dai
def onInitialize(oakDeviceOp, callCount):
return 0
def onInitializeFail(oakDeviceOp):
parent().addScriptError(oakDeviceOp.scriptErrors())
return
def onReady(oakDeviceOp):
return
def onStart(oakDeviceOp):
return
def whileRunning(oakDeviceOp):
return
def onDone(oakDeviceOp):
return
def createPipeline(oakDeviceOp):
pipeline = dai.Pipeline()
cam = pipeline.create(dai.node.ColorCamera)
xoutIsp = pipeline.create(dai.node.XLinkOut)
xoutPrev = pipeline.create(dai.node.XLinkOut)
xoutIsp.setStreamName('isp')
xoutPrev.setStreamName('preview')
cam.setResolution(dai.ColorCameraProperties.SensorResolution.THE_12_MP)
cam.setInterleaved(False)
cam.setIspScale(1, 2)
cam.setPreviewKeepAspectRatio(False)
cam.setPreviewSize(1280, 720) # or any desired preview resolution
cam.preview.link(xoutPrev.input) # wide-angle output
return pipeline
Once you've replaced the script:
-
Click the arrow next to the Stream parameter in OAK Select TOP.
-
Select
'preview'
to visualise the wide-angle image.