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

Dark frame subtraction #63

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Dark frame subtraction #63

wants to merge 2 commits into from

Conversation

russss
Copy link
Contributor

@russss russss commented Jan 5, 2025

Here's a proof of concept for doing dark frame subtraction. It takes an image before turning on the LED, then subtracts that image from the one taken when the LED is on.

This results in an extremely clean image. The only disadvantage is that it's very sensitive to anything moving in frame - even sub-pixel movements can become visible.

This managed to accurately detect LEDs in a large room with my (old) Macbook Pro webcam and no exposure adjustments. I think exposure adjustment may still be valuable, but this makes it much less necessary.

This might not be the neatest way of doing it, as I hacked a lot of stuff around on Friday. I've refactored this a bit without testing because I don't actually have any easily-accessible LEDs at home...

I'd recommend giving it a try with your test setup and see how it works.

ref #33

@russss russss mentioned this pull request Jan 5, 2025
@TheMariday
Copy link
Owner

I've had a play with this this morning and it operates as I expect!

Howeverrrrr, this does raise some other things that (I) need to do:

  • Update documentation so camera exposure is less prominent
  • Add an escape clause for waiting for darkness in case the camera moves slightly and a large swathe of light area appears
  • Update the camera_check tool so it performs in a similar way to the detector now and document

Oh only last thing is that cv2.absdiff will return a high value if an area of the image gets darker as well as lighter.
So I've replaced that with cv2.subtract in my copy

@TheMariday TheMariday linked an issue Jan 7, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Light mode
2 participants