The goal: I want to use the SimpleARToolKit in processing. The demo programs use all the Library JMyron to get the images from the webcam, although there was written
"The PImage variable img contains the latest capture image. It does not matter to create the img by using JMyron, Capture object, JMF or GStream, etc."
http://www.bryanchung.net/?page_id=415
And I know the old never ending stroy with the JMyron because of finding the native dll's.
The way: So I'm decided to try to get the PImage with the help of JMF. I learnd by the examples of
timcam package. With my function getPImage I get PImages into processing:
// the player may be in the started state, but it takes a few tries before
// we get a valid frame!
do {
buf = fgc.grabFrame();
}
while(buf.getLength() == 0);
BufferToImage btoi = new BufferToImage((VideoFormat) buf.getFormat());
img = btoi.createImage(buf);
PImage pimg = new PImage( (java.awt.Image)img );
return pimg;
}
My problem It seems to work very well. Each new image of the webcam can be displayed in processing. But the SimpleARToolKit dosn't work with my PImages in the following code: