From c1a84f54e74f7359a65fcf9076c57c98cd6d8ea1 Mon Sep 17 00:00:00 2001 From: shxyke Date: Sun, 8 May 2022 10:37:22 +0800 Subject: [PATCH 1/7] fix: Fix build error on Linux with gnustl This error seems caused by gnustl vector, I do not know how to fix it, so I use macro to change container to deque under gnustl, use deque under other STL library will also cause problem. --- .../penguin-stats-recognize/result.hpp | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/3rdparty/include/penguin-stats-recognize/result.hpp b/3rdparty/include/penguin-stats-recognize/result.hpp index 5623a8af71..0d9a639550 100644 --- a/3rdparty/include/penguin-stats-recognize/result.hpp +++ b/3rdparty/include/penguin-stats-recognize/result.hpp @@ -13,6 +13,12 @@ #include "core.hpp" #include "recognize.hpp" +#if defined(__GLIBCXX__) || defined(__GLIBCPP__) +#define Widget_container std::deque +#else +#define Widget_container std::vector +#endif + using dict = nlohmann::ordered_json; // extern void show_img(cv::Mat src); @@ -323,7 +329,7 @@ private: const int _CANDIDATES_COUNT = 5; bool _existance = false; std::string _difficulty = "NORMAL"; // for temporary workaround - std::vector _stage_chrs; + Widget_container _stage_chrs; const std::string _stage_code() const { return _stage_code(_candidate_index); @@ -407,8 +413,8 @@ private: } void _get_candidates() { - auto comp = [](std::vector a, - std::vector b) { + auto comp = [](Widget_container a, + Widget_container b) { int dist_a = 0, dist_b = 0; for (const auto& chr : a) { @@ -421,8 +427,8 @@ private: return dist_a > dist_b; }; std::priority_queue< - std::vector, - std::vector>, + Widget_container, + std::vector>, decltype(comp)> q(comp); auto last_pop = _stage_chrs; @@ -882,7 +888,7 @@ public: private: dict _drops_data; std::vector _drop_list; - std::vector _droptype_list; + Widget_container _droptype_list; auto _get_separate() { cv::Mat img_bin = _img; @@ -960,8 +966,8 @@ private: } void _next_droptype_candidate() { - auto comp = [](std::vector a, - std::vector b) { + auto comp = [](Widget_container a, + Widget_container b) { int dist_a = 0, dist_b = 0; for (const auto& type : a) { @@ -974,8 +980,8 @@ private: return dist_a > dist_b; }; std::priority_queue< - std::vector, - std::vector>, + Widget_container, + std::vector>, decltype(comp)> q(comp); auto last_pop = _droptype_list; From df486706f07172c1cd32746edf0ac62cec669570 Mon Sep 17 00:00:00 2001 From: zzyyyl <74587068+zzyyyl@users.noreply.github.com> Date: Sun, 8 May 2022 13:16:12 +0800 Subject: [PATCH 2/7] =?UTF-8?q?chore.=E4=BC=98=E5=8C=96CI=E4=BD=BF?= =?UTF-8?q?=E5=BE=97=E5=9C=A8fork=E4=B8=8A=E4=B8=8D=E8=BF=90=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/maa-doc-azure-deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maa-doc-azure-deploy.yaml b/.github/workflows/maa-doc-azure-deploy.yaml index b7fe035724..f71103aa47 100644 --- a/.github/workflows/maa-doc-azure-deploy.yaml +++ b/.github/workflows/maa-doc-azure-deploy.yaml @@ -6,12 +6,12 @@ on: - master paths: - "docs/*" - workflow_dispatch: jobs: build_and_deploy: runs-on: ubuntu-latest name: Build and Deploy Job + if: github.repository_owner == 'MaaAssistantArknights' steps: - uses: actions/checkout@v2 with: From 122c7464a7d6fe94b6271b66f8e77e79c6c9fc7c Mon Sep 17 00:00:00 2001 From: zzyyyl <74587068+zzyyyl@users.noreply.github.com> Date: Sun, 8 May 2022 13:03:20 +0800 Subject: [PATCH 3/7] =?UTF-8?q?style.=E9=9A=8F=E4=BE=BF=E6=94=B9=E7=82=B9?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Linux编译教程.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Linux编译教程.md b/docs/Linux编译教程.md index aed8b9172b..a10863e56f 100644 --- a/docs/Linux编译教程.md +++ b/docs/Linux编译教程.md @@ -29,7 +29,7 @@ cmake ../ -DPADDLE_LIB=/your_path/paddle_inference/ -DOpenCV_DIR=/your_path_to_o ### zlib -Ubuntu 下: +Ubuntu 下: ```bash sudo apt update && sudo apt install zlib1g-dev From 511501a6374fd50d8905f819a046956327fb3137 Mon Sep 17 00:00:00 2001 From: ABA2396 <2396806385@qq.com> Date: Sun, 8 May 2022 23:37:44 +0800 Subject: [PATCH 4/7] =?UTF-8?q?fix.=E6=B4=BB=E5=8A=A8=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=90=8E=E5=AF=BC=E8=88=AA=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/tasks.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resource/tasks.json b/resource/tasks.json index 7f3e271583..a17e07f2ae 100644 --- a/resource/tasks.json +++ b/resource/tasks.json @@ -10,7 +10,7 @@ "algorithm": "OcrDetect", "action": "clickSelf", "text": [ - "活动已开放" + "已开放" ], "roi": [ 40, @@ -69,7 +69,7 @@ "algorithm": "OcrDetect", "action": "clickSelf", "text": [ - "活动已开放" + "已开放" ], "roi": [ 40, @@ -128,7 +128,7 @@ "algorithm": "OcrDetect", "action": "clickSelf", "text": [ - "活动已开放" + "已开放" ], "roi": [ 40, From 6bc4163b2b69f47f86b60633230de973dbba0b63 Mon Sep 17 00:00:00 2001 From: MistEO Date: Mon, 9 May 2022 00:32:29 +0800 Subject: [PATCH 5/7] =?UTF-8?q?fix.=E6=9B=B4=E6=96=B0=E4=BC=81=E9=B9=85?= =?UTF-8?q?=E8=AF=86=E5=88=AB=E5=BA=93=EF=BC=8C=E4=BF=AE=E5=A4=8D=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E8=AF=86=E5=88=AB=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../include/penguin-stats-recognize/depot.hpp | 8 +- .../penguin-stats-recognize/recognize.hpp | 9 +- .../penguin-stats-recognize/recognizer.hpp | 8 +- .../penguin-stats-recognize/result.hpp | 125 +++++++++++------- 4 files changed, 92 insertions(+), 58 deletions(-) diff --git a/3rdparty/include/penguin-stats-recognize/depot.hpp b/3rdparty/include/penguin-stats-recognize/depot.hpp index b2ab6b3c59..704a51de9d 100644 --- a/3rdparty/include/penguin-stats-recognize/depot.hpp +++ b/3rdparty/include/penguin-stats-recognize/depot.hpp @@ -16,6 +16,7 @@ using dict = nlohmann::ordered_json; namespace penguin { + enum CircleFlags { X = 0, @@ -36,7 +37,7 @@ public: _get_item_list(); return *this; } - const dict report([[maybe_unused]] bool debug = false) + const dict report(bool debug = false) { dict _report = dict::object(); return _report; @@ -112,7 +113,7 @@ private: } } } - _item_diameter = static_cast(round(cv::mean(item_circles)[R] * 2)); + _item_diameter = round(cv::mean(item_circles)[R] * 2); for (const cv::Vec3i& c : item_circles) { @@ -127,7 +128,7 @@ private: // show_img(img_blur); int radius = _item_diameter / 2; - int offset = static_cast(radius * 1.2); + int offset = radius * 1.2; ItemTemplates templs; for (const cv::Vec3i& c : item_circles) { @@ -156,6 +157,7 @@ private: // show_img(_img_ext); } }; + } // namespace penguin #endif // PENGUIN_DEPOT_HPP_ diff --git a/3rdparty/include/penguin-stats-recognize/recognize.hpp b/3rdparty/include/penguin-stats-recognize/recognize.hpp index bd0327d908..e8e0acec3a 100644 --- a/3rdparty/include/penguin-stats-recognize/recognize.hpp +++ b/3rdparty/include/penguin-stats-recognize/recognize.hpp @@ -15,6 +15,7 @@ using dict = nlohmann::ordered_json; namespace penguin { + enum class StatusFlags { NORMAL = 0, @@ -842,9 +843,11 @@ private: } void _get_quantity() { - cv::Rect quantityrect = cv::Rect(0, static_cast(round(height * _ITEM_QTY_Y_PROP)), - static_cast(round(width * _ITEM_QTY_WIDTH_PROP)), - static_cast(round(height * _ITEM_QTY_HEIGHT_PROP))); + cv::Rect quantityrect = + cv::Rect(0, + static_cast(round(height * _ITEM_QTY_Y_PROP)), + static_cast(round(width * _ITEM_QTY_WIDTH_PROP)), + static_cast(round(height * _ITEM_QTY_HEIGHT_PROP))); cv::Mat quantityimg = _img(quantityrect); _quantity.set_img(quantityimg); _quantity.analyze(); diff --git a/3rdparty/include/penguin-stats-recognize/recognizer.hpp b/3rdparty/include/penguin-stats-recognize/recognizer.hpp index 070664a2c2..1ec99ff572 100644 --- a/3rdparty/include/penguin-stats-recognize/recognizer.hpp +++ b/3rdparty/include/penguin-stats-recognize/recognizer.hpp @@ -18,7 +18,13 @@ #include "depot.hpp" #include "result.hpp" -static const std::string version = "4.2.3"; +#ifdef PENGUIN_RECOGNIZER_RELEASE_VERSION +#define PENGUIN_RECOGNIZER_VERSION_STRING PENGUIN_RECOGNIZER_RELEASE_VERSION +#else +#define PENGUIN_RECOGNIZER_VERSION_STRING "v0.0.0" +#endif + +static const std::string version = PENGUIN_RECOGNIZER_VERSION_STRING; static const std::string opencv_version = CV_VERSION; cv::Mat decode(std::string JSarrayBuffer) diff --git a/3rdparty/include/penguin-stats-recognize/result.hpp b/3rdparty/include/penguin-stats-recognize/result.hpp index 0d9a639550..ae40bbbeb7 100644 --- a/3rdparty/include/penguin-stats-recognize/result.hpp +++ b/3rdparty/include/penguin-stats-recognize/result.hpp @@ -31,7 +31,7 @@ const double DROP_AREA_X_PROP = 0.21; const double DROP_AREA_Y_PROP = 0.2; const double DROP_AREA_HEIGHT_PROP = 0.8; const double ITEM_DIAMETER_PROP = 0.524; -const double W_H_PROP = 7; +const double W_H_PROP = 6.5; enum DroptypeFlags { @@ -201,7 +201,7 @@ public: } private: - size_t _stars = 0; + int _stars = 0; void _get_is_3stars() { auto& self = *this; @@ -232,7 +232,7 @@ private: star_rect.width = sp.back().end - star_rect.x; _img = star_img = star_img(star_rect); self._relate(star_rect.tl()); - _stars = sp.size(); + _stars = static_cast(sp.size()); } }; @@ -612,7 +612,7 @@ private: { continue; } - int dist = static_cast(abs(kh - hsv[H])); + int dist = static_cast(round(abs(kh - hsv[H]))); _candidates.emplace_back(vtype, dist); } std::sort(_candidates.begin(), _candidates.end(), @@ -751,11 +751,23 @@ public: const int items_count() const { return _items_count; } Widget_Droptype() = default; Widget_Droptype(const cv::Mat& img, const std::string& label, Widget* const parent_widget = nullptr) - : WidgetWithCandidate(img, label, parent_widget) {} + : WidgetWithCandidate(label, parent_widget) + { + set_img(img); + } + void set_img(const cv::Mat& img) + { + cv::Mat img_bin = img; + cv::cvtColor(img_bin, img_bin, cv::COLOR_BGR2GRAY); + cv::threshold(img_bin, img_bin, 127, 255, cv::THRESH_BINARY); + int bottom = separate(img_bin, DirectionFlags::BOTTOM, 1)[0].end; + Widget::set_img(img(cv::Rect(0, 0, img.cols, bottom))); + } Widget_Droptype& analyze() { if (!_img.empty()) { + _get_items_count(); _get_candidates(); } if (const auto type = droptype(); @@ -790,7 +802,7 @@ public: } private: - int _items_count = static_cast(round(width / (height * W_H_PROP))); + int _items_count = 0; Widget_DroptypeLine _line {this}; Widget_DroptypeText _text {this}; void _get_candidates() @@ -809,6 +821,10 @@ private: _candidates = _text.candidates(); } } + void _get_items_count() + { + _items_count = static_cast(round(width / (height * W_H_PROP))); + } }; class Widget_DropArea : public Widget @@ -827,8 +843,7 @@ public: : Widget("dropArea", parent_widget) {} Widget_DropArea(const cv::Mat& img, Widget* const parent_widget = nullptr) : Widget(img, "dropArea", parent_widget) {} - Widget_DropArea& analyze(const std::string& stage, - const std::string& difficulty) + Widget_DropArea& analyze(const std::string& stage) { if (!_img.empty()) { @@ -849,7 +864,7 @@ public: widget_label = "droptypes"; push_exception(ERROR, ExcSubtypeFlags::EXC_ILLEGAL); } - _get_drops(stage, difficulty); + _get_drops(stage); } else { @@ -995,7 +1010,7 @@ private: _droptype_list = q.top(); } - void _get_drops(const std::string& stage, [[maybe_unused]] const std::string& difficulty) + void _get_drops(const std::string& stage) { if (_status == StatusFlags::HAS_ERROR || _status == StatusFlags::ERROR) { @@ -1015,10 +1030,10 @@ private: { continue; } - else if (std::string label = - "drops." + std::to_string(_drop_list.size()); - type == DroptypeFlags::FURNITURE) + else if (type == DroptypeFlags::FURNITURE) { + std::string label = + "drops." + std::to_string(_drop_list.size()); _drop_list.emplace_back( Drop(Widget_Item(FURNI_1, label, this), type)); } @@ -1034,13 +1049,13 @@ private: int length = (droptype.width) / items_count; for (int i = 0; i < items_count; i++) { - std::string cur_label = + std::string label = "drops." + std::to_string(_drop_list.size()); auto range = cv::Range(droptype.x - x + length * i, droptype.x - x + length * (i + 1)); auto dropimg = _img(cv::Range(0, droptype.y - y), range); - Widget_Item drop {dropimg, item_diameter, cur_label, this}; + Widget_Item drop {dropimg, item_diameter, label, this}; drop.analyze(templs); _drop_list.emplace_back(drop, type); _drops_data.push_back({{"dropType", Droptype2Str[type]}, @@ -1216,10 +1231,10 @@ private: } const auto& bv = _baseline_v; auto drop_area_img = _img( - cv::Range(static_cast(bv.y + bv.height * DROP_AREA_Y_PROP), bv.y + bv.height), - cv::Range(static_cast(bv.x + bv.height * DROP_AREA_X_PROP), width)); + cv::Range(bv.y + static_cast(bv.height * DROP_AREA_Y_PROP), bv.y + bv.height), + cv::Range(bv.x + static_cast(bv.height * DROP_AREA_X_PROP), width)); _drop_area.set_img(drop_area_img); - _drop_area.analyze(_stage.stage_code(), "NORMAL"); + _drop_area.analyze(_stage.stage_code()); } }; @@ -1285,11 +1300,10 @@ private: { return; } - cv::Mat img_bin = _img(cv::Rect( - 0, - static_cast(0.2 * height), - static_cast(0.2 * width), - static_cast(0.4 * height))); + cv::Mat img_bin = _img(cv::Rect(0, + static_cast(0.2 * height), + static_cast(0.2 * width), + static_cast(0.4 * height))); cv::cvtColor(img_bin, img_bin, cv::COLOR_BGR2GRAY); cv::threshold(img_bin, img_bin, 120, 255, cv::THRESH_BINARY); @@ -1309,8 +1323,9 @@ private: abs(img_temp.cols - last_height) <= 1 && abs(first_height - last_height) <= 1) { - baseline_v_rect = cv::Rect(range.start, sp2.front().start + static_cast(0.2 * height), - img_temp.cols, sp2.back().end - sp2.front().start); + baseline_v_rect = + cv::Rect(range.start, sp2.front().start + static_cast(0.2 * height), + img_temp.cols, sp2.back().end - sp2.front().start); break; } } @@ -1336,11 +1351,10 @@ private: : x(x_), y(y_), width(width_), height(height_), area(area_) {} }; - cv::Mat img_bin = _img(cv::Rect( - 0, - static_cast(0.2 * height), - static_cast(0.2 * width), - static_cast(0.4 * height))); + cv::Mat img_bin = _img(cv::Rect(0, + static_cast(0.2 * height), + static_cast(0.2 * width), + static_cast(0.4 * height))); cv::cvtColor(img_bin, img_bin, cv::COLOR_BGR2GRAY); cv::threshold(img_bin, img_bin, 120, 255, cv::THRESH_BINARY); cv::Mat _; @@ -1381,10 +1395,11 @@ private: { if (ccomps[0].x == ccomps[1].x) { - baseline_v_rect = cv::Rect(ccomps[0].x, - ccomps[0].y + static_cast(0.2 * height), - ccomps[0].width, - ccomps[1].y - ccomps[0].y + ccomps[1].height); + baseline_v_rect = + cv::Rect(ccomps[0].x, + ccomps[0].y + static_cast(0.2 * height), + ccomps[0].width, + ccomps[1].y - ccomps[0].y + ccomps[1].height); } } else if (const auto ccsize = ccomps.size(); @@ -1393,10 +1408,11 @@ private: for (int i = 0; i < ccsize - 1; ++i) { if (ccomps[i].x == ccomps[i + 1].x) - baseline_v_rect = cv::Rect(ccomps[i].x, - ccomps[i].y + static_cast(0.2 * height), - ccomps[i].width, - ccomps[i + 1].y - ccomps[i].y + ccomps[i + 1].height); + baseline_v_rect = + cv::Rect(ccomps[i].x, + ccomps[i].y + static_cast(0.2 * height), + ccomps[i].width, + ccomps[i + 1].y - ccomps[i].y + ccomps[i + 1].height); } } @@ -1420,8 +1436,9 @@ private: } const auto& bv = _baseline_v; int left_margin = bv.x + bv.width; - auto result_img = _img(cv::Range(bv.y, bv.y + bv.height / 2), - cv::Range(left_margin, static_cast(left_margin + 1.5 * bv.height))); + auto result_img = + _img(cv::Range(bv.y, bv.y + bv.height / 2), + cv::Range(left_margin, left_margin + static_cast(1.5 * bv.height))); cv::Mat img_bin; cv::cvtColor(result_img, img_bin, cv::COLOR_BGR2GRAY); cv::threshold(img_bin, img_bin, 200, 255, cv::THRESH_BINARY); @@ -1438,8 +1455,9 @@ private: } const auto& bv = _baseline_v; int left_margin = bv.x + bv.width; - auto star_img = _img(cv::Range(bv.y + bv.height / 2, bv.y + bv.height), - cv::Range(left_margin, static_cast(left_margin + 1.2 * bv.height))); + auto star_img = + _img(cv::Range(bv.y + bv.height / 2, bv.y + bv.height), + cv::Range(left_margin, left_margin + static_cast(1.2 * bv.height))); cv::Mat img_bin; cv::cvtColor(star_img, img_bin, cv::COLOR_BGR2GRAY); cv::threshold(img_bin, img_bin, 127, 255, cv::THRESH_BINARY); @@ -1456,9 +1474,10 @@ private: } const auto& bv = _baseline_v; int left_margin = bv.x + bv.width; - auto stage_img = _img(cv::Range(0, bv.y), - cv::Range(static_cast(left_margin + 0.43 * bv.height), - static_cast(left_margin + 1.5 * bv.height))); + auto stage_img = + _img(cv::Range(0, bv.y), + cv::Range(left_margin + static_cast(0.43 * bv.height), + left_margin + static_cast(1.5 * bv.height))); cv::Mat img_bin; cv::cvtColor(stage_img, img_bin, cv::COLOR_BGR2GRAY); cv::threshold(img_bin, img_bin, 200, 255, cv::THRESH_BINARY); @@ -1475,8 +1494,9 @@ private: } const auto& bv = _baseline_v; int left_margin = bv.x + bv.width; - auto diff_img = _img(cv::Range(0, bv.y), - cv::Range(left_margin, static_cast(left_margin + 0.43 * bv.height))); + auto diff_img = + _img(cv::Range(0, bv.y), + cv::Range(left_margin, left_margin + static_cast(0.43 * bv.height))); cv::Mat img_bin; cv::cvtColor(diff_img, img_bin, cv::COLOR_BGR2GRAY); cv::threshold(img_bin, img_bin, 64, 255, cv::THRESH_BINARY); @@ -1492,19 +1512,22 @@ private: return; } const auto& bv = _baseline_v; - cv::Mat img_bin = _img(cv::Range(bv.y + bv.height, height), - cv::Range(bv.x + bv.width, static_cast(0.2 * width))); + cv::Mat img_bin = + _img(cv::Range(bv.y + bv.height, height), + cv::Range(bv.x + bv.width, static_cast(0.2 * width))); cv::cvtColor(img_bin, img_bin, cv::COLOR_BGR2GRAY); cv::threshold(img_bin, img_bin, 127, 255, cv::THRESH_BINARY); auto sp = separate(img_bin, DirectionFlags::TOP, 2); int top_margin = bv.y + bv.height + sp[1].start; auto drop_area_img = _img( - cv::Range(top_margin + static_cast(bv.height * DROP_AREA_Y_PROP), top_margin + bv.height), + cv::Range(top_margin + static_cast(bv.height * DROP_AREA_Y_PROP), + top_margin + bv.height), cv::Range(bv.x + bv.width, width)); _drop_area.set_img(drop_area_img); - _drop_area.analyze(_stage.stage_code(), _difficutly.difficulty()); + _drop_area.analyze(_stage.stage_code()); } }; + } // namespace penguin #endif // PENGUIN_RESULT_HPP_ From 7bd8a0d0599149dcc6d35b17bf7ac236d912822e Mon Sep 17 00:00:00 2001 From: MistEO Date: Mon, 9 May 2022 00:33:22 +0800 Subject: [PATCH 6/7] =?UTF-8?q?chore.=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7v3.3.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MeoAssistant/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MeoAssistant/Version.h b/src/MeoAssistant/Version.h index efb55c9201..f2a33f6ba9 100644 --- a/src/MeoAssistant/Version.h +++ b/src/MeoAssistant/Version.h @@ -2,5 +2,5 @@ namespace asst { - constexpr static const char* Version = "v3.3.1"; + constexpr static const char* Version = "v3.3.2"; } From 164728eb9cb7e2c2ad686948bcfd5a2e1adc81d4 Mon Sep 17 00:00:00 2001 From: MistEO Date: Mon, 9 May 2022 00:53:55 +0800 Subject: [PATCH 7/7] =?UTF-8?q?chore.=E6=9B=B4=E6=96=B0=E4=BC=81=E9=B9=85?= =?UTF-8?q?=E5=BA=93=EF=BC=8C=E4=BF=AE=E5=A4=8D=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/MaaAssistantArknights/recognizer/commit/cf5ebbc89c84684179a4d2c7e7ccdbc131960a2c --- 3rdparty/include/penguin-stats-recognize/depot.hpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/3rdparty/include/penguin-stats-recognize/depot.hpp b/3rdparty/include/penguin-stats-recognize/depot.hpp index 704a51de9d..6e7d46798e 100644 --- a/3rdparty/include/penguin-stats-recognize/depot.hpp +++ b/3rdparty/include/penguin-stats-recognize/depot.hpp @@ -16,7 +16,6 @@ using dict = nlohmann::ordered_json; namespace penguin { - enum CircleFlags { X = 0, @@ -37,7 +36,7 @@ public: _get_item_list(); return *this; } - const dict report(bool debug = false) + const dict report([[maybe_unused]] bool debug = false) { dict _report = dict::object(); return _report; @@ -113,7 +112,7 @@ private: } } } - _item_diameter = round(cv::mean(item_circles)[R] * 2); + _item_diameter = static_cast(round(cv::mean(item_circles)[R] * 2)); for (const cv::Vec3i& c : item_circles) { @@ -128,7 +127,7 @@ private: // show_img(img_blur); int radius = _item_diameter / 2; - int offset = radius * 1.2; + int offset = static_cast(radius * 1.2); ItemTemplates templs; for (const cv::Vec3i& c : item_circles) { @@ -157,7 +156,6 @@ private: // show_img(_img_ext); } }; - } // namespace penguin -#endif // PENGUIN_DEPOT_HPP_ +#endif // PENGUIN_DEPOT_HPP_ \ No newline at end of file