{"action":"created","issue":{"url":"https://api.github.com/repos/shimat/opencvsharp/issues/527","repository_url":"https://api.github.com/repos/shimat/opencvsharp","labels_url":"https://api.github.com/repos/shimat/opencvsharp/issues/527/labels{/name}","comments_url":"https://api.github.com/repos/shimat/opencvsharp/issues/527/comments","events_url":"https://api.github.com/repos/shimat/opencvsharp/issues/527/events","html_url":"https://github.com/shimat/opencvsharp/issues/527","id":355818701,"node_id":"MDU6SXNzdWUzNTU4MTg3MDE=","number":527,"title":"Why exception occur with OpenCvSharp MatchTemplete ?","user":{"login":"Lay4U","id":31833270,"node_id":"MDQ6VXNlcjMxODMzMjcw","avatar_url":"https://avatars3.githubusercontent.com/u/31833270?v=4","gravatar_id":"","url":"https://api.github.com/users/Lay4U","html_url":"https://github.com/Lay4U","followers_url":"https://api.github.com/users/Lay4U/followers","following_url":"https://api.github.com/users/Lay4U/following{/other_user}","gists_url":"https://api.github.com/users/Lay4U/gists{/gist_id}","starred_url":"https://api.github.com/users/Lay4U/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lay4U/subscriptions","organizations_url":"https://api.github.com/users/Lay4U/orgs","repos_url":"https://api.github.com/users/Lay4U/repos","events_url":"https://api.github.com/users/Lay4U/events{/privacy}","received_events_url":"https://api.github.com/users/Lay4U/received_events","type":"User","site_admin":false},"labels":[{"id":71621893,"node_id":"MDU6TGFiZWw3MTYyMTg5Mw==","url":"https://api.github.com/repos/shimat/opencvsharp/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-08-31T02:36:21Z","updated_at":"2018-09-01T06:52:45Z","closed_at":null,"author_association":"NONE","body":"    public void searchIMG(Bitmap screen_img, Bitmap find_img)\r\n    {\r\n        //스크린 이미지 선언\r\n        using (Mat ScreenMat = OpenCvSharp.Extensions.BitmapConverter.ToMat(screen_img))\r\n        //찾을 이미지 선언\r\n        using (Mat FindMat = OpenCvSharp.Extensions.BitmapConverter.ToMat(find_img))\r\n        //스크린 이미지에서 FindMat 이미지를 찾아라\r\n        using (Mat res = ScreenMat.MatchTemplate(FindMat, TemplateMatchModes.CCoeffNormed))\r\n        {\r\n            //찾은 이미지의 유사도를 담을 더블형 최대 최소 값을 선언합니다.\r\n            double minval, maxval = 0;\r\n            //찾은 이미지의 위치를 담을 포인트형을 선업합니다.\r\n            OpenCvSharp.Point minloc, maxloc;\r\n            //찾은 이미지의 유사도 및 위치 값을 받습니다. \r\n            Cv2.MinMaxLoc(res, out minval, out maxval, out minloc, out maxloc);\r\n            Debug.WriteLine(\"찾은 이미지의 유사도 : \" + maxval);\r\n            //이미지를 찾았을 경우 클릭이벤트를 발생!!\r\n            if(maxval >= 0.8)\r\n            {\r\n                InClick(maxloc.X, maxloc.Y);\r\n            }\r\n        }\r\n    }\r\n\r\ni tried very many times but i don't know why occur exception and solution\r\n\r\nplease help me\r\n\r\nwhen i execute this program then Exception occur like this [exception](https://i.stack.imgur.com/KSKSK.jpg)\r\n\r\nwhen i do debugging and check the different like this [debug](https://i.stack.imgur.com/xuOJp.jpg)\r\n\r\ni don't know why exception occur and how can fix it\r\n\r\nand if you want to see full souce then click below\r\n\r\n[Full Source] (https://colorscripter.com/s/UYNfKXf)"},"comment":{"url":"https://api.github.com/repos/shimat/opencvsharp/issues/comments/417838036","html_url":"https://github.com/shimat/opencvsharp/issues/527#issuecomment-417838036","issue_url":"https://api.github.com/repos/shimat/opencvsharp/issues/527","id":417838036,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNzgzODAzNg==","user":{"login":"shimat","id":4434824,"node_id":"MDQ6VXNlcjQ0MzQ4MjQ=","avatar_url":"https://avatars0.githubusercontent.com/u/4434824?v=4","gravatar_id":"","url":"https://api.github.com/users/shimat","html_url":"https://github.com/shimat","followers_url":"https://api.github.com/users/shimat/followers","following_url":"https://api.github.com/users/shimat/following{/other_user}","gists_url":"https://api.github.com/users/shimat/gists{/gist_id}","starred_url":"https://api.github.com/users/shimat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shimat/subscriptions","organizations_url":"https://api.github.com/users/shimat/orgs","repos_url":"https://api.github.com/users/shimat/repos","events_url":"https://api.github.com/users/shimat/events{/privacy}","received_events_url":"https://api.github.com/users/shimat/received_events","type":"User","site_admin":false},"created_at":"2018-09-01T06:52:45Z","updated_at":"2018-09-01T06:52:45Z","author_association":"OWNER","body":"```c#\r\nusing (Mat screenMat8UC4 = OpenCvSharp.Extensions.BitmapConverter.ToMat(screen_img))\r\nusing (Mat screenMat8UC3 = new Mat())\r\n{\r\n    Cv2.CvtColor(screenMat8UC4, screenMat8UC3, ColorConversionCodes.BGRA2BGR);\r\n\r\n    ...\r\n}\r\n```"}}
{"actor":{"display_login":"shimat"}}