Тёмный

Motion Detection Alarm System in Python 

NeuralNine
Подписаться 357 тыс.
Просмотров 39 тыс.
50% 1

In this video, we build a motion detection alarm system, which recognizes movement in Python.
◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚
🐍 The Python Bible Book: www.neuralnine.com/books/
💻 The Algorithm Bible Book: www.neuralnine.com/books/
👕 Programming Merch: www.neuralnine.com/shop
🌐 Social Media & Contact 🌐
📱 Website: www.neuralnine.com/
📷 Instagram: / neuralnine
🐦 Twitter: / neuralnine
🤵 LinkedIn: / neuralnine
📁 GitHub: github.com/NeuralNine
🎙 Discord: / discord
🎵 Outro Music From: www.bensound.com/
Timestamps:
(0:00) Intro
(0:11) Preview
(1:26) Coding Alarm System
(15:44) Demonstration
(18:47) Outro

Наука

Опубликовано:

 

1 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 57   
@nopaallo1147
@nopaallo1147 8 месяцев назад
Great presentation, detailed explanation, could not have asked for more
@Krishna-kb9ul
@Krishna-kb9ul Год назад
Dude this is awesome, i have been searching for almost same project, now i just need to alter it to meet my needs , thanks alot ❣️
@musabizimana3587
@musabizimana3587 Год назад
Thanks man, learning so much from these videos
@arek7198
@arek7198 Год назад
Thanks a lot, good presentation.
@arthsingh5878
@arthsingh5878 29 дней назад
great explanation
@tcgvsocg1458
@tcgvsocg1458 Год назад
thx a lot really interesting i will try it right now
@mehdimojaradi
@mehdimojaradi Год назад
You're really great 👍
@vincenzo3292
@vincenzo3292 Год назад
Thank you. Can you recommend a tutorial on how to set up a camera with a computer that runs this code? Appreciate your help.
@vidya-laxmi
@vidya-laxmi Год назад
Impressive...One!
@skgamedev
@skgamedev Год назад
Really good video
@felixronnoh
@felixronnoh Год назад
Nice one.
@andystevens3474
@andystevens3474 Год назад
excellent video
@francescologrillo443
@francescologrillo443 Год назад
thank you , can i have a hint how select different cam and send mail?
@zerlinalilin
@zerlinalilin 3 месяца назад
works!, thanks!
@duscraftphoto
@duscraftphoto Год назад
This was great! One issue that I ran into (because I'm stupid and wasn't paying attention to what I was doing ha ha) is that the cam window has to be selected and in the foreground for the waitKey to be triggered by the key press. If the terminal is selected, it will just type the keyboard output to the terminal and do nothing. I'm sure I'm the only idiot that did this, but just incase anyone else made the same mistake... I figured I'd save you the waitKey Google sinkhole you may end up in ha ha. Keep up the great content, Flori!
@musabizimana3587
@musabizimana3587 Год назад
is there a video on how to set up our IDE to look like yours?
@SiLiDNB
@SiLiDNB Год назад
Thanks
@ndmdm1578
@ndmdm1578 Год назад
i use this motion on my program. i increase the value of threshold.sum to 1000 and even 9999 to verify if it work but still its sensitive to movement..what should i do?
@Solexdballer
@Solexdballer Год назад
Awesome Dude......
@tcgvsocg1458
@tcgvsocg1458 Год назад
can you do a soft for card (like yugioh, magic ,pokemon) that add card show on camera to database with the number of card associate? that can be really itneresting
@tmusic1001
@tmusic1001 Год назад
when I write 'cv2.' it doesn't show me its options like VideoCapture(), but I write it manually and it works properly how to fix it?
@shenzo00ff
@shenzo00ff 10 месяцев назад
Anyone tell me how does he opens his camera/webcam in the video ?
@spike868
@spike868 Год назад
Cool
@user-rm3ed8tr7z
@user-rm3ed8tr7z Год назад
Traceback (most recent call last): File "/Users/vladimir/Desktop/Projects_RU-vid/main.py", line 36, in difference = cv2.absdiff(frame_bw, start_frame) cv2.error: OpenCV(4.7.0) /Users/runner/work/opencv-python/opencv-python/opencv/modules/core/src/arithm.cpp:650: error: (-209:Sizes of input arguments do not match) The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array' in function 'arithm_op'
@flarexlucifer
@flarexlucifer Год назад
i'm also getting same error
@charlesbanana6060
@charlesbanana6060 Год назад
I don't know if you will still reply, but I want to get a smart bulb, and then turn it to a specific color after motion is detected. I can already turn the bulb on and off using voice commands and change is color. Do you think it will be possible this way? Plus, I also wanted to ask if you could give me a bit more details about the type of cameras I can use and how I can connect them to my computer etc. I want fire cameras dey up at the same point, pointing in all four directions.
@alertsByJarvis
@alertsByJarvis 6 месяцев назад
How do u add python code into bulb?
@qwezxc23456
@qwezxc23456 5 месяцев назад
​There are Python libraries for smart bulbs. You connect to the bulb over wi-fi specifying it's IP address​ in Python code.@@alertsByJarvis
@benezer4937
@benezer4937 Год назад
It didnt shows my webcam? My webcam light is turned on but its not showing any video
@koongfu00
@koongfu00 4 месяца назад
How to make this work on a linux server without Qt?
@meditation_and_focus245
@meditation_and_focus245 Год назад
boss my winsound is not producing any sound
@philtoa334
@philtoa334 Год назад
Thx_.
@larianemouad4884
@larianemouad4884 Год назад
Anyone having troubles with the opencv lib, for me it can't find the references
@splou6777
@splou6777 Год назад
me too
@justacoder_
@justacoder_ Год назад
alarm_mode = not alarm_mode wow this is mindblowing lol
@TechWithLoLo
@TechWithLoLo Год назад
Agree +1
@splou6777
@splou6777 Год назад
I have errors at import cv2 and impot imutils
@shenzo00ff
@shenzo00ff 10 месяцев назад
Bro first install in cmd
@havocff4900
@havocff4900 10 месяцев назад
​@@shenzo00ffbro source code available ? Can u share the link
@gemini1014
@gemini1014 Год назад
I am having a prob AttributeError: 'NoneType' object has no attribute 'shape.' any support is appreciated
@kevinflanigan8653
@kevinflanigan8653 Год назад
Same problem here --> frame = imutils.resize(frame, width=500)
@kevinflanigan8653
@kevinflanigan8653 Год назад
Figured it out. Tabbing error. Duh!
@jamesfraser7394
@jamesfraser7394 Год назад
@@kevinflanigan8653 Very old newbie wondering what tab position should be?
@kevinflanigan8653
@kevinflanigan8653 Год назад
@@jamesfraser7394 I believe my problem was that I had the "key_pressed = cv2.waitKey(30)" statement and the two subsequent "if statements" indented too far to the right. Had pull the group back by one tab. I hope that helps.
@ladislav6291
@ladislav6291 Год назад
Hi there That's because your camera won't turn on, so there's no picture Try to change this cap = cv2.VideoCapture(0, cv2.CAP_DSHOW) for this cap = cv2.VideoCapture(0) I hope it helped you
@sarthaksingh7570
@sarthaksingh7570 Год назад
This program was used in squid game Red light and green light...😅😅😅
@booster404
@booster404 5 дней назад
one more subscriber from me
@codenerd7823
@codenerd7823 Год назад
11sec only
@jamesfraser7394
@jamesfraser7394 Год назад
What is causing this...Very old inspired newbie asking. Traceback (most recent call last): File "/home/aladdinsane/vpyenv/detectmotion/detectmotion.py", line 21, in start_frame = imutils.resize(start_frame, width=500) File "/home/aladdinsane/vpyenv/detectmotion/lib/python3.10/site-packages/imutils/convenience.py", line 69, in resize (h, w) = image.shape[:2] AttributeError: 'NoneType' object has no attribute 'shape'
@jamesfraser7394
@jamesfraser7394 Год назад
I'm sure it's not opening the cam on my MacBook so no image.
@ladislav6291
@ladislav6291 Год назад
@@jamesfraser7394 Hi James Here is the code that works on mac You need import playsound and download some alarm ring :) enjoy import threading from playsound import playsound import cv2 import imutils cap = cv2.VideoCapture(0) cap.set(cv2.CAP_PROP_FRAME_WIDTH, 640) cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 480) _, start_frame = cap.read() start_frame = imutils.resize(start_frame, width=500) start_frame = cv2.cvtColor(start_frame, cv2.COLOR_BGR2GRAY) start_frame = cv2.GaussianBlur(start_frame, (21,21), 0) alarm = False alarm_mode = False alarm_counter = 0 def beep_alarm(): global alarm for _ in range(5): if not alarm_mode: break print('ALARM') playsound ('/Applications/Sienna/songs/alert.wav') alarm = False while True: _, frame = cap.read() frame = imutils.resize(frame, width=500) if alarm_mode: frame_bw = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) frame_bw = cv2.GaussianBlur(frame_bw, (5, 5), 0) difference = cv2.absdiff(frame_bw, start_frame) threshold = cv2.threshold(difference, 25,255, cv2.THRESH_BINARY)[1] start_frame = frame_bw if threshold.sum() > 300: alarm_counter += 1 else: if alarm_counter > 0: alarm_counter -= 1 cv2.imshow("Cam", threshold) else: cv2.imshow("Cam", frame) if alarm_counter > 20: if not alarm: alarm = True threading.Thread(target=beep_alarm).start() key_pressed = cv2.waitKey(30) if key_pressed == ord('t'): alarm_mode = not alarm_mode alarm_counter = 0 if key_pressed == ord('q'): alarm_mode = False break cap.release() cv2.destroyAllWindows()
@jamesfraser7394
@jamesfraser7394 Год назад
@@ladislav6291 Thanks Ladislav!!!
@ladislav6291
@ladislav6291 Год назад
@@jamesfraser7394 You're welcome
@guilhermeschitzamaral8627
@guilhermeschitzamaral8627 10 месяцев назад
⥊ 55: 135 0: Good (if not good, then not zero) 1: Ethics 2: Problem-Solution 3: Consent 4: Emotion/Will 5: To Testify/To Meet 6: Why/Who/When/How/Where/What 7: Information 8: Stability 9: Sanity/Seriousness 10: Network (Good Network, because zero) 11: Justice 13: Death 16: Tower 20: Judgement 21: Solving Problems with Ethics 22: Resistance 23: Resilience 30: Good Wave 32: Discernment 33: Sacred 40: Good Force 44: Free Love 50: Good Expression 55: War 57: Counter-Terrorism 60: Good Reason 70: Good Information 80: Good Stability 90: Good Seriousness 95: Only One Global Fiat Currency 96: Blockchain 97: Anarchy 98: Vegan 99: Revolution 100: Liberation 444: Direct Digital Democracy 555: Diplomacy 1000: Possible Conversation Method using numbers to convey meaning For ex.: 6022: Good Reason to Resist.
@guilhermeschitzamaral8627
@guilhermeschitzamaral8627 10 месяцев назад
513
Далее
Context Managers in Python Make Life Easier
15:01
Просмотров 12 тыс.
Бмв сгорела , это нормально?
01:01
Building A Security System In Python...🚨
17:56
Просмотров 50 тыс.
Simple Automated SSH Python Bot
17:50
Просмотров 30 тыс.
Water powered timers hidden in public restrooms
13:12
Просмотров 496 тыс.
25 Nooby Pandas Coding Mistakes You Should NEVER make.
11:30
How I Made AI Assistants Do My Work For Me: CrewAI
19:21
Image Processing with OpenCV and Python
20:38
Просмотров 143 тыс.
Object Tracking with Opencv and Python
30:03
Просмотров 601 тыс.
Make A Security Camera With Python
35:58
Просмотров 232 тыс.