mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-18 18:20:39 +08:00
@@ -241,9 +241,13 @@ int asst::DepotImageAnalyzer::match_quantity(const ItemInfo& item)
|
||||
auto mask_rect = cv::boundingRect(mask);
|
||||
mask_rect.width -= 1;
|
||||
mask_rect.height -= 1;
|
||||
|
||||
if (mask_rect.height < 18) mask_rect.height = 18;
|
||||
const auto mid_x = mask.cols / 2; // center of image
|
||||
if (mask_rect.br().x - mid_x < 30) mask_rect.width = mid_x + 30 - mask_rect.x;
|
||||
|
||||
// minus 1 to trim white pixels
|
||||
Rect ocr_roi { item.rect.x + mask_rect.x, item.rect.y + mask_rect.y, mask_rect.width, mask_rect.height };
|
||||
Rect ocr_roi { item.rect.x + mask_rect.x, item.rect.y + mask_rect.y, mask_rect.width - 1, mask_rect.height - 1 };
|
||||
|
||||
cv::Mat ocr_img = m_image_resized.clone();
|
||||
cv::subtract(m_image_resized(make_rect<cv::Rect>(item.rect)), item_templ * 0.41,
|
||||
|
||||
Reference in New Issue
Block a user