We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
OpenCV and PS3EYE (Read 2332 times)
OpenCV and PS3EYE
Feb 5th, 2010, 12:24am
 
I am trying to get OpenCV to work with my PS3EYE. Processing's video library works fine so I guess if one works the other should too?

As a workaround I am using cl.eye library to get video frames then I copy them to OpenCV. While it works there are some problems. The captured frames are copied to the BUFFER instead of being sent to SOURCE, and the frame rate is low.

This is the code, can any improvements be made?
Code:
myCameras.getCameraFrame(myImages.pixels, 0);
opencv.copy(myImages);


As a better fix I started looking inside OpenCV source code to implement cl.eye API directly in it's capture. At this point I am in way over my head since I have minimal programming experience, but I might be able to pull it off.

While I was looking at the source code I noticed in OpenCV.h:
Code:

#define CAPTURE 4
#define SOURCE hypermedia_video_OpenCV_SOURCE
#define BUFFER hypermedia_video_OpenCV_BUFFER
#define MEMORY hypermedia_video_OpenCV_MEMORY
#define ROI hypermedia_video_OpenCV_ROI


Is that "4" out of place or am I just clueless?

Re: OpenCV and PS3EYE
Reply #1 - Feb 5th, 2010, 1:34am
 
For me openCV and PS3eye work perfectly (on Vista with newest
driver from http://codelaboratories.com/).
Please give some more details on the problem.
Re: OpenCV and PS3EYE
Reply #2 - Feb 5th, 2010, 9:54am
 
I tried in windows xp and windows 7. Windows 7 is my regular OS and windows XP is a fresh install.

Both systems are running:
CL-Eye-Driver-4.0.1.0201
jre-6u18-windows-i586-s
OpenCV_1.0
processing-1.0.9
opencv-01
Pretty much everything is latest version.

Both systems fail with a NullPointerException when I call opencv.image() after opencv.read();

This is the full error:
Error while starting capture : device 0

OpenCV could not define source dimensions.

Exception in thread "Animation Thread" java.lang.NullPointerException
     at processing.core.PGraphics.image(PGraphics.java:2179)
     at processing.core.PApplet.image(PApplet.java:7280)
     at blobs.draw(blobs.java:56)
     at processing.core.PApplet.handleDraw(PApplet.java:1425)
     at processing.core.PApplet.run(PApplet.java:1327)
     at java.lang.Thread.run(Thread.java:619)
Re: OpenCV and PS3EYE
Reply #3 - Feb 5th, 2010, 12:47pm
 
sorry,sorry, was a little tired when I wrote my reply, probably not enough coffee Sad
I in fact have the same problem with OpenCV that you describe(I was mixed up with JMyron, that works).
Could not solve it. My workaround is to use the PS3eye SDK to capture the cam image and then go via opencv.copy: The same solution that you describe.
What is your frame rate ?
Re: OpenCV and PS3EYE
Reply #4 - Feb 5th, 2010, 5:10pm
 
I am getting about 15-20FPS. I am moving the whole project to linux. Maybe I will have better luck.
Re: OpenCV and PS3EYE
Reply #5 - Feb 6th, 2010, 8:26am
 
Good luck. Would be interested to hear something on the results.
Re: OpenCV and PS3EYE
Reply #6 - Feb 6th, 2010, 12:24pm
 
It works but not really. opencv.read(); works but the frames are corrupted in really weird way. Angry
Re: OpenCV and PS3EYE
Reply #7 - Feb 7th, 2010, 12:45am
 
so, the general message is: OpemCV and PS3Eye dont work together.
Any ideas what to do ? (of course in the short run stick to capture via PS3EyeSDK and use openCV.copy)
Page Index Toggle Pages: 1