Create Vision Art included Face Tracking using opencv.
😄 Our Artwork is Here
- IDE : anaconda3
- python >= 3.8 with Virtual Environment
- IDE : processing3 >= 3.5.4
- IDE : Visual Studio
- IDE : Web Editor
- p5.js == 1.2.0
Template with basic code to help you get started quickly of this repository is located in the template folder
- DL : Tensorflow Pre-trained Model for Face Tracking
Object Detection
- CV :
-
Install Anaconda : https://www.anaconda.com/products/individual (Check your OS.)
-
Open 'Anaconda Prompt'
(base) C:> conda create -n [env_name] python=3.8
(base) C:> activate [env_name]
([env_name]) C:> pip install opencv-python==4.5.1.48
-
Open 'Anaconda Navigator' > Applications on [env_name] > Install and Launch Jupyter Notebook(or Spyder)
-
Create Python3 files and Run following Code
(fix 'haarcascade_frontalface_default.xml' file to Absolute Path)
import numpy as np
import cv2
cap = cv2.VideoCapture(0)
while (True):
ret, img = cap.read()
cv2.imshow('frame', img)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
- Imagine and Realizae Creative Idea as your Python Code!
-
Install IDE : https://processing.org/download/ (Check your OS.)
-
Open IDE and Install Libraries.
- Video
- OpenCV for Processing
- Run following Code (Mouse Click!)
void setup() {
size(400, 400);
}
void draw() {
//background(220);
noStroke();
fill(random(0,255),random(0,255),random(0,255),20);
if(mousePressed)
circle(mouseX, mouseY, 50);
}
- Imagine and Realizae Creative Idea as your Processing Code!
-
Open WebEditor : https://editor.p5js.org/
-
Run following Code (Mouse Click!)
function setup() {
createCanvas(400, 400);
}
function draw() {
//background(220);
noStroke();
fill(random(0,255),random(0,255),random(0,255),20)
if(mouseIsPressed)
circle(mouseX, mouseY, 50)
}
- Imagine and Realizae Creative Idea as your JavaScript Code!
- camera (connected with PC, or webcam)
What is OpenCV -> https://opencv.org/
Quick Setup : setupfile