Jump to content



Photo

your webcam as security gaurd!


  • Please log in to reply
14 replies to this topic

#1 ludocus

ludocus

    Possibly inventive crap going on right here

  • Active Members
  • PipPipPipPipPipPip
  • 664 posts

Posted 29 August 2008 - 09:54 AM

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:
Attached File  WebcamSpy.au3   1.01K   800 downloads
Have fuN!
and look at my sig or download here:
Attached File  Webcam.au3   8.63K   895 downloads

Edited by ludocus, 30 August 2008 - 08:53 AM.






#2 spudw2k

spudw2k

    i dunno what i'm doing

  • Active Members
  • PipPipPipPipPipPip
  • 1,147 posts

Posted 29 August 2008 - 05:35 PM

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, 29 August 2008 - 05:45 PM.


#3 ludocus

ludocus

    Possibly inventive crap going on right here

  • Active Members
  • PipPipPipPipPipPip
  • 664 posts

Posted 29 August 2008 - 09:07 PM

thnx!

#4 spudw2k

spudw2k

    i dunno what i'm doing

  • Active Members
  • PipPipPipPipPipPip
  • 1,147 posts

Posted 30 August 2008 - 04:00 AM

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, 03 September 2008 - 02:05 AM.


#5 ludocus

ludocus

    Possibly inventive crap going on right here

  • Active Members
  • PipPipPipPipPipPip
  • 664 posts

Posted 30 August 2008 - 08:54 AM

Nice!!..
Btw I forgot to attach webcam.au3, sorry for that..
Did it now

#6 spudw2k

spudw2k

    i dunno what i'm doing

  • Active Members
  • PipPipPipPipPipPip
  • 1,147 posts

Posted 30 August 2008 - 06:46 PM

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, 03 September 2008 - 02:06 AM.


#7 ludocus

ludocus

    Possibly inventive crap going on right here

  • Active Members
  • PipPipPipPipPipPip
  • 664 posts

Posted 01 September 2008 - 04:06 PM

nice

#8 spudw2k

spudw2k

    i dunno what i'm doing

  • Active Members
  • PipPipPipPipPipPip
  • 1,147 posts

Posted 02 September 2008 - 11:46 PM

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!

Attached Files


Edited by spudw2k, 03 September 2008 - 05:07 AM.


#9 ludocus

ludocus

    Possibly inventive crap going on right here

  • Active Members
  • PipPipPipPipPipPip
  • 664 posts

Posted 20 November 2008 - 03:34 PM

thnx dude :mellow:

#10 Manadar

Manadar

    Taking a REST.

  • MVPs
  • 10,714 posts

Posted 20 November 2008 - 04:30 PM

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, 20 November 2008 - 04:31 PM.


#11 ludocus

ludocus

    Possibly inventive crap going on right here

  • Active Members
  • PipPipPipPipPipPip
  • 664 posts

Posted 20 November 2008 - 04:43 PM

I have no idea how to work with this function..
Could you put it in my script as an example?

#12 Manadar

Manadar

    Taking a REST.

  • MVPs
  • 10,714 posts

Posted 20 November 2008 - 09:47 PM

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.

#13 Aceguy

Aceguy

    YAY ME.....

  • Active Members
  • PipPipPipPipPipPip
  • 669 posts

Posted 21 November 2008 - 11:42 AM

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.
AutoIt         
#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 EndFuncƒo݊÷ Ú«z+ìZš™^jëhŠ×6if _pixelget(245,135,16725,50)=1 then

Edited by Aceguy, 21 November 2008 - 11:43 AM.


#14 ludocus

ludocus

    Possibly inventive crap going on right here

  • Active Members
  • PipPipPipPipPipPip
  • 664 posts

Posted 21 November 2008 - 03:00 PM

Hi there, i have tried seaarching for a working webcam script...
just keeps comming up with a black screen.....

thats probaly because of your webcam..

Edited by ludocus, 21 November 2008 - 03:01 PM.


#15 PhoenixXL

PhoenixXL

    Be what you are, believe me its always the BEST...

  • Active Members
  • PipPipPipPipPipPip
  • 1,324 posts

Posted 19 May 2012 - 09:54 AM

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

Keep Up the c0oL work .............. ;)
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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users