Jump to content



Photo

Advanced Pixel Search Library


  • Please log in to reply
285 replies to this topic

Poll: What do you think of this library ? (48 member(s) have cast votes)

What do you think about FastFind ?

  1. It's really great, I can't imagine doing a script without it (23 votes [47.92%] - View)

    Percentage of vote: 47.92%

  2. It's of some use for me in my current scripts (10 votes [20.83%] - View)

    Percentage of vote: 20.83%

  3. I could use it some day (5 votes [10.42%] - View)

    Percentage of vote: 10.42%

  4. Looks nice, but of no use for me (5 votes [10.42%] - View)

    Percentage of vote: 10.42%

  5. I've tried it, but it doesnt fit my needs (1 votes [2.08%] - View)

    Percentage of vote: 2.08%

  6. Sounds good on the paper, but can't make it work (bug or too difficult to use it) (4 votes [8.33%] - View)

    Percentage of vote: 8.33%

Have you tried it ?

  1. Yes, I'm using it right now (21 votes [43.75%] - View)

    Percentage of vote: 43.75%

  2. Somewhat, I've done some testing, will surely use it later (12 votes [25.00%] - View)

    Percentage of vote: 25.00%

  3. I've downloaded it and just played a little with packaged demo scripts (9 votes [18.75%] - View)

    Percentage of vote: 18.75%

  4. I've downloaded it, but not tried it so far (2 votes [4.17%] - View)

    Percentage of vote: 4.17%

  5. Not downloaded it so far, but I probably will some day (1 votes [2.08%] - View)

    Percentage of vote: 2.08%

  6. It's of no interested for me. (3 votes [6.25%] - View)

    Percentage of vote: 6.25%

What is missing or should be improved ?

  1. It has all the features I may need about Pixels Handling (13 votes [16.25%] - View)

    Percentage of vote: 16.25%

  2. OK it's pretty fast, but couldn't it be faster ? (12 votes [15.00%] - View)

    Percentage of vote: 15.00%

  3. Too hard to use it, could you simplify usage ? (10 votes [12.50%] - View)

    Percentage of vote: 12.50%

  4. Some additional features would be nice to have (please explain in a message) (17 votes [21.25%] - View)

    Percentage of vote: 21.25%

  5. It really lacks some decent documentation (I still hope to find someone to help on that) (11 votes [13.75%] - View)

    Percentage of vote: 13.75%

  6. Some critical features are missing, can't use it (please explain in a message) (2 votes [2.50%] - View)

    Percentage of vote: 2.50%

  7. I found some minor bugs (please explain in a message) (3 votes [3.75%] - View)

    Percentage of vote: 3.75%

  8. I've found some serious bugs (please explain in a message) (1 votes [1.25%] - View)

    Percentage of vote: 1.25%

  9. I've never tried it so far, can't tell (6 votes [7.50%] - View)

    Percentage of vote: 7.50%

  10. It would be nice if you could provide easy access to the associated tool - FFShowPixel (3 votes [3.75%] - View)

    Percentage of vote: 3.75%

  11. I would like to use it other languages. Could you provide wrappers ? (please explain in a message) (2 votes [2.50%] - View)

    Percentage of vote: 2.50%

Vote Guests cannot vote

#161 garreh

garreh

    Seeker

  • Active Members
  • 5 posts

Posted 01 February 2012 - 10:25 PM

Actualy I have not much time to make those changes (and also not using AutoIt some time ago). Would someone be ready to implement the AutoIt wrapper part if I provide him updated dll with corresponding prototype to use ?


Isn't AutoIt part the easy bit? I mean I could have a go, at adapting the .au3 file to add this function.... just let me know the parameters etc.







#162 FastFrench

FastFrench

    Adventurer

  • Active Members
  • PipPip
  • 113 posts

Posted 02 February 2012 - 09:51 AM

Ok, thank you very much. In fact, the C++ for some of those points is pretty easy to do (adding some tolerancy on change detection is a bit more challenging). But thinking how to make it easy to use in AutoIt, adding the stuff in the wrapper, and doing some testing, that's a good part of the job, and not the part I like the most.

Can you please gimme your e-mail in a pm, so I can send you the updated dll and instructions when done (within a week I hope) ?

Edited by FastFrench, 02 February 2012 - 09:58 AM.


#163 garreh

garreh

    Seeker

  • Active Members
  • 5 posts

Posted 06 February 2012 - 05:49 PM

I think there is a bug in FFColorCount whilst using the ShareVariation. Just using a shade variation of 1 will cause a jump from 12 pixels to 652312 pixels.... and based on the image this doesn't make any sense.

#164 FastFrench

FastFrench

    Adventurer

  • Active Members
  • PipPip
  • 113 posts

Posted 07 February 2012 - 10:00 AM

Fixed in version 2.0. I send it to you right now for AutoIt parts update.

Changes :
Function with an additionnal parameter (ShadeVariation) :
KeepChanges
LocalizeChanges
HasChanged

New functions :
DrawSnapShotXY (same as DrawSnapShot, with specific top-left position for drawing).
ComputeMeanValues (Gives mean Red, Green and Blue values)
ApplyFilterOnSnapShot (apply a AND filter on each pixels in the SnapShot)

Bug fix :
FFColorCount with ShadeVariation

Version is now 2.0

Thanks !

Edited by FastFrench, 07 February 2012 - 10:00 AM.


#165 FastFrench

FastFrench

    Adventurer

  • Active Members
  • PipPip
  • 113 posts

Posted 10 February 2012 - 02:42 PM

As garreh do not seems to want to work on the AutoIt wrapper anymore, I'm looking for someone else who could do it. Otherwise I'll do it, but probably not soon.

#166 qqwqqw

qqwqqw

    Seeker

  • New Members
  • 2 posts

Posted 18 February 2012 - 05:10 AM

All is pretty good, but can you realize the ability or generally change the way snapshots is taken? Smth like made in AutoHotkey
Big lack of autoit and your lib pixel retrieving functions is inability to use them in cases where screenshot can not be captured with PrtScr key directly from the desktop i mean especially games in fullscreen mode.

Edited by qqwqqw, 18 February 2012 - 05:14 AM.


#167 FastFrench

FastFrench

    Adventurer

  • Active Members
  • PipPip
  • 113 posts

Posted 23 February 2012 - 07:43 PM

There is no assumption on the way you triggers the SnapShots with FastFind.

AutoIt and FastFind can both be used in fullscreen games or whatever, all what your programming skills allow you to code.

#168 qqwqqw

qqwqqw

    Seeker

  • New Members
  • 2 posts

Posted 29 February 2012 - 05:28 PM

Ok, then i have to inform you that in some fullscreen games(many of them at least under Win 7) straight use of GetPixelColor etc always return black.

#169 FastFrench

FastFrench

    Adventurer

  • Active Members
  • PipPip
  • 113 posts

Posted 06 March 2012 - 03:01 PM

Well, in theory it's possible for any application to intercept calls to any Windows API functions. In this case, all we could do is to use low level hardware-dependent API. I most certainly won't.

BTW, FastFind do not use GetPixelColor or such Win32 functions. It just relies on Win32 functions to copy the Screen content when taking a SnapShot (and also GDI+ for Bitmap manipulations). After that point, it only uses it's own representation of the screen, with direct memory access (that's the reason it's so fast).

#170 adolfito121

adolfito121

    Wayfarer

  • Active Members
  • Pip
  • 85 posts

Posted 11 March 2012 - 09:05 PM

Hello from Barcelona.

First of all let me thank to you for sharing your work with all of us.

I though that I was starting to be an average Autoit user... but I'm stuck with you FastFind :oops:

I have a Full screen GUI with an ActiveX object (an offline webpage) that shows a webcam stream on screen:

$GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, 640, 480) $oIE.navigate(@ScriptDir & "\TestPage.html")


Over everything I have a transparent gui and I have drawed the borders of the transparent gui using gdi+ to make it more visible. The gui is resizable and can be moved, so it visualy shows the limits of the area I want to search pixels inside:
$Guipeque = GUICreate("minigui", 100, 50, 300, 200, $WS_POPUPWINDOW, $WS_EX_LAYERED + $GUI_WS_EX_PARENTDRAG, WinGetHandle(AutoItWinGetTitle())) WinSetOnTop($Guipeque, "minigui", 1) GUISetBkColor(0xABCDEF) _WinAPI_SetLayeredWindowAttributes($Guipeque, 0xABCDEF, 255) Global $size = WinGetPos("minigui") GUISetState(@SW_SHOW) $medicion = 0 $size = WinGetPos("minigui") Local $Guipeque, $hGraphic, $hPen ; Draw line _GDIPlus_Startup() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($Guipeque) $hPen = _GDIPlus_PenCreate(0xC4FF0000, 5) _GDIPlus_GraphicsDrawLine($hGraphic, 1, 1, 1, $size[3], $hPen) _GDIPlus_GraphicsDrawLine($hGraphic, 1, 1, $size[2] - 5, 1, $hPen) _GDIPlus_GraphicsDrawLine($hGraphic, 1, $size[3] - 5, $size[2], $size[3] - 5, $hPen) _GDIPlus_GraphicsDrawLine($hGraphic, $size[2] - 5, $size[3] - 5, $size[2] - 5, 0, $hPen) Sleep(10) _GDIPlus_PenDispose($hPen) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown()


It looks like:
Posted Image

The html file is the webcam stream running the sobel operator on real time.

