Jump to content

ImageSearch I need it faster


Recommended Posts

  • Moderators

GeneNight,

I am almost convinced that your friend wrote a simple app - what I do not understand is why you are trying to automate it using ImageSearch. To automate the app in any manner you must have some way of telling which question is currently being shown and which of the options is the correct answer - so why not just send the corresponding key (A-D) to select the answer rather than trying to recognise its image on screen?

Other responders,

How many times do we have to ask people not to provide answers, or even respond at all, if one of the Mods is involved in deciding the legitimacy of a thread? Perhaps we need to make an example of someone at some point "pour encourager les autres".....

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

3 hours ago, Melba23 said:

GeneNight,

I am almost convinced that your friend wrote a simple app - what I do not understand is why you are trying to automate it using ImageSearch. To automate the app in any manner you must have some way of telling which question is currently being shown and which of the options is the correct answer - so why not just send the corresponding key (A-D) to select the answer rather than trying to recognise its image on screen?

Other responders,

How many times do we have to ask people not to provide answers, or even respond at all, if one of the Mods is involved in deciding the legitimacy of a thread? Perhaps we need to make an example of someone at some point "pour encourager les autres".....

M23

When I started the bot, I was thinking which way was the best to take. There were 2 choises, ImageSearch or Tesseract UDF, since the examples of the Tesseract UDF weren't working anymore because the site is offline, I decided to go for ImageSearch. If you do have a different way to detect the question and then the aswer, I'm ready to hear your tip. Thank you anyway.

Edited by GeneNight
Link to comment
Share on other sites

  • Moderators

GeneNight,

Have you used the AutoIt Window Info tool (Au3Info.exe in your AutoIt installation folder) to see if you can get any text from the GUI? That would make the whole thing trivial.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

GeneNight,

Run the tool and look to see if there is anything on the "Visible text" or "Hidden text" tabs of the tool when the app window is highlighted. I would not be surprised if there was nothing as the window is probably not a standard Windows GUI, but you never know.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

9 minutes ago, Melba23 said:

GeneNight,

Run the tool and look to see if there is anything on the "Visible text" or "Hidden text" tabs of the tool when the app window is highlighted. I would not be surprised if there was nothing as the window is probably not a standard Windows GUI, but you never know.

M23

Thank you for the explanation, anyway, as you were saying because it isn't a normal windows GUI, I only get this information.

Visible text: 

QWidgetClassWindow
ScreenBoardClassWindow
QWidgetClassWindow
sub
centralWidgetWindow
 

Hidden text: 

QLabelClassWindow
qt_rubberbandWindow
 

Edited by GeneNight
Link to comment
Share on other sites

  • Moderators

GeneNight,

When you reply, please use the "Reply to this topic" button at the top of the thread or the "Reply to this topic" editor at the bottom rather than the "Quote" button - I know what I wrote and it just pads the thread unnecessarily.

You might like to look at this thread which has been a great success in reading various GUIs - but as I have not used it myself I cannot help you further.

M23

 

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

I didnt mean that, I'm sorry. Anyway, it looks like quite complex for my knowledge to this language and to the English language aswell :/. I think it possible to use an OCR fuction for my purpose and I saw you answering to that post, so I guess you know enough about it to help me out. Anyway, if the OCR cannot help me with my purpose, then I'll just wait for other responders. Thank you.

Edited by GeneNight
Link to comment
Share on other sites

As I think Melba has made up his mind on whether or not this is against the rules, I can give you a tip on OCR. The newest version of Tesseract has been moved to Github here, so if you want the latest version then download it there. A UDF to use Tesseract can be found here:

although that is very old and may require a few changes to get working. The UDF I'm using right now required a bunch of tweaks for me to get working a year or two ago. I have a very large amount of experience with OCR so if you need any more help just let me know.

 

UHJvZmVzc2lvbmFsIENvbXB1dGVyZXI=

Link to comment
Share on other sites

As I said my English is poor and I didn't understand why I broke the rules by saying something. Anyway, if I did, I'm sorry. Thank you for replying me about the OCR. I got only one question, do you know how long it takes to read an image? They are like 200 questions, so, does it affect the speed of the fuction such as imagesearch?

Link to comment
Share on other sites

  • Moderators

GeneNight,

You seem fixated on either OCR or ImageSearch as a solution - there might be an easier way. As I mentioned earlier in the thread, how do you know which question is being shown in the app and which of the 4 answers is correct? If we knew how you were going to determine that, we might be able to suggest an alternative method which will meet your strict time requirements - because I doubt either of your 2 current avenues will be able to  do so.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

GeneNight,

Understood - looks like you are stuck with your current choices then.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

I don't have any comment on the speed. I would say it is probably faster than imagesearch but I honestly can't say for sure. You'll have to do tests yourself for that. I can say that in my own scripts OCR is usually quicker, but I am using it differently than you are.

UHJvZmVzc2lvbmFsIENvbXB1dGVyZXI=

Link to comment
Share on other sites

If your friend maintains the app he should be able to set the accessibility properties of all elements. Professional developers should use them. As it are qtwidgets you can try to see whats visible with simplespy as you can find in iuiautomation thread as earlier given. See if element highlights and post output here.

Link to comment
Share on other sites

Thank your for replying me guys,

@ngskicker Unfortunately I did know that but I wanted to be sure by asking someone who knows a bit more than me. Anyway, right now I'm still using imagesearch fuction to finish my project, one thing that I have to do is to try my program on a better hardware because mine is really old.

@junkew I really don't know about what you are talking about because I'm not an Android programmer. I will let my friend read your reply and then I'll tell you.

My last chance is to try to make an "always win bot", if you correctly answer to 4 questions (every sequence is composed of 5), you win anyway. That wasn't the best choice, but I guess is the one that I have to take. Again thanks guys.

Link to comment
Share on other sites

Hi there guys,

I'm here to give you some news. I managed to add 125 questions to the bot but that's not enough for an "always win". That's why I was thinking, why not just slow down the application instead of trying to make the fuction faster...  which looks like impossible. Because I'm using an emulator I decided to slow down it with a simple program   kill -STOP and kill -CONT , I would like to add a fuction like that to my bot without using an external program. May someone help me with that? 

Edited by GeneNight
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...