Processing, Simple kinect app don't start a event
in
Integration and Hardware
•
3 months ago
I want to do a simple kinect aplication in processing, I just want to when kinect detect a skeleton, show a simple jpeg image, just that. I wrote some code, all works but when someone appears in front of kinect, nothing happens, can anyone help me? This is my code:
- import SimpleOpenNI.*;
- SimpleOpenNI kinect;
- void setup()
- {
- // Começar o evento
- kinect = new SimpleOpenNI(this);
- // Ativar o RGB
- kinect.enableRGB();
- background(200,0,0);
- // Criar a janela do tamanho do dephMap
- size(kinect.rgbWidth(), kinect.rgbHeight());
- }
- void draw()
- {
- // update da camera
- kinect.update();
- // mostrar o depthMap
- image(kinect.rgbImage(),0,0);
- // Definir quantidade de pessoas
- int i;
- for (i=1; i<=10; i++)
- {
- // Verificar presença da pessoa
- if(kinect.isTrackingSkeleton(i))
- {
- mostrarImagem(); // draw the skeleton
- }
- }
- }
- // Mostrar a imagem
- void mostrarImagem()
- {
- PImage img;
- img = loadImage("proverbio1.jpg");
- image(img, 0, 0);
- }
1