FindImagePos

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
mpsinfo
Junior Coder
Posts: 20
Joined: Mon Apr 19, 2021 1:31 pm

FindImagePos

Post by mpsinfo » Tue Jun 08, 2021 9:07 am

Scuse me if post in Italian but forum for MacroScheduler in ITALY is out. :cry: :evil:

Uso spesso la funzione FindImagePos per la ricerca di parti di immagini presenti su siti WEB dopo avere salvato precedentemente come .bmp porzioni del video.
Accade però che se la finestra WEB viene spostata leggermente di posizione, la mia immagine non venga più riconosciuta, anche variando il parametro "color_tolerance"
FindImagePos>bitmap_to_find,bitmap_to_scan|SCREEN,color_tolerance,return_center,X_Array,Y_Array,NumFound

o modificando il valore "Let>FIP_SCANPIXELS=90".

Questo è parte del mio codice e ultimamente crea più problemi con risoluzioni dei monitor in versione 4K.

FindImagePos>D:\LAVORI\Scheduler email\ricorda.bmp,SCREEN,30,X,Y,NumFound
If>NumFound>0
Msg>VALIDA
Wait>1

Io uso una vecchia versione 11 e volevo sapere se sulle successive versioni è stato migliorato il riconoscimento.

Come potete vedere dall'immagine qui caricata le scritte sembrerebbero identiche, ma se zoomate la foto, vedrete che le sfumature attorno ai testi sono completamente differenti.
Image

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1347
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: FindImagePos

Post by Dorian (MJT support) » Tue Jun 08, 2021 10:17 am

I would imagine it's more likely the browser dimensions have changed, possibly changing the visual properties of the image, rather than the screen position causing a problem. I've also seen this happen if browser magnification settings have been changed.

Your example has the Offset and Algorithm parameters missing, too, but may be that was typed from memory. It should look more like this :

Code: Select all

//Find and Left Click Center of 
FindImagePos>D:\LAVORI\Scheduler email\ricorda.bmp,SCREEN,30,1,X,Y,NumFound,EXACT
If>NumFound>0
  Msg>VALIDA
Endif
This is what the help file has to say about Tolerance with Exact :
If larger than zero the red, green and blue values of the pixels in bitmap_to_scan are checked to see if they are within the tolerance specified (color value + or - tolerance). Smaller values match less and larger values match more.
..so increasing the tolerance from 30 might help.
Yes, we have a Custom Scripting Service. Message me or go here

mpsinfo
Junior Coder
Posts: 20
Joined: Mon Apr 19, 2021 1:31 pm

Re: FindImagePos

Post by mpsinfo » Sat Jun 12, 2021 4:58 pm

I don't know the "Offset and Algorithm" parameters. Can you explain to me how they work?

What is that EXACT value you entered in the row?


I don't know the "Offset and Algorithm" parameters. Can you explain to me how they work?

What is that EXACT value you entered in the row?

I changed the tolerance from 30 to 100 in increments of 10 but nothing changes as does the parameter FIP_SCANPIXELS = 100

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1347
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: FindImagePos

Post by Dorian (MJT support) » Sat Jun 12, 2021 6:15 pm

That is all explained in depth here : http://www.mjtnet.com/manual/index.html ... agepos.htm
Yes, we have a Custom Scripting Service. Message me or go here

mpsinfo
Junior Coder
Posts: 20
Joined: Mon Apr 19, 2021 1:31 pm

Re: FindImagePos

Post by mpsinfo » Tue Jun 15, 2021 6:30 am

My problem is that I still have the ver. 11 by MacroScheduler.

Unfortunately, until I find a profitable benefit, I cannot afford to make updates.

Since the FindImagePos not recognized problem depends on moving the Chrome navigation window, what command can I use to make a web window always open in the same place with the same coordinates? I cannot put the web window in full screen also because in this case I would not have the problem described above.

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1347
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: FindImagePos

Post by Dorian (MJT support) » Tue Jun 15, 2021 7:49 am

I may have picked up on the version if the post was in English. We don't support version 11 as it's 11 years old.

To answer the move/size window question, these were all introduces in V5 :

http://www.mjtnet.com/manual/index.html ... action.htm

https://www.mjtnet.com/manual/index.htm ... ewndow.htm

http://www.mjtnet.com/manual/index.html?movewindow.htm
Yes, we have a Custom Scripting Service. Message me or go here

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts