Skip to content

Commit

Permalink
[update] 選択肢の認識処理修正
Browse files Browse the repository at this point in the history
グレースケール画像も処理する
  • Loading branch information
Cilda committed Nov 3, 2022
1 parent 28049d6 commit 367b461
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion UmaUmaChecker/Uma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,14 @@ std::shared_ptr<EventSource> Uma::GetEventByBottomOption(const cv::Mat& srcImg)
cv::threshold(gray, bin, 90, 255, cv::THRESH_BINARY);

std::wstring text = GetTextFromImage(bin);
return SkillLib.RetrieveEventFromOptionTitle(text);
auto event = SkillLib.RetrieveEventFromOptionTitle(text);
if (event) return event;

text = GetTextFromImage(gray);
event = SkillLib.RetrieveEventFromOptionTitle(text);
if (event) return event;

return nullptr;
}

std::shared_ptr<EventSource> Uma::GetCharaEventByBottomOption(const cv::Mat& srcImg)
Expand Down

0 comments on commit 367b461

Please sign in to comment.