One unified, vendor-agnostic Python API for industrial machine-vision cameras (Hikrobot, Basler, Allied Vision, GenICam / GigE Vision).
Swap camera hardware without rewriting your computer vision pipelines, inspection algorithms, or AI inference scripts.
- Vendor-Agnostic Interface: A single
CameraDevicebase class standardizes enumeration, connection, triggering, streaming, and parameter configuration across different manufacturers. - Built-in Camera Simulator: Develop, debug, and test your vision applications without physical camera hardware attached. Generates color bars, noise, checkerboard patterns, and configurable synthetic defects.
- Pluggable Driver Architecture: Dynamic registry supporting multiple backends (
simulator,hikrobot,genicam/basler). - Zero-Copy NumPy / OpenCV Integration: Acquired frames are directly available as NumPy arrays with fast BGR/RGB conversions.
- Context Manager Support: Clean lifecycle management (
with manager.open("sim:0") as cam:). - Command Line Interface (
dynamic-mv): Instant camera discovery, live parameter query, and frame capture from the terminal.
+-------------------------------------------------------------+
| Your Application / AI Pipeline |
+-------------------------------------------------------------+
|
[ CameraManager ]
|
+--------------------+--------------------+
| | |
[ SimulatorDriver ] [ HikrobotDriver ] [ GenICamDriver ]
(Virtual/Demo) (dynamic-hikrobot) (Basler/GigE/USB3)
pip install dynamic-machinevisionWith optional CLI and image preview dependencies:
pip install "dynamic-machinevision[cli]"from dynamic_machinevision import CameraManager
# Initialize manager
manager = CameraManager()
# Discover available cameras across all registered drivers
devices = manager.list_devices()
for dev in devices:
print(f"[{dev.driver}] {dev.name} (SN: {dev.serial_number})")
# Open camera using URI or serial number
with manager.open("sim:0") as cam:
# Set standard parameters
cam.set_parameter("exposure_time_us", 15000.0)
cam.set_parameter("gain_db", 6.0)
# Start stream and grab frame
cam.start_grabbing()
frame = cam.grab(timeout_ms=1000)
print(f"Captured frame #{frame.frame_id}: {frame.width}x{frame.height} ({frame.pixel_format})")
# Use with OpenCV or NumPy
image_bgr = frame.to_bgr()# List all connected and simulated cameras
dynamic-mv list
# Grab a test frame and save to disk
dynamic-mv grab --device sim:0 --pattern checkerboard --output frame.png
# Query camera parameters
dynamic-mv info --device sim:0dynamic-machinevision is an open-source component of the Dynamic Industrial Power ecosystem:
dynamic-hikrobot— Dedicated Pythonic SDK for Hikrobot machine-vision cameras.dynamic-camera-mcp— Model Context Protocol server exposing industrial cameras to AI agents.dynamic-inspection— Industrial QC inspection engine with ROI and ONNX models.dynamic-edge-runtime— High-throughput ONNX edge runtime & benchmarks.dynamic-modbus-bridge— Modbus TCP/RTU bridge connecting PLCs with vision systems.dynamic-opcua-bridge— OPC UA bridge exposing vision/AI metrics to SCADA/MES.dynamic-mqtt-gateway— Streaming camera metrics and AI inspection events over MQTT.
MIT License — Copyright (c) 2026 Dynamic Industrial Power.