-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ximea camera (and others) dont allow arbitrary ROI values #293
Comments
I vaguely remember another camera which had specific sizes that ROIs could be set to. Obviously we need to sanitize the input to ensure it is even and sensible eg not width 0, or outside the sensor edge. Maybe the set ROI functions should return the ROI that is actually set as this would mean that the calling function and have the real ROI rather than what it set, but was not valid on that camera. |
Or rather return False and log/raise the error (IncompatibleDeviceState?). Do we specify if left and top are zero based? Ximea uses 0 as the first pixel position and andor uses 1. |
I think returning an error is the wrong behavior as a random user is unlikely to know you need even positions. I think it would be better to force the ROI to a valid value and then return that. As to whether we count from 1 or 0, as you say we should probably specify this and then let the specific device code transform it to whichever. I would suggest counting from 0. |
Should we, for the sake of consistency, do the same for other settings (binning, exposure-time,...)
As for the first pixel of the camera, I would also go for 0. |
Ok, I think these are two separate issues and we should have separate discussions.
|
As Julio comments binning is a functionality that often has restrictions on what values are possible and hence valid, maybe both x and y must be equal, or must be powers of two. Another ares where this can be significant is exposure times. There are frequently restrictions on what exposures are valid. I think it would be reasonable to change the code so that setting values would always return the true value set, with the expectation that this MAY be different than the passed value. With the hardware specific code expected to massage the values if needed (eg ROI on Ximea cameras) or pass on to lower level code which does this, eg the raspberry PIcam exposure time setting will set something near what you ask for but often not exactly that. |
Looking into Hamamatsu's docs, this is some of a complex issue to handle and depends on the camera model. ie:
and the orca.flash (I think)
I presume that for ximea cameras it is a bit of the same or even more complex as the number of different chip types are more diverse. |
Trying to change the roi on the ximea camera to anything containing an uneven value throws a
ximea.xiapi.Xi_error: ERROR 101: Wrong parameter value
The text was updated successfully, but these errors were encountered: