开发者

Finding positon of an image onscreen via image matching

I'm currently trying to write a program in Java which will preform some macros however I need the macros to be capable of finding certain pictures located on my screen.

There is a function in Macro Schedule which is pretty much FindImagePos(myimage.bmp, tolerance(0-255)) and locates the image in about 0.2s at 1080P but the program would be a pain to code in Macro Scheduler. The images are not distorted in any way except for slight color variations which is where tol开发者_Python百科erance comes in,

ex. finding this: http://min.us/idivEC.png in every one of these bars min.us/iR64a.png

I don't think I could code such a function efficiently and briefly skimmed ImageJ and Neuroph which seemed complicated and overkill and would like to know if there was something simpler.

The only theory on how to code this would be to take screenshot, convert it into a 2D RGB array, search the rows for the occurrence of the first row in the sample image with some leniency (aka tolerance) and if it matches up somewhat then check underneath the row for the second row and so on.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