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 RANSAC by plane fitting #580

Closed
p0nce opened this issue Aug 30, 2021 · 9 comments
Closed

Replace RANSAC by plane fitting #580

p0nce opened this issue Aug 30, 2021 · 9 comments
Labels
Performance This issue is about performance enhancement. Question Input welcome.

Comments

@p0nce
Copy link
Collaborator

p0nce commented Aug 30, 2021

Is it possible to have most of the visual quality with less CPU?
RANSAC is pretty costly if the plugin depth isn't smooth (early exit).
And 16-bit depth is going to make non-smooth depth map pretty common.
Could a plane fitting method work?

@p0nce p0nce added Question Input welcome. Performance This issue is about performance enhancement. labels Aug 30, 2021
@p0nce
Copy link
Collaborator Author

p0nce commented Sep 2, 2021

Curent algo:

  • compute distance of every points to 12 potential planes
    • 4 with center and two middle points
    • 8 with center, one middle point, and one diagonal point
  • each plane that has more than 3 points on it contribute to the output normal. The more inlier points, the more score, with hand-tuned weights.
    This seems learnable? Paramters would be depth difference to center.
    Also there is two axis of symmetry.

@p0nce
Copy link
Collaborator Author

p0nce commented Sep 2, 2021

Some directions badly handled:
image
or perhaps it's just #430

@p0nce p0nce added Blocked Resolution depends on another issue. and removed Blocked Resolution depends on another issue. labels Sep 2, 2021
@p0nce
Copy link
Collaborator Author

p0nce commented Sep 3, 2021

Tried least-square plane-fitting:

  • Baseline
    ren-baseline
  • Plane-fitting
    ren-planefit

@p0nce
Copy link
Collaborator Author

p0nce commented Sep 3, 2021

Least-square plane-fitting makes smoother surfaces, which is neat for rotating knobs, but the overall effect is that there is less sharpness. It would be much less expensive in CPU though.

@p0nce
Copy link
Collaborator Author

p0nce commented Sep 3, 2021

Adapting the sigma of the gaussian kernel for covariance can increase sharpness, while still being anisotropic => https://observablehq.com/@jobleonard/gaussian-kernel-calculater

@p0nce
Copy link
Collaborator Author

p0nce commented Sep 4, 2021

We can totally have something that is both faster and nicer!

@p0nce
Copy link
Collaborator Author

p0nce commented Sep 4, 2021

New plane fitting method is faster and better lookign than RANSAC.
This means there is no need for a Z early exit if depth is flat.
Also the normal extraction is isotropic it manages better rotating knobs and circles.
Enabled by default in v12.1.6
RANSAC is removed.

@p0nce
Copy link
Collaborator Author

p0nce commented Mar 1, 2022

Maybe a tiny bit more sharpness would be good. Reopened.

@p0nce p0nce changed the title RANSAC speed-up possible? Normal extraction a tiny bit too blurry Mar 1, 2022
@p0nce p0nce changed the title Normal extraction a tiny bit too blurry Replace RANSAC by plane fitting May 4, 2022
@p0nce
Copy link
Collaborator Author

p0nce commented May 4, 2022

Made a new issue instead.

@p0nce p0nce closed this as completed May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Performance This issue is about performance enhancement. Question Input welcome.
Projects
None yet
Development

No branches or pull requests

1 participant