Skip to content

Commit

Permalink
chore: add logs for DirectHit
Browse files Browse the repository at this point in the history
  • Loading branch information
MistEO committed Oct 31, 2023
1 parent 74ce2a0 commit ad2972c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions source/MaaFramework/Task/Recognizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ std::optional<Recognizer::Result> Recognizer::recognize(const cv::Mat& image, co
std::optional<Result> result;
switch (task_data.rec_type) {
case Type::DirectHit:
result = direct_hit();
result = direct_hit(task_data.name);
break;

case Type::TemplateMatch:
Expand Down Expand Up @@ -77,8 +77,9 @@ std::optional<Recognizer::Result> Recognizer::recognize(const cv::Mat& image, co
return result;
}

std::optional<Recognizer::Result> Recognizer::direct_hit()
std::optional<Recognizer::Result> Recognizer::direct_hit(const std::string& name)
{
LogDebug << name;
return Result { .box = cv::Rect(), .detail = json::array() };
}

Expand Down
2 changes: 1 addition & 1 deletion source/MaaFramework/Task/Recognizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Recognizer
std::optional<Result> recognize(const cv::Mat& image, const TaskData& task_data);

private:
std::optional<Result> direct_hit();
std::optional<Result> direct_hit(const std::string& name);
std::optional<Result> template_match(const cv::Mat& image, const MAA_VISION_NS::TemplateMatcherParam& param,
const std::string& name);
std::optional<Result> feature_match(const cv::Mat& image, const MAA_VISION_NS::FeatureMatcherParam& param,
Expand Down

0 comments on commit ad2972c

Please sign in to comment.