Jump to content

Advanced Pixel Search Library


FastFrench
 Share

What do you think of this library ?  

35 members have voted

  1. 1. What do you think about FastFind ?

    • It's really great, I can't imagine doing a script without it
    • It's of some use for me in my current scripts
    • I could use it some day
    • Looks nice, but of no use for me
    • I've tried it, but it doesnt fit my needs
    • Sounds good on the paper, but can't make it work (bug or too difficult to use it)
  2. 2. Have you tried it ?

    • Yes, I'm using it right now
    • Somewhat, I've done some testing, will surely use it later
    • I've downloaded it and just played a little with packaged demo scripts
    • I've downloaded it, but not tried it so far
    • Not downloaded it so far, but I probably will some day
    • It's of no interested for me.
  3. 3. What is missing or should be improved ?

    • It has all the features I may need about Pixels Handling
    • OK it's pretty fast, but couldn't it be faster ?
    • Too hard to use it, could you simplify usage ?
    • Some additional features would be nice to have (please explain in a message)
    • It really lacks some decent documentation (I still hope to find someone to help on that)
    • Some critical features are missing, can't use it (please explain in a message)
    • I found some minor bugs (please explain in a message)
    • I've found some serious bugs (please explain in a message)
    • I've never tried it so far, can't tell
    • It would be nice if you could provide easy access to the associated tool - FFShowPixel
    • I would like to use it other languages. Could you provide wrappers ? (please explain in a message)


Recommended Posts

Salut FastFrench , je suis l'original auteur du core PixelGetColor .au3 et je dois dire que ton approches avec FastFind.dll est super cool ;) tu m'as donnés tout pleind d'idee pour mes futurs project autoit.

Donc tout cela pour te dire un gros merci! execlent travail avec FastFind.dll , merci merci :)

Amuse toi :)

GreenseedMCSE+I, CCNA, A+Canada, QuebecMake Love Around You.

Link to comment
Share on other sites

  • 3 weeks later...

Salut FastFrench, je ne sais pas si tu te souviens de moi, je suis de Cadernis. Vu que tu ne t'y connectes plus, je suis venu ici pour résoudre un problème avec FastFind. J'utilise la fonction FFNearestSpot et j'obtiens ceci :

Posted Image

J'ai bien analysé la fonction FFNearestPixel mais je ne sais pas comment résoudre cette erreur car je ne sais pas ce qui la provoque. Je sais juste que ça provient de cette ligne :

local $Result = DllCall($FFDllHandle, "int", "GenericColorSearch", "int", $SizeSearch, "int*", $NbPixel, "int*", $PosX, "int*",$PosY, "int", $Color, "int", $ShadeVariation, "int", $NoSnapShot)

En espérant que tu m'aides à résoudre ce problème, merci :)

Edited by NicoMasterChief
Link to comment
Share on other sites

I discovered the same message just yesterday, I was posting the same NicoMasterChief message :)!

Besides I get a lot of crashes using the FFBestSpot func: I'm trying to detect a White rectangle on a black background to measure how many rotation I get with a drill: I glued a little white rectangle on a drill bit and get it rotating using the webcam to count it.

So I thougth using FFBestSpot to detect it:

local $detected=0 , $a, $counter=1,$t=0
while 1
Sleep(20)
Execute('FFSnapShot(533,279,591,348, ' & 0 &', $hWnd)') ; the area of the drill bit

FFDrawSnapShotXY(0, 10,10) ; just to see I'm just on the drill bit

$ShadeVariation =20
$a = FFBestSpot(20, 10, 80, 0, 0, 0x00FFFFFF, $ShadeVariation, false,0,0,0,0,0)

if $detected = 0 Then
  $detected = 1

  ConsoleWrite(Round(TimerDiff($t),0) & ' ms    GiriTotali:' & $counter & @CRLF )
  $counter += 1
  $t = TimerInit()
EndIf
Else       ;it doesn't detect the white strip
if $detected = 1 Then $detected = 0
EndIf

WEnd

I get a lot of random crashes when calling Fastfind.dll (I set some Consolewrite in the wrapper and saw it breaks only when calling the dll)

Link to comment
Share on other sites

  • 2 weeks later...

I wonder why I've not translated this message in English... but it's better this way :idiot:

Obviously this message was not supposed to be displayed. I guess in your code the problem is that the parameters for FFBestSpot looks wrong.

