Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PImage scaledImg;
- PImage differenceImg;
- // size of the webcam capture depends your camera
- int captureWidth = 640;
- int captureHeight = 480;
- int cvWidth;
- int cvHeight;
- int rows = 3; // rows
- int cols = 4; // cols
- Capture camera;
- void setupCam() {
- // make sure the draw runs one time to display the "waiting" text
- if(frameCount<2) return;
- println("Checking for webcam");
- String[] cameras = Capture.list();
- if (cameras.length == 0) {
- println("There are no cameras available for capture.");
- exit();
- }
- else {
- println("Available cameras:");
- // printArray(cameras);
- // The camera can be initialized directly using an element from the array returned by list();
- //cam = new Capture(this, cameras[camNumber]);
- int camNumber = 4;
- camera = new Capture(this, captureWidth, captureHeight, cameras[camNumber]);
- // Start capturing the images from the camera
- camera.start();
- while(camera.available() != true) {
- delay(1);//println("waiting for camera");
- }
- cameraInitDone = true;
- }
- }
Advertisement
RAW Paste Data
Copied
Advertisement