-
Notifications
You must be signed in to change notification settings - Fork 125
New camera API #593
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
base: main
Are you sure you want to change the base?
New camera API #593
Conversation
…pile bug in mmdevice
…d add explicit skipping
Thinking about cameras I have used in MM that support light sheet mode you would set 2 parameters:
In my experience with rolling shutter cameras, temporal offsets are usually handled externally by the user by e.g. adjusting the speed of the element that is synchronized with the rolling shutter. But I think they could be separately specified with camera properties (e.g. a camera might support a user-settable delay between camera trigger and actual exposure start). |
New Camera API
This PR implements a new camera API based on the GenICam standard features naming convention v2.7. It also includes a reference implementation of the API on a Basler camera. Associated tests for new functionality and backwards compatibility are available here
Dependencies
This PR should be merged after:
InsertImageon snap #592 (required for backwards compatibility)Overview
The new API converts GenICam features to their respective implementations:
ICommands become methods (e.g.,TriggerSoftware)IEnumeration,IFloat,IBoolean(as strings "0"/"1"), andIIntegerbecome standard propertiesRequired Methods in device API
Additions to core API
Standard properties
Additional functionality is implemented through standard properties following the GenICam naming convention:
These properties are opt-out for new-API camera device adapters; device adapters must explicitly declare skipped properties during initialization.
Two additional non-GenICam standard properties for rolling shutter exposure/light sheet readout:
RollingShutterActiveLinesandRollingShutterLineOffset@jondaniels I haven't used this feature myself and don't have a camera. These properties may need refinement or should perhaps be pushed to a future PR.
Backwards compatibility
This API maintains full backwards compatibility:
CLegacyCameraBaseorCOldAPICameraBaseCNewAPICameraBaseCameraInstancehandles conversion between old-style core calls (core.snapImage,core.startSequenceAcquisition, etc) and new-style calls (core.acquisitionArm,core.acquisitionStart) to old or new style cameras.All standard properties are also opt-in for existing cameras without requiring full migration to the new API. This means old style cameras can, for example, standardize the names of their hardware triggering properties without having to do a full migration. In many cases, I think this can be done fully backwards compatibly by reusing a property handler (eg
OnTriggerType) and have the functionality under both standard and legacy non-standard names.Usage notes
The required methods of the API map fairly closely to the old one. A couple small differences to point out:
acquisitionStartfunction (ie no difference between snap and sequences)acquisitionStartalways returns immediately. Unfortunately, there doesn't seem to be any reliable GenICam way to receive a callback when exposure or a sequence is finished. This means the device adapter still must callGetCoreCallback()->acqFinished()core.popImageorgetLastImage, notgetImage).ArmAcquisition(int numImages)takes the number of images that will be acquired (or 0 for continuous acquisition). This allows them to fully prepare before any hardware (ie shutter) changes state, including pre-allocating buffer slots (once this feature is enabled with the new buffer api). Since all preparation should take place here, there is not need to callGetCoreCallback()->PrepareForAcq(this)inacquisitionStart(), though this can be included for backwards compatibilityEvents
GenIStyle camera events are not sufficiently reliable for critical operations. For example,
ExposureEndevents cannot be used to close shutters as delivery is not guaranteed (and this indeed was unreliable on my testing with a Basler cameras).A new core callback method has been added to support GenICam-style events from cameras to nonetheless provide non-critical GenICam-style updates.
When merged, the following PRs should also be merged
Notes