This commit is contained in:
cool609 2026-03-29 15:58:39 +08:00
parent eddc403142
commit b873290801
2 changed files with 95 additions and 73 deletions

View File

@ -2,7 +2,9 @@
#include <algorithm>
#include <cmath>
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
namespace {
@ -208,6 +210,19 @@ int DetectMultipleHoles(
continue;
}
/*if (debugCallbacks && debugCallbacks->clusterOutputDir) {
std::string path = std::string(debugCallbacks->clusterOutputDir)
+ "/cluster_" + std::to_string(i) + ".csv";
std::ofstream ofs(path);
if (ofs.is_open()) {
ofs << "row,col,x,y,z\n";
for (const auto& bp : clusterPoints) {
ofs << bp.row << "," << bp.col << ","
<< bp.point.x << "," << bp.point.y << "," << bp.point.z << "\n";
}
}
}*/
SHoleResult hole;
ret = hole_detection::internal::FitHoleFromExtremePoints(
points,

View File

@ -151,6 +151,13 @@ struct SHoleDetectionDebugCallbacks {
* @brief User-provided context pointer, passed to all callbacks
*/
void* userData;
/**
* @brief If non-null, each cluster's boundary points are saved as a CSV file
* in this directory before fitting. Files are named cluster_0.csv, cluster_1.csv, ...
* Fields: row,col,x,y,z
*/
const char* clusterOutputDir;
};
/**