To select a camera for image capturing

edited October 2014 in How To...

Hi guys,

I am using Processing 2.2.1 on a Win8.1 PC and trying to capture images from the BACK camera (out of two) on my laptop. However, I find the images captured by my scripts can only be from the FRONT camera which is not the one prefered. I would be grateful if someone could give me a clue how I would be able undertake a image capturing with the other camera. Many thanks in advance!

import processing.video.*;

Capture cam;

void setup() {

size(160, 120);

String[] cameras = Capture.list();

println(this);

cam = new Capture(this);

cam.start();
}

void draw() {

image(cam, 0, 0, width, height);

}

void captureEvent(Capture cam) {

cam.read();

}imageCaptureIssue

Answers

  • does it not show up in your cameras list? There is another constructor to Capture that takes the name of the camera as the second argument. So if it's the second camera in your list it becomes:

    cam = new Capture(this, cameras[1]);

Sign In or Register to comment.