spoo Posted April 10, 2019 Share Posted April 10, 2019 Requirements 1.import the image 2.Select the portion of an (Region of Interest ) image. 3.find all the instances of that selected image , from the same image 4.Provide the count and Annotated locations to the users I have already got Template_match working (as shown in the below code), but how do i ask the user to select the portion of the image and then use match_template to find how many such image portions are present #AutoIt3Wrapper_UseX64=n ; In order for the x86 DLLs to work #include "OpenCV-Match_UDF.au3" _OpenCV_Startup();loads opencv DLLs _OpenCV_EnableLogging(True,True,True) ;Logs matches, errors in a log file and autoit console output. ;Please note that these examples might not work as the match pictures have to be found with the exact same size on your screen. ;Example 1 ShellExecute("https://xyz.com");Open Website tv.com $Match1 = _MatchPicture(@ScriptDir&"\Match\easy.png", 0.70,False,10,500);Try to find the match picture on the screen. Number of tries: 10, Sleep between each try: 500ms. If Not @error Then _MarkMatch($Match1) ;Debugging: Draws a rect on the screen/coordinates of the match to show the user where the match was found Sleep(100) _ClickMouse($Match1, "left",1) ;Calculates the center of the match and clicks the left mouse once on click position EndIf Sleep(1000) Link to comment Share on other sites More sharing options...
Nine Posted April 10, 2019 Share Posted April 10, 2019 You could take a look at this thread, M23 code could solve your #2, pooja code could solve your #3 and #1. As for #4 depends on how you want to inform your users (maybe some GUI ListView ?)... spoo 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
spoo Posted April 11, 2019 Author Share Posted April 11, 2019 (edited) Thank you:) @Nine Edited April 11, 2019 by spoo Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now