esrf-bliss / Lima-camera-basler

Lima basler plugin
lima.blissgarden.org
GNU General Public License v3.0
4 stars 26 forks source link

setRoi error on camera construction #31

Closed gjover closed 1 year ago

gjover commented 3 years ago

Using conda package:

lima-camera-basler        1.9.3            py37h6bb024c_0    esrf-bcu
lima-core                 1.9.7            py37h2bc3f7f_0    esrf-bcu
python                    3.7.10          hffdb5ce_100_cpython    conda-forge

Exception: Hardware: setRoi raises on Camera object construction

In [1]: from Lima import Core, Basler

In [2]: cam = Basler.Camera("ccd130")
[2021/03/12 18:42:00.544014] 7f140f792580     *Camera*Basler::Camera::setRoi (/opt/conda/conda-bld/lima-camera-basler_1582408894043/work/src/BaslerCamera.cpp:1386)-Error: Exception(Error): Value = 1296 must be equal or smaller than Max = 1288. [thrown]
---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
<ipython-input-2-6df17cafa0e1> in <module>
----> 1 cam = Basler.Camera("ccd130")

Exception: Hardware: setRoi(/opt/conda/conda-bld/lima-camera-basler_1582408894043/work/src/BaslerCamera.cpp, 1386): Error: Value = 1296 must be equal or smaller than Max = 1288.

The camera is a Basler scA1300-32gm

gjover commented 3 years ago

As a workarround, setting the AOI to full frame with PylonViewerApp avoids the problem.

laurent-claustre commented 3 years ago

I don't understand, you did set a AOI first with PylonViewerApp? What is the max image size of the camera? according to Basler doc you have Scout camera model 1296 px x 966 px. At startup Lima set the Roi to the max image size, get by reading the pylon attributes WidthMax and HeightMax

gjover commented 3 years ago

May be the issue is with the roi initialization. I have seen that initializes the camera with Width.GetMax(), Height.GetMax() instead of WidthMax() and HeightMax().

laurent-claustre commented 3 years ago

You're right, to be tested.