airtest.aircv.utils module

generate_result(middle_point, pypts, confi)[source]

Format the result: 定义图像识别结果格式.

check_image_valid(im_source, im_search)[source]

Check if the input images valid or not.

检查图像识别的输入.

img_mat_rgb_2_gray(img_mat)[source]

Turn img_mat into gray_scale, so that template match can figure the img data. “print(type(im_search[0][0])”) can check the pixel type.

img_2_string(img)[source]
string_2_img(pngstr)[source]
pil_2_cv2(pil_image)[source]
cv2_2_pil(cv2_image)[source]
compress_image(pil_img, path, quality, max_width=300, max_height=300)[source]

生成缩略图