[SAMPLE_CONSENSUS] Refactor Ellipse3D optimization kernel to internal namespace#6430
Conversation
ea89929 to
21bcec1
Compare
mvieth
left a comment
There was a problem hiding this comment.
Some first review comments, I will probably hove more comments later.
Another question: you claim ~24% reduction in build time, what is that number based on? In the two clang build analyzer reports, total build time of the baseline is 105.3s+197.6s=302.9s (frontend+backend), while afterwards it is 108.7s+198.6s=307.3s (so actually more?). Looking only at the build time of sac_model_ellipse3d.cpp, for the baseline it is 40.3s (again frontend+backend), afterwards it is 37.9s, so about 2.5s or 6% difference.
Sorry for the misattribution; the 24% is actually based on wall-clock rebuild time for the pcl_sample_consensus target. While the serial aggregate in the reports is flat, this change reduced LevenbergMarquardt instantiations from 61 down |
21bcec1 to
45a5300
Compare
|
new values after taking into account review comments:
|
45a5300 to
70a08ba
Compare
|
@mvieth, I've undone any unrelated modifications as requested (except for loops, since I get clang-tidy errors). Could you check? |
72b88b0 to
f01f2c4
Compare
|
Commenter does not have sufficient privileges for PR 6430 in repo PointCloudLibrary/pcl |
…ntiations Move the Levenberg-Marquardt optimization logic into a non-templated pcl::internal::optimizeModelCoefficientsEllipse3D function in the source file, reducing redundant template instantiations from 61 to 44. This results in a ~7% reduction in build time and 10% runtime speedup for the pcl_sample_consensus library. Move the get_ellipse_point, dvec2ellipse, and golden_section_search math helpers into pcl::internal in the header to allow shared access without exposing them as class members. Additionally: - Fix projectPoints to write to projected_points[inlier] instead of projected_points[i++] when copy_data_fields is true, consistent with other SAC models - Fix modernize-return-braced-init-list lint warning
f01f2c4 to
4ddd51a
Compare
mvieth
left a comment
There was a problem hiding this comment.
Okay, I am happy with the changes. Thanks!
@larshg I am going to leave this PR open a few more days, so you have the opportunity to review again, if you want to. If you don't want to or don't have the time, I would merge by end of next week.
|
@AlrIsmail BTW, after looking at the clang build analyzer output, I believe modifying this line might also improve build time and run time: the currently used constructor internally calls |
Summary
Refactor SampleConsensusModelEllipse3D to move the heavy Eigen::LevenbergMarquardt optimization
kernel into a non-templated source file. See #6428 for more.
Technical Changes