Kinect Circle Recognition In Real Time
in
Contributed Library Questions
•
8 months ago
Hi i am currently trying to implement a kinect application using SimpleOpenNI where i will be be able to detect circles in real time from the kinects RGB camera. So far i have completed the following code
- package KinectCircleRecognition;
- import processing.core.*;
- import SimpleOpenNI.*;
- import static com.googlecode.javacv.cpp.opencv_core.*;
- import static com.googlecode.javacv.cpp.opencv_highgui.*;
- import static com.googlecode.javacv.cpp.opencv_imgproc.*;
- public class MainWindow extends PApplet
- {
- //Giving a name to the kinect library
- public SimpleOpenNI kinect;
- public void setup()
- {
- //Setting the papplet window size
- size(640*2,480);
- //Instantiating the instance of the library
- kinect = new SimpleOpenNI(this);
- //Calling the depth method from the library
- kinect.enableDepth();
- //Calling the RGB method from the library
- kinect.enableRGB();
- //Setting the kinect as mirror
- kinect.setMirror(true);
- }
- public void draw()
- {
- //Updating the images from the kinect sensor
- kinect.update();
- //Setting the depth image to the processing PImage function
- PImage depthImage = kinect.depthImage();
- //Setting the RGB image to the processing PImage function
- PImage rgbImage = kinect.rgbImage();
- //Call the depth image
- image(depthImage, 0, 0);
- //Call the rgb image
- image(rgbImage, 640, 0);
- }
- }
Cheers
GodveX
1