javacvpro with simpleopenni
in
Contributed Library Questions
•
10 months ago
I'm trying to use javacvpro to blur an image from the rgb camera on the kinect in real time. the video loads but its not blurry and the program will grow in memory until it crashes. Im thinking the previous images arent being deleted and some kind of buffer management needs to be added in. does anyone know whats wrong with my code? thanks
- import SimpleOpenNI.*;
- import monclubelec.javacvPro.*;
- SimpleOpenNI kinect;
- OpenCV opencv;
- void setup()
- {
- // create a new kinect object
- kinect = new SimpleOpenNI(this);
- // create a new openCV object
- opencv = new OpenCV(this);
- // mirrors image of kinect to get natural mirror effect
- kinect.setMirror(true);
- // enable depthMap generation
- kinect.enableDepth();
- // enable RGB camera
- kinect.enableRGB();
- // enable skeleton generation for all joints
- kinect.enableUser(SimpleOpenNI.SKEL_PROFILE_ALL);
- // create a window the size of the depth and rgb information
- size(kinect.rgbWidth(),kinect.rgbHeight());
- // create openCV window the size of the rgb sensor
- opencv.allocate(kinect.rgbWidth(), kinect.rgbHeight());
- // window background color
- background(200,0,0);
- // drawer color is red
- stroke(255,0,0);
- // thickness of drawer is small
- strokeWeight(1);
- // smooth out drawer
- smooth();
- } // void setup()
- void draw()
- {
- // update the kinect sensors
- kinect.update();
- // copy image from kinect to opencv
- opencv.copy(kinect.rgbImage());
- //blur the image
- opencv.blur();
- // display new image at coordinates (0,0)
- image(opencv.getBuffer(),0,0);
- }
1