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

Maybe your dll file was corrupted then. It happens some rare times. You may want to check for viruses on you PC too.

Do someone have problems with the current version (2.2) ?

Hi thank you for your library but i have serious problem with it.

#include "FastFind.au3"
#Include <WinAPI.au3>
#include <Array.au3>
AutoItSetOption("WinTitleMatchMode", 4)
Global $Diff
Func MakeScreen1 ()
While 1
FFSnapShot(0,0,100,100,1)
;FFDuplicateSnapShot(1,3)
ConsoleWrite("FFSnapShot1" & @CRLF)
Sleep(1000)
FFSnapShot(0,0,100,100,2)
;FFDuplicateSnapShot(2,4)
ConsoleWrite("FFSnapShot2" & @CRLF)
Sleep(1000)
$Diff = FFIsDifferent(1,2)
ConsoleWrite("FFIsDifferent: " & $Diff & @CRLF)
WEnd
EndFunc
MakeScreen1()

There are allways errors after FFIsDifferent function execution, when i try to make new snapshot at same slot. And also it breaks While.

Edited by dondavis
Link to comment
Share on other sites

Hello,

do you know if Visual Debugging is active ? That may explain why you always have differences : when Visual Debugging is set, then first change is shown on the screen (with a small red circle)... appearing on the next capture.

Can you do the same test with all debugging off ?

Thanks,

Link to comment
Share on other sites

  • 4 weeks later...

Any chance you will be adding the image search functionality? Beeing able to search the same screenshot for several images would speed up my project alot.

Wishlist:

Load snapshot from bmp/jpg

Find (smaler) snapshot inside another snapshot (option to return "found(true/false)" or array of results with coords)

Link to comment
Share on other sites

  • 2 weeks later...

Hello, i want ask: I can make better my script for speed Return? With FastFind. If yes, how to translate? This Work for Video player (video area) in Window mode.

<snip>

 

Need make action very fast in frame of video (If Mouse right button down. FF wait pixel in coord. And click on this frame, not on other frame) Example Movie Files

Thank you very much, if can help me. Sorry for my Bad English)


DO NOT REPLACE THE SCRIPT A SECOND TIME - READ MY POST BELOW, WE DO NOT SUPPORT GAME AUTOMATION HERE :naughty:

Edited by Melba23
Code removed a second time - it had better be the last
Link to comment
Share on other sites

  • Moderators

Tixan,

Welcome to the AutoIt forum. :)

 

This Work for Game

I suggest you read the Forum rules (there is also a link at bottom right of each page) - partcularly the bit that says no game interaction - before you post again. ;)

M23

Edited by Melba23
Typo

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

Any chance you will be adding the image search functionality? Beeing able to search the same screenshot for several images would speed up my project alot.

Wishlist:

Load snapshot from bmp/jpg

Find (smaler) snapshot inside another snapshot (option to return "found(true/false)" or array of results with coords)

Hello,

honnestly, I've switched to C# like 18 months ago, and C++ looks very bulky now for me to use.

So if there is massive demand for for simple-to-implement feature, OK, but otherwise, few chance.

 

Sorry ;)

FF

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...
Hey FastFrench

 

I have question : on your FastFind_Demo.au3, the FFLocalizeChanges crashes on the second loop. Do you have any idea what could be the problem?

Even i tried this code and when i press "end" button a second time, it crashes.

#include "FastFind.au3"
#Include <WinAPI.au3>
#include <Misc.au3>


HotKeySet("{ESC}", "TheEnd")
HotKeySet("{HOME}", "home")
HotKeySet("{END}", "end")

$i = 1
$dir = "D:\FastFind 2_2\"

FFSnapShot(225, 293, 1140, 705, 1)
FFSaveJPG($dir & "image1",100,true,225, 293, 1140, 705)  

while 1
   Sleep(10)
Wend

func end()

  $i = $i + 1

  FFSnapShot(225, 293, 1140, 705, $i) 
  FFSaveJPG($dir & "image" & $i,100,true,225, 293, 1140, 705) 
  $Res = FFLocalizeChanges(1,$i,0) ; Search all differences between two SnapShots
  if @Error Then
    Beep(500, 300)
  Else 
    MsgBox(0, "Mouse x,y:","Change detected : ("&$Res[0]&","&$Res[1]&","&$Res[2]&","&$Res[3]&"), "&$Res[4]&" pixels are different")
  EndIf
Endfunc
   
Func TheEnd()
  CloseFFDll() ; Unload the DLL, free the memory, close files...
  Exit
Endfunc
Link to comment
Share on other sites

  • 3 weeks later...

Hello,

