def run_ximea():
with XimeaCamera(n_lines=128, exposure_ms=1, processing_lvl = -1, pkl_path="",json_path='../assets/cam_settings_ximea.json') as cam:
cam.start_cam()for i in tqdm(range(cam.n_lines)):
cam.put(cam.get_img())
cam.stop_cam()
#fig = cam.show(robust=True)
#fig
Ximea
Ximea Hardware cameras
OpenHSI Ximea Camera Implementations
Tip
This module can be imported using from openhsi.cameras import *
Wrapper class and example code for getting images from the OpenHSI.
Tip
To use the camera, you will need some calibration files. You can also generate these files following this guide which uses the calibrate
module.
XIMEA Camera
Used for the OpenHSI Camera Mark I with a Ximea detetor (with IMX252 sensor, e.g. MX031CG-SY).
Make sure you install the Ximea API beforehand in the instructions https://www.ximea.com/support/wiki/apis/Python
XimeaCamera
XimeaCamera (exposure_ms:float=10, serial_num:str=None)
Core functionality for Ximea cameras
XimeaCameraBase
XimeaCameraBase (exposure_ms:float=10, serial_num:str=None)
Core functionality for Ximea cameras
with XimeaCamera(n_lines=128, exposure_ms=1, processing_lvl = -1, pkl_path="",json_path='../assets/cam_settings_ximea.json') as cam:
cam.collect()
Allocated 251.56 MB of RAM. There was 12433.93 MB available.
xiAPI: ---- xiOpenDevice API:V4.27.07.00 started ----
xiAPI: EAL_IF_xiFAPI_Top::InitializeDevice sn:CEMAU2105019 name:MC031MG-SY-UB
xiAPI: FGTL_SetParam_to_CAL error from CAL: -1015, addr:x27317e
xiAPI: XiApiToGentlParamModel Auto bandwidth measurement finished (396MBps). Safe limit set to: 317MBps
xiAPI: FGTL_SetParam_to_CAL error from CAL: -10009, addr:x201380
xiAPI: ---- Device opened. Model:MC031MG-SY-UB SN:CEMAU2105019 FwF1:01.31 API:V4.27.07.00 ----
Connected to device b'CEMAU2105019'
xiAPI: xiFAPI_Device::AllocateBuffers Allocating buffers. Count:346 OneBuff:756 KiB All:256 MiB Frm:x10c0047
xiAPI: xiAPI error: Expected XI_OK in:../API/xiFAPI/camera_model/XiApiToGentlParamModel.cpp GetHDR/Line:622
xiAPI: Failed to change thread scheduler, check user limit for realtime priority.
100%|█████████████████████████████████████████████████████████████████████| 128/128 [00:00<00:00, 163.96it/s]
xiAPI: xiFAPI_Device::AcquisitionStop - ignored: acquisition is not running
xiAPI: xiCloseDevice
Multiprocessing camera export
Export cameras using the SharedOpenHSI class.