airtest.aircv.utils module

print_run_time(func)[源代码]
generate_result(middle_point, pypts, confi)[源代码]

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

check_image_valid(im_source, im_search)[源代码]

Check if the input images valid or not.

检查图像识别的输入.

img_mat_rgb_2_gray(img_mat)[源代码]

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)[源代码]
string_2_img(pngstr)[源代码]
pil_2_cv2(pil_image)[源代码]
cv2_2_pil(cv2_image)[源代码]
compress_image(pil_img, path, quality, max_size=None)[源代码]

Save the picture and compress

参数:
  • pil_img – PIL image

  • path – save path

  • quality – the image quality, integer in range [1, 99]

  • max_size – the maximum size of the picture, e.g 1200

返回: