-/**\r
- * Java3Dサンプルプログラム\r
- * シングルマーカー追跡用のBehaviorを使って、背景と1個のマーカーに連動したTransformGroup\r
- * を動かします。\r
- * (c)2008 A虎@nyatla.jp\r
- * airmail@ebony.plala.or.jp\r
- * http://nyatla.jp/\r
+/* \r
+ * PROJECT: NyARToolkit Java3d sample program.\r
+ * --------------------------------------------------------------------------------\r
+ * The MIT License\r
+ * Copyright (c) 2008 nyatla\r
+ * airmail(at)ebony.plala.or.jp\r
+ * http://nyatla.jp/nyartoolkit/\r
+ * \r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy\r
+ * of this software and associated documentation files (the "Software"), to deal\r
+ * in the Software without restriction, including without limitation the rights\r
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+ * copies of the Software, and to permit persons to whom the Software is\r
+ * furnished to do so, subject to the following conditions:\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ * \r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
+ * THE SOFTWARE.\r
+ * \r
*/\r
package jp.nyatla.nyartoolkit.java3d.sample;\r
\r
\r
import com.sun.j3d.utils.geometry.ColorCube;\r
\r
+/**\r
+ * Java3Dサンプルプログラム\r
+ * 単一マーカー追跡用のBehaviorを使って、背景と1個のマーカーに連動した\r
+ * TransformGroupを動かします。\r
+ *\r
+ */\r
public class NyARJava3D extends JFrame implements NyARSingleMarkerBehaviorListener\r
{\r
private final String CARCODE_FILE = "../../Data/patt.hiro";\r
-/**
- * VFM+ARToolkitテストプログラム
- * カメラから取り込んだデータからマーカーを検出して、一致度と変換行列を表示します。
- * (c)2008 A虎@nyatla.jp
+/*
+ * PROJECT: NyARToolkit JMF sample program.
+ * --------------------------------------------------------------------------------
+ * The MIT License
+ * Copyright (c) 2008 nyatla
* airmail(at)ebony.plala.or.jp
- * http://nyatla.jp/
+ * http://nyatla.jp/nyartoolkit/
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
*/
package jp.nyatla.nyartoolkit.jmf.sample;
import jp.nyatla.nyartoolkit.core.transmat.*;
import jp.nyatla.nyartoolkit.detector.NyARSingleDetectMarker;
+/**
+ * VFM+ARToolkitテストプログラム
+ * カメラから取り込んだデータからマーカーを検出して、一致度と変換行列を表示します。
+ */
+public class NyarToolkitLinkTest extends Frame implements JmfCaptureListener
+{
+ private final String CARCODE_FILE = "../../Data/patt.hiro";
+ private final String PARAM_FILE = "../../Data/camera_para.dat";
+ private JmfCameraCapture capture;
+ private NyARSingleDetectMarker nya;
+ private JmfNyARRaster_RGB raster;
-public class NyarToolkitLinkTest extends Frame implements JmfCaptureListener
-{
- private final String CARCODE_FILE ="../../Data/patt.hiro";
- private final String PARAM_FILE ="../../Data/camera_para.dat";
- private JmfCameraCapture capture;
- private NyARSingleDetectMarker nya;
- private JmfNyARRaster_RGB raster;
- private NyARTransMatResult trans_mat_result=new NyARTransMatResult();
-
- public NyarToolkitLinkTest() throws NyARException,NyARException
- {
- setTitle("JmfCaptureTest");
- setBounds(0,0,320+64,240+64);
- //キャプチャの準備
- capture=new JmfCameraCapture(320,240,30f,JmfCameraCapture.PIXEL_FORMAT_RGB);
- capture.setCaptureListener(this);
-
- //NyARToolkitの準備
- NyARParam ar_param=new NyARParam();
- NyARCode ar_code =new NyARCode(16,16);
- ar_param.loadARParamFromFile(PARAM_FILE);
- ar_param.changeScreenSize(320,240);
- nya=new NyARSingleDetectMarker(ar_param,ar_code,80.0);
- ar_code.loadFromARFile(CARCODE_FILE);
- //キャプチャイメージ用のラスタを準備
- raster=new JmfNyARRaster_RGB(320,240);
- }
-
-
-
- public void onUpdateBuffer(Buffer i_buffer)
- {
- try{
- //キャプチャしたバッファをラスタにセット
- raster.setBuffer(i_buffer);
-
- //キャプチャしたイメージを表示用に加工
- BufferToImage b2i=new BufferToImage((VideoFormat)i_buffer.getFormat());
- Image img=b2i.createImage(i_buffer);
-
- Graphics g = getGraphics();
- double[][] atm=null;
-
- //マーカー検出
- boolean is_marker_exist=nya.detectMarkerLite(raster,100);
- if(is_marker_exist){
- //変換行列を取得
- nya.getTransmationMatrix(this.trans_mat_result);
- atm=this.trans_mat_result.getArray();
- }
- //情報を画面に書く
- g.drawImage(img, 32, 32,this);
- if(is_marker_exist){
- g.drawString("マーカー検出:"+nya.getConfidence(),32,50);
- for(int i=0;i<3;i++){
- for(int i2=0;i2<4;i2++){
- g.drawString("["+i+"]["+i2+"]"+atm[i][i2],32,50+(1+i2*3+i)*16);
- }
-
- }
- }else{
- g.drawString("マーカー未検出:",32,100);
- }
- }catch(Exception e){
- e.printStackTrace();
+ private NyARTransMatResult trans_mat_result = new NyARTransMatResult();
+
+ public NyarToolkitLinkTest() throws NyARException, NyARException
+ {
+ setTitle("JmfCaptureTest");
+ setBounds(0, 0, 320 + 64, 240 + 64);
+ //キャプチャの準備
+ capture = new JmfCameraCapture(320, 240, 30f, JmfCameraCapture.PIXEL_FORMAT_RGB);
+ capture.setCaptureListener(this);
+
+ //NyARToolkitの準備
+ NyARParam ar_param = new NyARParam();
+ NyARCode ar_code = new NyARCode(16, 16);
+ ar_param.loadARParamFromFile(PARAM_FILE);
+ ar_param.changeScreenSize(320, 240);
+ nya = new NyARSingleDetectMarker(ar_param, ar_code, 80.0);
+ ar_code.loadFromARFile(CARCODE_FILE);
+ //キャプチャイメージ用のラスタを準備
+ raster = new JmfNyARRaster_RGB(320, 240);
}
-
-
-
-
- }
- private void startCapture()
- {
- try{
- capture.start();
- }catch(Exception e){
- e.printStackTrace();
+
+ public void onUpdateBuffer(Buffer i_buffer)
+ {
+ try {
+ //キャプチャしたバッファをラスタにセット
+ raster.setBuffer(i_buffer);
+
+ //キャプチャしたイメージを表示用に加工
+ BufferToImage b2i = new BufferToImage((VideoFormat) i_buffer.getFormat());
+ Image img = b2i.createImage(i_buffer);
+
+ Graphics g = getGraphics();
+
+ //マーカー検出
+ boolean is_marker_exist = nya.detectMarkerLite(raster, 100);
+ if (is_marker_exist) {
+ //変換行列を取得
+ nya.getTransmationMatrix(this.trans_mat_result);
+ }
+ //情報を画面に書く
+ g.drawImage(img, 32, 32, this);
+ if (is_marker_exist) {
+ g.drawString("マーカー検出:" + nya.getConfidence(), 32, 50);
+ g.drawString("[m00]" +this.trans_mat_result.m00, 32, 50 + 16*1);
+ g.drawString("[m01]" +this.trans_mat_result.m01, 32, 50 + 16*2);
+ g.drawString("[m02]" +this.trans_mat_result.m02, 32, 50 + 16*3);
+ g.drawString("[m03]" +this.trans_mat_result.m03, 32, 50 + 16*4);
+ g.drawString("[m10]" +this.trans_mat_result.m10, 32, 50 + 16*5);
+ g.drawString("[m11]" +this.trans_mat_result.m11, 32, 50 + 16*6);
+ g.drawString("[m12]" +this.trans_mat_result.m12, 32, 50 + 16*7);
+ g.drawString("[m13]" +this.trans_mat_result.m13, 32, 50 + 16*8);
+ g.drawString("[m20]" +this.trans_mat_result.m20, 32, 50 + 16*9);
+ g.drawString("[m21]" +this.trans_mat_result.m21, 32, 50 + 16*10);
+ g.drawString("[m22]" +this.trans_mat_result.m22, 32, 50 + 16*11);
+ g.drawString("[m23]" +this.trans_mat_result.m23, 32, 50 + 16*12);
+ } else {
+ g.drawString("マーカー未検出:", 32, 100);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
}
- }
- public static void main(String[] args) {
- try{
- NyarToolkitLinkTest mainwin = new NyarToolkitLinkTest();
- mainwin.setVisible(true);
- mainwin.startCapture();
- }catch(Exception e){
- e.printStackTrace();
+
+ private void startCapture()
+ {
+ try {
+ capture.start();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static void main(String[] args)
+ {
+ try {
+ NyarToolkitLinkTest mainwin = new NyarToolkitLinkTest();
+ mainwin.setVisible(true);
+ mainwin.startCapture();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
}
-
- }
}
-/**\r
- * simpleLiteと同じようなテストプログラム\r
- * 最も一致する"Hiro"マーカーを一つ選択して、その上に立方体を表示します。\r
- * (c)2008 A虎@nyatla.jp\r
+/* \r
+ * PROJECT: NyARToolkit JOGL sample program.\r
+ * --------------------------------------------------------------------------------\r
+ * The MIT License\r
+ * Copyright (c) 2008 nyatla\r
* airmail(at)ebony.plala.or.jp\r
- * http://nyatla.jp/\r
+ * http://nyatla.jp/nyartoolkit/\r
+ * \r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy\r
+ * of this software and associated documentation files (the "Software"), to deal\r
+ * in the Software without restriction, including without limitation the rights\r
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+ * copies of the Software, and to permit persons to whom the Software is\r
+ * furnished to do so, subject to the following conditions:\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ * \r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
+ * THE SOFTWARE.\r
+ * \r
*/\r
package jp.nyatla.nyartoolkit.jogl.sample;\r
\r
import jp.nyatla.nyartoolkit.core.NyARCode;\r
import jp.nyatla.nyartoolkit.core.raster.NyARGlayscaleRaster;\r
import jp.nyatla.nyartoolkit.core.rasteranalyzer.threshold.NyARRasterThresholdAnalyzer_SlidePTile;\r
-import jp.nyatla.nyartoolkit.core.rasterfilter.rgb2gs.NyARRasterFilter_RgbAve;\r
+import jp.nyatla.nyartoolkit.core2.NyARRasterFilter_RgbAve;\r
\r
import jp.nyatla.nyartoolkit.jmf.utils.JmfCameraCapture;\r
import jp.nyatla.nyartoolkit.jmf.utils.JmfCaptureListener;\r
import jp.nyatla.nyartoolkit.jogl.utils.*;\r
-\r
+/**\r
+ * simpleLiteと同じようなテストプログラム\r
+ * 出来る限りARToolKitのサンプルと似せて作ってあります。\r
+ * 最も一致する"Hiro"マーカーを一つ選択して、その上に立方体を表示します。\r
+ * \r
+ */\r
public class JavaSimpleLite implements GLEventListener, JmfCaptureListener\r
{\r
private final String CARCODE_FILE = "../../Data/patt.hiro";\r
{\r
// Colour cube data.\r
int polyList = 0;\r
- float fSize = 0.5f;//マーカーサイズに対して0.5倍なので、4cmのナタデココ\r
+ float fSize = 0.5f;//マーカーサイズに対して0.5倍なので、4cmの立方体\r
int f, i;\r
float[][] cube_vertices = new float[][] { { 1.0f, 1.0f, 1.0f }, { 1.0f, -1.0f, 1.0f }, { -1.0f, -1.0f, 1.0f }, { -1.0f, 1.0f, 1.0f }, { 1.0f, 1.0f, -1.0f }, { 1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f }, { -1.0f, 1.0f, -1.0f } };\r
float[][] cube_vertex_colors = new float[][] { { 1.0f, 1.0f, 1.0f }, { 1.0f, 1.0f, 0.0f }, { 0.0f, 1.0f, 0.0f }, { 0.0f, 1.0f, 1.0f }, { 1.0f, 0.0f, 1.0f }, { 1.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 1.0f } };\r
-/**\r
- * simpleLiteの複数マーカー同時認識バージョン\r
- * "Hiro"のマーカーと"人"のマーカーの混在環境で、Hiroのマーカー全てに\r
- * 立方体を表示します。\r
- * (c)2008 A虎@nyatla.jp\r
+/* \r
+ * PROJECT: NyARToolkit JOGL sample program.\r
+ * --------------------------------------------------------------------------------\r
+ * The MIT License\r
+ * Copyright (c) 2008 nyatla\r
* airmail(at)ebony.plala.or.jp\r
- * http://nyatla.jp/\r
+ * http://nyatla.jp/nyartoolkit/\r
+ * \r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy\r
+ * of this software and associated documentation files (the "Software"), to deal\r
+ * in the Software without restriction, including without limitation the rights\r
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+ * copies of the Software, and to permit persons to whom the Software is\r
+ * furnished to do so, subject to the following conditions:\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ * \r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
+ * THE SOFTWARE.\r
+ * \r
*/\r
+\r
package jp.nyatla.nyartoolkit.jogl.sample;\r
\r
import java.awt.event.WindowAdapter;\r
import jp.nyatla.nyartoolkit.jmf.utils.JmfCameraCapture;\r
import jp.nyatla.nyartoolkit.jmf.utils.JmfCaptureListener;\r
import jp.nyatla.nyartoolkit.jogl.utils.*;\r
-\r
+/**\r
+ * simpleLiteの複数マーカー同時認識バージョン\r
+ * "Hiro"のマーカーと"人"のマーカーの混在環境で、Hiroのマーカー全てに\r
+ * 立方体を表示します。\r
+ */\r
public class JavaSimpleLite2 implements GLEventListener, JmfCaptureListener\r
{\r
private final String CARCODE_FILE1 = "../../Data/patt.hiro";\r
{\r
// Colour cube data.\r
int polyList = 0;\r
- float fSize = 0.5f;//マーカーサイズに対して0.5倍なので、4cmのナタデココ\r
+ float fSize = 0.5f;//マーカーサイズに対して0.5倍なので、4cmの立方体\r
int f, i;\r
float[][] cube_vertices = new float[][] { { 1.0f, 1.0f, 1.0f }, { 1.0f, -1.0f, 1.0f }, { -1.0f, -1.0f, 1.0f }, { -1.0f, 1.0f, 1.0f }, { 1.0f, 1.0f, -1.0f }, { 1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f }, { -1.0f, 1.0f, -1.0f } };\r
float[][] cube_vertex_colors = new float[][] { { 1.0f, 1.0f, 1.0f }, { 1.0f, 1.0f, 0.0f }, { 0.0f, 1.0f, 0.0f }, { 0.0f, 1.0f, 1.0f }, { 1.0f, 0.0f, 1.0f }, { 1.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 1.0f } };\r
-/**
- * VFM+ARToolkitテストプログラム
- * カメラから取り込んだデータからマーカーを検出して、一致度と変換行列を表示します。
- * (c)2008 A虎@nyatla.jp
+/*
+ * PROJECT: NyARToolkit QuickTime sample program.
+ * --------------------------------------------------------------------------------
+ * The MIT License
+ * Copyright (c) 2008 nyatla
* airmail(at)ebony.plala.or.jp
- * http://nyatla.jp/
+ * http://nyatla.jp/nyartoolkit/
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
*/
+
+
package jp.nyatla.nyartoolkit.qt.sample;
import jp.nyatla.nyartoolkit.NyARException;
import jp.nyatla.nyartoolkit.core.param.NyARParam;
import jp.nyatla.nyartoolkit.core.transmat.NyARTransMatResult;
import jp.nyatla.nyartoolkit.detector.NyARSingleDetectMarker;
+/**
+ * VFM+ARToolkitテストプログラム
+ * カメラから取り込んだデータからマーカーを検出して、一致度と変換行列を表示します。
+ */
+public class NyarToolkitLinkTest extends Frame implements QtCaptureListener
+{
+ private final String CARCODE_FILE = "../../Data/patt.hiro";
+ private final String PARAM_FILE = "../../Data/camera_para.dat";
+ private QtCameraCapture capture;
-public class NyarToolkitLinkTest extends Frame implements QtCaptureListener
-{
- private final String CARCODE_FILE ="../../Data/patt.hiro";
- private final String PARAM_FILE ="../../Data/camera_para.dat";
- private QtCameraCapture capture;
- private NyARSingleDetectMarker nya;
- private QtNyARRaster_RGB raster;
- private NyARTransMatResult trans_mat_result=new NyARTransMatResult();
-
- public NyarToolkitLinkTest() throws NyARException,NyARException
- {
- setTitle("QtCaptureTest");
- setBounds(0,0,320+64,240+64);
- //キャプチャの準備
- capture=new QtCameraCapture(320,240,30f);
- capture.setCaptureListener(this);
-
- //NyARToolkitの準備
- NyARParam ar_param=new NyARParam();
- NyARCode ar_code =new NyARCode(16,16);
- ar_param.loadARParamFromFile(PARAM_FILE);
- ar_param.changeScreenSize(320,240);
- nya=new NyARSingleDetectMarker(ar_param,ar_code,80.0);
- ar_code.loadFromARFile(CARCODE_FILE);
- //キャプチャイメージ用のラスタを準備
- raster=new QtNyARRaster_RGB(320,240);
- }
-
-
-
- public void onUpdateBuffer(byte[] pixels)
- {
- try{
- //キャプチャしたバッファをラスタにセット
- raster.setBuffer(pixels);
-
- //キャプチャしたイメージを表示用に加工
- Image img= raster.createImage();
-
- Graphics g = getGraphics();
- double[][] atm=null;
-
- //マーカー検出
- boolean is_marker_exist=nya.detectMarkerLite(raster,100);
- if(is_marker_exist){
- //変換行列を取得
- nya.getTransmationMatrix(this.trans_mat_result);
- atm=this.trans_mat_result.getArray();
- }
- //情報を画面に書く
- g.drawImage(img, 32, 32,this);
- if(is_marker_exist){
- g.drawString("マーカー検出:"+nya.getConfidence(),32,50);
- for(int i=0;i<3;i++){
- for(int i2=0;i2<4;i2++){
- g.drawString("["+i+"]["+i2+"]"+atm[i][i2],32,50+(1+i2*3+i)*16);
- }
-
- }
- }else{
- g.drawString("マーカー未検出:",32,100);
- }
- }catch(Exception e){
- e.printStackTrace();
+ private NyARSingleDetectMarker nya;
+
+ private QtNyARRaster_RGB raster;
+
+ private NyARTransMatResult trans_mat_result = new NyARTransMatResult();
+
+ public NyarToolkitLinkTest() throws NyARException, NyARException
+ {
+ setTitle("QtCaptureTest");
+ setBounds(0, 0, 320 + 64, 240 + 64);
+ //キャプチャの準備
+ capture = new QtCameraCapture(320, 240, 30f);
+ capture.setCaptureListener(this);
+
+ //NyARToolkitの準備
+ NyARParam ar_param = new NyARParam();
+ NyARCode ar_code = new NyARCode(16, 16);
+ ar_param.loadARParamFromFile(PARAM_FILE);
+ ar_param.changeScreenSize(320, 240);
+ nya = new NyARSingleDetectMarker(ar_param, ar_code, 80.0);
+ ar_code.loadFromARFile(CARCODE_FILE);
+ //キャプチャイメージ用のラスタを準備
+ raster = new QtNyARRaster_RGB(320, 240);
}
-
-
-
-
- }
- private void startCapture()
- {
- try{
- capture.start();
- }catch(Exception e){
- e.printStackTrace();
+
+ public void onUpdateBuffer(byte[] pixels)
+ {
+ try {
+ //キャプチャしたバッファをラスタにセット
+ raster.setBuffer(pixels);
+
+ //キャプチャしたイメージを表示用に加工
+ Image img = raster.createImage();
+
+ Graphics g = getGraphics();
+
+ //マーカー検出
+ boolean is_marker_exist = nya.detectMarkerLite(raster, 100);
+ if (is_marker_exist) {
+ //変換行列を取得
+ nya.getTransmationMatrix(this.trans_mat_result);
+ }
+ //情報を画面に書く
+ g.drawImage(img, 32, 32, this);
+ if (is_marker_exist) {
+ g.drawString("マーカー検出:" + nya.getConfidence(), 32, 50);
+ g.drawString("[m00]" + this.trans_mat_result.m00, 32, 50 + 16 * 1);
+ g.drawString("[m01]" + this.trans_mat_result.m01, 32, 50 + 16 * 2);
+ g.drawString("[m02]" + this.trans_mat_result.m02, 32, 50 + 16 * 3);
+ g.drawString("[m03]" + this.trans_mat_result.m03, 32, 50 + 16 * 4);
+ g.drawString("[m10]" + this.trans_mat_result.m10, 32, 50 + 16 * 5);
+ g.drawString("[m11]" + this.trans_mat_result.m11, 32, 50 + 16 * 6);
+ g.drawString("[m12]" + this.trans_mat_result.m12, 32, 50 + 16 * 7);
+ g.drawString("[m13]" + this.trans_mat_result.m13, 32, 50 + 16 * 8);
+ g.drawString("[m20]" + this.trans_mat_result.m20, 32, 50 + 16 * 9);
+ g.drawString("[m21]" + this.trans_mat_result.m21, 32, 50 + 16 * 10);
+ g.drawString("[m22]" + this.trans_mat_result.m22, 32, 50 + 16 * 11);
+ g.drawString("[m23]" + this.trans_mat_result.m23, 32, 50 + 16 * 12);
+
+ } else {
+ g.drawString("マーカー未検出:", 32, 100);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ private void startCapture()
+ {
+ try {
+ capture.start();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
}
- }
- public static void main(String[] args) {
- try{
- NyarToolkitLinkTest mainwin = new NyarToolkitLinkTest();
- mainwin.setVisible(true);
- mainwin.startCapture();
- }catch(Exception e){
- e.printStackTrace();
+
+ public static void main(String[] args)
+ {
+ try {
+ NyarToolkitLinkTest mainwin = new NyarToolkitLinkTest();
+ mainwin.setVisible(true);
+ mainwin.startCapture();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
}
-
- }
}
-/**
- * VFMキャプチャテストプログラム
- * (c)2008 A虎@nyatla.jp
- * airmail@ebony.plala.or.jp
- * http://nyatla.jp/
+/*
+ * PROJECT: NyARToolkit QuickTime sample program.
+ * --------------------------------------------------------------------------------
+ * The MIT License
+ * Copyright (c) 2008 nyatla
+ * airmail(at)ebony.plala.or.jp
+ * http://nyatla.jp/nyartoolkit/
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
*/
package jp.nyatla.nyartoolkit.qt.sample;
import jp.nyatla.nyartoolkit.qt.utils.*;
import java.awt.*;
+/**
+ * QuickTimeキャプチャプログラム
+ *
+ */
+public class QtCaptureTest extends Frame implements QtCaptureListener
+{
+ public QtCaptureTest() throws NyARException
+ {
+ setTitle("QtCaptureTest");
+ setBounds(0, 0, 320 + 64, 240 + 64);
+ capture = new QtCameraCapture(320, 240, 30f);
+ capture.setCaptureListener(this);
+ //キャプチャイメージ用のラスタを準備
+ raster = new QtNyARRaster_RGB(320, 240);
+ }
+ private QtCameraCapture capture;
+ private QtNyARRaster_RGB raster;
-public class QtCaptureTest extends Frame implements QtCaptureListener{
- public QtCaptureTest() throws NyARException
- {
- setTitle("QtCaptureTest");
- setBounds(0,0,320+64,240+64);
- capture=new QtCameraCapture(320,240,30f);
- capture.setCaptureListener(this);
- //キャプチャイメージ用のラスタを準備
- raster=new QtNyARRaster_RGB(320,240);
- }
-
-
-
- private QtCameraCapture capture;
- private QtNyARRaster_RGB raster;
- public void onUpdateBuffer(byte[] pixels)
- {
- raster.setBuffer(pixels);
- Image img=raster.createImage();
- Graphics g = getGraphics();
- g.drawImage(img, 32, 32,this);
- }
- private void startCapture()
- {
- try{
- capture.start();
- }catch(Exception e){
- e.printStackTrace();
+ public void onUpdateBuffer(byte[] pixels)
+ {
+ raster.setBuffer(pixels);
+ Image img = raster.createImage();
+ Graphics g = getGraphics();
+ g.drawImage(img, 32, 32, this);
}
- }
- public static void main(String[] args) {
- try{
- QtCaptureTest mainwin = new QtCaptureTest();
- mainwin.setVisible(true);
- mainwin.startCapture();
- }catch(Exception e){
- e.printStackTrace();
+
+ private void startCapture()
+ {
+ try {
+ capture.start();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static void main(String[] args)
+ {
+ try {
+ QtCaptureTest mainwin = new QtCaptureTest();
+ mainwin.setVisible(true);
+ mainwin.startCapture();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
}
-
- }
}
-/**\r
- * NyARParamにOpenGL向け関数を追加したもの\r
- * (c)2008 A虎@nyatla.jp\r
+/* \r
+ * PROJECT: NyARToolkit Java3D utilities.\r
+ * --------------------------------------------------------------------------------\r
+ * The MIT License\r
+ * Copyright (c) 2008 nyatla\r
* airmail(at)ebony.plala.or.jp\r
- * http://nyatla.jp/\r
+ * http://nyatla.jp/nyartoolkit/\r
+ * \r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy\r
+ * of this software and associated documentation files (the "Software"), to deal\r
+ * in the Software without restriction, including without limitation the rights\r
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+ * copies of the Software, and to permit persons to whom the Software is\r
+ * furnished to do so, subject to the following conditions:\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ * \r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
+ * THE SOFTWARE.\r
+ * \r
*/\r
package jp.nyatla.nyartoolkit.java3d.utils;\r
\r
import jp.nyatla.nyartoolkit.core.param.NyARParam;\r
\r
import javax.media.j3d.Transform3D;\r
-\r
+/**\r
+ * NyARParamにJava3D向け関数を追加したもの\r
+ */\r
public class J3dNyARParam extends NyARParam\r
{\r
private double view_distance_min = 0.01;//1cm~10.0m\r
-/**\r
- * NyARRaster_RGBにOpenGL向け関数を追加したもの\r
- * (c)2008 A虎@nyatla.jp\r
+/* \r
+ * PROJECT: NyARToolkit Java3D utilities.\r
+ * --------------------------------------------------------------------------------\r
+ * The MIT License\r
+ * Copyright (c) 2008 nyatla\r
* airmail(at)ebony.plala.or.jp\r
- * http://nyatla.jp/\r
+ * http://nyatla.jp/nyartoolkit/\r
+ * \r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy\r
+ * of this software and associated documentation files (the "Software"), to deal\r
+ * in the Software without restriction, including without limitation the rights\r
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+ * copies of the Software, and to permit persons to whom the Software is\r
+ * furnished to do so, subject to the following conditions:\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ * \r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
+ * THE SOFTWARE.\r
+ * \r
*/\r
package jp.nyatla.nyartoolkit.java3d.utils;\r
\r
-/**\r
- * NyARToolkitのBehaviorホルダー\r
- * (c)2008 A虎@nyatla.jp\r
- * airmail@ebony.plala.or.jp\r
- * http://nyatla.jp/\r
+/* \r
+ * PROJECT: NyARToolkit Java3D utilities.\r
+ * --------------------------------------------------------------------------------\r
+ * The MIT License\r
+ * Copyright (c) 2008 nyatla\r
+ * airmail(at)ebony.plala.or.jp\r
+ * http://nyatla.jp/nyartoolkit/\r
+ * \r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy\r
+ * of this software and associated documentation files (the "Software"), to deal\r
+ * in the Software without restriction, including without limitation the rights\r
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+ * copies of the Software, and to permit persons to whom the Software is\r
+ * furnished to do so, subject to the following conditions:\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ * \r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
+ * THE SOFTWARE.\r
+ * \r
*/\r
package jp.nyatla.nyartoolkit.java3d.utils;\r
\r
}\r
if (raster.hasData()) {\r
is_marker_exist = related_nya.detectMarkerLite(raster, 100);\r
- if (is_marker_exist) {\r
- related_nya.getTransmationMatrix(this.trans_mat_result);\r
- double[][] src = this.trans_mat_result.getArray();\r
- Matrix4d matrix = new Matrix4d(src[0][0], -src[1][0], -src[2][0], 0, -src[0][1], src[1][1], src[2][1], 0, -src[0][2], src[1][2], src[2][2], 0, -src[0][3], src[1][3], src[2][3], 1);\r
+ if (is_marker_exist)\r
+ {\r
+ final NyARTransMatResult src = this.trans_mat_result;\r
+ related_nya.getTransmationMatrix(src);\r
+ Matrix4d matrix = new Matrix4d(src.m00, -src.m10, -src.m20, 0, -src.m01, src.m11, src.m21, 0, -src.m02, src.m12, src.m22, 0, -src.m03, src.m13, src.m23, 1);\r
matrix.transpose();\r
t3d = new Transform3D(matrix);\r
if (trgroup != null) {\r
-/**\r
- * NyARToolkitのBehaviorのリスナ\r
- * (c)2008 A虎@nyatla.jp\r
- * airmail@ebony.plala.or.jp\r
- * http://nyatla.jp/\r
+/* \r
+ * PROJECT: NyARToolkit Java3D utilities.\r
+ * --------------------------------------------------------------------------------\r
+ * The MIT License\r
+ * Copyright (c) 2008 nyatla\r
+ * airmail(at)ebony.plala.or.jp\r
+ * http://nyatla.jp/nyartoolkit/\r
+ * \r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy\r
+ * of this software and associated documentation files (the "Software"), to deal\r
+ * in the Software without restriction, including without limitation the rights\r
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+ * copies of the Software, and to permit persons to whom the Software is\r
+ * furnished to do so, subject to the following conditions:\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ * \r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
+ * THE SOFTWARE.\r
+ * \r
*/\r
package jp.nyatla.nyartoolkit.java3d.utils;\r
\r
-/**\r
- * JMFお手軽キャプチャクラス\r
- * (c)2008 A虎@nyatla.jp\r
- * airmail@ebony.plala.or.jp\r
- * http://nyatla.jp/\r
+/* \r
+ * PROJECT: NyARToolkit JMF utilities.\r
+ * --------------------------------------------------------------------------------\r
+ * The MIT License\r
+ * Copyright (c) 2008 nyatla\r
+ * airmail(at)ebony.plala.or.jp\r
+ * http://nyatla.jp/nyartoolkit/\r
+ * \r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy\r
+ * of this software and associated documentation files (the "Software"), to deal\r
+ * in the Software without restriction, including without limitation the rights\r
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+ * copies of the Software, and to permit persons to whom the Software is\r
+ * furnished to do so, subject to the following conditions:\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ * \r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
+ * THE SOFTWARE.\r
+ * \r
*/\r
package jp.nyatla.nyartoolkit.jmf.utils;\r
\r
import javax.media.protocol.DataSource;\r
\r
import jp.nyatla.nyartoolkit.NyARException;\r
-\r
+/**\r
+ * 簡易JMFキャプチャクラス\r
+ * @author atla\r
+ *\r
+ */\r
public class JmfCameraCapture\r
{\r
- private Dimension image_size;\r
+ private Dimension image_size;\r
\r
- private JmfCaptureListener capture_listener;\r
+ private JmfCaptureListener capture_listener;\r
\r
- // private DataSource jmf_data_source;\r
- private MonitorStream jmf_monitor_stream;\r
+ // private DataSource jmf_data_source;\r
+ private MonitorStream jmf_monitor_stream;\r
\r
- private Processor jmf_processor;\r
+ private Processor jmf_processor;\r
\r
- private VideoFormat jmf_video_format;\r
+ private VideoFormat jmf_video_format;\r
\r
- private Buffer read_buf = new Buffer();\r
+ private Buffer read_buf = new Buffer();\r
\r
- public static final String PIXEL_FORMAT_RGB = "RGB";\r
+ public static final String PIXEL_FORMAT_RGB = "RGB";\r
\r
- public JmfCameraCapture(int i_width, int i_height, float i_rate,\r
- String i_pixcel_format) {\r
- String encoding = i_pixcel_format;// comboEncoding.getSelectedItem();\r
- image_size = new Dimension(i_width, i_height);\r
- jmf_video_format = new VideoFormat(encoding, image_size,\r
- Format.NOT_SPECIFIED, null, i_rate);\r
- }\r
-\r
- public Dimension getSize() {\r
- return image_size;\r
- }\r
-\r
- public javax.media.Buffer readBuffer() throws NyARException {\r
- if (jmf_monitor_stream == null) {\r
- throw new NyARException();\r
+ public JmfCameraCapture(int i_width, int i_height, float i_rate, String i_pixcel_format)\r
+ {\r
+ String encoding = i_pixcel_format;// comboEncoding.getSelectedItem();\r
+ image_size = new Dimension(i_width, i_height);\r
+ jmf_video_format = new VideoFormat(encoding, image_size, Format.NOT_SPECIFIED, null, i_rate);\r
}\r
- try {\r
- jmf_monitor_stream.read(read_buf);\r
- } catch (Exception e) {\r
- throw new NyARException(e);\r
- }\r
- return read_buf;\r
- }\r
\r
- public void setCaptureListener(JmfCaptureListener i_listener)\r
- throws NyARException {\r
- if (jmf_processor != null) {\r
- throw new NyARException();\r
- }\r
- capture_listener = i_listener;\r
-\r
- }\r
-\r
- public void start() throws NyARException {\r
-\r
- DataSource ds = getCaptureDS(jmf_video_format);\r
- VideoFormat[] formats = new VideoFormat[] { new VideoFormat(null) };\r
- ProcessorModel pm = new ProcessorModel(ds, formats, null);// ,\r
- // formats,\r
- // ftd);\r
- Processor processor;\r
- try {\r
- processor = Manager.createRealizedProcessor(pm);\r
- } catch (Exception e) {\r
- // Make sure the capture devices are released\r
- ds.disconnect();\r
- throw new NyARException(e);\r
+ public Dimension getSize()\r
+ {\r
+ return image_size;\r
}\r
- // Get the monitor control:\r
- // Since there are more than one MonitorControl objects\r
- // exported by the DataSource, we get the specific one\r
- // that is also the MonitorStream object.\r
- jmf_monitor_stream = (MonitorStream) ds\r
- .getControl("jmfsample.MonitorStream");\r
- jmf_monitor_stream.setCaptureListener(capture_listener);\r
- // jmf_data_source=ds;\r
- jmf_processor = processor;\r
- jmf_processor.start();\r
- }\r
-\r
- public void stop() {\r
- jmf_processor.stop();\r
- jmf_processor.close();\r
- jmf_processor = null;\r
-\r
- }\r
-\r
- protected void finalize() {\r
- if (jmf_processor != null) {\r
- jmf_processor.stop();\r
- jmf_processor.close();\r
- jmf_processor = null;\r
+\r
+ public javax.media.Buffer readBuffer() throws NyARException\r
+ {\r
+ if (jmf_monitor_stream == null) {\r
+ throw new NyARException();\r
+ }\r
+ try {\r
+ jmf_monitor_stream.read(read_buf);\r
+ } catch (Exception e) {\r
+ throw new NyARException(e);\r
+ }\r
+ return read_buf;\r
}\r
- }\r
-\r
- private static DataSource getCaptureDS(VideoFormat vf) {\r
- DataSource dsVideo = null;\r
- DataSource ds = null;\r
-\r
- // Create a capture DataSource for the video\r
- // If there is no video capture device, then exit with null\r
- if (vf != null) {\r
- dsVideo = createDataSource(vf);\r
- if (dsVideo == null)\r
- return null;\r
+\r
+ public void setCaptureListener(JmfCaptureListener i_listener) throws NyARException\r
+ {\r
+ if (jmf_processor != null) {\r
+ throw new NyARException();\r
+ }\r
+ capture_listener = i_listener;\r
+\r
}\r
\r
- // Create the monitoring datasource wrapper\r
- if (dsVideo != null) {\r
- dsVideo = new MonitorCDS(dsVideo);\r
- return dsVideo;\r
+ public void start() throws NyARException\r
+ {\r
+\r
+ DataSource ds = getCaptureDS(jmf_video_format);\r
+ VideoFormat[] formats = new VideoFormat[] { new VideoFormat(null) };\r
+ ProcessorModel pm = new ProcessorModel(ds, formats, null);// ,\r
+ // formats,\r
+ // ftd);\r
+ Processor processor;\r
+ try {\r
+ processor = Manager.createRealizedProcessor(pm);\r
+ } catch (Exception e) {\r
+ // Make sure the capture devices are released\r
+ ds.disconnect();\r
+ throw new NyARException(e);\r
+ }\r
+ // Get the monitor control:\r
+ // Since there are more than one MonitorControl objects\r
+ // exported by the DataSource, we get the specific one\r
+ // that is also the MonitorStream object.\r
+ jmf_monitor_stream = (MonitorStream) ds.getControl("jmfsample.MonitorStream");\r
+ jmf_monitor_stream.setCaptureListener(capture_listener);\r
+ // jmf_data_source=ds;\r
+ jmf_processor = processor;\r
+ jmf_processor.start();\r
}\r
\r
- // Merge the data sources, if both audio and video are available\r
- try {\r
- ds = Manager.createMergingDataSource(new DataSource[] { dsVideo });\r
- } catch (IncompatibleSourceException ise) {\r
- return null;\r
+ public void stop()\r
+ {\r
+ jmf_processor.stop();\r
+ jmf_processor.close();\r
+ jmf_processor = null;\r
+\r
}\r
\r
- return ds;\r
- }\r
-\r
- private static DataSource createDataSource(Format format)\r
- {\r
- DataSource ds;\r
- Vector devices;\r
- CaptureDeviceInfo cdi;\r
- MediaLocator ml;\r
-\r
- // Find devices for format\r
- devices = CaptureDeviceManager.getDeviceList(format);\r
- if (devices.size() < 1) {\r
- System.err.println("! No Devices for " + format);\r
- return null;\r
+ protected void finalize()\r
+ {\r
+ if (jmf_processor != null) {\r
+ jmf_processor.stop();\r
+ jmf_processor.close();\r
+ jmf_processor = null;\r
+ }\r
}\r
- // Pick the first device\r
- cdi = (CaptureDeviceInfo) devices.elementAt(0);\r
-\r
- ml = cdi.getLocator();\r
-\r
- try {\r
- ds = Manager.createDataSource(ml);\r
- ds.connect();\r
- if (ds instanceof CaptureDevice) {\r
- setCaptureFormat((CaptureDevice) ds, format);\r
- }\r
- } catch (Exception e) {\r
- System.err.println(e);\r
- return null;\r
+\r
+ private static DataSource getCaptureDS(VideoFormat vf)\r
+ {\r
+ DataSource dsVideo = null;\r
+ DataSource ds = null;\r
+\r
+ // Create a capture DataSource for the video\r
+ // If there is no video capture device, then exit with null\r
+ if (vf != null) {\r
+ dsVideo = createDataSource(vf);\r
+ if (dsVideo == null)\r
+ return null;\r
+ }\r
+\r
+ // Create the monitoring datasource wrapper\r
+ if (dsVideo != null) {\r
+ dsVideo = new MonitorCDS(dsVideo);\r
+ return dsVideo;\r
+ }\r
+\r
+ // Merge the data sources, if both audio and video are available\r
+ try {\r
+ ds = Manager.createMergingDataSource(new DataSource[] { dsVideo });\r
+ } catch (IncompatibleSourceException ise) {\r
+ return null;\r
+ }\r
+\r
+ return ds;\r
}\r
- return ds;\r
- }\r
-\r
- private static void setCaptureFormat(CaptureDevice cdev, Format format)\r
- {\r
- FormatControl[] fcs = cdev.getFormatControls();\r
- if (fcs.length < 1) {\r
- return;\r
+\r
+ private static DataSource createDataSource(Format format)\r
+ {\r
+ DataSource ds;\r
+ Vector devices;\r
+ CaptureDeviceInfo cdi;\r
+ MediaLocator ml;\r
+\r
+ // Find devices for format\r
+ devices = CaptureDeviceManager.getDeviceList(format);\r
+ if (devices.size() < 1) {\r
+ System.err.println("! No Devices for " + format);\r
+ return null;\r
+ }\r
+ // Pick the first device\r
+ cdi = (CaptureDeviceInfo) devices.elementAt(0);\r
+\r
+ ml = cdi.getLocator();\r
+\r
+ try {\r
+ ds = Manager.createDataSource(ml);\r
+ ds.connect();\r
+ if (ds instanceof CaptureDevice) {\r
+ setCaptureFormat((CaptureDevice) ds, format);\r
+ }\r
+ } catch (Exception e) {\r
+ System.err.println(e);\r
+ return null;\r
+ }\r
+ return ds;\r
}\r
- FormatControl fc = fcs[0];\r
- Format[] formats = fc.getSupportedFormats();\r
- for (int i = 0; i < formats.length; i++) {\r
- if (formats[i].matches(format)) {\r
- format = formats[i].intersects(format);\r
- fc.setFormat(format);\r
- break;\r
- }\r
+\r
+ private static void setCaptureFormat(CaptureDevice cdev, Format format)\r
+ {\r
+ FormatControl[] fcs = cdev.getFormatControls();\r
+ if (fcs.length < 1) {\r
+ return;\r
+ }\r
+ FormatControl fc = fcs[0];\r
+ Format[] formats = fc.getSupportedFormats();\r
+ for (int i = 0; i < formats.length; i++) {\r
+ if (formats[i].matches(format)) {\r
+ format = formats[i].intersects(format);\r
+ fc.setFormat(format);\r
+ break;\r
+ }\r
+ }\r
}\r
- }\r
}
\ No newline at end of file
-/**\r
- * JMFお手軽キャプチャ用リスナ\r
- * (c)2008 A虎@nyatla.jp\r
- * airmail@ebony.plala.or.jp\r
- * http://nyatla.jp/\r
+/* \r
+ * PROJECT: NyARToolkit JMF utilities.\r
+ * --------------------------------------------------------------------------------\r
+ * The MIT License\r
+ * Copyright (c) 2008 nyatla\r
+ * airmail(at)ebony.plala.or.jp\r
+ * http://nyatla.jp/nyartoolkit/\r
+ * \r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy\r
+ * of this software and associated documentation files (the "Software"), to deal\r
+ * in the Software without restriction, including without limitation the rights\r
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+ * copies of the Software, and to permit persons to whom the Software is\r
+ * furnished to do so, subject to the following conditions:\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ * \r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
+ * THE SOFTWARE.\r
+ * \r
*/\r
package jp.nyatla.nyartoolkit.jmf.utils;\r
\r
import javax.media.Buffer;\r
-\r
+/**\r
+ * JMF簡易キャプチャ用のリスナクラス\r
+ *\r
+ */\r
public interface JmfCaptureListener{\r
public void onUpdateBuffer(Buffer i_buffer);\r
\r
-/**\r
- * RGB形式のJMFバッファをラップするNyARRasterです。\r
- * JMFから得たラスタデータのピクセル並び順を考慮します。\r
- * (c)2008 A虎@nyatla.jp\r
+/* \r
+ * PROJECT: NyARToolkit JMF utilities.\r
+ * --------------------------------------------------------------------------------\r
+ * The MIT License\r
+ * Copyright (c) 2008 nyatla\r
* airmail(at)ebony.plala.or.jp\r
- * http://nyatla.jp/\r
+ * http://nyatla.jp/nyartoolkit/\r
+ * \r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy\r
+ * of this software and associated documentation files (the "Software"), to deal\r
+ * in the Software without restriction, including without limitation the rights\r
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+ * copies of the Software, and to permit persons to whom the Software is\r
+ * furnished to do so, subject to the following conditions:\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ * \r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
+ * THE SOFTWARE.\r
+ * \r
*/\r
package jp.nyatla.nyartoolkit.jmf.utils;\r
\r
import java.awt.Dimension;\r
\r
import jp.nyatla.nyartoolkit.NyARException;\r
-import jp.nyatla.nyartoolkit.core.raster.*;\r
import jp.nyatla.nyartoolkit.core.raster.rgb.*;\r
import jp.nyatla.nyartoolkit.core.rasterreader.*;\r
import jp.nyatla.nyartoolkit.core.types.*;\r
-\r
+/**\r
+ * \r
+ * RGB形式のJMFバッファをラップするNyARRasterです。\r
+ * JMFから得たラスタデータのピクセル並び順を考慮します。\r
+ *\r
+ */\r
public class JmfNyARRaster_RGB extends NyARRgbRaster_BasicClass\r
{\r
protected class Reader implements INyARRgbPixelReader,INyARBufferReader\r
-/**
- * VFMキャプチャテストプログラム
- * (c)2008 A虎@nyatla.jp
- * airmail@ebony.plala.or.jp
- * http://nyatla.jp/
+/*
+ * PROJECT: NyARToolkit JMF utilities.
+ * --------------------------------------------------------------------------------
+ * The MIT License
+ * Copyright (c) 2008 nyatla
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
*/
+
package jp.nyatla.nyartoolkit.jmf.utils.sample;
import javax.media.*;
import java.awt.*;
+/**
+ * VFMキャプチャテストプログラム
+ */
public class JmfCaptureTest extends Frame implements JmfCaptureListener
{
public JmfCaptureTest() throws NyARException
/* \r
- * PROJECT: NyARToolkit\r
+ * PROJECT: NyARToolkit JOGL utilities.\r
* --------------------------------------------------------------------------------\r
* This work is based on the original ARToolKit developed by\r
* Hirokazu Kato\r
* <airmail(at)ebony.plala.or.jp>\r
* \r
*/\r
-\r
package jp.nyatla.nyartoolkit.jogl.utils;\r
\r
import jp.nyatla.nyartoolkit.NyARException;\r
{\r
private NyARTransMatResult trans_mat_result = new NyARTransMatResult();\r
\r
- private double view_scale_factor = 0.025;// #define VIEW_SCALEFACTOR 0.025 // 1.0 ARToolKit unit becomes 0.025 of my OpenGL units.\r
+ private double view_scale_factor = 0.025;\r
\r
public GLNyARDetectMarker(NyARParam i_param, NyARCode[] i_code, double[] i_marker_width, int i_number_of_code) throws NyARException\r
{\r
// 座標を計算\r
this.getTransmationMatrix(i_index, this.trans_mat_result);\r
// 行列変換\r
- double[][] para = this.trans_mat_result.getArray();\r
- o_result[0 + 0 * 4] = para[0][0]; // R1C1\r
- o_result[0 + 1 * 4] = para[0][1]; // R1C2\r
- o_result[0 + 2 * 4] = para[0][2];\r
- o_result[0 + 3 * 4] = para[0][3];\r
- o_result[1 + 0 * 4] = -para[1][0]; // R2\r
- o_result[1 + 1 * 4] = -para[1][1];\r
- o_result[1 + 2 * 4] = -para[1][2];\r
- o_result[1 + 3 * 4] = -para[1][3];\r
- o_result[2 + 0 * 4] = -para[2][0]; // R3\r
- o_result[2 + 1 * 4] = -para[2][1];\r
- o_result[2 + 2 * 4] = -para[2][2];\r
- o_result[2 + 3 * 4] = -para[2][3];\r
+ final NyARTransMatResult mat = this.trans_mat_result;\r
+ o_result[0 + 0 * 4] = mat.m00; \r
+ o_result[0 + 1 * 4] = mat.m01;\r
+ o_result[0 + 2 * 4] = mat.m02;\r
+ o_result[0 + 3 * 4] = mat.m03;\r
+ o_result[1 + 0 * 4] = -mat.m10;\r
+ o_result[1 + 1 * 4] = -mat.m11;\r
+ o_result[1 + 2 * 4] = -mat.m12;\r
+ o_result[1 + 3 * 4] = -mat.m13;\r
+ o_result[2 + 0 * 4] = -mat.m20;\r
+ o_result[2 + 1 * 4] = -mat.m21;\r
+ o_result[2 + 2 * 4] = -mat.m22;\r
+ o_result[2 + 3 * 4] = -mat.m23;\r
o_result[3 + 0 * 4] = 0.0;\r
o_result[3 + 1 * 4] = 0.0;\r
o_result[3 + 2 * 4] = 0.0;\r
/* \r
- * PROJECT: NyARToolkit\r
+ * PROJECT: NyARToolkit JOGL utilities.\r
* --------------------------------------------------------------------------------\r
* This work is based on the original ARToolKit developed by\r
* Hirokazu Kato\r
* <airmail(at)ebony.plala.or.jp>\r
* \r
*/\r
-\r
package jp.nyatla.nyartoolkit.jogl.utils;\r
\r
import jp.nyatla.nyartoolkit.core.*;\r
/* \r
- * PROJECT: NyARToolkit\r
+ * PROJECT: NyARToolkit JOGL utilities.\r
* --------------------------------------------------------------------------------\r
* This work is based on the original ARToolKit developed by\r
* Hirokazu Kato\r
\r
import jp.nyatla.nyartoolkit.NyARException;\r
import jp.nyatla.nyartoolkit.jmf.utils.*;\r
-import jp.nyatla.nyartoolkit.core.*;\r
import jp.nyatla.nyartoolkit.core.param.NyARParam;\r
import jp.nyatla.nyartoolkit.core.rasterreader.*;\r
\r
/* \r
- * PROJECT: NyARToolkit\r
+ * PROJECT: NyARToolkit JOGL utilities.\r
* --------------------------------------------------------------------------------\r
* This work is based on the original ARToolKit developed by\r
* Hirokazu Kato\r
* <airmail(at)ebony.plala.or.jp>\r
* \r
*/\r
-\r
package jp.nyatla.nyartoolkit.jogl.utils;\r
\r
import jp.nyatla.nyartoolkit.NyARException;\r
// 座標を計算\r
this.getTransmationMatrix(this.trans_mat_result);\r
// 行列変換\r
- double[][] para = this.trans_mat_result.getArray();\r
- o_result[0 + 0 * 4] = para[0][0]; // R1C1\r
- o_result[0 + 1 * 4] = para[0][1]; // R1C2\r
- o_result[0 + 2 * 4] = para[0][2];\r
- o_result[0 + 3 * 4] = para[0][3];\r
- o_result[1 + 0 * 4] = -para[1][0]; // R2\r
- o_result[1 + 1 * 4] = -para[1][1];\r
- o_result[1 + 2 * 4] = -para[1][2];\r
- o_result[1 + 3 * 4] = -para[1][3];\r
- o_result[2 + 0 * 4] = -para[2][0]; // R3\r
- o_result[2 + 1 * 4] = -para[2][1];\r
- o_result[2 + 2 * 4] = -para[2][2];\r
- o_result[2 + 3 * 4] = -para[2][3];\r
+ final NyARTransMatResult mat = this.trans_mat_result;\r
+ o_result[0 + 0 * 4] = mat.m00; // R1C1\r
+ o_result[0 + 1 * 4] = mat.m01; // R1C2\r
+ o_result[0 + 2 * 4] = mat.m02;\r
+ o_result[0 + 3 * 4] = mat.m03;\r
+ o_result[1 + 0 * 4] = -mat.m10; // R2\r
+ o_result[1 + 1 * 4] = -mat.m11;\r
+ o_result[1 + 2 * 4] = -mat.m12;\r
+ o_result[1 + 3 * 4] = -mat.m13;\r
+ o_result[2 + 0 * 4] = -mat.m20; // R3\r
+ o_result[2 + 1 * 4] = -mat.m21;\r
+ o_result[2 + 2 * 4] = -mat.m22;\r
+ o_result[2 + 3 * 4] = -mat.m23;\r
o_result[3 + 0 * 4] = 0.0;\r
o_result[3 + 1 * 4] = 0.0;\r
o_result[3 + 2 * 4] = 0.0;\r
/* \r
- * PROJECT: NyARToolkit\r
+ * PROJECT: NyARToolkit JOGL utilities.\r
* --------------------------------------------------------------------------------\r
* This work is based on the original ARToolKit developed by\r
* Hirokazu Kato\r
-/**\r
- * QuickTimeお手軽キャプチャクラス\r
- * (c)2008 arc@dmz, A虎@nyatla.jp\r
- * arc@digitalmuseum.jp\r
- * http://nyatla.jp/\r
+/* \r
+ * PROJECT: NyARToolkit Quicktime utilities.\r
+ * --------------------------------------------------------------------------------\r
+ * Copyright (C)2008 arc@dmz\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ * \r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this framework; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ * \r
+ * For further information please contact.\r
+ * \r
+ * <arc(at)digitalmuseum.jp>\r
+ * \r
*/\r
+\r
package jp.nyatla.nyartoolkit.qt.utils;\r
\r
import java.awt.Dimension;\r
\r
import jp.nyatla.nyartoolkit.NyARException;\r
\r
-\r
+/**\r
+ * QuickTimeキャプチャクラス\r
+ *\r
+ */\r
public class QtCameraCapture implements ActionListener\r
{\r
\r
private Dimension image_size;\r
- private QtCaptureListener capture_listener;\r
\r
- protected float fps = 30; // キャプチャ画像を取得するfps\r
- protected byte[] pixels; // キャプチャ画像の実データを保持するバイト型配列\r
+ private QtCaptureListener capture_listener;\r
+\r
+ protected float fps = 30; // キャプチャ画像を取得するfps\r
+\r
+ protected byte[] pixels; // キャプチャ画像の実データを保持するバイト型配列\r
\r
// キャプチャに使うタイマー\r
private Timer timer;\r
\r
// QTJava用のあれこれ\r
private QDGraphics graphics;\r
+\r
private QDRect bounds;\r
+\r
private SequenceGrabber grabber;\r
+\r
private SGVideoChannel channel;\r
+\r
private RawEncodedImage rawEncodedImage;\r
+\r
private Movie movie;\r
\r
// ピクセルフォーマット変換用の一時変数\r
private int[] pixels_int;\r
- \r
- public static final int PIXEL_FORMAT_RGB = quicktime.util.EndianOrder.isNativeLittleEndian() ?\r
- QDConstants.k32BGRAPixelFormat : QDGraphics.kDefaultPixelFormat;\r
- public QtCameraCapture(int i_width,int i_height,float i_rate)\r
- {\r
- image_size = new Dimension(i_width,i_height);\r
- fps = i_rate;\r
- }\r
- public Dimension getSize()\r
- {\r
- return image_size;\r
- }\r
- public byte[] readBuffer() throws NyARException\r
- {\r
- if(grabber==null){\r
- throw new NyARException();\r
+\r
+ public static final int PIXEL_FORMAT_RGB = quicktime.util.EndianOrder.isNativeLittleEndian() ? QDConstants.k32BGRAPixelFormat : QDGraphics.kDefaultPixelFormat;\r
+\r
+ public QtCameraCapture(int i_width, int i_height, float i_rate)\r
+ {\r
+ image_size = new Dimension(i_width, i_height);\r
+ fps = i_rate;\r
}\r
- return pixels;\r
- }\r
- public void setCaptureListener(QtCaptureListener i_listener) throws NyARException\r
- {\r
- if(grabber!=null){\r
- throw new NyARException();\r
+\r
+ public Dimension getSize()\r
+ {\r
+ return image_size;\r
+ }\r
+\r
+ public byte[] readBuffer() throws NyARException\r
+ {\r
+ if (grabber == null) {\r
+ throw new NyARException();\r
+ }\r
+ return pixels;\r
}\r
- capture_listener=i_listener;\r
- \r
- }\r
\r
- public void prepSetInput(Object input) throws QTException {\r
+ public void setCaptureListener(QtCaptureListener i_listener) throws NyARException\r
+ {\r
+ if (grabber != null) {\r
+ throw new NyARException();\r
+ }\r
+ capture_listener = i_listener;\r
+\r
+ }\r
+\r
+ public void prepSetInput(Object input) throws QTException\r
+ {\r
QTSession.open();\r
bounds = new QDRect(image_size.width, image_size.height);\r
- graphics = new QDGraphics(\r
- quicktime.util.EndianOrder.isNativeLittleEndian() ?\r
- QDConstants.k32BGRAPixelFormat : QDGraphics.kDefaultPixelFormat,\r
- bounds);\r
+ graphics = new QDGraphics(quicktime.util.EndianOrder.isNativeLittleEndian() ? QDConstants.k32BGRAPixelFormat : QDGraphics.kDefaultPixelFormat, bounds);\r
if (input != null && input.getClass().equals(File.class)) {\r
- movie = quicktime.std.movies.Movie.fromDataRef(\r
- new DataRef(new QTFile((File) input)),\r
- StdQTConstants.newMovieActive\r
- );\r
+ movie = quicktime.std.movies.Movie.fromDataRef(new DataRef(new QTFile((File) input)), StdQTConstants.newMovieActive);\r
} else {\r
grabber = new SequenceGrabber();\r
grabber.setGWorld(graphics, null);\r
* Webcamの設定ダイアログを表示する。\r
* 既定のWebcamでは駄目な場合(複数のWebcamが接続されているPCなど)ではこれを実行するとよい。\r
*/\r
- public void prepShowDialog() throws QTException { channel.settingsDialog(); }\r
+ public void prepShowDialog() throws QTException\r
+ {\r
+ channel.settingsDialog();\r
+ }\r
\r
- public void start() throws NyARException\r
- {\r
+ public void start() throws NyARException\r
+ {\r
try {\r
\r
- if (grabber == null) prepSetInput(null);\r
+ if (grabber == null)\r
+ prepSetInput(null);\r
\r
if (movie == null) {\r
grabber.prepare(true, false); // あってもなくてもよさそう\r
}\r
\r
// キャプチャイメージを定期的に更新するタイマー\r
- timer = new Timer((int) (1000/fps), this);\r
+ timer = new Timer((int) (1000 / fps), this);\r
timer.start();\r
- }\r
- public void stop()\r
- {\r
- finalize();\r
- }\r
+ }\r
+\r
+ public void stop()\r
+ {\r
+ finalize();\r
+ }\r
\r
/** タイマー処理。キャプチャイメージの更新結果をリスナに伝える。 */\r
- public void actionPerformed(ActionEvent event) {\r
+ public void actionPerformed(ActionEvent event)\r
+ {\r
\r
// 画像をQTJavaのRawEncodedImageとして取得\r
try {\r
if (movie == null) {\r
grabber.idle();\r
} else {\r
- if (movie.isDone()) movie.goToBeginning();\r
+ if (movie.isDone())\r
+ movie.goToBeginning();\r
movie.getPict(movie.getTime()).draw(graphics, bounds);\r
}\r
} catch (QTException e) {\r
\r
// バイト列を生成する\r
int idx_byte = 0;\r
- for (int idx = 0; idx < image_size.width*image_size.height; idx ++) {\r
- pixels[idx_byte ++] = (byte) (pixels_int[idx] >> 16);\r
- pixels[idx_byte ++] = (byte) (pixels_int[idx] >> 8 & 0xff);\r
- pixels[idx_byte ++] = (byte) (pixels_int[idx] & 0xff);\r
+ for (int idx = 0; idx < image_size.width * image_size.height; idx++) {\r
+ pixels[idx_byte++] = (byte) (pixels_int[idx] >> 16);\r
+ pixels[idx_byte++] = (byte) (pixels_int[idx] >> 8 & 0xff);\r
+ pixels[idx_byte++] = (byte) (pixels_int[idx] & 0xff);\r
}\r
\r
// 各リスナに更新されたバイト列を渡す\r
capture_listener.onUpdateBuffer(pixels);\r
}\r
\r
- protected void finalize()\r
- {\r
+ protected void finalize()\r
+ {\r
try {\r
if (movie == null) {\r
grabber.stop();\r
QTSession.close();\r
}\r
timer.stop();\r
- }\r
+ }\r
\r
}\r
-/**\r
- * QuickTimeお手軽キャプチャ用リスナ\r
- * (c)2008 arc@dmz, A虎@nyatla.jp\r
- * arc@digitalmuseum.jp\r
- * http://nyatla.jp/\r
+/* \r
+ * PROJECT: NyARToolkit Quicktime utilities.\r
+ * --------------------------------------------------------------------------------\r
+ * Copyright (C)2008 arc@dmz\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ * \r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this framework; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ * \r
+ * For further information please contact.\r
+ * \r
+ * <arc(at)digitalmuseum.jp>\r
+ * \r
*/\r
package jp.nyatla.nyartoolkit.qt.utils;\r
\r
-\r
-public interface QtCaptureListener{\r
+/**\r
+ * QuickTime リスナクラス\r
+ *\r
+ */\r
+public interface QtCaptureListener\r
+{\r
public void onUpdateBuffer(byte[] i_buffer);\r
\r
}
\ No newline at end of file
-/**\r
- * RGB形式のbyte配列をラップするNyARRasterです。\r
- * 保持したデータからBufferedImageを出力する機能も持ちます。\r
- * (c)2008 arc@dmz, A虎@nyatla.jp\r
- * arc@digitalmuseum.jp\r
- * http://nyatla.jp/\r
+/* \r
+ * PROJECT: NyARToolkit Quicktime utilities.\r
+ * --------------------------------------------------------------------------------\r
+ * Copyright (C)2008 arc@dmz\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ * \r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this framework; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ * \r
+ * For further information please contact.\r
+ * \r
+ * <arc(at)digitalmuseum.jp>\r
+ * \r
*/\r
package jp.nyatla.nyartoolkit.qt.utils;\r
\r
import jp.nyatla.nyartoolkit.core.raster.rgb.NyARRgbRaster_BasicClass;\r
import jp.nyatla.nyartoolkit.core.rasterreader.*;\r
import jp.nyatla.nyartoolkit.core.types.*;\r
-\r
+/**\r
+ * RGB形式のbyte配列をラップするNyARRasterです。\r
+ * 保持したデータからBufferedImageを出力する機能も持ちます。\r
+ */\r
public class QtNyARRaster_RGB extends NyARRgbRaster_BasicClass\r
{\r
private class PixcelReader extends NyARRgbPixelReader_RGB24 implements INyARBufferReader\r
{\r
public PixcelReader(NyARIntSize i_size)\r
{\r
- super(null,i_size);\r
+ super(null, i_size);\r
return;\r
}\r
+\r
public void syncBuffer(byte[] i_ref_buffer)\r
{\r
- this._ref_buf=i_ref_buffer;\r
+ this._ref_buf = i_ref_buffer;\r
return;\r
}\r
+\r
//\r
- //INyARBufferReader\r
+ // INyARBufferReader\r
//\r
public Object getBuffer()\r
{\r
return this._ref_buf;\r
}\r
+\r
public int getBufferType()\r
{\r
return INyARBufferReader.BUFFERFORMAT_BYTE1D_R8G8B8_24;\r
}\r
+\r
public boolean isEqualBufferType(int i_type_value)\r
{\r
- return i_type_value==INyARBufferReader.BUFFERFORMAT_BYTE1D_R8G8B8_24;\r
- } \r
+ return i_type_value == INyARBufferReader.BUFFERFORMAT_BYTE1D_R8G8B8_24;\r
+ }\r
}\r
+\r
protected byte[] _ref_buf;\r
+\r
protected PixcelReader _reader;\r
+\r
private WritableRaster _raster;\r
+\r
private BufferedImage _image;\r
\r
/**\r
this._ref_buf = i_buffer;\r
this._reader.syncBuffer(i_buffer);\r
}\r
+\r
public INyARBufferReader getBufferReader()\r
{\r
return this._reader;\r
}\r
+\r
public INyARRgbPixelReader getRgbPixelReader()\r
{\r
return this._reader;\r
- } \r
+ }\r
+\r
/**\r
* データを持っているかを返します。\r
* \r
{\r
return this._ref_buf != null;\r
}\r
+\r
/**\r
* 保持しているデータからBufferedImageを作って返します。\r
+ * \r
* @return\r
*/\r
public BufferedImage createImage()\r
{\r
- _raster.setDataElements(0, 0, this._size.w,this._size.h,this._ref_buf);\r
+ _raster.setDataElements(0, 0, this._size.w, this._size.h, this._ref_buf);\r
_image.setData(_raster);\r
return _image;\r
}\r
- \r
- \r
- \r
+\r
}\r
* このクラスは、arDetectMarker2.cとの置き換えになります。\r
* \r
*/\r
-public class NyARSquareDetector\r
+public class NyARSquareDetector implements INyARSquareDetector\r
{\r
private static final double VERTEX_FACTOR = 1.0;// 線検出のファクタ\r
\r
* @return\r
* @throws NyARException\r
*/\r
- public boolean getSquareLine(int[] i_mkvertex, int[] i_xcoord, int[] i_ycoord, NyARSquare o_square) throws NyARException\r
+ private boolean getSquareLine(int[] i_mkvertex, int[] i_xcoord, int[] i_ycoord, NyARSquare o_square) throws NyARException\r
{\r
final NyARLinear[] l_line = o_square.line;\r
final NyARVec ev = this.__getSquareLine_ev; // matrixPCAの戻り値を受け取る\r
NyARException.trap("未チェックのパス");\r
{\r
this.v[i_start] += s;// x->v[0] += s;\r
- t = 1 / Math.sqrt(this.v[i_start] * s);// t = 1 / sqrt(x->v[0]\r
- // * s);\r
+ t = 1 / Math.sqrt(this.v[i_start] * s);// t = 1 / sqrt(x->v[0] * s);\r
}\r
for (int i = i_start; i < this.clm; i++) {\r
NyARException.trap("未チェックのパス");\r
+/* \r
+ * PROJECT: NyARToolkit\r
+ * --------------------------------------------------------------------------------\r
+ * This work is based on the original ARToolKit developed by\r
+ * Hirokazu Kato\r
+ * Mark Billinghurst\r
+ * HITLab, University of Washington, Seattle\r
+ * http://www.hitl.washington.edu/artoolkit/\r
+ *\r
+ * The NyARToolkit is Java version ARToolkit class library.\r
+ * Copyright (C)2008 R.Iizuka\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ * \r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this framework; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ * \r
+ * For further information please contact.\r
+ * http://nyatla.jp/nyatoolkit/\r
+ * <airmail(at)ebony.plala.or.jp>\r
+ * \r
+ */\r
package jp.nyatla.nyartoolkit.core.param;\r
\r
import jp.nyatla.nyartoolkit.core.types.NyARDoublePoint2d;\r
+/* \r
+ * PROJECT: NyARToolkit\r
+ * --------------------------------------------------------------------------------\r
+ * This work is based on the original ARToolKit developed by\r
+ * Hirokazu Kato\r
+ * Mark Billinghurst\r
+ * HITLab, University of Washington, Seattle\r
+ * http://www.hitl.washington.edu/artoolkit/\r
+ *\r
+ * The NyARToolkit is Java version ARToolkit class library.\r
+ * Copyright (C)2008 R.Iizuka\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ * \r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this framework; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ * \r
+ * For further information please contact.\r
+ * http://nyatla.jp/nyatoolkit/\r
+ * <airmail(at)ebony.plala.or.jp>\r
+ * \r
+ */\r
package jp.nyatla.nyartoolkit.core.param;\r
\r
import jp.nyatla.nyartoolkit.core.*;\r
* <airmail(at)ebony.plala.or.jp>\r
* \r
*/\r
-package jp.nyatla.nyartoolkit.core.rasterfilter.rgb2gs;\r
+package jp.nyatla.nyartoolkit.core.rasterfilter;\r
\r
import jp.nyatla.nyartoolkit.NyARException;\r
import jp.nyatla.nyartoolkit.core.raster.*;\r
+/* \r
+ * PROJECT: NyARToolkit\r
+ * --------------------------------------------------------------------------------\r
+ * This work is based on the original ARToolKit developed by\r
+ * Hirokazu Kato\r
+ * Mark Billinghurst\r
+ * HITLab, University of Washington, Seattle\r
+ * http://www.hitl.washington.edu/artoolkit/\r
+ *\r
+ * The NyARToolkit is Java version ARToolkit class library.\r
+ * Copyright (C)2008 R.Iizuka\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ * \r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this framework; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ * \r
+ * For further information please contact.\r
+ * http://nyatla.jp/nyatoolkit/\r
+ * <airmail(at)ebony.plala.or.jp>\r
+ * \r
+ */\r
package jp.nyatla.nyartoolkit.core.rasterreader;\r
\r
public class NyARBufferReader implements INyARBufferReader\r
*/\r
package jp.nyatla.nyartoolkit.core.transmat;\r
\r
-import jp.nyatla.nyartoolkit.NyARException;\r
-import jp.nyatla.nyartoolkit.core.*;\r
+\r
import jp.nyatla.nyartoolkit.core.transmat.rotmatrix.NyARRotMatrix;\r
import jp.nyatla.nyartoolkit.core.types.*;\r
+import jp.nyatla.nyartoolkit.core.types.matrix.*;\r
\r
/**\r
* NyARTransMat戻り値専用のNyARMat\r
* \r
*/\r
-public class NyARTransMatResult extends NyARMat\r
+public class NyARTransMatResult extends NyARDoubleMatrix34\r
{\r
private boolean has_value = false;\r
\r
- public NyARTransMatResult()\r
- {\r
- super(3, 4);\r
- }\r
-\r
- /**\r
- * この関数は使えません。\r
- * \r
- * @param i_row\r
- * @param i_clm\r
- * @throws NyARException\r
- */\r
- public NyARTransMatResult(int i_row, int i_clm) throws NyARException\r
- {\r
- super();// ここで例外発生\r
- }\r
\r
/**\r
* パラメータで変換行列を更新します。\r
*/\r
public void updateMatrixValue(NyARRotMatrix i_rot, NyARDoublePoint3d i_off, NyARDoublePoint3d i_trans)\r
{\r
- double[] pa;\r
- pa = this.m[0];\r
- pa[0] = i_rot.m00;\r
- pa[1] = i_rot.m01;\r
- pa[2] = i_rot.m02;\r
- pa[3] = i_rot.m00 * i_off.x + i_rot.m01 * i_off.y + i_rot.m02 * i_off.z + i_trans.x;\r
+ this.m00=i_rot.m00;\r
+ this.m01=i_rot.m01;\r
+ this.m02=i_rot.m02;\r
+ this.m03=i_rot.m00 * i_off.x + i_rot.m01 * i_off.y + i_rot.m02 * i_off.z + i_trans.x;\r
\r
- pa = this.m[1];\r
- pa[0] = i_rot.m10;\r
- pa[1] = i_rot.m11;\r
- pa[2] = i_rot.m12;\r
- pa[3] = i_rot.m10 * i_off.x + i_rot.m11 * i_off.y + i_rot.m12 * i_off.z + i_trans.y;\r
+ this.m10 = i_rot.m10;\r
+ this.m11 = i_rot.m11;\r
+ this.m12 = i_rot.m12;\r
+ this.m13 = i_rot.m10 * i_off.x + i_rot.m11 * i_off.y + i_rot.m12 * i_off.z + i_trans.y;\r
\r
- pa = this.m[2];\r
- pa[0] = i_rot.m20;\r
- pa[1] = i_rot.m21;\r
- pa[2] = i_rot.m22;\r
- pa[3] = i_rot.m20 * i_off.x + i_rot.m21 * i_off.y + i_rot.m22 * i_off.z + i_trans.z;\r
+ this.m20 = i_rot.m20;\r
+ this.m21 = i_rot.m21;\r
+ this.m22 = i_rot.m22;\r
+ this.m23 = i_rot.m20 * i_off.x + i_rot.m21 * i_off.y + i_rot.m22 * i_off.z + i_trans.z;\r
\r
this.has_value = true;\r
return;\r
}\r
\r
- public void copyFrom(NyARTransMatResult i_from) throws NyARException\r
- {\r
- super.copyFrom(i_from);\r
- this.has_value = i_from.has_value;\r
- }\r
-\r
public boolean hasValue()\r
{\r
return this.has_value;\r
+/* \r
+ * PROJECT: NyARToolkit\r
+ * --------------------------------------------------------------------------------\r
+ * This work is based on the original ARToolKit developed by\r
+ * Hirokazu Kato\r
+ * Mark Billinghurst\r
+ * HITLab, University of Washington, Seattle\r
+ * http://www.hitl.washington.edu/artoolkit/\r
+ *\r
+ * The NyARToolkit is Java version ARToolkit class library.\r
+ * Copyright (C)2008 R.Iizuka\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ * \r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this framework; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ * \r
+ * For further information please contact.\r
+ * http://nyatla.jp/nyatoolkit/\r
+ * <airmail(at)ebony.plala.or.jp>\r
+ * \r
+ */\r
package jp.nyatla.nyartoolkit.core.transmat;\r
\r
import jp.nyatla.nyartoolkit.core.types.*;\r
+/* \r
+ * PROJECT: NyARToolkit\r
+ * --------------------------------------------------------------------------------\r
+ * This work is based on the original ARToolKit developed by\r
+ * Hirokazu Kato\r
+ * Mark Billinghurst\r
+ * HITLab, University of Washington, Seattle\r
+ * http://www.hitl.washington.edu/artoolkit/\r
+ *\r
+ * The NyARToolkit is Java version ARToolkit class library.\r
+ * Copyright (C)2008 R.Iizuka\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ * \r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this framework; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ * \r
+ * For further information please contact.\r
+ * http://nyatla.jp/nyatoolkit/\r
+ * <airmail(at)ebony.plala.or.jp>\r
+ * \r
+ */\r
package jp.nyatla.nyartoolkit.core.transmat.fitveccalc;\r
\r
import jp.nyatla.nyartoolkit.core.*;\r
+/* \r
+ * PROJECT: NyARToolkit\r
+ * --------------------------------------------------------------------------------\r
+ * This work is based on the original ARToolKit developed by\r
+ * Hirokazu Kato\r
+ * Mark Billinghurst\r
+ * HITLab, University of Washington, Seattle\r
+ * http://www.hitl.washington.edu/artoolkit/\r
+ *\r
+ * The NyARToolkit is Java version ARToolkit class library.\r
+ * Copyright (C)2008 R.Iizuka\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ * \r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this framework; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ * \r
+ * For further information please contact.\r
+ * http://nyatla.jp/nyatoolkit/\r
+ * <airmail(at)ebony.plala.or.jp>\r
+ * \r
+ */\r
package jp.nyatla.nyartoolkit.core.transmat.rotmatrix;\r
\r
import jp.nyatla.nyartoolkit.NyARException;\r
\r
public final void initRotByPrevResult(NyARTransMatResult i_prev_result)\r
{\r
- double[][] prev_array = i_prev_result.getArray();\r
- double[] pt;\r
- pt = prev_array[0];\r
- this.m00=pt[0];\r
- this.m01=pt[1];\r
- this.m02=pt[2];\r
- pt = prev_array[1];\r
- this.m10=pt[0];\r
- this.m11=pt[1];\r
- this.m12=pt[2];\r
- pt = prev_array[2];\r
- this.m20=pt[0];\r
- this.m21=pt[1];\r
- this.m22=pt[2];\r
+\r
+ this.m00=i_prev_result.m00;\r
+ this.m01=i_prev_result.m01;\r
+ this.m02=i_prev_result.m02;\r
+\r
+ this.m10=i_prev_result.m10;\r
+ this.m11=i_prev_result.m11;\r
+ this.m12=i_prev_result.m12;\r
+\r
+ this.m20=i_prev_result.m20;\r
+ this.m21=i_prev_result.m21;\r
+ this.m22=i_prev_result.m22;\r
+ return;\r
} \r
\r
\r
+/* \r
+ * PROJECT: NyARToolkit\r
+ * --------------------------------------------------------------------------------\r
+ * This work is based on the original ARToolKit developed by\r
+ * Hirokazu Kato\r
+ * Mark Billinghurst\r
+ * HITLab, University of Washington, Seattle\r
+ * http://www.hitl.washington.edu/artoolkit/\r
+ *\r
+ * The NyARToolkit is Java version ARToolkit class library.\r
+ * Copyright (C)2008 R.Iizuka\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ * \r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this framework; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ * \r
+ * For further information please contact.\r
+ * http://nyatla.jp/nyatoolkit/\r
+ * <airmail(at)ebony.plala.or.jp>\r
+ * \r
+ */\r
package jp.nyatla.nyartoolkit.core.transmat.rotmatrix;\r
\r
import jp.nyatla.nyartoolkit.NyARException;\r
+/* \r
+ * PROJECT: NyARToolkit\r
+ * --------------------------------------------------------------------------------\r
+ * This work is based on the original ARToolKit developed by\r
+ * Hirokazu Kato\r
+ * Mark Billinghurst\r
+ * HITLab, University of Washington, Seattle\r
+ * http://www.hitl.washington.edu/artoolkit/\r
+ *\r
+ * The NyARToolkit is Java version ARToolkit class library.\r
+ * Copyright (C)2008 R.Iizuka\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ * \r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this framework; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ * \r
+ * For further information please contact.\r
+ * http://nyatla.jp/nyatoolkit/\r
+ * <airmail(at)ebony.plala.or.jp>\r
+ * \r
+ */\r
package jp.nyatla.nyartoolkit.core.transmat.rottransopt;\r
\r
\r
+/* \r
+ * PROJECT: NyARToolkit\r
+ * --------------------------------------------------------------------------------\r
+ * This work is based on the original ARToolKit developed by\r
+ * Hirokazu Kato\r
+ * Mark Billinghurst\r
+ * HITLab, University of Washington, Seattle\r
+ * http://www.hitl.washington.edu/artoolkit/\r
+ *\r
+ * The NyARToolkit is Java version ARToolkit class library.\r
+ * Copyright (C)2008 R.Iizuka\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ * \r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this framework; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ * \r
+ * For further information please contact.\r
+ * http://nyatla.jp/nyatoolkit/\r
+ * <airmail(at)ebony.plala.or.jp>\r
+ * \r
+ */\r
package jp.nyatla.nyartoolkit.core.types;\r
\r
public class NyARDoublePoint2d\r
+/* \r
+ * PROJECT: NyARToolkit\r
+ * --------------------------------------------------------------------------------\r
+ * This work is based on the original ARToolKit developed by\r
+ * Hirokazu Kato\r
+ * Mark Billinghurst\r
+ * HITLab, University of Washington, Seattle\r
+ * http://www.hitl.washington.edu/artoolkit/\r
+ *\r
+ * The NyARToolkit is Java version ARToolkit class library.\r
+ * Copyright (C)2008 R.Iizuka\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ * \r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this framework; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ * \r
+ * For further information please contact.\r
+ * http://nyatla.jp/nyatoolkit/\r
+ * <airmail(at)ebony.plala.or.jp>\r
+ * \r
+ */\r
package jp.nyatla.nyartoolkit.core.types;\r
\r
public class NyARDoublePoint3d\r
+/* \r
+ * PROJECT: NyARToolkit\r
+ * --------------------------------------------------------------------------------\r
+ * This work is based on the original ARToolKit developed by\r
+ * Hirokazu Kato\r
+ * Mark Billinghurst\r
+ * HITLab, University of Washington, Seattle\r
+ * http://www.hitl.washington.edu/artoolkit/\r
+ *\r
+ * The NyARToolkit is Java version ARToolkit class library.\r
+ * Copyright (C)2008 R.Iizuka\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ * \r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this framework; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ * \r
+ * For further information please contact.\r
+ * http://nyatla.jp/nyatoolkit/\r
+ * <airmail(at)ebony.plala.or.jp>\r
+ * \r
+ */\r
package jp.nyatla.nyartoolkit.core.types;\r
\r
public class NyARLinear\r
+/* \r
+ * PROJECT: NyARToolkit\r
+ * --------------------------------------------------------------------------------\r
+ * This work is based on the original ARToolKit developed by\r
+ * Hirokazu Kato\r
+ * Mark Billinghurst\r
+ * HITLab, University of Washington, Seattle\r
+ * http://www.hitl.washington.edu/artoolkit/\r
+ *\r
+ * The NyARToolkit is Java version ARToolkit class library.\r
+ * Copyright (C)2008 R.Iizuka\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ * \r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this framework; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ * \r
+ * For further information please contact.\r
+ * http://nyatla.jp/nyatoolkit/\r
+ * <airmail(at)ebony.plala.or.jp>\r
+ * \r
+ */\r
package jp.nyatla.nyartoolkit.core.types.matrix;\r
\r
public interface INyARDoubleMatrix\r
+/* \r
+ * PROJECT: NyARToolkit\r
+ * --------------------------------------------------------------------------------\r
+ * This work is based on the original ARToolKit developed by\r
+ * Hirokazu Kato\r
+ * Mark Billinghurst\r
+ * HITLab, University of Washington, Seattle\r
+ * http://www.hitl.washington.edu/artoolkit/\r
+ *\r
+ * The NyARToolkit is Java version ARToolkit class library.\r
+ * Copyright (C)2008 R.Iizuka\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ * \r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this framework; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ * \r
+ * For further information please contact.\r
+ * http://nyatla.jp/nyatoolkit/\r
+ * <airmail(at)ebony.plala.or.jp>\r
+ * \r
+ */\r
package jp.nyatla.nyartoolkit.core.types.matrix;\r
\r
public class NyARDoubleMatrix33 implements INyARDoubleMatrix\r
+/* \r
+ * PROJECT: NyARToolkit\r
+ * --------------------------------------------------------------------------------\r
+ * This work is based on the original ARToolKit developed by\r
+ * Hirokazu Kato\r
+ * Mark Billinghurst\r
+ * HITLab, University of Washington, Seattle\r
+ * http://www.hitl.washington.edu/artoolkit/\r
+ *\r
+ * The NyARToolkit is Java version ARToolkit class library.\r
+ * Copyright (C)2008 R.Iizuka\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ * \r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this framework; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ * \r
+ * For further information please contact.\r
+ * http://nyatla.jp/nyatoolkit/\r
+ * <airmail(at)ebony.plala.or.jp>\r
+ * \r
+ */\r
package jp.nyatla.nyartoolkit.core.types.matrix;\r
\r
public class NyARDoubleMatrix34 implements INyARDoubleMatrix\r
* <airmail(at)ebony.plala.or.jp>\r
* \r
*/\r
-package jp.nyatla.nyartoolkit.core.rasterfilter.rgb2gs;\r
+package jp.nyatla.nyartoolkit.core2;\r
\r
import jp.nyatla.nyartoolkit.NyARException;\r
import jp.nyatla.nyartoolkit.core.raster.*;\r
import jp.nyatla.nyartoolkit.core.raster.rgb.INyARRgbRaster;\r
+import jp.nyatla.nyartoolkit.core.rasterfilter.INyARRasterFilter_RgbToGs;\r
import jp.nyatla.nyartoolkit.core.rasterreader.INyARBufferReader;\r
import jp.nyatla.nyartoolkit.core.types.NyARIntSize;\r
\r
* <airmail(at)ebony.plala.or.jp>\r
* \r
*/\r
-package jp.nyatla.nyartoolkit.core.rasterfilter.rgb2gs;\r
+package jp.nyatla.nyartoolkit.core2;\r
\r
import jp.nyatla.nyartoolkit.NyARException;\r
import jp.nyatla.nyartoolkit.core.raster.*;\r
import jp.nyatla.nyartoolkit.core.raster.rgb.INyARRgbRaster;\r
+import jp.nyatla.nyartoolkit.core.rasterfilter.INyARRasterFilter_RgbToGs;\r
import jp.nyatla.nyartoolkit.core.rasterreader.INyARBufferReader;\r
import jp.nyatla.nyartoolkit.core.types.NyARIntSize;\r
\r
* <airmail(at)ebony.plala.or.jp>\r
* \r
*/\r
-package jp.nyatla.nyartoolkit.core.rasterfilter.rgb2gs;\r
+package jp.nyatla.nyartoolkit.core2;\r
\r
import jp.nyatla.nyartoolkit.NyARException;\r
import jp.nyatla.nyartoolkit.core.raster.*;\r
import jp.nyatla.nyartoolkit.core.raster.rgb.INyARRgbRaster;\r
+import jp.nyatla.nyartoolkit.core.rasterfilter.INyARRasterFilter_RgbToGs;\r
import jp.nyatla.nyartoolkit.core.rasterreader.INyARBufferReader;\r
import jp.nyatla.nyartoolkit.core.types.NyARIntSize;\r
\r
\r
private NyARMatchPatt_Color_WITHOUT_PCA _match_patt;\r
\r
- private NyARSquareDetector _square_detect;\r
+ private INyARSquareDetector _square_detect;\r
\r
private final NyARSquareStack _square_list = new NyARSquareStack(AR_SQUARE_MAX);\r
\r
\r
private boolean _is_continue = false;\r
private NyARMatchPatt_Color_WITHOUT_PCA _match_patt;\r
- private NyARSquareDetector _square_detect;\r
+ private INyARSquareDetector _square_detect;\r
\r
private final NyARSquareStack _square_list = new NyARSquareStack(AR_SQUARE_MAX);\r
\r
+/* \r
+ * PROJECT: NyARToolkit\r
+ * --------------------------------------------------------------------------------\r
+ * This work is based on the original ARToolKit developed by\r
+ * Hirokazu Kato\r
+ * Mark Billinghurst\r
+ * HITLab, University of Washington, Seattle\r
+ * http://www.hitl.washington.edu/artoolkit/\r
+ *\r
+ * The NyARToolkit is Java version ARToolkit class library.\r
+ * Copyright (C)2008 R.Iizuka\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ * \r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this framework; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ * \r
+ * For further information please contact.\r
+ * http://nyatla.jp/nyatoolkit/\r
+ * <airmail(at)ebony.plala.or.jp>\r
+ * \r
+ */\r
package jp.nyatla.utils;\r
\r
public class DoubleValue\r
+/* \r
+ * PROJECT: NyARToolkit\r
+ * --------------------------------------------------------------------------------\r
+ * This work is based on the original ARToolKit developed by\r
+ * Hirokazu Kato\r
+ * Mark Billinghurst\r
+ * HITLab, University of Washington, Seattle\r
+ * http://www.hitl.washington.edu/artoolkit/\r
+ *\r
+ * The NyARToolkit is Java version ARToolkit class library.\r
+ * Copyright (C)2008 R.Iizuka\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ * \r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this framework; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ * \r
+ * For further information please contact.\r
+ * http://nyatla.jp/nyatoolkit/\r
+ * <airmail(at)ebony.plala.or.jp>\r
+ * \r
+ */\r
package jp.nyatla.utils;\r
\r
public class IntValue\r
/**\r
* bitmapとして利用可能なラベリングイメージです。\r
* \r
- * @author atla\r
* \r
*/\r
public class LabelingBufferdImage extends BufferedImage\r
import jp.nyatla.nyartoolkit.core.rasterfilter.*;
import jp.nyatla.nyartoolkit.core.rasterfilter.gs2bin.*;
import jp.nyatla.nyartoolkit.core.rasterfilter.rgb2gs.*;
+import jp.nyatla.nyartoolkit.core2.NyARRasterFilter_RgbAve;
import jp.nyatla.utils.j2se.LabelingBufferdImage;
public class LabelingCamera extends Frame implements JmfCaptureListener {