airtest.core.cv module¶
“Airtest图像识别专用.
-
loop_find
(query, timeout=20, threshold=None, interval=0.5, intervalfunc=None)[源代码]¶ Search for image template in the screen until timeout
参数: - query – image template to be found in screenshot
- timeout – time interval how long to look for the image template
- threshold – default is None
- interval – sleep interval before next attempt to find the image template
- intervalfunc – function that is executed after unsuccessful attempt to find the image template
Raises: TargetNotFoundError
– when image template is not found in screenshot返回: TargetNotFoundError if image template not found, otherwise returns the position where the image template has been found in screenshot
-
try_log_screen
(screen=None, quality=None, max_size=None)[源代码]¶ Save screenshot to file
参数: - screen – screenshot to be saved
- quality – The image quality, default is ST.SNAPSHOT_QUALITY
- max_size – the maximum size of the picture, e.g 1200
返回: filename, “resolution”: aircv.get_resolution(screen)}
返回类型: {“screen”
-
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: 多尺度模板匹配搜索步长.
-
filepath
¶
-