Skip to content

Commit

Permalink
fix: testing error
Browse files Browse the repository at this point in the history
  • Loading branch information
MistEO committed Mar 3, 2024
1 parent db47f86 commit b8354bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 2 additions & 4 deletions source/MaaFramework/Instance/InstanceStatus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,8 @@ bool InstanceStatus::cv_mat_equal(const cv::Mat& lhs, const cv::Mat& rhs)
if (lhs.cols != rhs.cols || lhs.rows != rhs.rows || lhs.dims != rhs.dims) {
return false;
}
cv::Mat diff;
cv::compare(lhs, rhs, diff, cv::CMP_NE);
int nz = cv::countNonZero(diff);
return nz == 0;

return std::equal(lhs.begin<uchar>(), lhs.end<uchar>(), rhs.begin<uchar>());
}

MAA_NS_END
4 changes: 4 additions & 0 deletions source/MaaFramework/Task/SyncContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ bool SyncContext::run_recognizer(cv::Mat image, std::string task, std::string_vi
LogError << "Instance is null";
return false;
}
if (image.empty()) {
LogError << "Image is empty";
return false;
}

auto json_opt = json::parse(param);
if (!json_opt) {
Expand Down

0 comments on commit b8354bd

Please sign in to comment.