mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-16 09:50:40 +08:00
opt.增加对截图数据全 0 的检查
https://github.com/MistEO/MeoAssistantArknights/issues/99
This commit is contained in:
@@ -593,6 +593,15 @@ bool asst::Controller::screencap()
|
||||
}
|
||||
size_t header_size = unzip_data.size() - std_size;
|
||||
Log.trace("header size:", header_size);
|
||||
|
||||
bool is_all_zero = std::all_of(unzip_data.data() + header_size, unzip_data.data() + std_size,
|
||||
[](uchar uch) -> bool {
|
||||
return uch == 0;
|
||||
});
|
||||
if (is_all_zero) {
|
||||
return false;
|
||||
}
|
||||
|
||||
m_cache_image = cv::Mat(
|
||||
adb.display_height,
|
||||
adb.display_width,
|
||||
|
||||
Reference in New Issue
Block a user