Saqoosha

大阪てら子 15 「題名のない Flash 会」

Blog

やるよー。はい、以下、告知。

──────────────↓ココカラ↓──────────────

開催日時:2008年05月17日(土)(14:00~ [途中参加OK])
開催場所:大阪府 (株式会社カラーズ Osaka office)

うーん、前回ちゃんと次のこと決めなかったから gdgd なってるー。
開催日は 5/17 決定です。場所はいつものカラーズさんち。
Ido さんがてら子のために東京から帰ってきてくれるので使わせてもらえまーす。

んで、やること決まってないからなんか企画プリーズ。
(あー、そういえばタケシがなんか考えるってゆてたねー。)

ちょうどその日、名古屋 WCAN で Progression 会やるみたいだから、こっちでもやってみてもいいかもー。わたくしはクラスベースしかできませんけども。。

いつも通り 18:30 ぐらいから 2 次会もやるよ。2 次会からの参加も OK。
おすすめ 2 次会会場も募集中。

んじゃっ。

──────────────↑ココマデ↑──────────────

まー、とりあえず集まろうさ。

参加申し込みは mixi てら子コミュのイベントトピックへどぞー。(mixi はいってないひとはミーにメールでも可)

Teraco-Logoてら子とは。 Flash / ActionScript を中心に、情報共有をしたくて、いてもたってもいられない人達による集会ということでよろしくお願いします。(mixi コミュからコピペ)

ARToolKit を Flash に移植したよ。

BlogFlash, FLARToolKit

こんちわ。さくーしゃです。
えーと、巷では Flash Player 10 beta で騒がしい感じになってきておりますが、そんな中、わたくしは ARToolKit を Flash (AS3) に移植してました。FLARToolKit と命名しておきましょう。まー、移植つっても本家からじゃなくって A虎@nyatla.jp 氏が Java に移植した NyARToolkit を AS3 で書き直したものなんだけど。言語仕様が近いだけあって C 版よりもはるかに移植しやすかったですな。

やっぱでもねー、速度的にはかなり厳しいもんがあるな。ラベリングの部分は Bitmap 師匠のコードをベースにほとんど書き直したんだけど、それでも複数マーカーの認識とかってのはかなり無理がありそう。

3D 表示部分も現状の Flash だとソフトウェアレンダリング(デモでは Papervision3D 使ってる)しか手がないわけで、そのへんもかなり足を引っ張る。(Astro なったらそのへんはある程度解消されるだろけど。)

つーわけで、まだいろいろ制限はあるものの Webcam とプリントされたマーカーさえあればブラウザだけでさくっと体験できちゃう Flash 版てのはお手軽でいーんじゃないかと思います。作るのも簡単だしね。

