Skip to content

Instantly share code, notes, and snippets.

View tonmoay's full-sized avatar

Tonmoay Deb tonmoay

View GitHub Profile
@tonmoay
tonmoay / cvimg.py
Created December 20, 2016 05:18
Template matching using OpenCV python. This code gets a real time frame from webcam & matches with faces in 'images' folder. After the lookup, it rectangles the webcam face & says with which face the webcam face matches
import cv2
from matplotlib import pyplot as plt
import numpy as np
cap = cv2.VideoCapture(0) #Webcam Capture
while(True):
ret, frame = cap.read()
@tonmoay
tonmoay / webcam2.py
Created December 20, 2016 05:14
Detect face & eyes with webcam & rectangle face with showing some text over rectangle real time. Save 30 faces into 'faceimg' directory & exit after face saving
import cv2
#import numpy as np
import time
#import finished
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
eye_cascade = cv2.CascadeClassifier('haarcascade_eye.xml')
smile_cascade = cv2.CascadeClassifier('haarcascade_smile.xml')
@tonmoay
tonmoay / webcam.py
Created November 11, 2016 07:00
Basic Face Detection Using OpenCV
import cv2
#import numpy as np
import time
#import finished
cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
'''
References: