hello everyone. i m new to processing. i need help with below code.
what i m trying is that when my camera starts running it should show box as soon as the marker is shown by me for detection. But it does not detect any marker or show any cube. But camera does start.
import jp.nyatla.nyar4psg.*; // NyAR2 library from cpbotha.net for multi markers
import processing.opengl.*;
import processing.video.*;
Capture vid;
NyARMultiBoard nya;
void setup(){
size(640,480,P3D);
vid= new Capture(this, 640,480, 30);
String[] patts= {"patt.kanji"};
double[] widths= {80};
nya= new NyARMultiBoard(this, width, height, "camera_para.dat", patts, widths);
vid.start();
}
void draw(){
background(200);
vid.read();
image(vid,0,0);
if(nya.detect(vid)) // marker detection code starts here
{
nya.markers[0].beginTransform();
box(40);
nya.markers[0].endTransform();
}
}