bool checkIsHome(const std::string *ADB_IP, cv::Mat *mat, fastdeploy::vision::detection::YOLOv5 *homemodelPoint)
{
screenShot(ADB_IP, mat);
cv::imwrite("../check.jpeg",*mat);
fastdeploy::vision::DetectionResult res;
homemodelPoint->Predict(mat, &res, 0.6f);
short ressize = res.label_ids.size();
cv::Mat mat2 = fastdeploy::vision::VisDetection(*mat, res, 0.6f);
for (size_t i = 0; i < ressize; i++)
{
std::cout << res.label_ids[i] << std::endl;
if (res.label_ids[i] == 0)
{ // 0 是每日商人
std::cout << "检测到每日商人,在家乡主界面" << std::endl;
return true;
}
}
cv::imwrite("../www.jpeg", mat2);
std::cout << "未检测到刀剑,不在家乡主界面" << std::endl;
return false;
}
标签:mat,checkIsHome,--,res,coc,cv,vision,fastdeploy
From: https://www.cnblogs.com/yuxiannana/p/17564466.html