ha4t.aircv.cv module

class Template(filename, threshold=None, target_pos=5, record_pos=None, resolution=(), rgb=False, scale_max=800, scale_step=0.005)[源代码]

基类:object

picture as touch/swipe/wait/exists target and extra info for cv match filename: pic filename target_pos: ret which pos in the pic record_pos: pos in screen when recording resolution: screen resolution when recording rgb: 识别结果是否使用rgb三通道进行校验. scale_max: 多尺度模板匹配最大范围. scale_step: 多尺度模板匹配搜索步长.

property filepath
match_in(screen)[源代码]
match_all_in(screen)[源代码]
class Predictor[源代码]

基类:object

this class predicts the press_point and the area to search im_search.

DEVIATION = 100
static count_record_pos(pos, resolution)[源代码]

计算坐标对应的中点偏移值相对于分辨率的百分比.

classmethod get_predict_point(record_pos, screen_resolution)[源代码]

预测缩放后的点击位置点.

classmethod get_predict_area(record_pos, image_wh, image_resolution=(), screen_resolution=())[源代码]

Get predicted area in screen.

match_loop(screenshot_func: <MagicMock name='mock.Device.screenshot' id='140002806826144'>, template, timeout=10, threshold=None, rgb=False, *args, **kwargs)[源代码]

模板匹配循环,直到匹配到一个或多个模板为止. :param screenshot_func: 截图函数,返回截图图片. :param template: 模板列表. :param timeout: 超时时间,单位秒. :param threshold: 匹配阈值. :param rgb: 是否使用rgb三通道进行校验. :return: 匹配到的模板列表.