Bug 1234 : capture webcam (from pde to java )
Last modified: 2009-05-01 05:45




Status:
RESOLVED
Resolution:
INVALID -
Priority:
P2
Severity:
normal

 

Reporter:
valentin
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2009-05-01 05:39
Please help me! it's important!
if I copy the text from the *.pde to a java class in a project in eclipse and I include
external jars core and pde I get the next error when I run the applet :

( [I'm desperate to access the webcam from inside a html page containg the applet
-> it's for my final exam comming very soon !!!! ]
PLEASE HELP , I'll be a thousand years grateful if you do !@ )


Exception in thread "Animation Thread" java.lang.NoClassDefFoundError:
quicktime/std/StdQTException
at capture2.setup(capture2.java:35)
at processing.core.PApplet.handleDraw(PApplet.java:1383)
at processing.core.PApplet.run(PApplet.java:1311)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: quicktime.std.StdQTException
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 4 more
Additional Comment #1 From valentin 2009-05-01 05:40
import processing.core.*;
import processing.xml.*;

import processing.video.*;

import java.applet.*;
import java.awt.*;
import java.awt.image.*;
import java.awt.event.*;
import java.io.*;
import java.net.*;
import java.text.*;
import java.util.*;
import java.util.zip.*;
import java.util.regex.*;

public class capture2 extends PApplet {

// Each pixel from the video source is drawn as a
// rectangle with size based on brightness.

// Size of each cell in the grid
int videoScale = 10;
// Number of columns and rows in our system
int cols, rows;
// Variable for Capture device
Capture video;
public void setup() {
size(640,480);
// Initialize columns and rows
cols = width/videoScale;
rows = height/videoScale;
smooth();
// Construct the Capture object
video = new Capture(this,cols,rows,15);
}
public void draw() {
if (video.available()) {
video.read();
}
background(0);
video.loadPixels();
// Begin loop for columns
for (int i = 0; i<cols;i++ ) {
// Begin loop for rows
for (int j = 0; j<rows; j++ ) {
// Where are we, pixel-wise?
int x = i*videoScale;
int y = j*videoScale;
// Reversing x to mirror the image
//int loc=(video.width\u2013i\u20131)+j*video.width;
int loc=(video.width-i-1)+j*video.width;
// Each rect is colored white with a size determined by brightness
int c = video.pixels[loc];
float sz = (brightness(c)/255.0f)*videoScale;
rectMode(CENTER);
fill(255);
noStroke();
rect(x + videoScale/2,y + videoScale/2,sz,sz);
}
}
}

static public void main(String args[]) {
PApplet.main(new String[] { "--bgcolor=#D4D0C8", "capture2" });
}
}

Additional Comment #2 From fry 2009-05-01 05:45
The bugs database is for reporting problems in the Processing software.
Please use the forum for asking questions about code.