{"action":"created","issue":{"url":"https://api.github.com/repos/NetEase/airtest/issues/12","repository_url":"https://api.github.com/repos/NetEase/airtest","labels_url":"https://api.github.com/repos/NetEase/airtest/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/NetEase/airtest/issues/12/comments","events_url":"https://api.github.com/repos/NetEase/airtest/issues/12/events","html_url":"https://github.com/NetEase/airtest/issues/12","id":134240675,"number":12,"title":"发现修改图片分辨率的方法可能有些问题(cv2.resize)","user":{"login":"yisake","id":4221944,"avatar_url":"https://avatars.githubusercontent.com/u/4221944?v=3","gravatar_id":"","url":"https://api.github.com/users/yisake","html_url":"https://github.com/yisake","followers_url":"https://api.github.com/users/yisake/followers","following_url":"https://api.github.com/users/yisake/following{/other_user}","gists_url":"https://api.github.com/users/yisake/gists{/gist_id}","starred_url":"https://api.github.com/users/yisake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yisake/subscriptions","organizations_url":"https://api.github.com/users/yisake/orgs","repos_url":"https://api.github.com/users/yisake/repos","events_url":"https://api.github.com/users/yisake/events{/privacy}","received_events_url":"https://api.github.com/users/yisake/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-02-17T10:24:50Z","updated_at":"2016-02-18T02:29:12Z","closed_at":null,"body":"看了下，项目中将图片分辨率做修改用了cv2.resize函数，用的是余数的宽高比，但是比配的图片阈值并不高，但是我百度了一下，\r\n用了**nim = cv2.resize(imsrc, (**768,1280**), interpolation=cv2.INTER_CUBIC)**，直接带入，发现可以匹配到0.8以上阈值的图片，希望这部分能做下修改。: P\r\n\r\n>>> imsrc = cv2.imread('s1080full.png',cv2.IMREAD_UNCHANGED)\r\n>>> ow, oh = 768,1280\r\n>>> cw, ch = 1080,1920\r\n>>> (ratew, rateh) = cw/float(ow), ch/float(oh)\r\n>>> nim = cv2.resize(imsrc, (0, 0), fx=ratew, fy=rateh)\r\n>>>\r\n>>> imsch = imread('B.png')\r\n>>> result = find_all_template(nim, imsch)\r\ntemplmatch_value(thresh:0.5) = 0.586\r\ntemplmatch_value(thresh:0.5) = 0.574\r\ntemplmatch_value(thresh:0.5) = 0.541\r\ntemplmatch_value(thresh:0.5) = 0.532\r\ntemplmatch_value(thresh:0.5) = 0.529\r\ntemplmatch_value(thresh:0.5) = 0.524\r\ntemplmatch_value(thresh:0.5) = 0.514\r\ntemplmatch_value(thresh:0.5) = 0.504\r\ntemplmatch_value(thresh:0.5) = 0.498\r\n\r\n\r\n>>> imsrc = cv2.imread('s1080full.png',cv2.IMREAD_UNCHANGED)\r\n>>> nim = cv2.resize(imsrc, (768,1280), interpolation=cv2.INTER_CUBIC)\r\n>>>\r\n>>> imsch = imread('B.png')\r\n>>> result = find_all_template(nim, imsch)\r\ntemplmatch_value(thresh:0.5) = 0.872\r\ntemplmatch_value(thresh:0.5) = 0.743\r\ntemplmatch_value(thresh:0.5) = 0.720\r\ntemplmatch_value(thresh:0.5) = 0.666\r\ntemplmatch_value(thresh:0.5) = 0.660\r\ntemplmatch_value(thresh:0.5) = 0.657\r\ntemplmatch_value(thresh:0.5) = 0.650\r\ntemplmatch_value(thresh:0.5) = 0.643\r\ntemplmatch_value(thresh:0.5) = 0.595\r\ntemplmatch_value(thresh:0.5) = 0.593\r\ntemplmatch_value(thresh:0.5) = 0.585\r\ntemplmatch_value(thresh:0.5) = 0.581\r\ntemplmatch_value(thresh:0.5) = 0.547\r\ntemplmatch_value(thresh:0.5) = 0.524\r\ntemplmatch_value(thresh:0.5) = 0.523\r\ntemplmatch_value(thresh:0.5) = 0.519\r\ntemplmatch_value(thresh:0.5) = 0.510\r\ntemplmatch_value(thresh:0.5) = 0.508\r\ntemplmatch_value(thresh:0.5) = 0.495"},"comment":{"url":"https://api.github.com/repos/NetEase/airtest/issues/comments/185513388","html_url":"https://github.com/NetEase/airtest/issues/12#issuecomment-185513388","issue_url":"https://api.github.com/repos/NetEase/airtest/issues/12","id":185513388,"user":{"login":"yisake","id":4221944,"avatar_url":"https://avatars.githubusercontent.com/u/4221944?v=3","gravatar_id":"","url":"https://api.github.com/users/yisake","html_url":"https://github.com/yisake","followers_url":"https://api.github.com/users/yisake/followers","following_url":"https://api.github.com/users/yisake/following{/other_user}","gists_url":"https://api.github.com/users/yisake/gists{/gist_id}","starred_url":"https://api.github.com/users/yisake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yisake/subscriptions","organizations_url":"https://api.github.com/users/yisake/orgs","repos_url":"https://api.github.com/users/yisake/repos","events_url":"https://api.github.com/users/yisake/events{/privacy}","received_events_url":"https://api.github.com/users/yisake/received_events","type":"User","site_admin":false},"created_at":"2016-02-18T02:29:12Z","updated_at":"2016-02-18T02:29:12Z","body":"哈哈，开玩笑的，回到主题，这个问题你怎么看？是调用方法的问题还是？"}}