Advanced Pixel Search Library
#121
Posted 04 November 2011 - 10:45 AM
Full-Screen Crash Recovery | Performance Counters in Windows - Measure CPU,Disk,Network etc Performance | Process, Thread, & DLL Functions UDFs | Windows Desktop Dimmer Shade | CrossHairs (FullScreen) | _EnumChildWindows (controls etc) | Rubber-Band Boxes using GUI's (_GUIBox) | File + Process Imports/Exports Information | _DLLStructDisplay (Debug!) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters
Wrappers/Modifications of others' contributions:
_DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity)
UDF's added support/programming to:
_ExplorerWinGetSelectedItems | MIDI UDF (original code: eynstyne)
(All personal code/wrappers centrally located at Ascend4nt's AutoIT Code)
#122
Posted 04 November 2011 - 12:10 PM
please help me,about 10 days ago I still useable but now i not use my script, when I run my script I get a message box saying "Can't start, try again".
followed by the "Failed to load FastFind.dll, application probably won't properly work." message box from FastFind.au3
#123
Posted 04 November 2011 - 01:24 PM
@1loxe2006 : the last version should fix that problem.
Also note that CeramicWeasel has started to write a documentation on FastFind. It will be a nice addition to help people in using FastFind.
Edited by FastFrench, 04 November 2011 - 01:31 PM.
#124
Posted 17 November 2011 - 06:51 PM
http://stackoverflow.com/questions/1855884/determine-font-color-based-on-background-color
#125
Posted 18 December 2011 - 01:54 PM
I juste need some information about FastFind.dll, because I developed an application in C# and I recently found your dll, but after including the dll with DllImport, I tried the FFGetPixel function for example, but it always return "-1"
Sample :
[DllImport(@"....\FastFind.dll")] static extern int FFGetPixel(int X, int Y, int NoSnapShot); private void timer1_Tick(object sender, EventArgs e) { int pixel = FFGetPixel(Cursor.Position.X, Cursor.Position.Y, 0); this.Text = pixel.ToString(); }
Do I have to do something with SnapShot function ?
#126
Posted 04 January 2012 - 08:32 PM
How do you make a webcam motion detection?
Let's say I have a 640x480 webcam pic and I want to detect if someone opens a door in a vertical position of 100x350 at 70px from the left of window.
I thougth using FFLocalizeChanges, but it compares the entire snapshot and the webcam introduces fuzzy pixels every frame because of noise, so snapshots are always different...
Could you post a code example?
#127
Posted 05 January 2012 - 10:42 AM
Yes. When you use the AutoIt wrapper, SnapShots are done implicitely as needed. If you use FastFind.dll in some other language like C#, then you have to explicitely make a SnapShot first to use it.Hello FastFrench,
I juste need some information about FastFind.dll, because I developed an application in C# and I recently found your dll, but after including the dll with DllImport, I tried the FFGetPixel function for example, but it always return "-1"
Sample :[DllImport(@"....FastFind.dll")] static extern int FFGetPixel(int X, int Y, int NoSnapShot); private void timer1_Tick(object sender, EventArgs e) { int pixel = FFGetPixel(Cursor.Position.X, Cursor.Position.Y, 0); this.Text = pixel.ToString(); }
Do I have to do something with SnapShot function ?
You may check the autoit wrapper (FastFind.au3) to see how to do that.
The log file should give you precious hints on the problem.
Edited by FastFrench, 05 January 2012 - 10:46 AM.
#128
Posted 05 January 2012 - 10:57 AM
If you want to localize changes in a restricted region, you should better do SnapShots of only that restricted region (rectangle).Very good UDF/dll. Very fast.
How do you make a webcam motion detection?
Let's say I have a 640x480 webcam pic and I want to detect if someone opens a door in a vertical position of 100x350 at 70px from the left of window.
I thougth using FFLocalizeChanges, but it compares the entire snapshot and the webcam introduces fuzzy pixels every frame because of noise, so snapshots are always different...
Could you post a code example?
But you're right : LocalizeChanges do not handle ShadeVariations, so it has no noise tolerancy.
There are probably many ways to do that. The starting point would be compare a pic with the door opened and another with the door closed. If you have a significative area with a relatively homogeneous color when opened and closed, then
ColorCount should do the job. You need to experiment to find the optimal ShadeVariation value.
Hope this will help,
FF
Edited by FastFrench, 05 January 2012 - 10:58 AM.
#129
Posted 05 January 2012 - 03:35 PM
Cam1 is with all doors closed, Cam1_Zones has doorA, doorB and doorC that's not visible.
Cam2 is with DoorB open, Cam3 is with DoorB half-closed, Cam4 is with DoorA open.
I don't think it's possible with ColourCount, because one can check the colourCount of B when closed and it's brown with some shadevariations, but if someone opens it (you can fire this with ColourCount) and leaves B open like Cam2 you can't use the previous ColourCode brown code, because there is no more brown... So you could not detect anymore if someone crosses. And what about someone dressed with similar colour?
I hope to detect if someone enters A and crosses B, or enters from B and crosses C and so on.
I think the best mode should be to compare two adjacent screenshots taken every about 700ms and looking at how many contiguos pixels changed: so if they are a lot contiguos px changed, there was motion in that reported area A, B or C.
This way the webcam noise should not interfere because they are sparse pixels over all the screenshot.
I don't know if this is possible with your udf, up to now.
If it's not possible, I think you could add this feature: it should be a value one for all motion detection uses.
Or maybe another approach could be to flatten the most differences in the colours, making a flat cartoon uniform pic, so eliminating noise, and then compare these screenshots with FFLocalizeChanges.
Like Emboss or Cartoonize.
http://cartoonized.net/tutorial-turning-photograph-into-cartoon-part1.php
But I don't know how to automate this in autoit.
Edited by frank10, 05 January 2012 - 03:41 PM.
#130
Posted 10 January 2012 - 10:09 AM
I post some pics as an example.
Cam1 is with all doors closed, Cam1_Zones has doorA, doorB and doorC that's not visible.
Cam2 is with DoorB open, Cam3 is with DoorB half-closed, Cam4 is with DoorA open.
I don't think it's possible with ColourCount, because one can check the colourCount of B when closed and it's brown with some shadevariations, but if someone opens it (you can fire this with ColourCount) and leaves B open like Cam2 you can't use the previous ColourCode brown code, because there is no more brown... So you could not detect anymore if someone crosses. And what about someone dressed with similar colour?
I hope to detect if someone enters A and crosses B, or enters from B and crosses C and so on.
I think the best mode should be to compare two adjacent screenshots taken every about 700ms and looking at how many contiguos pixels changed: so if they are a lot contiguos px changed, there was motion in that reported area A, B or C.
This way the webcam noise should not interfere because they are sparse pixels over all the screenshot.
I don't know if this is possible with your udf, up to now.
If it's not possible, I think you could add this feature: it should be a value one for all motion detection uses.
Or maybe another approach could be to flatten the most differences in the colours, making a flat cartoon uniform pic, so eliminating noise, and then compare these screenshots with FFLocalizeChanges.
Like Emboss or Cartoonize.
http://cartoonized.net/tutorial-turning-photograph-into-cartoon-part1.php
But I don't know how to automate this in autoit.
I see. Probably the best option would be to have a sort of FFLocalizeChanges with an additional "ShadeVariation" (or noise tolerancy) parameter. May be a good candidat for the next version of FastFind.
For all people that failed to dowload FFshowPixels, could you please try again now ? An admin told me that the link is available now.
Thanks,
FF
#131
Posted 12 January 2012 - 10:13 AM
#132
Posted 12 January 2012 - 06:30 PM
In your C func, how do you compare the pixel variations?
Do you trasform the pixel region in array and then compare them as strings?
#133
Posted 12 January 2012 - 09:18 PM
#134
Posted 12 January 2012 - 10:51 PM
Perhaps noise might cause some pixels to loo lose credibility but I doubt all of them in that area would.
Run('hh mk:@MSITStore:'&StringReplace(@AutoItExe,'.exe','.chm')&'::/html/tutorials/helloworld/helloworld.htm','',@SW_MAXIMIZE)
#135
Posted 12 January 2012 - 11:00 PM
I could do this if the doors were always closed after each entry.
But when one enters, he can leave the door open, so I could know the door isn't closed but I can't detect anymore if someone crosses again.
EDIT:
Maybe you mean to put these stickers on the doorposts. Yes in that case it could work.
But it's a bit unaestetich...
Edited by frank10, 12 January 2012 - 11:40 PM.
#136
Posted 12 January 2012 - 11:50 PM
of a fixed area and only acknowledge the break in continuity if all of them change.
Run('hh mk:@MSITStore:'&StringReplace(@AutoItExe,'.exe','.chm')&'::/html/tutorials/helloworld/helloworld.htm','',@SW_MAXIMIZE)
#137
Posted 16 January 2012 - 07:43 AM
With BestSpot, specify something like a 10x10 area with a minimum of 30 matching pixels. This will hopefully be enough to ignore noise and give you a location for the change.
Not perfect, but may work.
You could drastically reduce noise by cartoonizing the snapshot, but you'll never completely eliminate noise with that technique. To do this you could loop through every pixel in the snapshot and "round" it's color to the nearest n'th shade (GetPixel -> Round -> SetPixel), but I don't know how fast that will be.
Edited by CeramicWeasel, 16 January 2012 - 08:24 AM.
#138
Posted 17 January 2012 - 08:57 PM
I thought also to get some orizontal areas in the crossing points and trasform the pixels in Array, then using some string compare method to find how many pixels changed. May work well and also be fast.
#139
Posted 18 January 2012 - 12:10 AM
#140
Posted 18 January 2012 - 04:20 PM
I think of a new function that would simply do a "AND" filter on each pixel of a snapShot. It would be very easy to implement and very fast too.
The usage would be :
Filter(SnapShotNb, FilterValue).
For instance, to ignore the 6 low weight bits out of 8 for each color component, the FilterValue would be 0x00C0C0C0. This would make a decent noise filter (this way, you would actually transform your 24 bits per pixel picture into a 64 colors - or 6 bits per pixel - picture).
Another usage would be to split each color channel (Red, Green and Blue) :
the Red SnapShot would come with Filter(SnapShotNb, 0x00FF0000)
the Green one SnapShot would come with Filter(SnapShotNb, 0x0000FF00)
and the blue one with Filter(SnapShotNb, 0x000000FF)
Any use ?
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users





