public double searchIMG(IntPtr handle, Bitmap screen_img, Bitmap find_img)
{
using (Mat ScreenMat = OpenCvSharp.Extensions.BitmapConverter.ToMat(screen_img)) <<<<<<이부분에서 에러가 나는데 제 지식으로는 한계가 있는거 같습니다. 예외처리를 어떻게하면 좋을까요 ?
using (Mat FindMat = OpenCvSharp.Extensions.BitmapConverter.ToMat(find_img))
using (Mat res = ScreenMat.MatchTemplate(FindMat, TemplateMatchModes.CCoeffNormed))
{
double minval, maxval = 0;
OpenCvSharp.Point minloc, maxloc;
Cv2.MinMaxLoc(res, out minval, out maxval, out minloc, out maxloc);
Console.WriteLine("찾은 이미지의 유사도 : " + maxval);
Console.WriteLine("x : " + maxloc.X + ", y : " + maxloc.Y);
X = maxloc.X;
Y = maxloc.Y;
return maxval;
}
}
[최초 등록일: ]
[최종 수정일: 9/19/2020]