pypuclib is python package for INFINICAM SDK PUCLIB. This package allows user to control INFINICAM UC-1 on python.
infinicam_demo_python_tracking_en.mp4
*This is tracking_sample demo movie.
- Install INFINICAM SDK PUCLIB, driver, and Visual C++ Redistributable 2019.
- See Install section to install pypuclib package.
- See Quick Start section to start programming.
You can install it in any of the following ways:
-
Open command prompt and install using pip from pypi.
pip install pypuclib
If you don't register environment variable for python path, use this command instead.
py -m pip install pypuclib
-
Install from source code.
git clone repositryURL
Move current directory to pypuclib/pypuclib/ and install using this command.
pip install ./
To connect the first detected camera:
cam = CameraFactory().create()
And grab the image:
xferdata = cam.grab()
To decode image, get decoder object from camera and use it like:
decoder = cam.decoder()
img = decoder.decode(xferdata)
Decoded array is numpy array, so now you can use to imageprocessing package like opencv directory.
If you want to use only the resion of interest:
x = 0, y = 0, w = 128, h = 128
img = decoder.decode(xferdata, x, y, w, h)
This can reduce the decoding time.
Use beginXfer and endXfer to get callback from C++.
# xfercallback from c++
def callback(data) :
seq = data.sequenceNo()
if oldSeq != seq:
# avoid same sequence number.
# beginn xfer and start callback background
cam.beginXfer(callback)
~~ # some processing here
cam.endXfer()
-
Install pypuclib using pip.
-
Download following sample source code.
-
Run on python.
python hello_world.py
-
Sample of streaming a live image and saving a bitmap. If a GPU device is available, decoding is done on the GPU. Otherwise, decoding is done on the CPU.
-
Sample of saving videos with high speed streaming.
-
Sample of real-time tracking at 1,000 fps.
-
GUI sample for controlling camera parameters and recording.
-
This sample code implements the a deep learning network to detect objects such as people, cellphones etc.
This repository consists of three projects.
-
Source code of python wrapper of PUCLIB
-
Python sample code using pypuclib
-
Unit test of pypuclib
To build pypuclib, the following environment is required.
- Installed Visual Studio 2019
Don't hesitate to ask any questions or issues on GitHub.