-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add Hamamatsu camera service #163
Conversation
ba8122c
to
edc5337
Compare
afb248f
to
8068f38
Compare
if self.cam.buf_getframedata(-2) is False: | ||
# If there is no second to last frame, it means we just acquired the first frame. | ||
# In this case, drop the current frame since it always contains systematic errors. | ||
break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While testing in the lab, we learned that the first frame of each acquisition contains very obvious systematic errors, so it is unusable. It is probably rare that anyone would use the very first frame from a data stream, but it seemed more correct to me to never submit that faulty frame to the data stream in the first place.
I am not actually sure how to test this code block though... if you have any pointers @ehpor, please let me know.
@erinpougheon could I ask you to post a screenshot of the faulty frame here in the PR, for future reference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: does this faulty frame reappear when you change ROI, exposure time, gain or other settings?
Yes, I'd never submit that frame to the data stream. I'm not sure what you mean by "test". Since this is hardware-only behaviour, you can't do unit tests unless you go for hardware-in-the-loop, which is a hassle to automate. If you mean, just testing that this behaves as expected, I'd put an info log message instead of just breaking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good questions. I'll pass them on to @erinpougheon to test in the lab when she's back on Wednesday. FYI @johanmazoyer
I meant indeed to just test whether it behaves as expected. I'll do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a215f03
to
4e07258
Compare
So it turns out that we haven't paid much attention to the proper way of property setting with this camera - or the Allied Vision cameras. Some of the properties need the camera acquisition to be temporarily stopped, so I opened an issue for this for the AV service here: #183 For the Hamamatsu camera, only the exposure time can be changed while the camera is acquiring, the other properties need a temporary stop of the acquisition as well. Since that retriggers the acquisition loop, yes the faulty frame would appear again, but it would also be automatically discarded again in the current implementation. As for resetting the exposure time, I don't actually know how to catch the exact first frame after resetting it to figure out whether it's fine or not... We only have our loaner camera for one more day and we won't be able to implement and test this before we have to send it back. We won't get our own camera for a while. My idea would be to open an issue an put a rework of the properties that need an acquisition halt into it (#194), akin to the issue for the Allied Vision cameras. And to open a separate issue (#195) to figure out how to test the first frame upon an exposure time change to decide whether it's fine or whether we need to throw it away too. What do you say? |
ea6a71c
to
73c4123
Compare
73c4123
to
3594b19
Compare
Yes, I'm fine with merging this early, with potentially incorrect first-frame handling and some other issues to be fixed in a later PR. |
6a89892
to
f87f18d
Compare
Let me know when this is ready for review, since you're still changing things. |
@ehpor I think this is actually ready for review now, unless I forgot anything that we talked about. |
7c804df
to
153af19
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
7793640
to
d7edf0f
Compare
Fixes #162.
Contains a code sneak in which I delete a property from the AV cam service that is not set up or used.
Todo