I want to look for pixels only inside the transparent gui. I tried to do :
$size = WinGetPos("minigui") FFSnapShot($size[0], $size[1], $size[2], $size[3]) $coord1 = FFBestSpot(3, 2, 3,$size[0] + $size[2],$size[1] + $size[3]/2,0xFFFFFF, 1) If Not @error Then MouseMove($coord1[0], $coord1[1], 0);I move the mouse to the found pixels) EndIf


But I always get:
Posted Image

And:
Posted Image

And the mouse point correctly the nearest pixels next to the right side of the transparent gui.

But if I put the mug outside the transparent gui the mouse also points to the nearest pixels, even if they are outside the transparent gui :bye:

What do I'm doing wrong?
Is there any chance of getting an error when there are not any white pixel inside the transparent gui?

Is there any way of look for any color except one? (for me it would be easier to look for anything different from black.

Thanks again.

Greets from Barcelona

#171 FastFrench

FastFrench

    Adventurer

  • Active Members
  • PipPip
  • 113 posts

Posted 12 March 2012 - 11:32 AM

I guess WinGetPos("minigui") returns height and width where FFSnapShot needs right and bottom.

It fails because 102<300 and 52<200.

Edited by FastFrench, 12 March 2012 - 11:34 AM.


#172 TechnoMan

TechnoMan

    Seeker

  • New Members
  • 2 posts

Posted 12 March 2012 - 07:41 PM

Hey,

first im from Austria so my englis is not the best :bye:

I need to do a PixelSearch while Full Screen Mode is active.

THe normal PixealSearch() wont work, so i searched a bit and found this thread..

But i have big problems understanding the functions :/

So what i want is:

Search a Pixel in in a Full-Screen, and get back the Coordinates.

So i hope you can help me..

Thanks :oops:

Edited by TechnoMan, 12 March 2012 - 07:48 PM.


#173 Melba23

Melba23

    Yes, me!

  • Moderators
  • 15,744 posts

Posted 12 March 2012 - 07:44 PM

TechnoMan,

Welcome to the AutoIt forum. :bye:

Unfortunately you appear to have missed the Forum Rules on your way in. Please read them now and then you will understand why you will get no help for this request. :oops:

M23
StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
RecFileListToArray- An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options
GUIListViewEx - Insert, delete, move, drag and sort ListView items

#174 TechnoMan

TechnoMan

    Seeker

  • New Members
  • 2 posts

Posted 12 March 2012 - 07:53 PM

Hey,

thanks :oops:

Sry bro but youre right. I forgot to read them.. I try to avoid english textes ^^. So i just edidet my post, and hope thats okay :/

TechnoMan

#175 Jos

Jos

    oh joy ...

  • Developers
  • 21,104 posts

Posted 12 March 2012 - 07:59 PM

Sry bro but youre right. I forgot to read them.. I try to avoid english textes ^^. So i just edidet my post, and hope thats okay :/

Nope ... bro ... to late is how we call this.

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)


#176 adolfito121

adolfito121

    Wayfarer

  • Active Members
  • Pip
  • 85 posts

Posted 12 March 2012 - 10:14 PM

I guess WinGetPos("minigui") returns height and width where FFSnapShot needs right and bottom.

It fails because 102<300 and 52<200.

Oh, I see. Thanks a lot! Now it works as it should

I have created 4 exclusion areas:
$size = WinGetPos("minigui")     Sleep(20)     $area1 = FFAddExcludedArea(0, 0, @DesktopWidth, $size[1])     Sleep(20)     $area2 = FFAddExcludedArea(0, 0, $size[0] , @DesktopHeight)     Sleep(20)     $area3 = FFAddExcludedArea(0, $size[1] + $size[3], @DesktopWidth, @DesktopHeight)     Sleep(20)     $area4 = FFAddExcludedArea($size[0] + $size[2], 0, @DesktopWidth, @DesktopHeight)


cheers

#177 Dalord

Dalord

    Seeker

  • Active Members
  • 10 posts

Posted 23 March 2012 - 01:38 AM

Where can i find 2.0 ?

#178 FastFrench

FastFrench

    Adventurer

  • Active Members
  • PipPip
  • 113 posts

Posted 26 March 2012 - 08:48 AM

Sorry, but you can't for now. As I couldn't find someone to help on the AutoIt part, I've not released it yet. The dll is ready, but the wrapper is not. Unfortunately I've too few time to come back on Autoit to update and test the wrapper.

Edited by FastFrench, 26 March 2012 - 08:48 AM.


#179 frank10

frank10

    Polymath

  • Active Members
  • PipPipPipPip
  • 217 posts

Posted 10 April 2012 - 08:15 AM

I didn't receive any new posts with email in this topic, but I had subscribed it... Strange.

Anyway, now I could test some code for 2.0 if you want.

#180 p0werdance

p0werdance

    Seeker

  • New Members
  • 1 posts

Posted 10 April 2012 - 08:37 PM

Excuse me, can I use the original search mode function PixelSearch as a function of FFNearestPixel?
I need the coordinates of the first pixel.Thanks.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users