Skip to content
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

setting an roi is broken #85

Closed
nclack opened this issue Aug 14, 2023 · 0 comments · Fixed by #86
Closed

setting an roi is broken #85

nclack opened this issue Aug 14, 2023 · 0 comments · Fixed by #86
Assignees

Comments

@nclack
Copy link
Member

nclack commented Aug 14, 2023

Doing something like:

import acquire
runtime = acquire.Runtime() 
p = runtime.get_configuration() 
p.video[0].camera.identifier = runtime.device_manager().select(acquire.DeviceKind.Camera, 'Hamamatsu C15440.*')
p.video[0].camera.settings.shape = (1700, 512)
p.video[0].camera.settings.offset = (302, 896)
p = runtime.set_configuration(p)

fails with

ERROR acquire.runtime 2023-08-14 13:49:21,136 runtime.rs:40 C:\actions-runner\_work\acquire-driver-hdcam\acquire-driver-hdcam\src\dcam.getset.c:53 - prop_write_u32(): Expression failed:
        dcamprop_setgetvalue(hdcam, prop_id, &v, 0)
        DCAMERR_INVALIDPARAM invalid parameter

ERROR acquire.runtime 2023-08-14 13:49:21,137 runtime.rs:40 C:\actions-runner\_work\acquire-driver-hdcam\acquire-driver-hdcam\src\dcam.getset.c:53 - prop_write_u32(): Expression failed:
        dcamprop_setgetvalue(hdcam, prop_id, &v, 0)
        DCAMERR_INVALIDSUBARRAY the combination of subarray values are invalid. e.g. DCAM_IDPROP_SUBARRAYHPOS + DCAM_IDPROP_SUBARRAYHSIZE is greater than the number of horizontal pixel of sensor.
@nclack nclack self-assigned this Aug 14, 2023
@nclack nclack mentioned this issue Aug 14, 2023
aliddell pushed a commit that referenced this issue Aug 15, 2023
closes #85 

adds test, updates changelog

Changes the ROI setting procedure so it's more robust:
1. Set offset to 0, so size can have full range of sensor.
2. Set the size
3. Set the offset

Sometimes the offset has to be divisible by 4. When setting a parameter
that is not appropriately divisible, the call just fails with an invalid
parameter which is not very helpful.

Fortunately, when running in "progressive" mode (the default for
light-sheet), there are fewer restrictions. I'm not exactly sure how to
query the restrictions, so the approach for this PR is to make sure
we're setting the mode early.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
1 participant