Face detection using Haar Cascades – OpenCV 3.4 with python 3 Tutorial 37

You will learn in this video how to detect Faces using the Haar Cascades object detection method.   Source code: import cv2 import numpy as np def nothing(x): pass cap = cv2.VideoCapture(0) face_cascade = cv2.CascadeClassifier(“haarcascade_frontalface_default.xml”) cv2.namedWindow(“Frame”) cv2.createTrackbar(“Neighbours”, “Frame”, 5, 20, nothing) while True: _, frame…

Fourier Transform – OpenCV 3.4 with python 3 Tutorial 35

Source code: import cv2 import numpy as np import glob list_images = glob.iglob(“letters/*”) for image_title in list_images: img = cv2.imread(image_title, cv2.IMREAD_GRAYSCALE) f = np.fft.fft2(img) fshift = np.fft.fftshift(f) magnitude_spectrum = 20*np.log(np.abs(fshift)) magnitude_spectrum = np.asarray(magnitude_spectrum, dtype=np.uint8) img_and_magnitude = np.concatenate((img, magnitude_spectrum), axis=1) cv2.imshow(image_title, img_and_magnitude) cv2.waitKey(0) cv2.destroyAllWindows()   Files:…

Copyright © Pysource LTD 2017-2019, VAT: BG205838657, Plovdiv (Bulgaria) - Privacy Policy