![]() |
PointSpread® Vidu™ Software Development Kit
V1
Vidu SDK
|
We use pybind11
tool to export Vidu API classes and functions to python through a dynamically loadable module, e.g. the pyvidu.cpython-38-x86_64-linux-gnu.so
in Linux or pyvidu.cp38-win_amd64.pyd
for Windows. The class PDdevice
and PDstream
are well exposed to python. Thus, developers can use a Python-ish way to control the Okulo camera by simply executing import pyvidu
. Below we show a simple script that also retrieves the camera's intrinsic and extrinsic parameters as we have done before.
We import the pyvidu
and opencv
library, and initialize empty intrinsic
, extrinsic
and device
object through vidu.intrinsics()
, vidu.extrinsics()
, and vidu.PDdevice()
. By device.init()
, the program tries to connect to a camera. If there is a powered-up camera connected to the host computer, we will step forward to device.getStreamNum()
. Then we initialize the PDstream
object stream
correspondingly to each stream and get their intrinsics and extrinsics by stream.getCamPara(intrinsic, extrinsic)
. The whole procedure is the same as in its C++ version code in code sample