Hi Robin,
I’ve noticed an issue when using Focus Assistant (or Seeing Monitor): setting Black Threshold too high not only leaves the ROI greyed out, but also affects the frames delivered to the BeforeFrameDisplay and BeforeFrameWritten callback handlers. In this state, the callbacks receive altered frames (see attached screenshot) rather than the expected calibrated data.
Request: it would be very helpful if at least one callback always received the unaltered calibrated frame (bias/flat applied) and remained unaffected by tools like Focus Assistant and Seeing Monitor.
Thanks for considering this.
Regards,
Leo
An issue with data handled by BeforeFrameDisplay
Forum rules
If you have a problem or question, please check the FAQ to see if it already has an answer : https://www.sharpcap.co.uk/sharpcap-faqs
Please also read about Troubleshooting USB Issues before posting.
*** Please do not post license keys - please report any problems with licensing to 'admin' by private message ***
Please include the following details in any bug report:
* Version of SharpCap
* Camera and other hardware being user
* Operating system version
* Contents of the SharpCap log after the problem has occurred.
[If SharpCap crashes, please send the bug report when prompted instead of including the log]
If you have a problem or question, please check the FAQ to see if it already has an answer : https://www.sharpcap.co.uk/sharpcap-faqs
Please also read about Troubleshooting USB Issues before posting.
*** Please do not post license keys - please report any problems with licensing to 'admin' by private message ***
Please include the following details in any bug report:
* Version of SharpCap
* Camera and other hardware being user
* Operating system version
* Contents of the SharpCap log after the problem has occurred.
[If SharpCap crashes, please send the bug report when prompted instead of including the log]
An issue with data handled by BeforeFrameDisplay
- Attachments
-
- focus-roi.jpg (239.64 KiB) Viewed 646 times
- admin
- Site Admin
- Posts: 17526
- Joined: Sat Feb 11, 2017 3:52 pm
- Location: Vale of the White Horse, UK
- Contact:
Re: An issue with data handled by BeforeFrameDisplay
Hi Leo,
it's expected that the modified image arrives at BeforeFrameDisplay - that's how the image with the shaded out dark areas appears on screen. However, the BeforeFrameWritten event should receive an unmodified copy of the image (if it didn't then the saved image would contain the shading, and that shouldn't happen either).
If you are seeing the modified image in BeforeFrameWritten then there must be some sort of bug, but it doesn't seem to happen in my testing here, so it may be specific to certain camera configurations or be triggered by something else. If you capture an image/video with the shading active, please check to see if the saved images are affected. The best thing then would be to send me the capturesettings.txt file from that image/video - that will give me enough info to set up my test as similarly as possible to yours.
PS. There is also the 'FrameCaptured' event, which happens when the frame comes off the camera before any processing or analysis - not sure if that is useful to you.
cheers,
Robin
it's expected that the modified image arrives at BeforeFrameDisplay - that's how the image with the shaded out dark areas appears on screen. However, the BeforeFrameWritten event should receive an unmodified copy of the image (if it didn't then the saved image would contain the shading, and that shouldn't happen either).
If you are seeing the modified image in BeforeFrameWritten then there must be some sort of bug, but it doesn't seem to happen in my testing here, so it may be specific to certain camera configurations or be triggered by something else. If you capture an image/video with the shading active, please check to see if the saved images are affected. The best thing then would be to send me the capturesettings.txt file from that image/video - that will give me enough info to set up my test as similarly as possible to yours.
PS. There is also the 'FrameCaptured' event, which happens when the frame comes off the camera before any processing or analysis - not sure if that is useful to you.
cheers,
Robin
Re: An issue with data handled by BeforeFrameDisplay
Hi Robin,
Apologies, my test notes were incorrect. I thought I had used BeforeFrameWritten in one case, but I actually used BeforeFrameDisplay in both. For my use case I can’t rely on BeforeFrameWritten during live preview, and neither BeforeFrameDisplay nor FrameCaptured is ideal. A callback that always received the calibrated frame (bias/flat applied) without the shaded overlay would be perfect.
Regards,
Leo
Apologies, my test notes were incorrect. I thought I had used BeforeFrameWritten in one case, but I actually used BeforeFrameDisplay in both. For my use case I can’t rely on BeforeFrameWritten during live preview, and neither BeforeFrameDisplay nor FrameCaptured is ideal. A callback that always received the calibrated frame (bias/flat applied) without the shaded overlay would be perfect.
Regards,
Leo
- admin
- Site Admin
- Posts: 17526
- Joined: Sat Feb 11, 2017 3:52 pm
- Location: Vale of the White Horse, UK
- Contact:
Re: An issue with data handled by BeforeFrameDisplay
Hi Leo,
if I added a 'BeforeProcessing' event, it would end up being almost identical to 'FrameCaptured' in timing and information available to you. The only possible difference is the 'BeforeProcessing' event might fire less often if the processing is slow enough that some frames from the camera are not processed because the previous one is still being handled.
So, I guess the question is... Why doesn't FrameCaptured fit your situation, since it might be best to see if that can be addressed.
cheers,
Robin
if I added a 'BeforeProcessing' event, it would end up being almost identical to 'FrameCaptured' in timing and information available to you. The only possible difference is the 'BeforeProcessing' event might fire less often if the processing is slow enough that some frames from the camera are not processed because the previous one is still being handled.
So, I guess the question is... Why doesn't FrameCaptured fit your situation, since it might be best to see if that can be addressed.
cheers,
Robin
Re: An issue with data handled by BeforeFrameDisplay
Hi Robin,
Thanks for considering my request.
Why FrameCaptured doesn't fit my use case: it only fires during capture. I need a steady trickle of frames during preview as well, so my application can analyze images before, after, and during captures.
I specifically need the calibrated image (bias/flat applied) before any UI overlays (Focus Assistant shaded ROI, selection boxes, etc.). Raw frames carry dust spots/artifacts that degrade image processing accuracy, and BeforeFrameDisplay can be altered by overlays.
If a BeforeProcessing event could:
Leo
Thanks for considering my request.
Why FrameCaptured doesn't fit my use case: it only fires during capture. I need a steady trickle of frames during preview as well, so my application can analyze images before, after, and during captures.
I specifically need the calibrated image (bias/flat applied) before any UI overlays (Focus Assistant shaded ROI, selection boxes, etc.). Raw frames carry dust spots/artifacts that degrade image processing accuracy, and BeforeFrameDisplay can be altered by overlays.
If a BeforeProcessing event could:
- Fire for both preview and capture frames,
- Deliver the calibrated, unaltered frame (no shaded areas/overlays), then that would be perfect.
Leo
- admin
- Site Admin
- Posts: 17526
- Joined: Sat Feb 11, 2017 3:52 pm
- Location: Vale of the White Horse, UK
- Contact:
Re: An issue with data handled by BeforeFrameDisplay
Hi Leo,
ah, OK, well the first issue isn't an issue, just that the name of the 'FrameCaptured' event is misleading you. That one is fired regardless of the capture status in SharpCap, the name is really referring to the frame being captured from the camera. So, that event should be OK for you except that it occurs before dark/flat processing.
But, that event does occur before dark/flat correction, and there is no way for you to force the running of the dark/flat at that point as the information on what to do hasn't been attached to the frame yet when the event fires (anyway, running the dark/flat correction at that point could have unintended side effects).
So, I think we have exhausted the possibility of using existing events - I will have to look at creating a new one...
cheers,
Robin
ah, OK, well the first issue isn't an issue, just that the name of the 'FrameCaptured' event is misleading you. That one is fired regardless of the capture status in SharpCap, the name is really referring to the frame being captured from the camera. So, that event should be OK for you except that it occurs before dark/flat processing.
But, that event does occur before dark/flat correction, and there is no way for you to force the running of the dark/flat at that point as the information on what to do hasn't been attached to the frame yet when the event fires (anyway, running the dark/flat correction at that point could have unintended side effects).
So, I think we have exhausted the possibility of using existing events - I will have to look at creating a new one...
cheers,
Robin
Re: An issue with data handled by BeforeFrameDisplay
Hi Robin,
You’re right, and again, my apologies - I mixed up the names of the two handlers. I meant BeforeFrameWritten, not FrameCaptured. But you got my main points right.
Thanks,
Leo
You’re right, and again, my apologies - I mixed up the names of the two handlers. I meant BeforeFrameWritten, not FrameCaptured. But you got my main points right.
Thanks,
Leo