34 "CbSurveyTable: a component is missing (camera '%s' %d, table %d, segmenter %d, survey %d)",
43 std::optional<PinholeCamera> model;
45 std::chrono::steady_clock::now() + std::chrono::duration<double>(
params_.
waitS);
57 if (std::chrono::steady_clock::now() > deadline)
61 "CbSurveyTable: no usable image of '%s' after %.1f s (image %d, calibration and pose %d)",
66 std::this_thread::sleep_for(std::chrono::milliseconds(20));
74 const auto start = std::chrono::steady_clock::now();
77 auto survey = std::make_shared<Survey>();
78 survey->stamp = frame->stamp;
80 survey->model = *model;
81 survey->sequence = frame->sequence;
84 std::chrono::duration<double, std::milli>(std::chrono::steady_clock::now() - start).count();
87 getLogger(),
"CbSurveyTable: %zu blob(s) in image %lu of '%s' (%.1f ms)", survey->blobs.size(),
88 static_cast<unsigned long>(frame->sequence),
params_.
camera.c_str(), ms);
89 for (
const auto & blob : survey->blobs)
93 "CbSurveyTable: blob %d at x %+.3f y %+.3f m, %.0f x %.0f mm, axis %+.0f deg, %d px, "
94 "colour L %.0f a %+.0f b %+.0f",
95 blob.id, blob.tablePoint[0], blob.tablePoint[1], blob.lengthM * 1000.0, blob.widthM * 1000.0,
96 blob.axisRad * 180.0 / CV_PI, blob.areaPx, blob.meanLab[0], blob.meanLab[1], blob.meanLab[2]);
99 const bool enough =
static_cast<int>(survey->blobs.size()) >=
params_.
minBlobs;
108 getLogger(),
"CbSurveyTable: %zu blob(s), %d needed - posting failure", survey->blobs.size(),
std::vector< Blob > findBlobs(const cv::Mat &bgr, const cv::Mat &foreground, const PinholeCamera &camera, const TableParams &table, const BlobParams ¶ms)