Commit e24b3d1
refactor: implement CRTP-based correspondence generation with KNN and brute-force methods
- Create base_correspondence_generator_t using CRTP pattern for static polymorphism
- Implement knn_correspondence_generator_t for fast KNN-based matching
- Implement brute_force_correspondence_generator_t with parallel computation support
- Maintain backward compatibility by aliasing correspondence_generator_t to KNN version
- Add convenience functions for both KNN and brute-force correspondence generation
- Include comprehensive validation, ratio test, mutual verification, and distance threshold filtering
- Update tests and benchmarks to compare both methods
- Benchmark results show brute-force parallel is significantly faster for larger datasets:
- 100 descriptors: All methods ~150μs
- 500 descriptors: Brute-force parallel 4x faster (~1.3ms vs ~5.5ms)
- 1000 descriptors: Brute-force parallel 9x faster (~2.3ms vs ~20-22ms)
This refactoring provides flexibility to choose between accuracy-focused KNN methods
and performance-focused brute-force methods based on application requirements.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent ec79732 commit e24b3d1
File tree
10 files changed
+1066
-571
lines changed- benchmark/pcl
- src/include/cpp-toolbox/pcl/correspondence
- impl
- test/pcl
10 files changed
+1066
-571
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
91 | 90 | | |
92 | 91 | | |
93 | 92 | | |
94 | | - | |
95 | | - | |
| 93 | + | |
| 94 | + | |
96 | 95 | | |
97 | | - | |
98 | | - | |
99 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
100 | 99 | | |
101 | 100 | | |
102 | 101 | | |
| |||
112 | 111 | | |
113 | 112 | | |
114 | 113 | | |
115 | | - | |
116 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
117 | 147 | | |
118 | 148 | | |
119 | 149 | | |
| |||
0 commit comments