我使用的是NyARToolkit包,在样本中可以检测多个标记。我的问题是我想添加自己的标记,除了那些已经存在的标记。为此,我使用NyAR NFTFileGenerator.java将我的图像转换为字节。 当我添加我的标记时,就像那个已经存在的标记一样
mid1=this._ms.addARMarker(
new MemoryStream(((TextAsset)Resources.Load("patt_hiro",typeof(TextAsset))).bytes),
16,25,80);
mid2=this._ms.addARMarker(
new MemoryStream(((TextAsset)Resources.Load("third",typeof(TextAsset))).bytes),
16,25,80);
当我测试时,总是在我添加新标记的行中给出错误。我怀疑这是因为大小,但我已经尝试改变,错误仍然存在。
我所说的错误是:
NyARRuntimeException:jp.nyatla.nyartoolkit.cs.core.NyARRuntimeException:System.FormatException:输入字符串的格式不正确 在/Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Int32.cs:629中的System.Int32.Parse(System.String s)[0x00010] 在C:\ Users \ jessi \ Documents中的jp.nyatla.nyartoolkit.cs.core.NyARCodeFileReader.readBlock(System.String [] i_data,Int32 i_idx,Int32 i_width,Int32 i_height,System.Int32 [] o_buf)[0x0004d] \ Unity Projects \ Multimarkers \ Assets \ NyARToolkitCS \ src \ cs \ core \ marker \ artk \ NyARCode.cs:148 在C:\ Users \ jessi \ Documents中的jp.nyatla.nyartoolkit.cs.core.NyARCodeFileReader.readBlock(System.String [] i_data,Int32 i_idx,Int32 i_width,Int32 i_height,System.Int32 [] o_buf)[0x000c2] \ Unity Projects \ Multimarkers \ Assets \ NyARToolkitCS \ src \ cs \ core \ marker \ artk \ NyARCode.cs:160 在C:\ Users \ jessi \ Documents \ Unity Projects中的jp.nyatla.nyartoolkit.cs.core.NyARCodeFileReader.loadFromARToolKitFormFile(System.IO.Stream i_stream,jp.nyatla.nyartoolkit.cs.core.NyARCode o_code)[0x00064] \ Multimarkers \资产\ NyARToolkitCS \ SRC \ CS \芯\标记\ ARTK \ NyARCode.cs:102 jp.nyatla.nyartoolkit.cs.core.NyARCodeFileReader.loadFromARToolKitFormFile(System.IO.Stream i_stream,jp.nyatla.nyartoolkit.cs.core.NyARCode o_code)(在Assets / NyARToolkitCS / src / cs / core / marker / artk / NyARCode.cs:111) jp.nyatla.nyartoolkit.cs.core.NyARCode.loadFromARPattFile(System.IO.Stream i_stream,Int32 i_width,Int32 i_height)(在Assets / NyARToolkitCS / src / cs / core / marker / artk / NyARCode.cs:191) jp.nyatla.nyartoolkit.cs.markersystem.NyARMarkerSystem.addARMarker(System.IO.Stream i_stream,的Int32 i_patt_resolution,的Int32 i_patt_edge_percentage,双i_marker_size)(在资产/ NyARToolkitCS / src.markersystem / CS / markersystem / NyARMarkerSystem.cs:206) SimpleLiteMBehaviour.Awake()(在Assets / sample / SimpleLiteM / SimpleLiteMBehaviour.cs:43)
提前谢谢