Based fork of https://github.com/Optophys-Lab/FreiPose_Recorder
It allows to view/record video from a camera rig using Basler cameras. It includes a GUI for visualization of video stream as well as changing camera settings. PyQTgraph - toolbox allows to mark certain points in the view, visualize a grid, and pan/zoom the view.
Select and install suitable release of Pylon's libraries from: https://www.baslerweb.com/de/downloads/downloads-software/#type=pylonsoftware
(Optional) Create and activate a conda environment
conda env create -n SurViewer python=3.11
conda activate SurViewer
Install the following python packages (preferably in a virtual environment):
git clone https://github.com/arturoptophys/Surgery_Viewer.git
cd Surgery_Viewer
pip install -e .
To Run the GUI from the commandline:
#make sure conda env is activated
#make sure $CWD is Surgery_Viewer
python GUI_run.py
To more easily identify your cameras you can give them custom names.
After first connection to the camera, the serial number is saved in the cameras.json top level file. This file is used to load the camera id on subsequent runs. It's a jsonized ditionary with SN as key and camera name and context as value. Context is an int which is used to identify the frames from each camera. Its being hashed from camera name to prevent duplicates.
After first connection to the camera you can modify cameras.json to give your cameras unique names.
Can be found in configs/params.py file. It contains the following fields:
TODO
Camera settings are loaded from the default.settings.json file. Upon connection to the camera, the settings are loaded, if this file is not available dialog asks for any other settings files.
default.settings.json is an jsonized dictionary containing parameters for each camera (exposure time, gain, colormode, white balance values) and further general settings, such as save path for videos, preferred fps(recording and play fps for free-running mode and only play fps for trigger mode, there the recording fps is dictated by the trigger frequency), codec used for video encoding, crf defining the compression level(higher value - higher compression).