Jump to content

ImageSearch of an image within an image, help please


Yirrlaar
 Share

Recommended Posts

Hello All,

I'm using "ImageSearch2015.au3" and i'm trying to figure out WHY, for the life of me, I can't find an image is hidden.

So what I came up with, is as follows:

_ImageSearchAreaHidden("C:\icon.png", 1, 0, 0, 800, 600, $x1, $y1, 80, 0)

Func _ImageSearchAreaHidden($findImage, $resultPosition, $x1, $y1, $right, $bottom, ByRef $x, ByRef $y, $tolerance, $transparency = 0)
    Local $h, $result
    local $TestScreen = "C:\TestScreen.png" ;previsous screenshot of the image looking for, fully visible
    If Not FileExists($findImage) Then Return "Image File not found"
    If $transparency <> 0 Then $findImage = "*" & $transparency & " " & $findImage
    If $tolerance < 0 Or $tolerance > 255 Then $tolerance = 0
    If $h_ImageSearchDLL = -1 Then _ImageSearchStartup()
    
    If $tolerance > 0 Then $findImage = "*" & $tolerance & " " & $findImage
    $result = DllCall($h_ImageSearchDLL, "str", "ImageSearchEx", "str", $TestScreen, "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $findImage)
    If @error Then Return "DllCall Error=" & @error
    If $result = "0" Then Return False
    $array = StringSplit($result[0], "|")
    If (UBound($array) >= 4) Then
        $x = Int(Number($array[2])) ; Get the x,y location of the match
        $y = Int(Number($array[3]))
        If $resultPosition = 1 Then
            $x = $x + Int(Number($array[4]) / 2) ; Account for the size of the image to compute the centre of search
            $y = $y + Int(Number($array[5]) / 2)
        EndIf
        Return True
    EndIf
EndFunc   ;==>_ImageSearchAreaHidden

Now when the folder with the icon is completely visible, it finds the icon without any issues, however if I cover up the icon, it no longer finds the image in the folder.

Any ideas?

Edited by Yirrlaar
Link to comment
Share on other sites

Well, how will the script find something it cant see? It has to be visible, the same way for you to see something it has to be.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

There is an image of the desktop that I am trying to use as a reference ... Hence 

local $TestScreen = "C:\TestScreen.png" ;previsous screenshot of the image looking for, fully visible

so if it can't see the image on the screen then reference the TestScreen.png and it that way.

Link to comment
Share on other sites

It should detect the image if you feed it a previous screenshot where the image was visible, as you say you did.

I will have to do some tests at home.

Edited by careca
Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

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

×
×
  • Create New...