Capturing in Wide-Angle with the OAK-D Pro camera
If you haven'haven’t already, please make sure to set upcomplete all the prerequisites availableoutlined in our first introduction to the OAK-D Pro camera available here before followingstarting this tutorial. YouRefer can also followto the tutorialguide to set up the OAK Device CHOP and OAK Select TOP.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 TheText DAT with the following provides a couple of customisation examples:code:
1. Capturing in Wide-Angle
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.