-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDanceMask.pde
More file actions
46 lines (40 loc) · 1.26 KB
/
DanceMask.pde
File metadata and controls
46 lines (40 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import java.io.DataOutputStream;
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;
int ALTURA = 400;
int LARGURA = 300;
int DESLOCAMENTOCOR = 15;
String maskImageFilePath = "maskfiles/abstract2.jpg";
//Variaveis globais no contexto do ambiente
PImage background;
cameraInput camera;
PrintWriter FILE1;
PrintWriter FILE2;
float[][][] fluxoAmbiente;
void setup() {
//Seta o tamanho da tela.
//Tenta instanciar a camera se der
//instanciando o vetor FLuxo
//Carrega imagem do background para ser a textura!
size(640,480);
frameRate(30);
try{
print("\t############### INSTANCIANDO CAMERA #####################\n");
//Instancia o controlador da camera
camera = new cameraInput(this);
}catch(Exception e){
print("\t############### ERRO! NAO FOI POSSIVEL INSTANCIAR CAMERA!!#####################");
}
fluxoAmbiente = new float[ALTURA][LARGURA][2];
background = loadImage(maskImageFilePath);
background.resize(width,height);
}
void draw(){
//Coloca o background
//Calcula Movimento do contorno
//Desenha na tela o vulto
background(0x000);
camera.calculaFluxoOpenCV();
camera.desenhaCamera(width,height);
camera.displayFluxoBackground(width,height,background);
}