Best Python code snippet using Airtest
sift.py
Source:sift.py
...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 # å°æªå¾åè¯å«ç»æ缩æ¾å°å¤§å°ä¸è´,åå¤è®¡ç®å¯ä¿¡åº¦39 x_min, x_max, y_min, y_max, w, h = w_h_range40 target_img = im_source[y_min:y_max, x_min:x_max]41 resize_img = cv2.resize(target_img, (w, h))42 confidence = _cal_sift_confidence(im_search, resize_img, rgb=rgb)43 best_match = generate_result(middle_point, pypts, confidence)44 print("[aircv][sift] threshold=%s, result=%s" % (threshold, best_match))45 return best_match if confidence >= threshold else None46def _get_key_points(im_source, im_search, good_ratio):47 """æ ¹æ®ä¼ å
¥å¾å,计ç®å¾åææçç¹å¾ç¹,并å¾å°å¹é
ç¹å¾ç¹å¯¹."""48 # åå¤å·¥ä½: åå§åsiftç®å49 sift = _init_sift()50 # 第ä¸æ¥ï¼è·åç¹å¾ç¹éï¼å¹¶å¹é
åºç¹å¾ç¹å¯¹: è¿åå¼ good, pypts, kp_sch, kp_src51 kp_sch, des_sch = sift.detectAndCompute(im_search, None)...
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!