Jump to content

idkhow2username

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by idkhow2username

  1. Basically it's been a while since I did any coding and after battling depression (still fighting) I'm starting to feel more like myself and feel the desire to do things I once loved. With that being said I would absolutely love for anyone and everyone to ask me for help on projects or anything really. I'm pretty well versed in AutoIt, I would also like to think I know my way around PHP, HTML, and a few other things. It doesn't matter the project or the question; I just want to get back into coding; picturing things in my head and bringing them to life on a screen. Hope this doesn't come off weird or anything, just seems like a good way to get back into coding seeing as how I have no real ideas for any tools or projects to create at the moment. I'm also killing two birds with one stone; I struggle with social interaction and hope working with people of various projects/problems will help me fine tune my programming and social skills! Thanks for taking the time to read my post, I'm very happy to be apart of this community for as long as I can remember (at least 8 years).
  2. Been doing some tinkering, could you possibly tell me how I can search just the walk way? It's being way too sensitive, in 4 seconds I got maybe 5 instances of no chances when there was no motion. Here's my updated code: #Include <GUIConstantsEx.au3> #Include <IE.au3> #Include <WindowsConstants.au3> #Include <File.au3> #Include <ScreenCapture.au3> #Include <GUIEdit.au3> FileDelete ('log.txt') Opt ('GUIOnEventMode', 1) Opt ('WinTitleMatchMode', 2) Opt ('MostDeclareVars', 1) HotKeySet ('{F8}','_Start') Global $aPix[3][3] $GUI = GUICreate ('Motion Detection', 175, 175, 25, 50, $WS_SIZEBOX) GUISetOnEvent ($GUI_EVENT_CLOSE, '_Exit') GUICtrlCreateButton ('Start', 5, 5, 40, 20) GUICtrlSetOnEvent (-1, '_Start') $Console = GUICtrlCreateEdit ('', 0, 30, 175, 122) GUISetState (@SW_SHOW, $GUI) WinSetTrans ($GUI, '', 225) WinSetOnTop ($GUI, '', 1) While 1 Sleep (25) WEnd Func _Start () $HWnD = WinGetHandle ('My Home - Adobe Flash Player') WinActivate ($HWnD) $Timer = TimerInit () Do _Scan ($HWnD) Sleep (10) Until TimerDiff ($Timer) >= 4000 EndFunc Func _Scan ($Win) Local $Pos = WinGetPos ($Win), $Width = Int($Pos[2]/Ubound($aPix, 1)), $Height = Int($Pos[3]/Ubound($aPix, 2)) Local $Count = 0, $CS For $X = 0 to Ubound($aPix,1)-1 For $Y = 0 to Ubound($aPix,2)-1 $CS = PixelCheckSum ($Pos[0]+($X*$Width), $Pos[1]+($Y*$Height), $Pos[0]+(($X+1)*$Width), $Pos[1]+(($Y+1)*$Height), 10, $Win) If $CS <> $aPix[$X][$Y] Then $Count += 1 $aPix[$x][$y] = $CS FileWriteLine ('log.txt','Motion:' & $Count) Else FileWriteLine ('log.txt','Still.') EndIf _Update () Next Next ;If $Count > 4 Then ; _ScreenCapture_CaptureWnd ("\capture\" & @YEAR & @MON & @MDAY & "-" & @HOUR & @MIN & @SEC & ".jpg", $GUI2) ;EndIf EndFunc Func _Update () $Str = FileRead ('log.txt') GUICtrlSetData ($Console, $Str) _GUICtrlEdit_Scroll ($Console, 4) EndFunc Func _Exit () FileDelete ('log.txt') Exit EndFunc I'm trying to just scan this region of the video feed:
  3. Thank you for the help! What I'm wondering now is the video stream opens in it's own Adobe window and the stream isn't taking up the entire screen, how do I go about scanning that window, but just where the camera stream is (and more logically only the walk way on my porch needs to be scanned for movement). Here's a screen shot of what the live feed looks like. I know it's simple enough to get the cords of that window, make it active, just don't really know where to go from there, I was it to be as effective as possible by only scanning the areas people could possibly walk. I would tinker with my script, but I'm not at home. Also if you don't mind, could you explain how your function works? I would love to have a better comprehension on how you're doing the math to scan the area. Here's the code I'm working with after the camera stream is opened. #Include <GUIConstantsEx.au3> #Include <IE.au3> #Include <WindowsConstants.au3> #Include <File.au3> #Include <ScreenCapture.au3> Opt ('GUIOnEventMode', 1) Opt ('WinTitleMatchMode', 2) Opt ('MostDeclareVars', 1) HotKeySet ('{F8}','_Start') Global $aPix[3][3] $GUI = GUICreate ('Motion Detection', 175, 175, 25, 50, $WS_SIZEBOX) GUISetOnEvent ($GUI_EVENT_CLOSE, '_Exit') GUICtrlCreateButton ('Start', 5, 5, 40, 20) GUICtrlSetOnEvent (-1, '_Start') $Console = GUICtrlCreateEdit ('', 0, 30, 175, 122) GUISetState (@SW_SHOW, $GUI) WinSetTrans ($GUI, '', 225) WinSetOnTop ($GUI, '', 1) While 1 Sleep (25) WEnd Func _Start () $HWnD = WinGetHandle ('My Home - Adobe Flash Player') WinActivate ($HWnD) EndFunc Func _Map ($Win) Local $Pos = WinGetPos ($Win), $Width = Int($Pos[2]/Ubound($aPix,1)), $Height = Int($Pos[3]/Ubound($aPix,2)) Local $Count = 0, $CS For $X = 0 to Ubound($aPix,1)-1 For $Y = 0 to Ubound($aPix,2)-1 $CS = PixelCheckSum ($Pos[0]+($X*$Width),$Pos[1]+($Y*$Height),$Pos[0]+(($X+1)*$Width),$Pos[1]+(($Y+1)*$Height)) If $CS <> $aPix[$X][$Y] $Count += 1 $aPix[$x][$y] = $CS EndIf Next Next If $Count > 4 Then _ScreenCapture_CaptureWnd ("\capture\" & @YEAR & @MON & @MDAY & "-" & @HOUR & @MIN & @SEC & ".jpg", $GUI2) EndIf EndFunc Func _Exit () Exit EndFunc
  4. My bad. The question I'm asking is for this project, but it could also be used for other things. Sorry though, not trying to be annoying or anything. Just getting over some depressing; getting back into stuff I used to love. Wasn't trying to get the problem solved quicker, just thought it could use it's own post for anyone else who might need the functionality.
  5. So basically I'm trying to add motion detection to the camera on my front porch because the build in feature triggers at nothing. The theory I'm using for motion detection is figuring out how to do x amount of quadrants on the video stream it's self and for each of those quadrants do a Pixelchecksum and from there determine how many quadrants changed in order to detect motion. Pixelchecksum allows you to skip pixels too, so that's what I'll be doing. Tinkering with amount of quadrants and pixels to skip to get accurate motion detection is the goal. How would I go about getting the quadrants? Here's my code thus far, any help would be greatly appreciated. #Include <GUIConstantsEx.au3> #Include <WindowsConstants.au3> Opt ('GUIOnEventMode', 1) $GUI1 = GUICreate('Main', 100, 35, 100, 100) GUISetOnEvent ($GUI_EVENT_CLOSE, '_Exit', $GUI1) GUICtrlCreateButton ('Map Quadrants', 5, 5, 90, 25) GUICtrlSetOnEvent (-1, '_Map') GUISetState(@SW_SHOW) WinSetOnTop ($GUI1, '', 1) $GUI2 = GUICreate('Test', 350, 350, 205, 100, $WS_EX_TOOLWINDOW) GUISetOnEvent ($GUI_EVENT_CLOSE, '_Exit', $GUI2) GUISetState(@SW_SHOW) While 1 Sleep (50) WEnd Func _Map () Local $Pos = WinGetPos ($GUI2), $Quadrants = 10 ; From here how do I make my program draw 10 perfectly sized buttons bunched together on my test GUI? The purpose is I'm going to implment it into searching ; a video stream and each quadrant will allow me to see how much has changed in order to detect motion. EndFunc Func _Exit () Exit EndFunc
  6. The theory I'm using for motion detection is figuring out how to do x amount of quadrants on the video stream it's self and for each of those quadrants do a Pixelchecksum and from there determine how many quadrants changed in order to detect motion. Pixelchecksum allows you to skip pixels too, so that's what I'll be doing. Tinkering with amount of quadrants and pixels to skip to get accurate motion detection is the goal. How would I go about getting the quadrants? Here's my script so far. #Include <GUIConstantsEx.au3> #Include <WindowsConstants.au3> Opt ('GUIOnEventMode', 1) $GUI1 = GUICreate('Main', 100, 35, 100, 100) GUISetOnEvent ($GUI_EVENT_CLOSE, '_Exit', $GUI1) GUICtrlCreateButton ('Map Quadrants', 5, 5, 90, 25) GUICtrlSetOnEvent (-1, '_Map') GUISetState(@SW_SHOW) WinSetOnTop ($GUI1, '', 1) $GUI2 = GUICreate('Test', 350, 350, 205, 100, $WS_EX_TOOLWINDOW) GUISetOnEvent ($GUI_EVENT_CLOSE, '_Exit', $GUI2) GUISetState(@SW_SHOW) While 1 Sleep (50) WEnd Func _Map () Local $Pos = WinGetPos ($GUI2), $Quadrants = 10 ; From here how do I make my program draw 10 perfectly sized buttons bunched together on my test GUI? The purpose is I'm going to implment it into searching ; a video stream and each quadrant will allow me to see how much has changed in order to detect motion. EndFunc Func _Exit () Exit EndFunc
  7. Sorry, haven't used these forums since 2009 at least, thanks though! Anyone happen to have any ideas?
  8. So, any cleaner ways to do it? Thanks man! And I've been using AutoIt for a very long time. Just rusty.
  9. I just wanna load the webpage, use PixelChecksum to let me know when motion is detected. I've gotten most of it done, I just want to do it without loading the whole page, scrolling, waiting, then scanning for changes. #Include <GUIConstantsEx.au3> #Include <IE.au3> #Include <WindowsConstants.au3> Local $oIE = _IECreateEmbedded() $GUI = GUICreate('Camera Monitor / Motion Detector', 1000, 800, 100, 100, $WS_OVERLAPPEDWINDOW + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN) GUICtrlCreateObj($oIE, 0, 0, 1200, 1200) GUISetState(@SW_SHOW) $wInfo = WinGetPos ($GUI) MouseMove ($wInfo[0], $wInfo[1], 0) _IENavigate($oIE, 'https://portal.coxhomelife.com/sp/') _IELoadWait ($oIE) _IsLoaded ($wInfo[0], $wInfo[1], $wInfo[2], $wInfo[3]) ControlSend ($GUI, '', '', 'username') ControlSend ($GUI, '', '', '{TAB}') ControlSend ($GUI, '', '', 'password') ControlSend ($GUI, '', '', '{ENTER}') _IELoadWait ($oIE) Sleep (850) _IsLoaded ($wInfo[0] + 145, $wInfo[1] + 285, ($wInfo[2] - 405), ($wInfo[3] / 10)) Sleep (850) ControlClick ($GUI, '', '', 'Left', 1, $wInfo[0] + 200, $wInfo[1] + 200) Sleep (850) _IsLoaded ($wInfo[0] + 145, $wInfo[1] + 285, ($wInfo[2] - 405), ($wInfo[3] / 10)) Sleep (850) ControlClick ($GUI, '', '', 'Left', 1, $wInfo[0] + 200, $wInfo[1] + 200) Sleep (850) ControlSend ($GUI, '', '', '{TAB}') Sleep (850) ControlSend ($GUI, '', '', '{ENTER}') While 1 Local $iMsg = GUIGetMsg() Select Case $iMsg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd GUIDelete() Exit Func _IsLoaded ($A = 1, $B = 1, $C = 1, $D = 1) Sleep (2500) $OG = PixelChecksum ($A, $B, $C, $D) Do $New = PixelChecksum ($A, $B, $C, $D) Until $OG <> $New EndFunc
  10. Alright so here's the jest of it: I have a camera from Cox that I can use to view my front porch, the camera is supposed to have a motion sensor to let you know when someone's there and it doesn't record or anything; we only have it because we swapped it for the land line we never used and saved $5/month. But basically what I want to do is write a program to load the page with the video stream, extract that stream in a pretty little window and scan that stream for changes and setup notification and or recording options. I'm really rusty with AutoIt and have done all the Googling and help file exploring I can possibly do with little to no luck, so that brings me here. Can anyone help me figure out how to extract the video stream from the site? Thank you! Downloads.7z
×
×
  • Create New...