NyARToolkit for Java 5.0.0 has been released.
https://github.com/nyatla/NyARToolkit
NyARToolkit 5.0.0 supports the natural features tracking which is same as implemented on ARToolKit5 (NFT) .
The development of NyARToolKit5 has received the funding and technical assistance by DAQRI LLC.
I’m grateful to DAQRI LLC and ARToolKit team.
How to running NFT sample
- Checkout NyARToolKit from Github.
- Import NyARToolkit projects to Eclipse. Make sure that there are no errors in the project shown in ←.
- Print NFT image to paper. If you do not have a printer, display the pdf file into the screen.
infinitycat.pdf - Connect your webcam to computer.
- Run NftSimpleLite.java in NyARToolkit.sample.jogl package.
- It takes a few seconds to startup. When you take a picture with the camera, The color cube will display on image.
NFT Programming
NFT programming with NyARToolkit is simply.
It requires only a few dozen lines of code.
NftSimpleLite.java is a template of NFT application. You can create the unique application by modify the template.
public class NftSimpleLite extends GlSketch { String nftdataset="d:\\infinitycat"; String cparam="../../Data/testcase/camera_para5.dat"; private Webcam camera; private NyARGlNftSystem nyar; private NyARGlRender render; private NyARSensor sensor; public void setup(GL gl)throws Exception { this.size(640,480); NyARNftSystemConfig config = new NyARNftSystemConfig(new FileInputStream(cparam),640,480); this.camera=Webcam.getDefault(); this.camera.setViewSize(new Dimension(640,480)); this.nyar=new NyARGlNftSystem(config); //create MarkerSystem this.render=new NyARGlRender(this.nyar); this.sensor=new NyARSensor(config.getScreenSize()); // this.id=this.nyar.addNftTarget(nftdataset,160); gl.glEnable(GL.GL_DEPTH_TEST); this.camera.open(); } private int id; public void draw(GL gl)throws Exception { synchronized(this.camera){ try { this.sensor.update(new NyARBufferedImageRaster(this.camera.getImage())); this.render.drawBackground(gl,this.sensor.getSourceImage()); this.render.loadARProjectionMatrix(gl); this.nyar.update(this.sensor); if(this.nyar.isExistTarget(this.id)){ this.nyar.loadTransformMatrix(gl,this.id); this.render.colorCube(gl,40,80,60,20); } Thread.sleep(1); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { new NftSimpleLite().run(); return; } }
- How to change the tracking image file?
→Change nftdataset value. In NFT, it need to place 3 files(.iset, .fset, .fset3) onto same path.
For example: If you specify “d \\ example”, “c:\\ example.iset”, “c:\\ example.fset”, “c:\\example.fset3” will be used as a tracking image. - How to change the tracking image size?
→Set the paper image width in mm to the second parameter of addNftTarget function. - How to make the tracking image set file?
→NftFileGenerator.jar is a fileset generator.
Download NyARToolkit.utility.zip from the following URL.
https://github.com/nyatla/NyARToolkit/releases
For compatibility with ARToolKit5
Calculation algorithm of NyARToolKit is identical to the ARToolKit5 but there is a slight difference.
The cause of the difference are the accuracy of floating-point calculations, and the simplification of the math functions.
The NyARToolKit and ARToolKit data files(iset fset fset3) are compatible.
These files can be used with each other.