FFBestSpot ( SizeSearch, MinNbPixel, OptNbPixel, PosX, PosY, Color [, ShadeVariation [, ForceNewSnap [, Left [, Top [, Right [, Bottom [, NoSnapShot [, WindowHandle]]]]]]]] )

$a = FFBestSpot(20, 10, 80, 0, 0, 0x00FFFFFF, $ShadeVariation, false,0,0,0,0,0)

So PosX = 0 and PosY = 0. They are outside your SnapShot : FFSnapShot(533,279,591,348...

Can you try again with correct values and tell us ?

Thanks.

Link to comment
Share on other sites

I was thinking this way:

I get a region in a Snapshot with these coordinates:

FFSnapShot(533,279,591,348...

so the snapshot will be a little rectangle of 591-533= 58px and 348-279=69px, in fact when I show it with

FFDrawSnapShotXY(0, 10,10)

I see the snapshot is this tiny rectangle.

At this point when I call bestSpot, I argue I want posx and y at 0,0 of the little rectangle to get the spot from top left corner.

Instead, if I understand well, you mean I should put the originally region of the snapshot referring to the original size of the window. So it should be 533, 279.

I think it's a bit counterintuitive. In fact if you put X, Y= 533,279 you should go outside the snapshot rectangle of 58x69px.

Anyway, now my old code works. But also 533,279 works. So it's not important the Posx-y.

BUT after 30' of experiments, it gave me the potage msg also using BestSpot func.

And, weird it starts crashing again.

I made a reboot thinking of a memory problem, but it continues crashing also with fresh mem.

Why it was working good before for 30'??

Link to comment
Share on other sites

I checked MystikSpyral previous post, this is the same problem:

Memory usage never budges. These calls are not simultaneous, the memory is freed well before it becomes a problem. And 10,000 is an average. I have had it crash after a few dozen. I've also had it last well over 100,000 iterations. It's not a reliable amount of runs, it's random.

It occurs when using Snapshot limited in a particular area.

I use 1920x1080 desktop with a webcam window size of 1280x720 or 640x480, W7, 8GB ram, i3 cpu.

Edited by frank10
Link to comment
Share on other sites

Too bad it's so difficult to debug this kind of code (dll written in C++ called from AutoIt Script). When I'll find some time to do it, I'll carefully check the code to see what may be wrong. Sounds like it's peeking memory outside array boudaries.

Link to comment
Share on other sites

Hello! Really useful library!

But I have a question:

- How to save PNG files?

- Or how to get last snap image object to use it with standard functions like _GDIPlus_ImageSaveToFile?

Edited by Kverty
Link to comment
Share on other sites

  • 3 weeks later...
  • 2 months later...

If i could rate it 5 stars again i would but FastFrench i have a huge problem where all of sudden the .dll opening throws error "Can't start, try again...." "Failed to open .dll ....." and this happens random all the time.

Please, please, please help with this somehow as i cant keep using fastfind with this problem.

What i tried...

------------------

1. last version - happens randomly

2. 1.8 - happens every single time - i dont understand is there some sort of server check that must pass through before dll opens since the old ones dont open at all anymore?

FastFrench i will gladly pay for your time to handle this if somehow possible, do you have any contact information? Tried to email you but no reply.

Link to comment
Share on other sites

  • 4 weeks later...

Hello all,

sorry for the long delay with no news.

A new version - 2.1 - is available for download. It should solve most of the problems you reported.

Enjoy !

Maybe I'd put the sources on a public vault. Someone would be interested in maintaining this ? (C++ code inside)

Edited by FastFrench
Link to comment
Share on other sites

Hi,

this tool looks very impressive, but I am missing a special function for SW testing.

I would need to load a single (or even several) image(s) from file and then search a screen region for that/the load(ed) image(s).

In my use case I have to compare parts of the UI of an application for one or more possibly displayed graphs. I need to find out if or what of a set of defined graphs is shown. Can this be done?

I see most of the functionality provided, but have not seen the inverse of FFSaveBMP(...) to load such reference images from disk. ANd even in the dll, there's nothing I could identify for this purpose.

Any hints?

TIA and Greetings from Germany!

--

UF

Link to comment
Share on other sites

Thanks for update! I will test it.

A question that is *totally* unrelated to your library as far as it's function. How did you figure out how to sort nearest, best, etc pixel colors? Looking at the html color code, though I see *some* similarity, honestly I can't grasp it. Nor can I seem to find a good reference from anything I try to search on Google.

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