Skip to content
⚡ Developer documentation for INFINICAM, the real-time high-speed camera (UC-1.1 / GbE-2)

Python Sample Program Collection

This section introduces sample programs that run the INFINICAM GbE-2 from Python. Every sample uses pypuclib, the dedicated INFINICAM library. Captured images come out as NumPy arrays, so you can pass them straight to libraries such as OpenCV and PyTorch.

Basics (connecting, capturing, and saving)

Section titled “Basics (connecting, capturing, and saving)”

The most basic samples: connect to the camera, then capture and save one image. Try them from the top down.

Samples that process captured images with image processing and machine learning libraries.

Samples for live display, continuous capture at 1,000 fps, and fast decoding that takes advantage of INFINICAM’s compression.

Changing capture settings and external sync

Section titled “Changing capture settings and external sync”

Samples that change the frame rate or image size, or capture in step with an external signal.


Sample Program Main libraries Level What you learn
HelloWorld hello_camera.py pypuclib Beginner Connecting to the camera, reading camera information
SingleImage (PGM) single_image.py NumPy Beginner Capturing one frame, decoding, saving as PGM
SingleImage (PNG) single_image_png.py OpenCV Beginner Saving a NumPy array as PNG
SingleImage (color) single_image_color.py OpenCV Beginner Detecting a color model, saving a color image
OpenCV image processing opencv_process.py OpenCV Intermediate Blur and edge detection, showing a window
torchvision preprocessing torchvision_process.py torch / torchvision Intermediate Converting to a tensor, resizing and normalizing
OpenCV LiveView opencv_live.py OpenCV Intermediate Continuous transfer and real-time display
Continuous high-speed capture continuous_capture.py threading / queue Advanced Receiving 1,000 fps, decoding in parallel with threads
ROI decoding single_image_roi.py pypuclib Intermediate Decoding only part of the image (in multiples of 8)
DC component extraction single_image_dc.py pypuclib Intermediate Building a 1/8-scale image quickly
Changing capture settings single_image_settings.py pypuclib Beginner Changing resolution, frame rate, and shutter speed
External sync external_sync.py pypuclib Intermediate Setting up external sync, handling a missing signal