you're right, I've reproduced the same problem on the Demo. Not sure if that's the only reason, but looks like there're tons of useless data written in the trace file for each call to IsExluded (that is, for each pixel in the area !). I don't have the sources at hand right now, I'll check this problem ASAP.

You can maybe avoid this by removing all Debug data : set all FFSetDebugMode into FFSetDebugMode(0).

@neuronet : sorry, not yet. There is so much I'd like to do on this library; that each time I open the project, I spend all my time available to debug and improve it, and so do not proceed the needed cleaning.

Link to comment
Share on other sites

  • 3 weeks later...

Thanks FastFind. I'm waiting for your cleanup.

What would be maybe an interesting "expansion" of your actual dll is to implement some of the functions in a d3d9.dll since directx windows often produce problems. Within a d3d9.dll it would be possible then to work directely with the captured backbuffer.

Link to comment
Share on other sites

  • 2 months later...
  • Developers

Hi, I always get error from FFSnapShot when I try to input the screen size.

I think the error is in line 3 of your script. ;)

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • 3 weeks later...

Hi, FastFrench

First of all, thank you for a great library. I have one issue though, one that is already mentioned;

Hello,

you're right, I've reproduced the same problem on the Demo. Not sure if that's the only reason, but looks like there're tons of useless data written in the trace file for each call to IsExluded (that is, for each pixel in the area !). I don't have the sources at hand right now, I'll check this problem ASAP.

You can maybe avoid this by removing all Debug data : set all FFSetDebugMode into FFSetDebugMode(0).

 

Any update on this?

I'm having the same issue (crash) as BeginnerUser when running FFLocalizeChanges(0, 1) the second time (in FastFind_Demo). I've tried setting FFSetDebugMode(0), but it didn't help.

I need to compare two snapshots and see if there's been any changes. Is there a workaround?

Either way, I'd love to help out if you decide to share the source. Happy holidays! :-)

--DHL

Link to comment
Share on other sites

Just a small update to my last post with some new bits of information that might help debug the issue:

  • I downloaded version 1.3 of the script (from http://www.autoitscript.fr/forum/viewtopic.php?f=21&t=7090) and it works with FFLocalizeChanges and FFisDifferent (tried on autoit x32 on Windows 8.1)
  • When trying version 1.5-2.1 I get the error message that FastFind.dll cannot be opened when initializing the script.
  • Version 2.2 crashes on second run of FFLocalizeChanges (as described in previous post)

Hope this helps.

Link to comment
Share on other sites

Hello!

I'm trying to use this library to create 60x60px window to show 6x zoomed 10x10px area under the mouse pointer to make precised snapshots. After FFSnapshot I'm using FFGetPixel, but it returns color 0x00737373 or 0xffffffff, though when i'm using FFSaveBMP i'm getting what expected - colorful picture. Here is code fragment:

$pos = MouseGetPos()
   
   FFSnapShot($pos[0]-5, $pos[1]-5, $pos[0]+4, $pos[1]+4, 0)
   If Not $emcTempFileTaken Then
      $emcTempFileTaken = True
      FFSaveBMP ( "temp" )
   EndIf
   
   Local $c
   
   For $x = 0 To 9
      For $y = 0 To 9
         $c = FFGetPixel($x,$y, 0)
         DbgLog($locn&'.(x,y)=('&$x&','&$y&') c='&Hex($c))
      Next
   Next

What is wrong with FFGetPixel?

.................................................
Well, I found the reason: FFGetPixel needs coordinates relative to source of the corresponding snapshot, but not snapshot itself, i.e. if you take FFSnapShot(10, 10, 50, 50) then you should use FFGetPixel(10,10) to get color of snapshot's left-top corner pixel, but not FFGetPixel(0,0)!

I spend valuable time to understand this by experinence, so I think this particular case and related ones must be explained in documentation.

Edited by DiamondeX
Link to comment
Share on other sites

  • 4 weeks later...

Hello !

First I'd like to apologize for providing such a scarse support for this library.

We have a proverb in French that says : "Tout vient à temps à qui sait attendre". I'm not sure how it translates into English. But well, here it is : I finally found back the last version of FastFind sources, and put that on a shared repository (GitHub). That's very optimized but honestly not very readable code. Hope some of you will be able to improve it.

Here is the link : https://github.com/Fastfrench/FastFind
 

Please let me know when you use or change those sources, or if you have trouble using GitHub.

You can also input issues on GitHub to track them properly. And keep this post to communicate about the changes.

If you want to contribute actively on this project, please show me some suggested changes you'd like to include.

If it shows that you know what you're doing, then I'll set you as a contributor on the GitHub project (so you can directly change the sources on GitHub).

Thanks to all,

FF

Edited by FastFrench
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...