Webcam capture Processing Video vs openCV vs Flash
in
Contributed Library Questions
•
10 months ago
Hello,
I'm really new in Processing, and used to work with AS3, but i'm really excited to play with Processing. I have a project for an art installation, that i first code in AS3, and i wanted to made this project in Processing to get better performance.
The first step of my project is just to play in fullscreen what the webcam see.
I tried this with the basic Capture function with the video lib, and i made an other version with openCV. I'm suprised that the performance i really bad : only 15 FPS with this 2 version. I noted, for the openCV version, that just the
opencv.capture (without feedback of the capture in fullscreen) slow down to 15 FPS.
I tried the same thing in AS3 with AIR, and i got 40+ FPS ... So i'm suprised of processing performance ...
Here is the code i used :
Video Lib Version :
- import processing.video.*;
- Capture cam;
- void setup() {
- size(displayWidth, displayHeight)
- cam = new Capture(this, 640,480);
- cam.start();
- }
- }
- void draw() {
- if (cam.available() == true) {
- cam.read();
- }
- image(cam, 0, 0, width, height);
- text(int(frameRate),200,200)
- }
Here is the OpenCV version
- import hypermedia.video.*;
- OpenCV opencv;
- void setup()
- {
- size(displayWidth, displayHeight);
- opencv = new OpenCV(this);
- opencv.capture(640, 480);
- }
- void draw() {
- opencv.read();
- image(opencv.image(), 0, 0, width, height);
- text(int(frameRate),200,200);
- }
I'm on the last beta release of processing 2, m'y resolution is 1280x800, i'm on old macbook (2008) - OSX 10.6, and i use the isight integrated webcam.
Anybody can help me to get better performance ? Or do you think AS3 is much performant than Processing to do that ?
Thanks in advance for your help !
(And sorry for my bad english ... i'm french)
1