I'm using the AForge
library to find a (part of an) image inside other image using this code example.
(The images below are just for give an example)
I'm using this desktop screenshot in 1920x1080 px.:
And I search for and locate this piece of the image above (55x557 px.):
But I resize both images to it's 25% (to gain comparission speed), so when I compare the images the desktop screenshot is 480x270
px. and the cutted image is 13x14
px.
Using the AForge
library it returns me the relative coordinates of the found (cutted) image inside the resized desktop screennshot, the coordinates are x=86, y=200
.
Now I need to set the mouse position in my dektop, in the center of the VMWare icon (more exactlly in the center of the found cutted image), and here is where I'm confussed, what is the arithmetic operation to set the mouse position there?
I'll remember:
Resolutions:
My Desktop: 1920x1080
Image 1 : 1920x1080
Image to find in Image1 : 55x57
Resized Image1: 480x270
Resized Image to find in Image1 : 13x14
Relative coordinates of the found resized Image to find in Image1 :
x=86, y=200