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

With Windows 2000 it worked well, as long as gdiplus.dll was added (another dependency of your DLL). Windows XP seemed to work fine, though the FastFind_Demo program crashed with an exception in fastfind.dll. I'm not sure why that failed, it should have worked fine on XP. Could just chalk it up to a Virtual Machine fluke though. It'd be best to test it on a true Windows XP install to make sure.

Link to comment
Share on other sites

hello everybody !

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

Link to comment
Share on other sites

  • 2 weeks later...

I've been searching a while for this, thought I'd just ask here: has anyone created something like this in AutoIt? Before I dig into trying to create it, I thought this might be a good place to ask:

http://stackoverflow.com/questions/1855884/determine-font-color-based-on-background-color

Link to comment
Share on other sites

  • 1 month later...

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 ?

Link to comment
Share on other sites

  • 3 weeks later...

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?

Link to comment
Share on other sites

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 ?

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.

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
Link to comment
Share on other sites

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?

If you want to localize changes in a restricted region, you should better do SnapShots of only that restricted region (rectangle).

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
Link to comment
Share on other sites

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.

post-6572-0-71618700-1325776369_thumb.jp

post-6572-0-13878100-1325776374_thumb.jp

post-6572-0-14994700-1325776383_thumb.jp

post-6572-0-12031800-1325776391_thumb.jp

post-6572-0-81883300-1325776397_thumb.jp

post-6572-0-44352700-1325777677_thumb.jp

post-6572-0-48750400-1325777716_thumb.jp

Edited by frank10
Link to comment
Share on other sites

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

Link to comment
Share on other sites

frank10, If I were you I'd put coloured stickers on the doors, and focus the script attentions on those areas.

Perhaps noise might cause some pixels to loo lose credibility but I doubt all of them in that area would.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

@JohnOne

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
Link to comment
Share on other sites

How about using KeepChanges to blank out everything that hasn't changed, then follow up with BestSpot with a large shade variation that includes everything except black pixels.

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
Link to comment
Share on other sites

Interesting CeramicWeasel, I will try the BestSpot method when I have time. The only problem could be the different color of pixels, but shadeVariation should do the trick.

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.

Link to comment
Share on other sites

I fear that on a reasonably noisy 24 bits per pixel picture recording, most - if not all - pixels will change from one picture to another. Even if the change is usually not perceptible, the color will usually not be exactly the same.

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 ?

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