Jump to content

your webcam as security gaurd!


ludocus
 Share

Recommended Posts

ok, this is very simple..

But nice..!

Place your webcam so, that is is looking to the other side of your room or some place were people walk by.

run the script. the point where the mouse is, is were it is going to get a color from.

What this script simply does is get a color from a point and then if the color changes it plays a beep song and it adds $found + 1

so here it is:

WebcamSpy.au3

Have fuN!

and look at my sig or download here:

Webcam.au3

Edited by ludocus
Link to comment
Share on other sites

I like. I dont have a camera here to test with, but plan on checking it out when I get home. I'd also like to modify it so I choose a region instead of hardcoded region.

edit: http://www.autoitscript.com/forum/index.ph...st&p=572301

Edited by spudw2k
Link to comment
Share on other sites

See my last post for my latest version

Ok, It's still not elegant, but here's my second attempt at modifying/enhancing this script. Suggestions/feedback welcome. Requires the webcam UDf in ludocus' first post.

edit: added screen capture for trigger event and set region reset if window moves. Changed beep to random sequence. Sounds like r2d2.

Sloppy code, sorry. Woo Hoo. 300th post.

Yikes yikes yikes! super buggy. I need to work on my math. I am ashamed for posting such buggy crud. I'll repost when I get the kinks out.

edit: The new and improved version. Supports multiple detect regions. ;) I commented out the screencapture feature so if you want it to do screenshots, uncomment line 98.

See my last post for my latest version

Edited by spudw2k
Link to comment
Share on other sites

See my last post for my latest version

New and improved version above. ;) Multi-region support

Thanks a bunch to ludocus for giving me (and the comunity) the building blocks for this webcam stuff.

edit: I added color correction for lighting changes over time. Also limits trigger to 5 seconds apart minimum and also does color correction.

See my last post for my latest version

Edited by spudw2k
Link to comment
Share on other sites

Alright, this'll be my last post on this topic. The latest and greatest version.

Changes include: Multiple Trigger events. Window adjustment calculation (window gets moved) Added crummy region highlighter when setting/selecting a region. Enjoy.

edit: fixed a fews bugs. Last version.

Warning! The video capture length is unpredictable. Don't leave unattanded - Potential HD Filler!

Spycam.au3

Edited by spudw2k
Link to comment
Share on other sites

  • 2 months later...

Here's a function to compare two colors. Use it to eliminate false positives.

Func _ColorInBounds($pMColor, $pTColor, $pVariation)
    $lMCBlue = _ColorGetBlue($pMColor)
    $lMCGreen = _ColorGetGreen($pMColor)
    $lMCRed = _ColorGetRed($pMColor)
    
    $lTCBlue = _ColorGetBlue($pTColor)
    $lTCGreen = _ColorGetGreen($pTColor)
    $lTCRed = _ColorGetRed($pTColor)
    
    $a = Abs($lMCBlue - $lTCBlue)
    $b = Abs($lMCGreen - $lTCGreen)
    $c = Abs($lMCRed - $lTCRed)
    
    If ( ( $a < $pVariation ) AND ( $b < $pVariation ) AND ( $c < $pVariation ) ) Then
        Return 1
    Else
        Return 0
    EndIf
EndFunc

_ColorGetX functions are defined in either Color.au3 or Misc.au3

Edited by Manadar
Link to comment
Share on other sites

I have no idea how to work with this function..

Could you put it in my script as an example?

I could if it was properly coded, instead of using Globals for everything..

Func _ColorInBounds($pMColor, $pTColor, $pVariation)

$pMColor = 0xFFFFFF

$pTColor = 0x000000

$pVaration = 25

;; With these paremeters it will return false.

$pMColor = 0xFFFFFF

$pTColor = 0xEEEEEE

$pVaration = 25

;; With these paremeters it will return true because the colors are close together.

Link to comment
Share on other sites

Hi there, i have tried seaarching for a working webcam script...

just keeps comming up with a black screen.....

Have tried everything...

but this might help you guys.

#include<Color.au3>


Func _pixelget($hx,$hy,$hclr,$hvar)
    $hget=PixelGetColor($hx,$hy)
    $hrd=_ColorGetRed($hget)
    $hgr=_ColorGetGreen($hget)
    $hbl=_ColorGetBlue($hget)
    
    
    $hrd2=_ColorGetRed($hclr)
    $hgr2=_ColorGetGreen($hclr)
    $hbl2=_ColorGetBlue($hclr)
    
    
    $hrd3=abs($hrd-$hrd2)
    $hgr3=abs($hgr-$hgr2)
    $hbl3=abs($hbl-$hbl2)
    $hres=$hgr3+$hbl3+$hgr3
 

    if $hres <= $hvar Then
        Return 1
    Else
        Return SetError(1,0,0)
    EndIf
EndFuncoÝ÷ Ú«z+ìZ^jëh×6if _pixelget(245,135,16725,50)=1 then
Edited by Aceguy
Link to comment
Share on other sites

  • 3 years later...

Awesome......................................Bro.

Keep Up the c0oL work .............. ;)

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

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