| 236 | } |
| 237 | |
| 238 | cv::Rect ActionHelper::get_rect_from_node(const std::string& node_name) const |
| 239 | { |
| 240 | auto* t = tasker(); |
| 241 | if (!t) { |
| 242 | return { }; |
| 243 | } |
| 244 | |
| 245 | auto& cache = t->runtime_cache(); |
| 246 | auto node_id = cache.get_latest_node(node_name); |
| 247 | if (!node_id) { |
| 248 | LogWarn << "node not found or not executed" << VAR(node_name); |
| 249 | return { }; |
| 250 | } |
| 251 | NodeDetail node_detail = cache.get_node_detail(*node_id).value_or(NodeDetail { }); |
| 252 | RecoResult reco_result = cache.get_reco_result(node_detail.reco_id).value_or(RecoResult { }); |
| 253 | return reco_result.box.value_or(cv::Rect { }); |
| 254 | } |
| 255 | |
| 256 | Tasker* ActionHelper::tasker() const |
| 257 | { |
nothing calls this directly
no test coverage detected