NyARToolkit for Java 5.0.0リリース

English

NyARToolkit 5.0.0をリリースします。
https://github.com/nyatla/NyARToolkit

NyARToolkit 5.0.0では、ARToolKit5に搭載されている自然特徴点トラッキング(NFT)の機能が利用できるようになりました。

NyARToolKit5の開発には、DAQRI LLCから開発資金、及び技術提供をいただいています。DAQRI LLCと、ARToolKit開発チームに感謝いたします。

NFTトラッキングの起動方法

手っ取り早くNFTを体験する方法です。

  1. GitHubからNyARToolKitをチェックアウトしてください。
  2. EclipseにNyARToolkitのソースツリーをImportします。で示したプロジェクトにエラーが出ないことを確認します。
    p1
  3. NFTのターゲットとなる画像を印刷します。印刷できない方は画像を画面に表示してください。
    infinitycat.pdf
  4. コンピュータにカメラを接続してください。
  5. NyARToolkit.sample.joglパッケージのNftSimpleLite.javaを実行してください。
    p2
  6. 起動には数秒間かかります。撮影画像が現れた後にカメラで画像を撮影すると、カラーキューブが現れます。
    Ce7VUtqUIAAvu0o

NFTプログラミング

NyARToollitのNFTプログラミングはシンプルです。
数十行の実装でアプリケーションを実装できます。

NftSimpleLite.javaがNFTアプリケーションの雛形です。このコードを改変することで、直ぐにオリジナルのアプリケーションを実装できます。

public class NftSimpleLite extends GlSketch
{
  String nftdataset="d:\\infinitycat";
  String cparam="../../Data/testcase/camera_para5.dat";
  private Webcam camera;
  private NyARGlNftSystem nyar;
  private NyARGlRender render;
  private NyARSensor sensor;
  public void setup(GL gl)throws Exception
  {
    this.size(640,480);
    NyARNftSystemConfig config = new NyARNftSystemConfig(new FileInputStream(cparam),640,480);
    this.camera=Webcam.getDefault();
    this.camera.setViewSize(new Dimension(640,480));
    this.nyar=new NyARGlNftSystem(config);   //create MarkerSystem
    this.render=new NyARGlRender(this.nyar);
    this.sensor=new NyARSensor(config.getScreenSize());
    //
    this.id=this.nyar.addNftTarget(nftdataset,160);
    gl.glEnable(GL.GL_DEPTH_TEST);
    this.camera.open();
  }
  private int id;
  public void draw(GL gl)throws Exception
  {
    synchronized(this.camera){
      try {
        this.sensor.update(new NyARBufferedImageRaster(this.camera.getImage()));        
        this.render.drawBackground(gl,this.sensor.getSourceImage());
        this.render.loadARProjectionMatrix(gl);
        this.nyar.update(this.sensor);
        if(this.nyar.isExistTarget(this.id)){
          this.nyar.loadTransformMatrix(gl,this.id);
          this.render.colorCube(gl,40,80,60,20);
        }
        Thread.sleep(1);
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
  }  
  public static void main(String[] args)
  {
    new NftSimpleLite().run();
    return;
  }
}
  • トラッキングする画像を変えるには?
    →nftdatasetのファイルパス名を変えます。NFTではiset ,fset, fset3の3種のファイルが同じ場所に置かれている必要があります。
    たとえば”d:\\example”を指定すると、c:\\example.iset, c:\\example.fset, c:\\example.fset3のファイルセットがトラッキング画像として使われます。
  • トラッキング画像のサイズを変えるには?
    →addNftTarget関数の第二引数に、印刷した画像の横幅をmm単位で指定してください。
  • トラッキング画像を作るには?
    →NyARToolkit.utility.zipの中にあるNftFileGenerator.jarで画像ファイルからトラッキング画像を作ることができます。
    https://github.com/nyatla/NyARToolkit/releasesからダウンロードしてください。

ARToolKit5との互換性について

NyARToolKitは、ARToolKit5のアルゴリズムを忠実に移植したものです。計算結果はARToolKitのそれとほぼ同一ですが、若干の差があります。

差の原因は、浮動小数点計算の精度差、一部の算術関数を展開したことによるものです。

NFTのターゲッ トファイル(iset,fset,fset3)やカメラパラメータファイルについては、ARToolKitと互換性があります。相互に使うことができます。

NyARToolkit for Java 5.0.0

NyARToolkit for Java 5.0.0 has been released.
https://github.com/nyatla/NyARToolkit

NyARToolkit 5.0.0 supports the natural features tracking which is same as implemented on ARToolKit5 (NFT) .

The development of NyARToolKit5 has received the funding and technical assistance by DAQRI LLC.
I’m grateful to DAQRI LLC and ARToolKit team.

How to running NFT sample

  1. Checkout NyARToolKit from Github.
  2. Import NyARToolkit projects to Eclipse. Make sure that there are no errors in the project shown in .
    p1
  3. Print NFT image  to paper. If you do not have a printer, display the pdf file into the screen.
    infinitycat.pdf
  4. Connect your webcam to computer.
  5. Run NftSimpleLite.java in NyARToolkit.sample.jogl package.
    p2
  6. It takes a few seconds to startup. When you take a picture with the camera, The color cube will display on image.
    Ce7VUtqUIAAvu0o

NFT Programming

NFT programming with NyARToolkit is simply.
It requires only a few dozen lines of code.

NftSimpleLite.java is a template of NFT application. You can create the unique application by modify the template.

public class NftSimpleLite extends GlSketch
{
  String nftdataset="d:\\infinitycat";
  String cparam="../../Data/testcase/camera_para5.dat";
  private Webcam camera;
  private NyARGlNftSystem nyar;
  private NyARGlRender render;
  private NyARSensor sensor;
  public void setup(GL gl)throws Exception
  {
    this.size(640,480);
    NyARNftSystemConfig config = new NyARNftSystemConfig(new FileInputStream(cparam),640,480);
    this.camera=Webcam.getDefault();
    this.camera.setViewSize(new Dimension(640,480));
    this.nyar=new NyARGlNftSystem(config);   //create MarkerSystem
    this.render=new NyARGlRender(this.nyar);
    this.sensor=new NyARSensor(config.getScreenSize());
    //
    this.id=this.nyar.addNftTarget(nftdataset,160);
    gl.glEnable(GL.GL_DEPTH_TEST);
    this.camera.open();
  }
  private int id;
  public void draw(GL gl)throws Exception
  {
    synchronized(this.camera){
      try {
        this.sensor.update(new NyARBufferedImageRaster(this.camera.getImage()));        
        this.render.drawBackground(gl,this.sensor.getSourceImage());
        this.render.loadARProjectionMatrix(gl);
        this.nyar.update(this.sensor);
        if(this.nyar.isExistTarget(this.id)){
          this.nyar.loadTransformMatrix(gl,this.id);
          this.render.colorCube(gl,40,80,60,20);
        }
        Thread.sleep(1);
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
  }  
  public static void main(String[] args)
  {
    new NftSimpleLite().run();
    return;
  }
}
  • How to change the tracking image file?
    →Change nftdataset value. In NFT, it need to place 3 files(.iset, .fset, .fset3) onto same path.
    For example: If you specify “d \\ example”, “c:\\ example.iset”, “c:\\ example.fset”, “c:\\example.fset3” will be used as a tracking image.
  • How to change the tracking image size?
    →Set the paper image width in mm to the second parameter of addNftTarget function.
  • How to make the tracking image set file?
    →NftFileGenerator.jar is a fileset generator.
    Download NyARToolkit.utility.zip from the following URL.
    https://github.com/nyatla/NyARToolkit/releases

For compatibility with ARToolKit5

Calculation algorithm of NyARToolKit is identical to the ARToolKit5 but there is a slight difference.
The cause of the difference are the accuracy of floating-point calculations, and the simplification of  the math functions.

The NyARToolKit and ARToolKit data files(iset fset fset3) are compatible.
These files can be used with each other.

 

NyARToolkitのライセンス変更のお知らせ

NyARToolkitのライセンス変更のお知らせ

ARToolKitのLGPL化に伴い、NyARToolkitパッケージのライセンスをLGPLv3に変更します。

NyARToolkitCS, NyARToolkit for Unity, NyARToolkit for ActionScript3, NyARToolkit for Processing

今後はNyARToolkitをライブラリとして使用する場合にソースコードの開示義務がなくなります。

FLARToolKit、NyARToolkit for Androidについても変更を予定しています。もうしばらくお待ちください。

ライセンス変更に伴い、リポジトリをSourceforgeからGitHubへ移行しました。各パッケージのリポジトリは以下のURLからアクセスできます。

NyARToolkit

外部ライブラリ

English

The license of NyARToolkit will be change to LGPLv3.

Following packages licence is changed.

NyARToolkit, NyARToolkitCS, NyARToolkit for Unity, NyARToolkit for ActionScript3, NyARToolkit for Processing.

If you want to use the NyARToolkit as a library, there is no duty to disclose the source code.

Along with the license change, Repository is moved from Sourceforge to GitHub. Each package can be accessed from the following URL.

NyARToolkit

Related libraries

NyARToolkitのパッケージを更新しました。

最近の開発環境向けに、UnityとProcessing版のNyARToolkitのパッケージを更新しました。

http://nyatla.hatenadiary.jp/entry/20150106/1420529180

I’ve updated the package of NyARToolkit forUnity and Processing version for recent environment.