↓こちらが実際に動いてるデモ。
/a/labs/FLARToolKit/
(※このマーカーをプリントして使ってくださいな → pattHiro.pdf

んでもってソースコードは Spark Project にコミットしてあるので適当にどーぞ。ライセンスは NyARToolKit が GPL なので FLARToolKit も GPL てことになりますな。(ソース内の Copyright 表記が NyARToolKit のまんまなんだけど追々なおします。。)まだ速度的にチューニングできる部分は結構残ってるので興味あるひとはいじってやってください。

さあて、これでなんかオモロイもんつくろかのー。

追記 (5/17 1:45):trick7 の人が体験ムービーをアップしてくれてるよ!wwww

追記(8/3 20:00):サンプルで使ってる Papervision3D (GrateWhite)、どうやら最新リビジョンではカメラ関係のクラスが結構かわってるようで、動かなくなったらしい。そのうち直す。
追記(8/14 2:40):↑直した。GreatWhite の Camera3D クラスにも手をいれないとダメなのがにんともかんとも。。。 追記(2008/12/5):フォーラムできました。FLARToolKit についてのいろいろはこちらで。 English version project page available now! (Special thanks to daoki2) Edit (2008/12/5): FLARToolKit forum is setup. Please use this forum to exchange infomation about FLARToolKit.
Categories: Flash, FLARToolKit

Comments (25)

  • A虎@
    こんばんは。はじめまして。

    blogのコメント欄を見て飛んできました。

    ActionScript3版の実装成功おめでとうございます。
    私も同じ構成で作ろうとしていたんですが、先を越されちゃいましたねw

    JavaよりもFlashの方がユーザーに近いですし、色んな応用が出てくるんじゃないかと、個人的には楽しみにしてます。

    開発頑張ってくださいネ

    PS.
    mixiにNyARToolkitのコミュニティがあります。よければ遊びに来てください。http://mixi.jp/view_community.pl?id=3311281
  • fladdict
    スゴス!!!

    アストロのPixelBender使って、ラベリングの処理をFlashの外に出しちゃったら、結構スピードアップするんじゃないっすか??
  • Shinobu
    はじめまして。しのぶです。
    NyarToolkit DemoをAppletにしたりしております。

    FLARToolKitサッソク試してみました!さくさく動きますねー!
    オモロイもん期待してます☆
  • れん
    誰かやるとは思っていましたが流石!
    今日のteracoはスゴイコトになっている予感。w
  • Saqoosha
    みなさんこんにちわ。

    > A虎@さん
    すいませんすいません。公開したらコメントしにいこうとおもって、ブログ書いてたらそのまま忘れてたす。
    AS3 化は実は NyARToolKit 0.7 ぐらいのときにやっちゃってて、なんかおもしろコンテンツとともに出そうとおもってたんですけどなかなかできなくって、A虎@さんのブログにちらっと AS3 版の話がでてたんでもーいーやって出しちゃいましたw
    mixi にコミュなんてあったんですねー。チェックしまーす。

    > fladdict さ
    Flex でプロファイリングしてるとラベリングよりはマーカーのパターンマッチングのほうが重いかんじ。まー、いずれにしても Pixel Bender をうまく使えば高速化できるとはおもうねー。3D も Astro 版 Papervision とか出ればかなり使えるもんになるんじゃなかろうか。

    > Shinobu さ
    Applet も使ってみるっていうところでは Flash とさほど変わんないですよね。Processing から使えるようにすればそっちのがいろいろと強力な気も。。

    > れんさっ
    あー、まー、でも、そなにスゴイコトにもなってないw
  • A虎@
    こんにちは。

    AS版を開発してること教えてもらえてたら、多分私は作りませんでしたよw
    結果として慌てさせてしまったようで…申し訳ない。

    (でもインパクトのある開発は、こっそりやりたいときもありますよねw)

    表示系の件、blogのコメント欄に参考にする資料載せときました。もしよければ見てみてください。
  • Saqoosha
    > A虎@ さん
    あはは。ええまあちょっと内部事情もありまして。。w
    資料ありがとうございます。ちょっと試してみますー。
  • なおき
    こんにちはー Flashへの移植おめでとうございます.
    ブログにて紹介させていただきました.
    これを応用して何か実用的なものが作れるといいなーと
    期待しております.
  • Saqoosha
    > なおきさん
    こんんんにちわ。紹介ありがとうございます。
    そですねー、こっから何を作るかってのが重要ですよねー。うーむ。
  • prayone
    Hi !
    Sorry I can't read nor speak japanese...
    You made a amazing work !

    I just found a bug with the multi marker detector :
    file FLARMultiMarkerDetector.as, line 155
    replace
    var c2:int = match_patt.getConfidence();
    by
    var c2:Number = match_patt.getConfidence();

    Keep up the good work ;)
  • Saqoosha
    Thanks, prayone!
    I've fixed and commited to repository.
    Enjoy!
  • Raz-L
    kudos ! this is awesome, someone had to write this in flash, you're genius.
  • Ori Inbar
    You guys rock! This is as close to Do-it-yourself augmented reality that I have seen.
    See more augmented reality demos, devices and engines at www.gamesalfresco.com.
    Many, many thanks for sharing this with the world.
  • taniss
    Sorry for writing in english.
    I downloaded your FLARToolkit Class, and I can't make it work properly. I'm loading a specific pattern (patt file), but i'm getting every pattern recognized as the same. Even the example that you post, works the same with any black square drawn in a paper (it's not necessary to print patt.hiro, it works with any pattern, wich is wrogn). If you could post some directions on this, it would be great! And... Congratulations for your work! Cheers.
  • Saqoosha
    Hi, tannis.
    Sorry, I can't understand your problem. please tell me more detail.
  • taniss
    thanks, I already fixed it. The problem is that when only one marker is on the screen, the SingleMarkerDetector takes it as the correct marker. What I did, is force the script to check the level of confidence, not against another marker on screen (since of course ther isn't another), but to check against an average value (for example, I set 0.65). I'm getting really good results with that, actually if I point my camera to a marker that is not the one I loaded, nothing is drawn on the screen. Wich is what I needed, of course. Anything you need, please write me an e-mail, i'll be glad to answer, and once again, congratulations for your work.
  • Timbo
    hi Taniss, I have the same problem.
    can you contact me : tim_timmers @@@ hotmail dot com ?

    Thanks!

    Sweet work Saqoosha!
  • Tom
    Hi!

    That's really great work!
    Unfortunately I only can watch the demo. I tried to checkout (with subversion) the files but I always get an error "XML data was not well-formed". Did I do a mistake or isn't the code located at http://www.libspark.org/browser/as3/FLARToolKit/trunk/ anymore?
    I'd really be glad to have a look at it too!
    Thanks a lot!

    Tom
  • psilos
    Is it possible to detect more than one markers at the moment? I have seen the samples and its using SingleMarkerDetector. Is there any example with more than one markers?

    Thanks in advance!
  • psilos
    Hey Tom, I had the same problem. The proper svn address would be http://www.libspark.org/svn/as3/FLARToolKit/trunk.

    Good luck
  • Saqoosha
    to psilos.
    The class org.libspark.flartoolkit.detector.FLARDetectMarker is for multi marker detection. but I have not used this class.
    If you succeed, please report!
  • Jay
    in response to psilos.

    i've had mixed results using the multimarker class. Basically what it does is take an array of markers and loops through them looking for the ar marker.
    but it doesnt work as well as the simple marker and I still havent figure out why. maybe something wrong with my code.

    heres what i've done:

    1. load 2 or more markers

    var codes:Array = new Array();
    var widths:Array = new Array();

    _code = new FLARCode(16, 16);
    _code.loadFromURL("../Data/marker1.pat");
    codes.push(_code);

    _code = new FLARCode(16, 16);
    _code.loadFromURL("../Data/marker2.pat");
    codes.push(_code);

    widths.push(MARKER_SIZE);
    widths.push(MARKER_SIZE);

    this._ctx.mdetector = new FLARMultiMarkerDetector(this._param, codes, widths);

    2. then create a nodes array and push the Flar nodes into it:
    nodes.push(this._scene.addChild(new FLARBaseNode()));

    3. create papervision objects and add them as childs of the nodes created:
    nodes[0].addChild(new Plane(wmat, MARKER_SIZE, MARKER_SIZE));
    nodes[1].addChild(new Plane(wmat, MARKER_SIZE, MARKER_SIZE));

    4. in your application loop check which markers are being detected:

    var i:int = nodes.length;
    while (i-- > 0)
    {
    nodes[i].visible = false;
    if (this._ctx.mdetector.detectMarkerLite(this._ctx.raster, 100) && this._ctx.mdetector.getConfidence(i) > 0.5)
    {
    trace(i + " " + this._ctx.mdetector.getConfidence(i));
    this._ctx.mdetector.getTranslationMatrix(i,this._ctx.resultMat);
    nodes[i].visible = true;
    nodes[i].setTranslationMatrix(this._ctx.resultMat);
    }
    }
  • Tom
    Hi, I've just looked into this and it stuff is sweet.
    I've got a question thou. Is it possible to use a different marker rather than a square? I was thinking using a circle with a dash across it like the London underground logo:
    http://subtitlestocinema.files.wordpress.com/2008/11/london_underground_logo.jpg
    Any ideas how to achieve that?

    Thanks
  • Saqoosha
    Hi Tom,
    It's impossible to use other than the square for the marker in FLARToolKit. But you can design inside of square. Please refer http://saqoosha.net/en/2008/06/05/676/ (currently in Japanese only, sorry.)
  • Srikanth
    Hi.. i want to work with NyARToolkit..
    Could you please give me some guidelines.

    Thanks

    Srikanth

Lux - Multitouch Framework for Mac OS X

Blog

Lux - Multitouch Framework for Mac OS X

フロントエンドが Flash (AS3) だってよー。システム的にはフロントは何で作ってもいいっぽいけど。マルチタッチドライバ部分は OpenFramework で Flash 側とソケット通信してるかんじかな。マルチタッチのデバイスは naturalui のを使ってるらしい。こないだちょっと話題になってた段ボールマルチタッチデバイスもサポートしてるとかなんとか。Lux はまだ公開されてなくって 6 月にプレビュー版がでる。メール送ると beta テスターなれるよ。gizmodo に作者インタビューあるので読むよろし。