Jump to content
TheShaps

Multithreading , slow performance and ImageScaning

Recommended Posts

TheShaps

Hello guys!

I have a problem. I need to scan about 40 images within 3 to 2 seconds. The program goes on a loop and scans the images one by one then it outputs the name of the picture. I don't know which picture might pop out. I use ImageSearch Algorithm. The problem is its not fast enough and takes about 5 to 4 seconds to scan all the images. I thought about using Multithreading and using 2 threads. one thread would scan form the begining and the other would scan from the end. But there is no multithreading in auto it. so is there a solution to the problem? 

I store the pictures names in array. 

this is the code 

_CaptureRegion()
  
Local $aPathSplit
Local $sDrive = "", $sDir = "", $sFileName = "", $sExtension = ""
Local $EndLoop = UBound ( $games ,$UBOUND_DIMENSIONS =0)
;cs
 for $i = 0 to $EndLoop-1
If BotCommand() Then btnStop()
   If _ImageSearchArea($games[$i],  0,0,0,0,0, $x, $y, 0) Then
      $aPathSplit =_PathSplit($games[$i], $sDrive, $sDir, $sFileName, $sExtension)
      SetLog("recognized: " & $aPathSplit[3] )

      ExitLoop

   EndIf

Note: the values are set to 0,0,0,0,0 to simulate the fastest searching possible 

Thanks

Share this post


Link to post
Share on other sites
Melba23

TheShaps,

It seems you still have not read the Forum rules to which we keep linking you. This is so obviously a game launcher:

$games

You are becoming annoying - next time you go for good.

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 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

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×