Hi all,
I am trying to create a small game for kids about exploiting bubbles with the "touch" of their fingers. I have seen some examples in the web about exploiting bubbles, some with OpenCv and others with GSVideo, but as I need finger tracking I am trying to use the JavaCVPro library, which suggest to use GSVideo for the video capture part and opencv/javacvpro functions for the video processing part.
I am still at the very begining of the game trying to capture any movement. I have correctly done everything with opencv but when I try to use GSVideo for the capture part it gives me the error "Null Pointer Exception", I have checked my code and don´t find the problem, could you please help?
Here it is my code:
- import hypermedia.video.*;
- import codeanticode.gsvideo.*;
- OpenCV opencv;
- GSCapture cam;
- PImage imgSrc;
- void setup()
- {
- size( 800, 600 );
- //OpenCV
- opencv = new OpenCV( this );
- //opencv.capture( width,height);
- //GSVideo
- cam=new GSCapture(this,width,height);
- cam.start();
- }
- void draw()
- {
- //GSVideo
- cam.read();
- imgSrc=cam.get();
- opencv.copy(imgSrc);
- //OpenCV
- //opencv.read();
- //OpenCV or GSVideo
- opencv.absDiff();
- opencv.convert(OpenCV.GRAY);
- opencv.threshold(20);
- image(opencv.image(), 0, 0 );
- opencv.remember();
- }
Thanks in advance and brgds,
1