Help using ARToolkit with JMyron
in
Contributed Library Questions
•
2 years ago
Hello guys!!
First of all I'm very noob to this so be patient!
Well my question is simple (i think)... I'm currently using processing-1.0.9, what I'm trying to do is to play a video when a marker is placed with a webcam... I'm trying to use the Bryan Chung ( http://www.bryanchung.net/?cat=28 and also http://www.bryanchung.net/?page_id=415 ) post to help me do this but for some reason it doesn't work at all! I installed ARToolKit 2.0 and JMyron! This is the code i used:
Skype: juanda.ruiz
THANKS IN ADVANCE!!!
First of all I'm very noob to this so be patient!

Well my question is simple (i think)... I'm currently using processing-1.0.9, what I'm trying to do is to play a video when a marker is placed with a webcam... I'm trying to use the Bryan Chung ( http://www.bryanchung.net/?cat=28 and also http://www.bryanchung.net/?page_id=415 ) post to help me do this but for some reason it doesn't work at all! I installed ARToolKit 2.0 and JMyron! This is the code i used:
- import JMyron.*;
import processing.video.*;
import processing.opengl.*;
import pARToolKit.SimpleARToolKit;
SimpleARToolKit ar;
int capWidth, capHeight;
JMyron m;
Movie mov;
PImage img;
void setup() {
size(400, 300, OPENGL);
capWidth = 320;
capHeight = 240;
m = new JMyron();
m.start(capWidth,capHeight);
m.findGlobs(0);
img = createImage(capWidth,capHeight,ARGB);
mov = new Movie(this,"VIDEOFILE.mov");
mov.loop();
mov.read();
ar = new SimpleARToolKit(this, capWidth, capHeight);
ar.loadPattern("patt.hiro", 80, 0.0f, 0.0f);
ar.register("showBox");
noStroke();
fill(200,200,0);
rectMode(CENTER);
frameRate(15);
}
void draw() {
background(0);
m.update();
m.imageCopy(img.pixels);
img.updatePixels();
hint(DISABLE_DEPTH_TEST);
image(img,0,0,width,height);
hint(ENABLE_DEPTH_TEST);
if (ar.findMatch(img,100)) {
ar.showObject();
}
}
void showBox(SimpleARToolKit _a) {
pushMatrix();
translate(0,0,-20);
beginShape(QUADS);
texture(mov);
vertex(-60,-45,0,240);
vertex(60,-45,320,240);
vertex(60,45,320,0);
vertex(-60,45,0,0);
endShape();
popMatrix();
}
void movieEvent(Movie _m) {
_m.read();
}
void stop() {
m.stop();
super.stop();
}
When i hit Run the preview window pops up satys for a few seconds and closes and then give me this error:
error, disabling movieEvent() for nullPlease help me!!.. This is my email address (live messenger): juanda.ru@hotmail.com
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at processing.video.Movie.run(Movie.java:684)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ArrayIndexOutOfBoundsException
at quicktime.util.QTUtils.doBoundsChecks(QTUtils.java:767)
at quicktime.util.QTPointerRef.copyToArray(QTPointerRef.java:176)
at processing.video.Movie.read(Movie.java:471)
at sketch_jan19a.movieEvent(sketch_jan19a.java:85)
... 6 more
Exception in thread "Thread-3" java.lang.ArrayIndexOutOfBoundsException
at quicktime.util.QTUtils.doBoundsChecks(QTUtils.java:767)
at quicktime.util.QTPointerRef.copyToArray(QTPointerRef.java:176)
at processing.video.Movie.read(Movie.java:471)
at processing.video.Movie.run(Movie.java:680)
at java.lang.Thread.run(Thread.java:619)
Skype: juanda.ruiz
THANKS IN ADVANCE!!!
1