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

simplify: Rework point simplification to use reservoirs #618

Merged
merged 3 commits into from
Oct 12, 2023
Merged

Conversation

zeux
Copy link
Owner

@zeux zeux commented Oct 11, 2023

While quadrics are very important for triangle mesh simplification, they
are decidedly overkill for point cloud simplification. We encode a
simpler function into them compared to triangles, and even that function
is too complicated for what we need - minimizing the sum of square
distances to all points in the cell ends up yielding approximately the
same result as averaging all points in the cell and minimizing the
distance to that average.

The benefit of a simpler formulation is that there's less memory used
for encoding the function and less computation required to aggregate the
points / minimize the error.

This also sets us up for including color error into the calculation (by
computing a weighted average of the colors and minimizing the 6D
distance to XYZ+RGB). Even once we include RGB into the reservoirs,
we'll be at 7 floats per cell, vs 11 floats per cell that we spend right
now for weighted quadrics.

The RGB support is planned for a future PR; for now this improves the
error (due to a bug fix in quadric math, which is approximately equivalent
to reservoir based code) and makes space for extra data and calculation
for color support.

This makes it easier to debug the underlying algorithm and metrics.
Before this, point simplifier encoded non-sensical functions into the
quadric which resulted in fairly suboptimal candidate point selection,
raising the effective error (when computed separately as a distance function)
by ~2x.

To make mistakes like this less likely in the future we now annotate
each quadric structure with the formula it encodes.
While quadrics are very important for triangle mesh simplification, they
are decidedly overkill for point cloud simplification. We encode a
simpler function into them compared to triangles, and even that function
is too complicated for what we need - minimizing the sum of square
distances to all points in the cell ends up yielding approximately the
same result as averaging all points in the cell and minimizing the
distance to that average.

The benefit of a simpler formulation is that there's less memory used
for encoding the function and less computation required to aggregate the
points / minimize the error.

This also sets us up for including color error into the calculation (by
computing a weighted average of the colors and minimizing the 6D
distance to XYZ+RGB). Even once we include RGB into the reservoirs,
we'll be at 7 floats per cell, vs 11 floats per cell that we spend right
now for weighted quadrics.
@zeux zeux merged commit e7580bf into master Oct 12, 2023
12 checks passed
@zeux zeux deleted the simp-points branch October 12, 2023 01:31
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.

1 participant