style.项目、文件名统一化

This commit is contained in:
MistEO
2021-12-14 21:29:35 +08:00
parent c233c3ed38
commit 9c20b5da49
128 changed files with 2182 additions and 2240 deletions

View File

@@ -0,0 +1,37 @@
#include "InfrastSmileyImageAnalyzer.h"
#include "AsstUtils.hpp"
#include "MultiMatchImageAnalyzer.h"
#include "Resource.h"
bool asst::InfrastSmileyImageAnalyzer::analyze()
{
const static std::unordered_map<infrast::SmileyType, std::string> smiley_map = {
{ infrast::SmileyType::Rest, "InfrastSmileyOnRest" },
{ infrast::SmileyType::Work, "InfrastSmileyOnWork" },
{ infrast::SmileyType::Distract, "InfrastSmileyOnDistract" }
};
m_result.clear();
MultiMatchImageAnalyzer mm_analyzer(m_image);
decltype(m_result) temp_result;
for (const auto& [type, task_name] : smiley_map) {
const auto task_ptr = std::dynamic_pointer_cast<MatchTaskInfo>(task.get(task_name));
mm_analyzer.set_task_info(*task_ptr);
mm_analyzer.set_roi(m_roi);
if (!mm_analyzer.analyze()) {
continue;
}
auto& res = mm_analyzer.get_result();
for (const MatchRect& mr : res) {
temp_result.emplace_back(infrast::Smiley{ type, mr.rect });
#ifdef LOG_TRACE
cv::rectangle(m_image_draw, utils::make_rect<cv::Rect>(mr.rect), cv::Scalar(0, 0, 255), 2);
#endif
}
}
m_result = std::move(temp_result);
return true;
}