Make A Security Camera With Python

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everybody and welcome to the youtube video so in today's video i'm going to show you how to make a security system in python using the opencv module now what we'll be doing is actually detecting a face or a body in our video camera footage so you need to have some type of webcam to be able to follow along with this video or any type of camera that you can kind of like plug into your computer and you can view in live time what we'll do is we'll be accessing that camera using opencv detecting a face or detecting a body and then as soon as we detect that we're going to start recording so we're actually going to record all of the motion or all of the time that this thing is in the frame this person is in the frame we'll then save that video and then from there you guys can extend this you could email it to yourself you could send yourself a notification you could you know snap a photo of the person's face will actually show you how we can get directly the face from the video frame anyways this will be a really good kind of starting point if you are trying to build you know a security camera or security system or something along those lines with that said let's go ahead and dive in and start writing some code [Music] okay so let's go ahead and get started now the first thing i will mention is that i do have an opencv python tutorial series so in this video i will kind of skim through some of the more advanced opencv concepts i'm not going to explain them in depth because they would take a really long time so if you do want to understand how those things work then do go and check out my opencv python tutorial series i'll kind of reference which videos which things are talked about in as we go through here and i'll leave a link to that series in the description so now that i've mentioned that the first thing that we need to do here is install opencv so it doesn't really matter what operating system you're on open your terminal open your command prompt here i'm in vs code so i'm using the vs code terminal and type pip3 install opencv hyphen python now if that doesn't work for you try just pip if that doesn't work try python hyphen m like that and if that doesn't work try python 3 hyphen app okay try all of those i already have this installed so i'm not going to run that command once you have it installed though we can continue if for some reason that doesn't work i'll leave two videos in the description that show you how to fix this pip command one for mac and linux the other for windows okay now that we have that i'm in a python file i'm in vs code and the first thing i'll mention is wherever you create this python file is where the video recordings are going to be saved so just you know make this in a folder or something just don't put this like directly on your c drive because there's going to be a ton of video files when you're actually running this okay so now let's import a few things we're going to import cv2 we're going to import time and we're going to import date time okay we'll use some of these later first thing i'm going to show you how to do is access your webcam and just view video here in python so that's step one so to do that we're going to say capture is equal to cv2 dot video capture like that and we're going to put the number zero now what you can do if you have multiple video capture devices is index them with zero one two three the first video device will be zero i only have one so i can only put zero but if you had multiple you do one two and so if you're not getting the correct video camera just increment this number go up uh each time and just check and see if you're getting the right device now that we've done that what i need to do is set up a wallop so i'm going to say while true and i'm going to say underscore comma frame is equal to cap dot read so what i'm doing is reading one frame from my video capture device i'm then going to display that on the screen and so we'll display a ton of frames i mean that's really what a video is right a ton of images so we'll do that and we'll be able to see our video now if you're wondering why i did this the underscore is a placeholder variable i could do something like h or x or some variable name the reason i'm doing that is because this returns something else as well we don't really need to know what that is but the only thing we care about is the frame so we're going to say whatever this is we don't care about so we just put an underscore comma frame this is what we want all right so now what we're going to do is say cv2 dot i am show we're going to show as our camera the frame now this is just going to be the title of the window that shows you the actual video frame name this whatever you want doesn't need to be camera and then put frame right here great now that we have that i just need to set up one thing that allows us to actually quit this because right now if you run this you're going to be an infinite loop and without crashing your program you won't be able to actually quit this while loop so to do that we are going to say if and this will be cv2 dot weight key one equals equals the ordinal of q then break now i won't really explain how this works again watch the cv2 tutorial series specifically i believe the first video actually it might be a different video but one of those videos explains how this works but this pretty much just says hey if you hit the q key stop okay break the program end all right now that we have that we need to release the resources from this camera so it's just good practice after you kind of access a camera that you release the resource so what we're doing here is we're saying okay give me access to the video capture device it's going to activate the video camera and then this program has control of it okay so you won't actually be able to run this if another device is using your video camera actively so make sure it's not being used when you run this but what we need to do is make sure that once this program ends something else can now use the video camera so we're going to say dot release like that and that will release the resource kind of clean it up and allow other things to now use this once the program ends then we're going to say cv2.destroy all windows and this will destroy the window that is showing the video capture device perfect now that we have all this we can run our code cross our fingers and pray that this works i will mention this does take usually for me like 15 20 seconds to actually run not sure why it takes so long hopefully for you guys it's faster but it's totally normal if it's kind of hanging here i've had it hang for up to like you know 45 seconds sometimes and so if you see me cutting throughout this video it's probably because i'm just getting past the hanging of the video account anyways i can see my video camera on now so let me get out of vs code notice we have this camera frame here and you can see my beautiful face now in two places on the screen regardless to quit i'm gonna hit q we are now done and we can continue okay so now that we've done that we have access to our video camera i want to detect faces and bodies so to do that i'm going to use something called a harcass skate now a har cascade is kind of the first word that i need to say it's a hard cascade classifier and what the hard cascade classifier is is something that is pre-trained and pre-built by opencv to detect faces or whatever we want really in images so in this case we're going to use a face detection one and a body detection one and really all you need to know about these is that you pass an image to them they've been trained on like hundreds of thousands if not millions of images they're really really good and they can tell you very quickly if faces exist in the image and where those faces are or if whatever you're trying to classify exists in the image so to set these up we're going to say face underscore cascade is equal to cv2 dot cascade classifier like this we're then going to pass cv2.data dot har cascades like this plus and then the name of the hard cascade we want to access so in this case i want the har cascade underscore frontal face underscore default dot xml let me make sure this is correct looks good to me except i gotta spell cascade correctly so this is what we want let me just kind of run through this line and explain what i just did so i set up a cascade classifier i need to pass to it a classifier all of the classifiers we have here already exist they're pre-built into opencv you don't need to install them or download them or anything and one of the ones we have is this frontal face default classifier and so i have to pass kind of like the base directory of where all of these classifiers exist which is cv2.data.har cascades make sure you have the plural here so the s and then i add the actual name of the classifier so i just want this classifier that's pretty much it uh if you want a full list of all of the classifiers i'll leave a link to it in the description you can mess around with other ones they pretty much all work the same okay now we have face we want body so i want the body cascade i'm going to say cb2.data.hardcascades and this time rather than the frontal face default i want the full body not fully body the no that was actually right full body like that dot xml let me make sure that's correct yes that looks good okay so we now have the full body one and we have the frontal face one so now that we have them let's actually use them so to use them the first thing i need to do is actually convert my frame here to a grayscale image so all of these classifiers require a grayscale image to do the classification and they will tell us the location and presence of any faces in the grayscale image now it doesn't really matter we can still show like the color image on the screen it's just that to do the classification it needs grayscale so i'm going to say gray is equal to and this will be cv2.cvt color like that we're going to pass our frame we're going to pass cv2 dot color and this is going to be bgr 2 and then gray okay what this will do is give us a new image that is grayscale and yeah that's about it that's all i can really say for that okay now that we have the grayscale image let's use a classifier so i'm going to say faces in lowercase is equal to face cascade not dot fit dot this is going to be detect and then multi-scale like this it's a specific algorithm we're going to use with the hard cascade i need to pass to this my frame so i'm going to pass gray which is my grayscale image i need to pass what's known as a scale factor and what's known as my minimum number of neighbors now let me stop for a second explain what these are so gray clearly is our image okay that's what we want to detect the faces on as i said this is going to return to us a position or sorry list of positions of all of the faces that exist yes this can give you multiple faces if they are all in the image this will actually give you the x y width and height of all faces that exist anyways you pass the frame and then you pass the scale factor now the scale factor is a number that determines the accuracy and speed of this algorithm it does a lot more than that but i'm not going to explain exactly how it works pretty much you should keep this number between 1.1 and 1.5 i find 1.3 is the best kind of middle ground for speed and accuracy but the lower this number goes the more accurate it gets but the slower it is so if i do something like 1.01 by the way the minimum for this number is one you have to have something larger than one you're going to get a very very accurate algorithm but it's going to take a very long time to run so if you're noticing that at 1.3 your faces aren't quite accurate or it's too slow or actually other way around if they're not too accurate make this number lower make it like 1.2 1.1 and if you notice here that it's still too slow then make it something like 1.5 1.6 but again 1.3 will most likely be fine for you these things still work extremely quickly even if you make them like 1.2 or 1.1 but let's go with 1.3 okay now what is minimum number of neighbors uh this one is a little bit complicated but pretty much the way that this har cascade's gonna work is it's gonna detect like hundreds of faces and all of them are gonna be the same face so it's gonna look at my face and it's gonna draw like you know 20 boxes around my face and say we have 20 faces when really it's just my face 20 times and so what you do with this minimum number of neighbors is you say okay how many faces do i need to detect in a specific vicinity for me to call this thing a face and in this case i'm putting five so i have to have five kind of boxes overlapping each other in one area for me to say hey this here this is a face that's what it means so for this number you don't really have to worry about it too much make it something between three and six the higher the number goes the uh less number of faces you're going to get detected the lower the number the more faces so if you're finding it's not picking up faces make it lower maybe make it three or four if you're finding it's picking up too many faces things that aren't faces make it like six okay but five is a really good middle ground anyways now that we have this i'm going to show you how we can actually use this to draw where the faces are on our image so to do this we're going to say 4 x y width and height in faces we're going to say cv2.rectangle this is going to draw a rectangle on the screen we're going to draw this on our frame notice i'm drawing this on my color image not on my grayscale image that's because the grayscale image and the color image in terms of i guess locations so like x y width height where faces are is the exact same so i'm going to say frame i'm going to say x y i'm going to say x plus width and y plus height i'm going to say 255 0 0 and i'm going to say 3. now what the heck did i just do let me explain so frame this is the image you want to draw it on i want to draw an image on this frame okay i wonder a rectangle story on this image then we have point one and point two this is the top left and bottom right hand corner of our rectangle so x y this my top left x plus width and y plus height that is my bottom right so it's telling me the two corners of the rectangle and then i can draw the rectangle according to that that's all i need okay then this is the color of the rectangle don't get confused here this is actually bgr not rgb so 0 0 is going to give me a blue rectangle because blue green red kind of weird how they do it but that's how it is and then this is the line thickness so i want this to be three pixels thick across the rectangle sweet now this will draw all of our faces too because we're doing this in a for loop and if we have no faces well it will draw no faces okay now that we have that i'm going to skip the body for right now we'll just do the face let's run this and let's see if it works and there we go we have our window and notice the blue rectangles kind of follow me around now if i go and like i hide behind my microphone notice it disappears so obviously it's not perfect but considering how quick it is it does a pretty good job so there you go that is the face detection okay i'm going to quit that so now that i have quit that what i'm actually going to do is remove this because i don't actually care about the location of my faces or of my bodies and by the way if you want to do this with the body cascade you do the exact same thing so in fact let's just do this let's say bodies is equal to face cascade dot detect multi-scale 1.3 and 5. so same parameters are okay if you wanted to draw the bodies then what you would just repeat this but you do in bodies instead of faces okay we're not going to do that for right now the point is i don't really care where my faces are where my bodies are because i'm not going to draw rectangles and stuff around them i just want to know if they're there so if they are there then i will start recording that's kind of my logic here if i see a body or face start recording i don't really care where in the frame it is so how can i check if a body or if a face is here well i can look at the length of my faces and the length of my bodies because if i have one face this will be length one if i have one body this will be length one it's a list of locations so i'm going to say if the len of faces plus the lan of bodies is greater than zero then recording equals true and this should be recording not just record okay so we're gonna get the line of the faces add it to the line of bodies if we have at least one body or one face then we will start recording so let's make a variable up here let's call this recording and let's make this equal to true now before i go any further let me show you how to record video and then we'll implement all of the logic for actually doing like recording at a specific time essentially okay so to record video you need a few things the first thing you need is the frame size of the video you want to record so since we're going to be recording our video capture device the frame size of our video recording needs to be the exact same as our video capture device so i'm going to say my frame underscore size is equal to this is going to be a tuple this is going to be the end of cap.get3 cap.get3 gives you the width as a floating point value so we have to round it using int and then we're going to say int and cap dot get four okay so inside of here we put a four so this gives us the height i have one extra bracket there sweet now we have the frame size next thing we need to set up is what's known as our four character code which is the unique identifier for the specific format our video is going to be saved as now i want to save my videos using mp4 format so what i'm going to do is say that my 4cc four character code is equal to cv2 dot video writer underscore 4cc and then inside of here i'm going to pass a mp4v and then an asterisk now let me explain this and let me just look at my notes and make sure i did this right okay looks right right now though we might have to change this later so what this does is actually pass this string here as four parameters to this function so the asterisk kind of like decomposes this and into four separate arguments because this actually accepts four characters right mp v or mp4 and then v so what we need to do is pass well this and an easier way for me to do this is mp 4v with an asterisk hopefully that kind of makes sense but that's what that does okay so now that we have that we need to make an output stream now the output stream is where we're going to write all of our content to and then we will kind of close the output stream once we want to save the video so we're going to say out is equal to cv2.videowriter and we're going to pass the file name so i'll just go with video for right now.mp4 then i need to pass my four character code so i'm going to pass 4cc i need to pass my frame rate so i'm going to go with 20 and lastly i need to pass my frame size okay now you can just do 20 like that as well so you need video name the uh four character code which you got to set up like this and then you need your frame rate make this whatever you want to make it 20 and then frame size i am just going to go with the frame size of my video capture device now that we have out it's actually very very easy to make or save a video what you do is you say out dot write notice i'm doing this in the while loop i'm going to write my frame and now all i need to do is once i quit this while loop here so once i quit the program i have to say out dot release and this will save the video so i'm going to write all of the frames to this output stream and then as soon as i release the stream it saves the video so let's go ahead and save this and run it and let's see if we generate a video now the video will be in the same directory as where your python file is so keep that in mind if you're kind of searching for where the video is alright so here we go i have my video capture stream in front of me notice i'm not drawing the faces anymore that's intentional now when i hit q it stops let me open up my windows explorer and show you video so we will continue in one second but i need to quickly thank the sponsor of this video and this series which is algo expert algo expert is the best platform to use from preparing for your software engineering coding interviews they have over 160 coding interview practice questions taught by the best instructors one of which is me check out algo expert from the link in the description and use the code tech with tim for a discount on the platform all right so here we go we can see the saved video i'm not going to play it i mean like you guys know the video here you go it works it was just what you saw before and now we can continue so now that we know how to save video we know how to access the faces we know how to do all kinds of other stuff what we're going to do is implement the logic for saving videos at a specific time only when a person is in the frame of our video camera so to do this we need a little bit of logic we need this first variable which is recording this next variable we need is i got to look at my notes here we're going to call this detection underscore stopped underscore time we're going to make this equal to none explain why we need this in a second and i'm going to say timer underscore started is equal to false i'm actually going to change recording to be equal to detection to say hey we did detect something we have detected i think that makes more sense okay so let's go with detection if i could spell like that is equal to true okay so the reason i want these two variables detection stop time and time are started is because as soon as someone leaves the frame i still want to record for a certain period of time so you know most traditional video cameras someone comes in the frame or some motion's detected and then it will record like a certain duration of time after they leave the frame that's what i want to do now there's two good reasons for that one that just seems like a good thing to do two what will happen in my algorithm if i don't do this is that as soon as the face is not detected which can happen sometimes like the class the classifier can mess up it will instantly stop recording the video and then it will restart the video immediately and so what you'll get is like you know 100 like millisecond long videos we're just like start stop start stop start stop we don't want that instead we want one longish video and then if i'm out of the frame for a certain period of time then we'll stop and then we'll restart the video as soon as i come back in hopefully that kind of makes sense but that's the idea and if you want to see what happens if you don't do this well then just run it without the logic that i'm going to implement next i need this variable i'm going to say seconds to record after detection kind of a ridiculous variable name but i'm going to go with 5 just so we can very easily change this later on great now that we have this let's go down here so we have our if statement and we say if the atlanta faces plus the line of bodies greater than 0 detection equals true however i want to first say if detection so if detection like this then timer underscore started equals false so you'll see why we need this in a second i'm just going to have to code out a bunch of stuff and then i'll walk you through all the code because it's hard to break this into like different sections otherwise i'm going to say else detection is equal to true so starting off here we're saying okay if we detected a face of our body but we've already detected a face or a body like we're already detecting it just say the timer started as equal to false which means if we were going to stop recording don't stop recording we just detected a body and a face again seems kind of confusing because we haven't implemented the timer started yet but just keep that in mind now here we're saying okay well if we weren't already detecting something so if we hadn't detected something already let's set detection equal to true and now let's start a new video because i want to start a new video or start a new recording whenever i first detect a new body or face after we hadn't been detecting something previously if we were detecting something previously just keep writing to the video output stream we don't need to start a new video otherwise we would have a new video for every frame right so what i'm going to do is take this out variable delete it from there i'm going to put it in here and say out is equal to this however first i want to change this output file name and the name should actually be equal to whatever the current date and time is that's usually what you have for like your video file names when you have some type of security system so we have import date time here make sure you have that we're going to say current time is equal to datetime.datetime like this dot now dot strf time and then i'm just going to copy something in here and i'll explain what this is in a second but it's easier to copy okay so what this is going to do is format our time uh why is this okay i think this is all right i'm just trying to make sure i haven't messed something up here okay it looks good to me so we're saying okay let's get the current time all right and then we're going to format the time so we get it in day month year hour uh month and second or yeah does that make sense hour sorry hour minute second okay day month year hour minute second that's what this is going to give me in this order if you only want say like just the hour minute second then just remove these right you can mess with it as you want but make sure you don't have any colons in here or anything that's an invalid character in saving a file name because if you have that then this just isn't going to work i found that out the hard way when before making this video for like an hour i was debugging and i had a damn colon in this name and that was the issue so just keep it like this that's going to give us our current time so what i'm going to do now is i'm just going to use the current time so i'm going to use an f string and say f and then current time like that dot mb4 so this will actually be my file name let me see if there's anything else i need to do here that actually looks good to me after i do this though i'm just gonna print started recording just so we know that okay we just started recording start a new output stream now we can start writing to that string great so now that we have this part of the logic i'm going to implement else here so i'm going to say okay else if detection so actually this isn't else if this is just life been writing in too many different programming languages recently so i'm going to say all right if we did not detect a body or face but we had detected something previously the detection variable is equal to true then what we're going to do is say start our timer so start our timer for when we should end the video stream or end the video record hopefully this makes sense but if we just stopped detecting something so if we no longer see a face or a body but we just we're seeing a face our body we're gonna wait whatever this variable is so five seconds before we stop our video recording that's what this like part of logic that i'm gonna write is gonna do so i'm going to say timer underscore started is equal to true and then i'm gonna say the detection uh stop time is equal to time dot now okay uh sorry not time.now this is time.time and this will give you the current time now we also could use daytime.now but time.time is just a little bit better for this purpose anyways go with this okay detection time equals time dot time however we need a way to actually stop the video so what i'm going to do is say if the timer has started so if the timer was already started if we already did this then what i want to do is check if the timer is past its five seconds so i'm going to say if time dot time minus the detection stop time is greater than seconds to record after detection so greater than or equal to then what i will do is stop the video i'm going to say detection is equal to false i'm going to say the timer started is equal to false and i'm going to say out dot release this will save the video then i'm going to print stop recording okay and let's just go with capital here for consistency okay then i'm going to put else and i'm going to put this all right so i'm sure everyone's confused so let's run through this and just see what happens all right so let's pick our first scenario for running through this in that we just started the program we've not detected anyone yet this detection variable is false okay that that's the first thing we'll say this for right now is equal to false okay so when this is false we just detect a body or face we did my face just comes in frame and we say okay we've detected a body or face so we get inside this if statement were we just detecting a body of your face no we weren't so we go into the cells so we say okay detection is equal to true we have detected something what's the current time get the current time create our video output stream we're going to make a new video we're going to start recording right now because we just detected a new body or new face okay boom goes on face is in the frame all of a sudden stops face is no longer in the frame so this is false so we go to this lf and we say okay were we just detecting something before we were we were recording before detection was equal to true so what we're going to do is check if the timer was started well the timer was not started because we just stopped detecting something so start the timer all right so we say detection stop time is equal to time dot time this is telling us okay at this point in time we stopped seeing something on the video frame or in the video camera we didn't see a person anymore okay continue all of a sudden we no longer see any more people all right so we no longer see any more people we come back here we say okay were we detecting people before yes we were has the timer started the timer has started so now we run this we say okay well is the current timer or is the current time sorry five seconds past when we started this time that's what it's doing saying has five seconds elapsed if it hasn't we just continue keep running the program if it has though if five seconds or more has elapsed we say detection equals false timer start equals false stop the current recording print stop recording and now everything resets right hopefully that's kind of makes sense okay so now let's imagine that this is not the case all right so maybe it's only been one second or two seconds since someone's left the frame now all of a sudden boom i'm back in the frame we see a face so what happens is this is true we did detect a face or we detect the body the timer has started and we were detecting something before so if detection yes we were detecting something before timer started equals false now the reason for this is i need to kind of reset this time because all of a sudden we just saw another person so we're going to say timer start equals false keep recording and now if the person leaves we're going to have five seconds after they just left to keep record hopefully this is kind of making sense but this is to mitigate the fact if i leave and come in the frame a bunch of times very quickly i don't get like 20 videos i just have one video that maintains or records the entire time of me leaving coming back leaving coming back i'm hoping this is kind of making sense but that's what the logic is doing it's just saying we're not going to stop the recording unless it's been five seconds that someone entered the frame that's what all of this does and at this point i can't really explain it much more you can kind of run through the scenarios yourself and see how this works but i promise you it does work okay now that we have this we actually need to write to the output but we only want to write to the output stream first off the output stream exists and if we are recording so we're going to say if detection then out.right and that's actually all we need for this saying okay well if we are detecting something then we're going to be writing so as soon as this variable becomes false we stop writing to the output stream and while we would have stopped recording and then we would have started a new recording as soon as we detected a new thing hopefully making sense but that's actually all that i need i'm looking at my other screen here to make sure i didn't forget anything and i think this is all the code we need for our security system so let's run this let's test it out and i'll do one more recap and go through everything that we've done okay so let's run give it a second and see what we get for our videos alright so we already got an error my apologies it's because i set detection equal to true to start we need to set this equal to false to start because otherwise we get this out is not defined error because i tried to write to the output stream before i created it so just make detection equal false and let's try it again all right so we just ran it it says started recording because it detected my face what i'm going to do now is leave the frame you'll see that after about five seconds it stops recording then i'll come back in and we'll just we'll do a few examples so i'll be right back all right hopefully you guys enjoyed that me running around here trying to get this to work um let me get my face out of the frame for a second though just so we stopped this last recording all right great so we stopped last recording okay let's start again anyways let's just quit and let me go here and see that we have four recordings now and notice that as i kind of left the frame and come back in the frame or came back in the frame if i didn't wait five seconds the recording didn't stop so it just continued and i left came back in left came back in whatever so hopefully that kind of gave me an example of how this works but obviously you can tweak some of the settings to make it work differently anyways that's it that's literally all we need for this security system so let me make this a bit smaller here and i will kind of go through the code one last time just to make sure everyone is clear and then explain to you how you can maybe make this even better in the future if you wanted to so we create our hard cascades our video capture device you do our imports declare all our variables i don't need to talk about all this here we can quickly cover this we're getting the frame size and we're getting our four character code which is the kind of video format right so i'm going with mpv4 because i'm doing an mp4 video if you wanted a different format you'd have to pick something else again link in the description to find out what those formats are continuing we start our while loop we capture our frame we can convert our frame to grayscale we detect the faces and the bodies in our frame in the grayscale frame we then say have we detected or have we seen any uh faces or bodies if we have we go inside of here and we say okay were we detecting stuff before are we currently recording essentially yes we were so timer start equals false just to make sure that if we were um about to end the video if we'd start that timer we now make that false so we're going to keep recording we kind of like reset the timer if that makes sense that's what this is doing then we go into this else so if we were not recording before then we need to start recording because we just detected a phase of our body so we say the text equals true we get the current time use that as our file name start the video output stream create a new recording okay continuing we go to this life so l if we're recording so if we have not detected any faces or bodies and we're recording then it's time to start the timer and see if any faces or bodies come back in the frame within that time or duration so if the timer started we check if the timer has expired and if it has we stopped the recording if it hasn't we just continue if the timer is not started we start the timer and keep track of when we started the time okay that's it that's how this logic works then we come here we say okay are we detecting something if we are right right pretty much this is saying are we recording if we're recording yes let's write out to the frame then we show the current frame and you press q if you want to quit now it's worth mentioning you don't have to show the frame right like i can do this and this will work perfectly fine without me actually displaying the frame on on the screen obviously the point of that is it makes a better video but you don't need to show this especially if you're just running this on like a raspberry pi and in fact it'll be a lot faster if you don't show this frame on the screen finally we just release all of our resources so i release out just to make sure that in case we were recording and we didn't stop the recording when we got out of this while that we stop it just in case and then we release our video capture device and we destroy all our open cv windows perfect all right so with that said i am going to wrap up the video here all of this code will be available at the link in the description and so will that opencv python tutorial series that would explain all of this more in depth i hope you guys found this useful and you enjoyed the video if you did make sure to leave a like subscribe to the channel i will see you in another one [Music]
Info
Channel: Tech With Tim
Views: 62,690
Rating: 4.9763312 out of 5
Keywords: tech with tim, security camera, python, opencv, displaying video, webcam, detecting faces, detecting body, faces on video, drawing faces on video, diy security camera, diy security camera system, security camera system, recording video, security camera logic, security camera with python, python project, opencv python, python opencv, install opencv, install opencv python, camera system, opencv projects, security camera setup, webcam security camera, webcam security cam
Id: Exic9E5rNok
Channel Id: undefined
Length: 35min 58sec (2158 seconds)
Published: Sat Sep 25 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.