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

Replace OpenCV with GPU blob detection #28

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Conversation

osnr
Copy link
Collaborator

@osnr osnr commented Mar 8, 2018

Increases fps 3-4x (depending on dot size) and makes page load times way faster.
https://www.youtube.com/watch?v=7D3wY_wMGLo

Uses Laplacian of Gaussian at fixed scale to find dots; video data never needs to touch the CPU now.

todos

needs some extra docs on what sigma and dotThreshold mean

  • sigma = expected dot radius in pixels
  • dotThreshold = how strict to be in recognizing dots (gets rid of spurious dots)

should probably fix up outCanvas so it's not just hanging out there

would like to test on different cameras than 1080p, cc @ajbouh

other optimization ideas:

  • async GL readPixels (readPixels is very expensive right now)
  • simplify shader computation? one-pass Gaussian, one-pass Gaussian+Laplacian, difference of Gaussians, FFT and then do computation in frequency domain?
  • shrink output canvas so we don't need to read as much from GPU?

@janpaul123
Copy link
Owner

Amazing. As discussed in person, going to bring this in a bit more incrementally, and next to the OpenCV implementation for now (since this is still less robust).

@janpaul123
Copy link
Owner

@osnr maybe the marker sizes from #53 are handy here?

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.

None yet

2 participants