OSDN Git Service

[更新]NyARToolkit
[nyartoolkit-and/nyartoolkit-and.git] / src / jp / nyatla / nyartoolkit / detector / NyARSingleDetectMarker.java
1 /* \r
2  * PROJECT: NyARToolkit\r
3  * --------------------------------------------------------------------------------\r
4  * This work is based on the original ARToolKit developed by\r
5  *   Hirokazu Kato\r
6  *   Mark Billinghurst\r
7  *   HITLab, University of Washington, Seattle\r
8  * http://www.hitl.washington.edu/artoolkit/\r
9  *\r
10  * The NyARToolkit is Java version ARToolkit class library.\r
11  * Copyright (C)2008 R.Iizuka\r
12  *\r
13  * This program is free software; you can redistribute it and/or\r
14  * modify it under the terms of the GNU General Public License\r
15  * as published by the Free Software Foundation; either version 2\r
16  * of the License, or (at your option) any later version.\r
17  * \r
18  * This program is distributed in the hope that it will be useful,\r
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
21  * GNU General Public License for more details.\r
22  * \r
23  * You should have received a copy of the GNU General Public License\r
24  * along with this framework; if not, write to the Free Software\r
25  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
26  * \r
27  * For further information please contact.\r
28  *      http://nyatla.jp/nyatoolkit/\r
29  *      <airmail(at)ebony.plala.or.jp>\r
30  * \r
31  */\r
32 package jp.nyatla.nyartoolkit.detector;\r
33 \r
34 import jp.nyatla.nyartoolkit.NyARException;\r
35 import jp.nyatla.nyartoolkit.core.*;\r
36 import jp.nyatla.nyartoolkit.core.param.NyARParam;\r
37 import jp.nyatla.nyartoolkit.core.raster.rgb.*;\r
38 import jp.nyatla.nyartoolkit.core.rasterfilter.rgb2bin.NyARRasterFilter_ARToolkitThreshold;\r
39 \r
40 /**\r
41  * 画像からARCodeに最も一致するマーカーを1個検出し、その変換行列を計算するクラスです。\r
42  * \r
43  */\r
44 public class NyARSingleDetectMarker extends NyARCustomSingleDetectMarker\r
45 {\r
46         /**\r
47          * 検出するARCodeとカメラパラメータから、1個のARCodeを検出するNyARSingleDetectMarkerインスタンスを作ります。\r
48          * \r
49          * @param i_param\r
50          * カメラパラメータを指定します。\r
51          * @param i_code\r
52          * 検出するARCodeを指定します。\r
53          * @param i_marker_width\r
54          * ARコードの物理サイズを、ミリメートルで指定します。\r
55          * @throws NyARException\r
56          */\r
57         public NyARSingleDetectMarker(NyARParam i_param, NyARCode i_code, double i_marker_width) throws NyARException\r
58         {\r
59                 super(i_param,i_code,i_marker_width,new NyARRasterFilter_ARToolkitThreshold(100));\r
60         }\r
61 \r
62 \r
63         /**\r
64          * i_imageにマーカー検出処理を実行し、結果を記録します。\r
65          * \r
66          * @param i_raster\r
67          * マーカーを検出するイメージを指定します。イメージサイズは、カメラパラメータ\r
68          * と一致していなければなりません。\r
69          * @return マーカーが検出できたかを真偽値で返します。\r
70          * @throws NyARException\r
71          */\r
72         public boolean detectMarkerLite(INyARRgbRaster i_raster,int i_threshold) throws NyARException\r
73         {\r
74                 ((NyARRasterFilter_ARToolkitThreshold)this._tobin_filter).setThreshold(i_threshold);\r
75                 return super.detectMarkerLite(i_raster);\r
76         }\r
77 }\r