How do I Normalize mouse movement in Matlab from the browser (image processing)?
Show older comments
How do I Normalize mouse movement in Matlab from the browser (image processing)?
Would much appreciate help:
I am doing some image processing in Matlab, using information I pull from the matlab browser.
I am using this code to get the browser position
% top left corner
[top_left_brows] =...
[browser_handle.getLocationOnScreen.getX,browser_handle.getLocationOnScreen.getY];
% width_height
[brows_width_height] =...
[browser_handle.getWidth,browser_handle.getHeight];
brows_rectangle = [top_left_brows,brows_width_height];
Then I take a snapshot of what is in the browser with:
%# Set the capture area as the size for the screen
rectangle = ...
java.awt.Rectangle(brows_rectangle(1),brows_rectangle(2),brows_rectangle(3),brows_rectangle(4));
%# Get the capture
image = robo.createScreenCapture(rectangle);
Then I do some analysis on my image; the one I took the snapshot of.
I do some simple object recognition.
So far- so good
Now I want to interact with the browser using the mouse movement only.
That is easy enough using
robot.mouseMove
What I cannot do is normalise the mouse movement
I have three components; whole screen, browser & the figure that I am doing the image processing in:
The mouse is obviously set to work with the whole screen
I analyse my Figure and get a relative (to its own axis) position
I need to translate (normalise) that to the browser, but I dont even know if the browser has an ‘axes’ object.
I have tried moveptr, but there are too many gaps in my understanding. Will appreciate any help,
Answers (0)
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!