3 way image comparison fails

Asked by surfdork

My scripts compares the values of A, B and C and by this comparison launched a function specific to the DPI detected.

The problems are, aside from the multiple indent errors, that Sikuli can click on buttons when at 120 or 144 DPI. Is there a DPI limitation to Sikuli?

Also, am I making mu comparisons correctly

Lastly where can I shaare my compilation of novice questions and answers for the Sikuli user. I coverthe pain of selecting a useful Puthon IDE, creation of a robust image bank (unless you ha a DPI obsessed boss then all I can offer is meditation)creating a Sikuli based test harness. an localization testing the easy way via recognizing language agnostic objects to key upon.

# Logon with 96, 120 and 144 dpi
# define each logon as a function
def dpiLogin96():
   doubleClick(96 dpi image works )
   wait(10)
   type( , "<email address hidden>")
   wait(2)
   type( , "skyroom200")
   wait(3)
   click( )
   wait(10)
  # if exists( ,0): fails unknown reason
      #wait(1)
   click( )
popup("96 DPI Login Complete")
# end function
def dpiLogin120():
   doubleClick(120 dpi image )#manual click works sikuli fails
   wait(10)
   type( , "<email address hidden>")
   wait(2)
   type( , "skyroom200")
   wait(2)
   click( )
   wait(10)
   #if exists( ,0):
     # wait(1)
   click( )
popup("120 DPI Login Complete")
# end function
def dpiLogin144():
   doubleClick( 144dpiimage) # fails unknown reason, manual click functions
   wait(10)
   type( , "<email address hidden>")
   wait(2)
   type( , "skyroom200")
   wait(3)
   click( )
   wait(10)
   if exists( ,0):
     wait(1)
   click( )

#popup("144 DPI Login Complete")
# end function
# detects the dpi level

if exists( ):#96 dpi detection
      ret = dpiLogin96()
else:
  # if exists( ):# 120 dpi detection
  doubleclick( ) # another method to get DPI
  if exists( )
      ret = dpiLogin120()
        else:
           if exists( ): #144 dpi detection
               ret = dpiLogin144()

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

Sikuli has nothing to do with dpi. On a screen with no intervening app, a picture will be visually larger with a low resolution and smaller with a higher resolution (on the same monitor). On a screen normally a dot is a pixel.

An image in Sikuli is a rectangle containing pixels. e.g. (100x100) pixels is the same on every screen, if all the other aspects of one pixel (e.g. color depth, color scheme, ...) are the same or compatible. an example are the visual size of the icons on a desktop with different resolutions.

so for every different pixel situation, you need one captured image (in your case 3 images).

One more thing:
for your Python IDE question regarding Eclipse/PyDev I have the solution (see your other question).

Can you help with this problem?

Provide an answer of your own, or ask surfdork for more information if necessary.

To post a message you must log in.