Re: [Sikuli-driver] [Question #240511]: How same sikuli script can work with different resolutions of Android Phones

2013-12-12 Thread jitengoel
Question #240511 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/240511

jitengoel posted a new comment:
Hi Raimund  HAL-9000,

Thanks for your expert advice. It was really helpful and i am working on
my script now to see if it can work as per some of your suggestions 
tips.

Regards
Jite

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


[Sikuli-driver] [Question #240511]: How same sikuli script can work with different resolutions of Android Phones

2013-12-09 Thread jitengoel
New question #240511 on Sikuli:
https://answers.launchpad.net/sikuli/+question/240511

Hi,

Need some expert advice. 

I have recorded a script using Sikuli and AVD (Eclipse) on one resolution  
device size. I want to use the same script on other AVD with different 
resolution and device size without any changes in script.

Script is getting failed with following error:
--
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
at java.lang.reflect.Method.invoke(Unknown Source) 

org.sikuli.script.FindFailed: FindFailed: can not find 1386574456658.png on the 
screen.
 Line 21, in file 
C:\Users\gur19733\AppData\Local\Temp\sikuli-tmp5666562617732725317.py



Though original script work well as soon as i switch to AVD where i have 
recorded this.

Please suggest.

Regards
Jiten

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #240511]: How same sikuli script can work with different resolutions of Android Phones

2013-12-09 Thread RaiMan
Question #240511 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/240511

Status: Open = Answered

RaiMan proposed the following answer:
As long as on another device the captured image is rendered (visible on
screen) with the same width and height in pixels, the script should
work.

But if the rendering process on the other device displays the image in
another resolution, then usually the width and height in pixels is
different and the image will no longer found by Sikuli.

*** Background: Currently the image search is based on sliding the image probe 
(your captured image) over the base image (the search region - I guess in your 
case the whole screen) pixel by pixel and calculating a match score between 0 
and 1 based on the comparison of the pixels of the 2 rectangles. 
So searching an image of 30x30 in a region of 300x300 internally results in 271 
* 271  comparisons of 2 pixel areas of 30x30.

*** Current solution:
without any special provisions: You need a different image set for every 
different resolution.

If you know, how the images are rendered in the different resolution,
you might try to automatically setup a new image set using some graphics
package like ImageMagick.

Next year I will implement some standard features into version 1.2, that
might help in these situations.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #240511]: How same sikuli script can work with different resolutions of Android Phones

2013-12-09 Thread HAL-9000
Question #240511 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/240511

HAL-9000 posted a new comment:
If you are scripting to target Android emulators there are a couple
things to remember:

Display Scaling:
Screen Size, Scale, and Monitor DPI all appear in making Android emulator. 
Hence two emulators can have the same screen size, yet appear totally different 
on the computer monitor. However, so long as Monitor DPI and Scaling values are 
the same, the icons etc. should appear the same on the computer monitor no 
matter the 'screen size' of the Emulator.

Scaling to Whole Integers:
Scaling is important in Android emulators. You always want the Scale to div a 
whole integer into the screen size. 1 is obviously perfect, but 0.5 is always 
perfect as well (every X,Y of monitor resolution always can always div 2). So, 
if you're hypothetical emulator is 320x640, with a scaling factor of 0.5 the 
on-screen res of that emulator will be 640x1280 - note the numbers guarantee 
the pixels will be addressed to real monitor pixels perfectly.

If the Scale factor cannot divide as a whole integer, the emulator
display aliases the pixels, which makes the graphics different, and
breaks Sikuli. It also places unnecessary clock cycles on the host
machine aliasing all those pixels.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #240511]: How same sikuli script can work with different resolutions of Android Phones

2013-12-09 Thread RaiMan
Question #240511 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/240511

RaiMan posted a new comment:
@HAL 9000
thanks for this perfect explanation and advice

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #240511]: How same sikuli script can work with different resolutions of Android Phones

2013-12-09 Thread RaiMan
Question #240511 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/240511

Assignee: None = RaiMan

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp