NyAR4psg/1.2.0

NyAR4psg/1.2.0をリリースしました。

http://sourceforge.jp/projects/nyartoolkit/releases/?package_id=8920

 

 

基本ライブラリをNyARToolkiy/4.0.1へ更新しました。1.2.0では、近距離の頂点トラッキング等の機能により、従来と比較して良好な結果が得られます。

 

新しいAPI

新しいAPIとしては、MultiMarker#addARMarker関数があります。

この関数は、Processingの画像をそのままマーカとして使用するための関数です。適当なPNGファイル等を読み込んで、そのままマーカに使うことが出来ます。

example

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(loadImage("hiro.png"),16,25,80);
}

このAPIはカラーのマーカも扱うことが出来ますが、撮影画像とPNG画像の色値はかなりのズレがあるため、出来ればグレースケールのマーカで使ってください。

 

NyARToolkit version 4.0.1 Java/C#/Unity Released

NyARToolkit/4.0.1をリリースしました。Java/C#/Unityの同時リリースです。

NyARToolkit for Java

  • MarkerSystemのバグ修正(IdマーカのトラッキングがOFFになっていた問題)
  • 画像タイプにBYTE1D_X8B8G8R8_32を追加
  • NyARGlRender#drawImageをdrawImage2dに変更
  • NyARGlmarkerSystem#getGlMarkerMatrixをgetMarkerMatrixへ変更
  • NyARGlmarkerSystem#getGlMarkerMatrix(int i_id,double[] i_buf)のパラメタを変更
  • NyARGlmarkerSystem#getMarkerPlaneImageの戻り値を変更
  • NyARBufferedImageRasterがB8G8R8X8フォーマットの画像を正しく処理しない不具合を修正。

http://sourceforge.jp/projects/nyartoolkit/releases/?package_id=7512

NyARToolkit for C#

  • Javaに適応した問題の修正

http://sourceforge.jp/projects/nyartoolkit/releases/?package_id=7672

NyARToolkit for Unity

  • NyARToolkit/4.0.1のAPIに対応。
  • サンプルシーン4種を追加。
  • Texture2Dとの画像の相互変換に対応。
  • UnityMarkerSystemクラスを強化。
  • 座標系をX軸で180度回転しました。

http://sourceforge.jp/projects/nyartoolkit/releases/?package_id=12917

English

NyARToolkit/4.0.1 for Java/C#/Unity were released.

NyARToolkit for Java

Fixed some bugs.

  • Updated tracking parametor
  • Fixed a bug of MarkerSystemClass (NyIdMarker did not effect tracking.)
  • Added a new image format BYTE1D_X8B8G8R8_32.
  • Rename NyARGlRender#drawImage to drawImage2d.
  • Rename NyARGlmarkerSystem#getGlMarkerMatrix to getMarkerMatrix
  • Changed parametor of NyARGlmarkerSystem#getGlMarkerMatrix(int i_id,double[] i_buf).
  • Changed the return type of NyARGlmarkerSystem#getMarkerPlaneImage.
  • Fixed a bug of NyARBufferedImageRaster on B8G8R8X8 format.

http://sourceforge.jp/projects/nyartoolkit/releases/?package_id=7512

NyARToolkit for C#

  • Update for NyARToolkit/4.0.1 APIs.

http://sourceforge.jp/projects/nyartoolkit/releases/?package_id=7672

NyARToolkit for Unity

  • Update NyARToolkit/4.0.1 API
  • Added 4 sample seane.
  • Increased Texture2D compatibility.
  • Updated UnityMarkerSystm class.
  • Rotated Z axis around X axis 180 degrees.

http://sourceforge.jp/projects/nyartoolkit/releases/?package_id=12917

NyARToolkitCS/4.0.0 released

NyARToolkitCS/4.0.0をリリースします。

更新内容

更新内容は以下の通りです。

  • NyARToolkit/4.0.0に搭載したMarkerSystemが利用できるようになりました。
  • Processingライクな簡易スケッチシステム追加しました。
  • ユーティリティクラスのAPIを更新しました。C#のBitmapクラスとの互換性が向上しています。影響により、一部のユーティリティAPIの互換性がなくなっています。アプリケーションの修正して、代替APIを利用してください。
  • WindowsMobileをサポートしなくなりました。(要望があれば復活します。)

ダウンロード

こちらからダウンロードしてください。
http://sourceforge.jp/projects/nyartoolkit/releases/?package_id=7672

Unityバージョンについては、NyARToolkitUnityパッケージを別途作ります。しばらくお待ちください。

 

サンプル

新しいMarkerSystemとスケッチシステムを使ったSimpleLiteは、従来と比較してシンプルに実装できます。

using System;
using System.Drawing;
using System.Collections.Generic;
using System.Text;
using jp.nyatla.nyartoolkit.cs.core;
using jp.nyatla.nyartoolkit.cs.markersystem;
using NyARToolkitCSUtils;
using NyARToolkitCSUtils.Direct3d;
using NyARToolkitCSUtils.Capture;
using Microsoft.DirectX;
using Microsoft.DirectX.Direct3D;

namespace SimpleLite
{
    class Sketch : D3dSketch
    {
        private const int SCREEN_WIDTH = 640;
        private const int SCREEN_HEIGHT = 480;
        private const String AR_CODE_FILE = "../../../../../data/patt.hiro";

        private NyARD3dMarkerSystem _ms;
        private NyARDirectShowCamera _ss;
        private NyARD3dRender _rs;
        private int mid;
        public override void setup(CaptureDevice i_cap)
        {
            Device d3d=this.size(SCREEN_WIDTH, SCREEN_HEIGHT);
            i_cap.PrepareCapture(SCREEN_WIDTH, SCREEN_HEIGHT, 30.0f);
            INyARMarkerSystemConfig cf = new NyARMarkerSystemConfig(SCREEN_WIDTH, SCREEN_HEIGHT);
            d3d.RenderState.ZBufferEnable = true;
            d3d.RenderState.Lighting = false;
            d3d.RenderState.CullMode = Cull.CounterClockwise;
            this._ms = new NyARD3dMarkerSystem(cf);
            this._ss = new NyARDirectShowCamera(i_cap);
            this._rs = new NyARD3dRender(d3d, this._ms);
            this.mid = this._ms.addARMarker(AR_CODE_FILE, 16, 25, 80);

            //set View mmatrix
            this._rs.loadARViewMatrix(d3d);
            //set Viewport matrix
            this._rs.loadARViewPort(d3d);
            //setD3dProjectionMatrix
            this._rs.loadARProjectionMatrix(d3d);
            this._ss.start();
        }

        public override void loop(Device i_d3d)
        {
            lock (this._ss)
            {
                this._ms.update(this._ss);
                this._rs.drawBackground(i_d3d, this._ss.getSourceImage());
                i_d3d.BeginScene();
                i_d3d.Clear(ClearFlags.ZBuffer, Color.DarkBlue, 1.0f, 0);
                if (this._ms.isExistMarker(this.mid))
                {
                    //立方体を20mm上(マーカーの上)にずらしておく
                    Matrix transform_mat2 = Matrix.Translation(0, 0, 20.0f);
                    //変換行列を掛ける
                    transform_mat2 *= this._ms.getD3dMarkerMatrix(this.mid);
                    // 計算したマトリックスで座標変換
                    i_d3d.SetTransform(TransformType.World, transform_mat2);
                    // レンダリング(描画)
                    this._rs.colorCube(i_d3d,40);
                }
                i_d3d.EndScene();
            }
            i_d3d.Present();
        }
        public override void cleanup()
        {
            this._rs.Dispose();
        }
        static void Main(string[] args)
        {
            new Sketch();
        }
    }
}

NyARToolkit/4.0.0 release

NyARToolkit version 4.0.0をリリースします。

今回の更新では、パフォーマンスを若干犠牲にして、APIの使い勝手とコードの移植性を向上させました。以前のバージョンと比較して、より簡単に、複雑な機能(複数マーカの制御等)が利用できます。

追加機能

主な機能追加は、以前こちらのトピックで紹介した通りですが、もう一つだけ、画像ファイルをそのままマーカパターンに使うための機能を、MarkerSystemに追加しました。

  • MarkerSystemモジュールを追加しました。このモジュールは、NyAR4psgのMultimarkerの上位互換の機能を提供します。自動敷居値設定、複数マーカの管理、トラッキング、座標変換、画像取得機能を提供します。
  • OpenGL環境下で動作する、簡易なスケッチシステムを追加しました。アプリケーションの実装が容易になります。
  • NyARToolkitPro(仮)とのインタフェイスを追加しました。ARToolKitv4のアルゴリズムを、少量の修正のみで、NyARToolkitから使用できるようになります。
  • JavaのBufferedImageとの相互運用インタフェイスを強化しました。PNG画像をマーカパターンに使用したり、画像をBufferedImageで取得することが容易になります。

修正・変更

  • 多くの変更が有ります。一部のAPIは、3.0系のNyARToolkitと互換性がありません。(代替機能は用意してあります。)
  • ラスタ処理系を大幅に変更しました。INyARRaster、INyARRgbRastetrに関連するクラスは、ほぼ全て更新されています。
  • 画像を処理系をグレースケールで処理するようになりました。

ダウンロード

Sorceforcgeからダウンロードして下さい。
http://sourceforge.jp/projects/nyartoolkit/releases/?package_id=7512

English

NyARToolkit version 4.0.0 is released.

In this update, The API access rule and the code portability are more good than old version.  For example, multiple marker handling is more easy. But performance is a little down(3-10%).

New functions

  • MarkerSystem module – The MarkerSystem module provide NyAR4psg like APIs. For example, the module provides, auto threshold detection, multimarker management, tracking , coordinate system converter, image pattern accessor.
  • Sketch system – Sketch system – The sketch system is look like the processing. The sketch system enables application development by shorter code.
  • NyARToolkitV4Pro interface. – NyARToolkitV4 has the NyARToolkitV4Pro addon interface. (It has ARToolKitV4 functions).
  • The interface with BufferedImage of Java is strengthened. For example, a PNG image can be used for a marker pattern as it is.

Update and bugfix

  • A lot of update. Part of APIs are not compatible old NyARToolkit.
  • The raster processor classes was changed a lot. The class revant to INyARRaster and INyARRgbRaster is updated mostly altogether.