1
0
forked from BRT/arc
arc/android/ocr/OcrUtils.h
trnsmkot c79acee002 Add OCR utilities and backend integration for enhanced screen dump analysis:
- Introduce `OcrUtils` with fuzzy-matching logic for text recognition on screenshots.
- Implement dual-pass OCR to handle light-on-dark and dark-on-light text cases.
- Replace hardcoded "Подтверждаю" button tap logic with OCR-based detection and fallback geometry.
- Update `TaskDumpRecorder` to utilize `NetworkService` for uploading screen dumps, images, and metadata to the backend.
- Add support for `/monitoring/dump` endpoint in `NetworkService`.
- Enhance UI functionality with new error handling and progress feedback during dump creation and upload.
2026-04-30 19:17:17 +07:00

22 lines
1.1 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include <QByteArray>
#include <QPoint>
#include <QString>
namespace OcrUtils {
// Находит надпись `needle` на скриншоте (PNG-байты) и возвращает координаты
// центра bounding box-а в системе координат экрана. Если текст не найден —
// возвращает QPoint(-1, -1). Совпадение нечувствительно к регистру и допускает
// одну-две OCR-ошибки в букве (для "Подтверждаю" на оранжевом фоне это важно).
//
// `yMin`/`yMax` — необязательное окно по Y в координатах экрана. Если задано,
// OCR гоняется только по этой полосе, что в 2-3 раза быстрее на 1080×2340.
// 0/0 — обрабатывать всё изображение.
QPoint findTextCenter(const QByteArray &png,
const QString &needle,
int yMin = 0,
int yMax = 0);
} // namespace OcrUtils