Getting this error while running a simple processing program

edited February 2014 in Library Questions

program below suppose to detect a "patt.kanji" marker and show an image on it...

program code is

import picking.*;
import codeanticode.gsvideo.*;
import processing.opengl.*;
import jp.nyatla.nyar4psg.*;

GSCapture g;
PImage img;
MultiMarker m;
void setup()
{
      size(640, 480, OPENGL);
      m = new MultiMarker(this,width,height,"camara_para.dat",new NyAR4PsgConfig.CONFIG_PSG);
      img = loadImage("yo.jpg");
      m.addARMarker("patt.kanji",80);
      g = new GSCapture(this, 640, 480);
      g.start();
}

void draw()
{
      if (!g.available())
      {
           return;
      }
          g.read();
          m.detect(g);
          background(0);
          m.drawBackground(g);
          if(m.isExistMarker(0))
          {
                m.beginTransform(0);
                image(img,0,0);
                m.endTransform();
          }
}

I am using processing 2.1.1 on linux mint 15. All required libraries are added(as far as i know)

the exception i am getting in console of processing is -

jp.nyatla.nyartoolkit.core.NyARException: java.lang.NullPointerException
    at jp.nyatla.nyartoolkit.core.param.NyARParam$ParamLoader.(NyARParam.java:296)
    at jp.nyatla.nyartoolkit.core.param.NyARParam.createFromARParamFile(NyARParam.java:76)
    at jp.nyatla.nyar4psg.MultiMarker.(MultiMarker.java:167)
    at yoii.setup(yoii.java:33)
    at processing.core.PApplet.handleDraw(PApplet.java:2281)
    at processing.opengl.PJOGL$PGLListener.display(PJOGL.java:862)
    at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:652)
    at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:636)
    at javax.media.opengl.awt.GLCanvas$10.run(GLCanvas.java:1284)
    at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1106)
    at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:981)
    at javax.media.opengl.awt.GLCanvas$11.run(GLCanvas.java:1295)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$200(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.NullPointerException
    at jp.nyatla.nyartoolkit.core.utils.ByteBufferedInputStream.readToBuffer(ByteBufferedInputStream.java:50)
    at jp.nyatla.nyartoolkit.core.param.NyARParam$ParamLoader.(NyARParam.java:247)
    ... 25 more
java.lang.NullPointerException
    at processing.mode.java.runner.Runner.findException(Runner.java:926)
    at processing.mode.java.runner.Runner.reportException(Runner.java:871)
    at processing.mode.java.runner.Runner.exceptionEvent(Runner.java:797)
    at processing.mode.java.runner.Runner$2.run(Runner.java:686)

if i run a code to simply show the cam data on output screen, it works.. but when i add marker coding in it i.e.

                          **m = new MultiMarker(this,width,height,"camara_para.dat",NyAR4PsgConfig.CONFIG_PSG);** <br><br>

output screen goes haywire and above exception appears.

please guide me on this.. i need a solution as soon as possible...

Answers

Sign In or Register to comment.