View face_lock.py
#! /usr/bin/python | |
# import the necessary packages | |
from imutils.video import VideoStream | |
from imutils.video import FPS | |
import face_recognition | |
import imutils | |
import pickle | |
import time | |
import cv2 |
View simple_alarm.ino
#define SENSOR 3 | |
#define PIEZO 8 | |
#define NOTE_G5 784 | |
#define NOTE_C6 1047 | |
int Sound[] = {NOTE_G5, NOTE_C6}; | |
int SoundNoteDurations[] = {12, 8}; | |
#define playSound() playMelody(Sound, SoundNoteDurations, 2) |
View face_rec.py
#! /usr/bin/python | |
# import the necessary packages | |
from imutils.video import VideoStream | |
from imutils.video import FPS | |
import face_recognition | |
import imutils | |
import pickle | |
import time | |
import cv2 |
View template_matching.py
import cv2 | |
import numpy as np | |
img = cv2.imread("Cover.jpg") | |
gray_img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) | |
template = cv2.imread("Raspberry Pi.jpg", 0) | |
w, h = template.shape[::-1] | |
count = 0 | |
res = cv2.matchTemplate(gray_img, template, cv2.TM_CCORR_NORMED ) | |
#methods = ['cv.TM_CCOEFF', 'cv.TM_CCOEFF_NORMED', 'cv.TM_CCORR','cv.TM_CCORR_NORMED', 'cv.TM_SQDIFF', 'cv.TM_SQDIFF_NORMED'] |
View Barometer_grove.ino
#include "Seeed_BMP280.h" | |
#include <Wire.h> | |
#include <Arduino.h> | |
#include <U8x8lib.h> | |
U8X8_SSD1306_128X64_ALT0_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); | |
BMP280 bmp280; | |
void setup() { | |
Serial.begin(9600); |
View DHT_grove.ino
#include "DHT.h" | |
#include <Arduino.h> | |
#include <U8x8lib.h> | |
#define DHTPIN 3 | |
#define DHTTYPE DHT11 // DHT 11 | |
DHT dht(DHTPIN, DHTTYPE); | |
U8X8_SSD1306_128X64_ALT0_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); | |
#define LED 4 | |
#define PIEZO 5 |
View video_telegram.py
import telepot | |
from picamera import PiCamera | |
import RPi.GPIO as GPIO | |
import time | |
from time import sleep | |
import datetime | |
from telepot.loop import MessageLoop | |
from subprocess import call |
View security_image.py
from gpiozero import MotionSensor | |
from picamera import PiCamera | |
import time | |
from time import sleep | |
pir = MotionSensor(4) | |
camera = PiCamera() | |
camera.rotation = 180 | |
while True: |
View security_video.py
from gpiozero import MotionSensor | |
from picamera import PiCamera | |
import time | |
from time import sleep | |
pir = MotionSensor(4) | |
camera = PiCamera() | |
camera.rotation = 180 | |
while True: |
View camera.py
from picamera import PiCamera | |
from time import sleep | |
camera = PiCamera() | |
camera.rotation = 180 | |
camera.start_preview(fullscreen = False, window = (1300,10,640,480)) | |
camera.start_recording('/home/pi/Desktop/video.h264') | |
sleep(5) | |
camera.stop_recording() |
NewerOlder