blank window
in
Contributed Library Questions
•
1 year ago
Hi, all
I try to learn Augmented Reality with this library nyar4psg .
But all the examples I try to run end of getting yellow mark in this line as following code. It does not show error message but the running view is just blank, so I figure something might be wrong but I am not sore what it is.
Any pointer or help is appreciated.
-poserpro ;)
- /**
NyARToolkit for proce55ing/1.0.0
(c)2008-2011 nyatla
airmail(at)ebony.plala.or.jp
ARマーカと同じ平面からマーカパターンを得る事ができます。
Hiroマーカを使います。
This program gets the image from around the marker.
The marker file is "patt.hiro"
*/
import processing.video.*;
import jp.nyatla.nyar4psg.*;
Capture cam;
MultiMarker nya;
void setup() {
size(640,480,P3D);
colorMode(RGB, 100);
println(MultiMarker.VERSION);
cam=new Capture(this,640,480);
nya=new MultiMarker(this,width,height,"camera_para.dat",NyAR4PsgConfig.CONFIG_PSG);
nya.addARMarker("patt.hiro",80);//id=0
}
int c=0;
void draw()
{
c++;
if (cam.available() !=true) {
return;
}
cam.read();
nya.detect(cam);
background(0);
nya.drawBackground(cam);//frustumを考慮した背景描画
if((!nya.isExistMarker(0))){
return;
}
PImage pm=nya.pickupRectMarkerImage(0,-40,-40,80,80,100,100);
//以下のコードと意味は同じです。 The meaning of this code is the same as the next lines.
//PImage pm=nya.pickupMarkerImage(0,40,40,-40,40,-40,-40,40,-40,100,100);
image(pm,0,0);
}
1