How to use _handle_two_good_points method in Airtest

Best Python code snippet using Airtest

sift.py

Source:sift.py Github

copy

Full Screen

...16 # 匹配点对为1,可信度赋予设定值,并直接返回:17 return _handle_one_good_points(kp_src, good, threshold) if ONE_POINT_CONFI >= threshold else None18 elif len(good) == 2:19 # 匹配点对为2,根据点对求出目标区域,据此算出可信度:20 origin_result = _handle_two_good_points(im_source, im_search, kp_src, kp_sch, good)21 if isinstance(origin_result, dict):22 return origin_result if ONE_POINT_CONFI >= threshold else None23 else:24 middle_point, pypts, w_h_range = _handle_two_good_points(im_source, im_search, kp_src, kp_sch, good)25 elif len(good) == 3:26 # 匹配点对为3,取出点对,求出目标区域,据此算出可信度:27 origin_result = _handle_three_good_points(im_source, im_search, kp_src, kp_sch, good)28 if isinstance(origin_result, dict):29 return origin_result if ONE_POINT_CONFI >= threshold else None30 else:31 middle_point, pypts, w_h_range = _handle_three_good_points(im_source, im_search, kp_src, kp_sch, good)32 else:33 # 匹配点对 >= 4个,使用单矩阵映射求出目标区域,据此算出可信度:34 middle_point, pypts, w_h_range = _many_good_pts(im_source, im_search, kp_sch, kp_src, good)35 # 第四步:根据识别区域,求出结果可信度,并将结果进行返回:36 # 对识别结果进行合理性校验: 小于5个像素的,或者缩放超过5倍的,一律视为不合法直接raise.37 _target_error_check(w_h_range)38 # 将截图和识别结果缩放到大小一致,准备计算可信度...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Airtest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful